@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.
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +1 -1
- package/dist/mount.mjs +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ApiTab.mjs +1 -1
- package/dist/packem_chunks/AuditPanel.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
- package/dist/packem_chunks/FileBrowser.mjs +1 -1
- package/dist/packem_chunks/FunctionRunner.mjs +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
- package/dist/packem_chunks/HealthPanel.mjs +1 -1
- package/dist/packem_chunks/InsightsPanel.mjs +1 -1
- package/dist/packem_chunks/LogsPanel.mjs +1 -1
- package/dist/packem_chunks/MailPanel.mjs +1 -1
- package/dist/packem_chunks/MetricsPanel.mjs +1 -1
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
- package/dist/packem_chunks/PitrPanel.mjs +1 -1
- package/dist/packem_chunks/SchemaViewer.mjs +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
- package/dist/packem_chunks/SettingsPanel.mjs +1 -1
- package/dist/packem_chunks/SqlEditorPanel.mjs +24 -9
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/agents-panel.mjs +1 -1
- package/dist/packem_chunks/ai-knowledge.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
- package/dist/packem_chunks/assistant-panel.mjs +3 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/containers-panel.mjs +1 -1
- package/dist/packem_chunks/dashboards-panel.mjs +1 -1
- package/dist/packem_chunks/evals-panel.mjs +1 -1
- package/dist/packem_chunks/fanout-panel.mjs +1 -1
- package/dist/packem_chunks/flags-panel.mjs +1 -1
- package/dist/packem_chunks/issues-panel.mjs +1 -1
- package/dist/packem_chunks/kv-browser.mjs +1 -1
- package/dist/packem_chunks/log-drains-panel.mjs +1 -1
- package/dist/packem_chunks/migrations-route.mjs +1 -1
- package/dist/packem_chunks/payments-panel.mjs +1 -1
- package/dist/packem_chunks/permissions-panel.mjs +1 -1
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
- package/dist/packem_chunks/queues-panel.mjs +1 -1
- package/dist/packem_chunks/reactors-panel.mjs +1 -1
- package/dist/packem_chunks/rls-panel.mjs +1 -1
- package/dist/packem_chunks/schedule-panel.mjs +1 -1
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_chunks/workflows-panel.mjs +1 -1
- package/dist/packem_shared/ADMIN_FUNCTIONS-DUXsXId1.mjs +1 -0
- package/dist/packem_shared/{ApiDocsPanel-DD2Uns6b.mjs → ApiDocsPanel-B9S9l1Ce.mjs} +1 -1
- package/dist/packem_shared/{DataBrowser-CVRWnNWu.mjs → DataBrowser-Dm-jhIUP.mjs} +2 -2
- package/dist/packem_shared/{GlobalDataBrowser-DC47T6Zl.mjs → GlobalDataBrowser-C1Y8GUhe.mjs} +1 -1
- package/dist/packem_shared/{HomePanel-D12HxHQo.mjs → HomePanel-B5ytwPIo.mjs} +1 -1
- package/dist/packem_shared/{MigrationsPanel-DMkxSXNl.mjs → MigrationsPanel-CwLikxDT.mjs} +1 -1
- package/dist/packem_shared/Studio-B89ZNMOD.mjs +1 -0
- package/dist/packem_shared/{StudioApp-isdWpF9P.mjs → StudioApp-C9l1a3A8.mjs} +1 -1
- package/dist/packem_shared/advisor-view-CzieqKMe.mjs +5 -0
- package/dist/packem_shared/assistant-provider-Bp72uWsq.mjs +1 -0
- package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
- package/dist/packem_shared/{cf-links-CBJ5SywP.mjs → cf-links-C4DVTr8A.mjs} +1 -1
- package/dist/packem_shared/error-alert-DKXm5h19.mjs +6 -0
- package/dist/packem_shared/{home-panel-CDVTuTF8.mjs → home-panel-5fGktYeD.mjs} +1 -1
- package/dist/packem_shared/recording-client-z4CBi0y8.mjs +1 -0
- package/dist/packem_shared/studio-gZfpz1wC.mjs +2 -0
- package/dist/packem_shared/{table-list-sidebar-CNadcIgG.mjs → table-list-sidebar-kpHaDWjy.mjs} +1 -1
- package/dist/packem_shared/use-assistant-rpc-GCUK2zPa.mjs +1 -0
- package/dist/standalone/chunk-2DT3QG6Q.js +1 -0
- package/dist/standalone/chunk-2EB7FN5S.js +1 -0
- package/dist/standalone/chunk-2FTGLXYA.js +1 -0
- package/dist/standalone/chunk-2H6VLY2M.js +1 -0
- package/dist/standalone/chunk-2NGKUO32.js +1 -0
- package/dist/standalone/chunk-2SNHKJXK.js +1 -0
- package/dist/standalone/chunk-2W4UO5BC.js +1 -0
- package/dist/standalone/{chunk-SLIDAWNX.js → chunk-3D67ZJRW.js} +1 -1
- package/dist/standalone/chunk-3RZD6VJ7.js +1 -0
- package/dist/standalone/chunk-3X3NXJBR.js +1 -0
- package/dist/standalone/chunk-4EPW63HS.js +1 -0
- package/dist/standalone/{chunk-WS36BO4R.js → chunk-4NKJV7YX.js} +1 -1
- package/dist/standalone/chunk-4PI2OSSP.js +1 -0
- package/dist/standalone/chunk-53CGUTRT.js +1 -0
- package/dist/standalone/chunk-5EWIOOBI.js +1 -0
- package/dist/standalone/chunk-5GYHGDIF.js +8 -0
- package/dist/standalone/chunk-5NIQHOPN.js +1 -0
- package/dist/standalone/chunk-5O7ICPWV.js +1 -0
- package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
- package/dist/standalone/{chunk-O2NMPIV2.js → chunk-5WNGRT7N.js} +1 -1
- package/dist/standalone/chunk-66BMMNUR.js +1 -0
- package/dist/standalone/chunk-66LYVBXB.js +1 -0
- package/dist/standalone/chunk-6FPV3EK2.js +1 -0
- package/dist/standalone/chunk-6G3E4PJ2.js +1 -0
- package/dist/standalone/chunk-6KE7ILEZ.js +1 -0
- package/dist/standalone/chunk-7KJCRT4B.js +1 -0
- package/dist/standalone/chunk-7O5SGABV.js +1 -0
- package/dist/standalone/chunk-7QEZ2SFW.js +1 -0
- package/dist/standalone/chunk-7WV3EPE6.js +1 -0
- package/dist/standalone/chunk-A2Q3TGIQ.js +1 -0
- package/dist/standalone/chunk-ABMHWBYA.js +1 -0
- package/dist/standalone/chunk-AEU3EF4T.js +1 -0
- package/dist/standalone/chunk-ALQHMFOC.js +1 -0
- package/dist/standalone/chunk-AZIKM5BA.js +1 -0
- package/dist/standalone/chunk-BCUOQNI2.js +1 -0
- package/dist/standalone/chunk-BG2CJOVS.js +1 -0
- package/dist/standalone/chunk-BKI3JMXQ.js +1 -0
- package/dist/standalone/chunk-BO5NNWMO.js +1 -0
- package/dist/standalone/chunk-BX7TFVCC.js +1 -0
- package/dist/standalone/chunk-CKEQX655.js +1 -0
- package/dist/standalone/{chunk-DX55P3KZ.js → chunk-CL3JOU6F.js} +1 -1
- package/dist/standalone/chunk-COLSZPCE.js +1 -0
- package/dist/standalone/chunk-CVSIFPI5.js +1 -0
- package/dist/standalone/chunk-D65UVZIA.js +1 -0
- package/dist/standalone/{chunk-DBVJ5VLI.js → chunk-DA2CAFXI.js} +1 -1
- package/dist/standalone/chunk-DB6QX4X6.js +1 -0
- package/dist/standalone/{chunk-7ZIYHKLX.js → chunk-E2FFHKGI.js} +3 -3
- package/dist/standalone/chunk-EE2COWFF.js +1 -0
- package/dist/standalone/chunk-ELSQ4FVH.js +1 -0
- package/dist/standalone/chunk-EXFERMUT.js +1 -0
- package/dist/standalone/chunk-FACXM2UB.js +7 -0
- package/dist/standalone/chunk-FBDIQ67D.js +1 -0
- package/dist/standalone/chunk-FHLODLBC.js +1 -0
- package/dist/standalone/chunk-FQEZUQ36.js +1 -0
- package/dist/standalone/{chunk-VEWQWS3J.js → chunk-FWM5Z6CH.js} +1 -1
- package/dist/standalone/chunk-GC3GKGWD.js +1 -0
- package/dist/standalone/chunk-GJXCPZDN.js +1 -0
- package/dist/standalone/chunk-GNI37YCV.js +33 -0
- package/dist/standalone/chunk-GVZ3VFGG.js +1 -0
- package/dist/standalone/chunk-GWNGVKLG.js +1 -0
- package/dist/standalone/chunk-GXTSE66Z.js +1 -0
- package/dist/standalone/chunk-H7BQUL7D.js +1 -0
- package/dist/standalone/chunk-HCCQTUHS.js +1 -0
- package/dist/standalone/chunk-HCOF7HOM.js +1 -0
- package/dist/standalone/chunk-HZDLUAWS.js +1 -0
- package/dist/standalone/chunk-IDZLHZIA.js +1 -0
- package/dist/standalone/{chunk-SU5DTRGK.js → chunk-IHGRWY3Y.js} +1 -1
- package/dist/standalone/chunk-IUGNIG6L.js +6 -0
- package/dist/standalone/chunk-J3BZWYJQ.js +1 -0
- package/dist/standalone/chunk-J45HAKBU.js +1 -0
- package/dist/standalone/chunk-J4PQAVOF.js +1 -0
- package/dist/standalone/chunk-J6FR2B77.js +1 -0
- package/dist/standalone/chunk-J6XQKD2F.js +1 -0
- package/dist/standalone/chunk-JCRFMCNP.js +1 -0
- package/dist/standalone/chunk-JD6PRRFO.js +1 -0
- package/dist/standalone/chunk-JENPPZFV.js +1 -0
- package/dist/standalone/chunk-JHTL3QHW.js +1 -0
- package/dist/standalone/chunk-JOPNP4EO.js +1 -0
- package/dist/standalone/chunk-JVP3TR3A.js +1 -0
- package/dist/standalone/chunk-KGLIQIZU.js +1 -0
- package/dist/standalone/{chunk-ONWGX5Y4.js → chunk-KH6OXCG3.js} +1 -1
- package/dist/standalone/{chunk-3FS22LNI.js → chunk-L26RMC2W.js} +3 -3
- package/dist/standalone/chunk-L2FYX4FN.js +1 -0
- package/dist/standalone/{chunk-XIRKBJPD.js → chunk-LPFUEJZ4.js} +5 -5
- package/dist/standalone/chunk-LSEUUZN4.js +1 -0
- package/dist/standalone/{chunk-BYOGQ2IV.js → chunk-MJTVTUNI.js} +2 -2
- package/dist/standalone/chunk-MQTI3STP.js +1 -0
- package/dist/standalone/chunk-N7WQJPOM.js +1 -0
- package/dist/standalone/chunk-NF2Q75WM.js +1 -0
- package/dist/standalone/chunk-NGZNXNRD.js +1 -0
- package/dist/standalone/chunk-O3AZ7JKE.js +1 -0
- package/dist/standalone/chunk-OK2QU2EV.js +1 -0
- package/dist/standalone/{chunk-IH2CJZF2.js → chunk-ONTGYVAN.js} +1 -1
- package/dist/standalone/chunk-OP4QEV27.js +1 -0
- package/dist/standalone/chunk-OPIMGKWU.js +1 -0
- package/dist/standalone/chunk-OWRKSQPE.js +1 -0
- package/dist/standalone/chunk-P5EVJEGC.js +1 -0
- package/dist/standalone/chunk-PAZKX7I6.js +1 -0
- package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
- package/dist/standalone/chunk-PJUVJTDR.js +1 -0
- package/dist/standalone/chunk-Q2J73V2C.js +2 -0
- package/dist/standalone/chunk-Q2KL457J.js +1 -0
- package/dist/standalone/chunk-QAOZXPLU.js +1 -0
- package/dist/standalone/{chunk-3PAYDWHN.js → chunk-QEFLZBT7.js} +2 -2
- package/dist/standalone/chunk-QKUVJIRX.js +1 -0
- package/dist/standalone/chunk-QNM2J7MG.js +1 -0
- package/dist/standalone/chunk-QRA7AKYO.js +1 -0
- package/dist/standalone/chunk-RCXNYW7P.js +1 -0
- package/dist/standalone/chunk-RE7GRXBM.js +1 -0
- package/dist/standalone/{chunk-TDVDZ7XQ.js → chunk-RIAOZECW.js} +1 -1
- package/dist/standalone/{chunk-LUHXNZI4.js → chunk-RTS5G3ET.js} +1 -1
- package/dist/standalone/chunk-S36FVTKK.js +1 -0
- package/dist/standalone/chunk-SR6CPTRT.js +1 -0
- package/dist/standalone/chunk-T3ZCW3RG.js +1 -0
- package/dist/standalone/chunk-TKBTZX4K.js +1 -0
- package/dist/standalone/chunk-TMWKF4XM.js +5 -0
- package/dist/standalone/chunk-TW4O2BA5.js +159 -0
- package/dist/standalone/chunk-UD5REVU2.js +1 -0
- package/dist/standalone/{chunk-PQH2LSJX.js → chunk-UQA2AJGI.js} +1 -1
- package/dist/standalone/chunk-UW6QNC74.js +3 -0
- package/dist/standalone/chunk-UXBNXITB.js +1 -0
- package/dist/standalone/chunk-UZ2ZXB74.js +1 -0
- package/dist/standalone/chunk-V3BE427M.js +1 -0
- package/dist/standalone/chunk-VHPTPEZ4.js +1 -0
- package/dist/standalone/chunk-W4LJQYCI.js +1 -0
- package/dist/standalone/chunk-WADY55J2.js +30 -0
- package/dist/standalone/chunk-WCWP4EAW.js +1 -0
- package/dist/standalone/chunk-X54WR7FF.js +1 -0
- package/dist/standalone/chunk-XWWQIAF6.js +1 -0
- package/dist/standalone/{chunk-SYGCASPT.js → chunk-Y2YLTUMD.js} +1 -1
- package/dist/standalone/chunk-YEVTA35E.js +1 -0
- package/dist/standalone/{chunk-R36QXQZX.js → chunk-YORPLSI5.js} +1 -1
- package/dist/standalone/chunk-YX2N5PJW.js +1 -0
- package/dist/standalone/chunk-Z57KMMOK.js +1 -0
- package/dist/standalone/chunk-ZFQ253FX.js +1 -0
- package/dist/standalone/chunk-ZG3IUVQ2.js +1 -0
- package/dist/standalone/chunk-ZKEYRU5C.js +1 -0
- package/dist/standalone/{chunk-5R2YO7HF.js → chunk-ZOKSVUID.js} +4 -4
- package/dist/standalone/{chunk-H7HZ42JY.js → chunk-ZPQBVYNN.js} +1 -1
- package/dist/standalone/chunk-ZSLKFLWE.js +1 -0
- package/dist/standalone/chunk-ZSWW2UGP.js +1 -0
- package/dist/standalone/studio.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +7 -6
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +0 -1
- package/dist/packem_shared/Studio-MA8kKZLu.mjs +0 -1
- package/dist/packem_shared/advisor-view-tBumWci_.mjs +0 -1
- package/dist/packem_shared/error-alert-C0R39DO1.mjs +0 -1
- package/dist/packem_shared/recording-client-DAipTA_n.mjs +0 -1
- package/dist/packem_shared/studio-UhUrPz5J.mjs +0 -2
- package/dist/packem_shared/use-sql-assistant-rZPs3LC3.mjs +0 -1
- package/dist/standalone/chunk-2AH4ABE5.js +0 -1
- package/dist/standalone/chunk-2G57ENH5.js +0 -1
- package/dist/standalone/chunk-3GXPALXG.js +0 -1
- package/dist/standalone/chunk-3GYLOE4V.js +0 -1
- package/dist/standalone/chunk-473JK2PQ.js +0 -1
- package/dist/standalone/chunk-4C4THJUD.js +0 -1
- package/dist/standalone/chunk-4DAKKAK7.js +0 -1
- package/dist/standalone/chunk-4M57OYFX.js +0 -1
- package/dist/standalone/chunk-4SQBAPY6.js +0 -1
- package/dist/standalone/chunk-5DNGK3NT.js +0 -1
- package/dist/standalone/chunk-5GIQ6C5N.js +0 -1
- package/dist/standalone/chunk-5WJG7FMH.js +0 -1
- package/dist/standalone/chunk-63KDHS3H.js +0 -1
- package/dist/standalone/chunk-6B6ARRMI.js +0 -1
- package/dist/standalone/chunk-6LMO2D54.js +0 -1
- package/dist/standalone/chunk-6M7FLLMT.js +0 -1
- package/dist/standalone/chunk-6QEXGYWH.js +0 -1
- package/dist/standalone/chunk-6UTZXEW3.js +0 -1
- package/dist/standalone/chunk-6VAY6L4J.js +0 -1
- package/dist/standalone/chunk-7PADVGQX.js +0 -1
- package/dist/standalone/chunk-7RGYCU6F.js +0 -1
- package/dist/standalone/chunk-7UM5ROG6.js +0 -1
- package/dist/standalone/chunk-A566HCBX.js +0 -1
- package/dist/standalone/chunk-A5JISKHE.js +0 -1
- package/dist/standalone/chunk-ADNRFCMZ.js +0 -1
- package/dist/standalone/chunk-AP4PC2M4.js +0 -1
- package/dist/standalone/chunk-BFE2DRP6.js +0 -33
- package/dist/standalone/chunk-BPEB4KFE.js +0 -1
- package/dist/standalone/chunk-BVX45MU5.js +0 -7
- package/dist/standalone/chunk-C6GN7ZXJ.js +0 -1
- package/dist/standalone/chunk-CL2VZNDI.js +0 -1
- package/dist/standalone/chunk-CNA3TVUK.js +0 -1
- package/dist/standalone/chunk-CZ6HBDIL.js +0 -1
- package/dist/standalone/chunk-D6S7MXW4.js +0 -1
- package/dist/standalone/chunk-E26OT26O.js +0 -1
- package/dist/standalone/chunk-FCAXVYAX.js +0 -1
- package/dist/standalone/chunk-FXPAJDES.js +0 -1
- package/dist/standalone/chunk-HHRYM6UW.js +0 -1
- package/dist/standalone/chunk-HPRF5LMA.js +0 -1
- package/dist/standalone/chunk-IB22LETR.js +0 -1
- package/dist/standalone/chunk-IBJVVHV5.js +0 -1
- package/dist/standalone/chunk-IENQRRQT.js +0 -1
- package/dist/standalone/chunk-IQ4TTHQT.js +0 -1
- package/dist/standalone/chunk-ITH5LRWM.js +0 -1
- package/dist/standalone/chunk-J6VFG6M5.js +0 -1
- package/dist/standalone/chunk-JSDKOE4U.js +0 -1
- package/dist/standalone/chunk-JTGGWF7R.js +0 -1
- package/dist/standalone/chunk-JZD7ZN3F.js +0 -1
- package/dist/standalone/chunk-K3CWB3AM.js +0 -1
- package/dist/standalone/chunk-KNFB3FGW.js +0 -1
- package/dist/standalone/chunk-KNXWDE4N.js +0 -1
- package/dist/standalone/chunk-KRPXOSBL.js +0 -1
- package/dist/standalone/chunk-KRY7BYHT.js +0 -1
- package/dist/standalone/chunk-KYAG2YMF.js +0 -1
- package/dist/standalone/chunk-KZCEJFZF.js +0 -1
- package/dist/standalone/chunk-KZILJQX3.js +0 -8
- package/dist/standalone/chunk-LEYUH5TS.js +0 -1
- package/dist/standalone/chunk-LFM672WN.js +0 -1
- package/dist/standalone/chunk-LIGOLZND.js +0 -1
- package/dist/standalone/chunk-LPU6YTSU.js +0 -1
- package/dist/standalone/chunk-MWJC3S62.js +0 -1
- package/dist/standalone/chunk-NP2AQOLE.js +0 -1
- package/dist/standalone/chunk-NVKLYDOH.js +0 -1
- package/dist/standalone/chunk-O2X2XYCM.js +0 -1
- package/dist/standalone/chunk-O3MDWYXF.js +0 -1
- package/dist/standalone/chunk-ONG4JEZD.js +0 -1
- package/dist/standalone/chunk-OS26JXYA.js +0 -1
- package/dist/standalone/chunk-OXFKZ4BM.js +0 -1
- package/dist/standalone/chunk-PGTEGUAB.js +0 -1
- package/dist/standalone/chunk-PTBUWRBY.js +0 -1
- package/dist/standalone/chunk-Q6HA3L2H.js +0 -1
- package/dist/standalone/chunk-QGV5ARD2.js +0 -1
- package/dist/standalone/chunk-QWRK4ESB.js +0 -1
- package/dist/standalone/chunk-RL2ITK2N.js +0 -1
- package/dist/standalone/chunk-RTJO3AR4.js +0 -1
- package/dist/standalone/chunk-SFY646MC.js +0 -1
- package/dist/standalone/chunk-T5UMHPAB.js +0 -1
- package/dist/standalone/chunk-T6HV2FQP.js +0 -2
- package/dist/standalone/chunk-T7ZKNNGX.js +0 -1
- package/dist/standalone/chunk-TCYPNSTV.js +0 -1
- package/dist/standalone/chunk-TQM6XHBA.js +0 -1
- package/dist/standalone/chunk-TRMWBRRU.js +0 -1
- package/dist/standalone/chunk-TW7KJSMR.js +0 -15
- package/dist/standalone/chunk-TYD3V4NB.js +0 -1
- package/dist/standalone/chunk-TZKLK52W.js +0 -1
- package/dist/standalone/chunk-U4RXQSQ7.js +0 -1
- package/dist/standalone/chunk-UNZ2UBVL.js +0 -1
- package/dist/standalone/chunk-VJRNOSRY.js +0 -1
- package/dist/standalone/chunk-W2BCSK5S.js +0 -1
- package/dist/standalone/chunk-W7MRISE3.js +0 -1
- package/dist/standalone/chunk-WM72PRE3.js +0 -1
- package/dist/standalone/chunk-X4WHMCOZ.js +0 -1
- package/dist/standalone/chunk-X74GEPSG.js +0 -1
- package/dist/standalone/chunk-XKPD4SFN.js +0 -1
- package/dist/standalone/chunk-XMSNLMWU.js +0 -1
- package/dist/standalone/chunk-XOPFDWXX.js +0 -1
- package/dist/standalone/chunk-XQLOVFPP.js +0 -1
- package/dist/standalone/chunk-XSHYZPGF.js +0 -1
- package/dist/standalone/chunk-XST3UEHU.js +0 -1
- package/dist/standalone/chunk-XYR5NST4.js +0 -1
- package/dist/standalone/chunk-Y74LIFSL.js +0 -1
- package/dist/standalone/chunk-YHTHRYP5.js +0 -1
- package/dist/standalone/chunk-YMEKCV27.js +0 -1
- package/dist/standalone/chunk-Z5EV64KS.js +0 -1
- package/dist/standalone/chunk-ZBON5T5A.js +0 -1
- package/dist/standalone/chunk-ZGSL4DPP.js +0 -1
- package/dist/standalone/chunk-ZOQTXWPK.js +0 -1
- package/dist/standalone/chunk-ZTOREMGH.js +0 -1
- package/dist/standalone/chunk-ZZ5GICTF.js +0 -1
- /package/dist/standalone/{chunk-UYEZR3BI.js → chunk-P6VNMPWR.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Pt,b as jt,c as ot}from"./chunk-FWM5Z6CH.js";import{a as de}from"./chunk-SR6CPTRT.js";import{a as Et,b as Ot,c as Dt,d as Ft}from"./chunk-RIAOZECW.js";import{a as it}from"./chunk-DB6QX4X6.js";import{a as rt,b as at,c as st,d as At,e as zt,f as lt,g as nt,h as Kt,i as Lt}from"./chunk-5WNGRT7N.js";import{a as Rt}from"./chunk-YORPLSI5.js";import{a as $t}from"./chunk-QNM2J7MG.js";import"./chunk-ONTGYVAN.js";import{e as _t}from"./chunk-P6VNMPWR.js";import{a as kt,b as Ct,c as Mt,d as It,e as je}from"./chunk-2H6VLY2M.js";import"./chunk-O3AZ7JKE.js";import{a as qt}from"./chunk-ELSQ4FVH.js";import"./chunk-Y2YLTUMD.js";import"./chunk-2SNHKJXK.js";import"./chunk-P5EVJEGC.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import"./chunk-BG2CJOVS.js";import{a as wt}from"./chunk-J45HAKBU.js";import{a as St}from"./chunk-FHLODLBC.js";import{a as yt,b as Nt}from"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import{a as Ye}from"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import{a as vt}from"./chunk-RCXNYW7P.js";import{b as Je}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as Ze,b as et,c as tt,d as Pe,e as oe,f as B}from"./chunk-7QEZ2SFW.js";import"./chunk-4PI2OSSP.js";import{a as Ee}from"./chunk-2W4UO5BC.js";import{c as Oe}from"./chunk-FBDIQ67D.js";import{a as fe,b as De,c as Fe,d as bt,e as xe}from"./chunk-OK2QU2EV.js";import{f as ct,m as ft}from"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B as he,h as mt,i as ut,j as ht,k as gt,o as Ge,s as pt,x as xt}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as Ht}from"./chunk-GWNGVKLG.js";import{a as Ut,b as Gt}from"./chunk-6G3E4PJ2.js";import{a as b,d as Xe}from"./chunk-5PEAXTYQ.js";var me=Xe(Ht(),1),j=Xe(Ut(),1);var t=Xe(Gt(),1);var Bt=b((l,e,s)=>`${l}:${e}:${ct(s??{})}`,"ut"),Tt=b((l,e)=>l==="gauge"?e.last:l==="histogram"?e.sum/Math.max(1,e.count):e.sum,"ht"),Jt=b((l,e)=>Tt(l,e),"Vt"),Vt=b(l=>Tt(l.kind,l),"Gt"),dt=b(l=>Number.isInteger(l)?l.toLocaleString():l.toLocaleString(void 0,{maximumFractionDigits:2}),"Ye"),Wt=b(l=>Array.isArray(l?.series)?l.series:[],"Yt"),Xt="FUNCTION_NOT_FOUND",Yt=b(l=>{let e=new Map;if(!Array.isArray(l?.series))return e;for(let s of l.series)e.set(Bt(s.kind,s.name,s.attributes),s.points);return e},"Wt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},er=b(l=>{let e=(0,me.c)(18),{name:s,onOpenTrace:a,traceId:r}=l,o=he();if(r===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=c):c=e[0],c}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let c=`mt-instrument-trace-${s}`,d;return e[3]!==n||e[4]!==c||e[5]!==r?(d=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":c,title:r,children:n}),e[3]=n,e[4]=c,e[5]=r,e[6]=d):d=e[6],d}let m=`mt-instrument-trace-${s}`,p;e[7]!==a||e[8]!==r?(p=b(()=>{a(r)},"p"),e[7]=a,e[8]=r,e[9]=p):p=e[9];let h;e[10]!==o||e[11]!==r?(h=o("Open the exemplar trace {trace}",{trace:r}),e[10]=o,e[11]=r,e[12]=h):h=e[12];let u;return e[13]!==n||e[14]!==m||e[15]!==p||e[16]!==h?(u=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":m,onClick:p,title:h,type:"button",children:n}),e[13]=n,e[14]=m,e[15]=p,e[16]=h,e[17]=u):u=e[17],u},"Zt"),tr=b(l=>{let e=(0,me.c)(105),{onOpenTrace:s,shardKey:a}=l,r=he(),o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={},e[0]=o):o=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:m,errorSource:p}=Oe(Ee.getMetricSeries,o,i),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let u;e[4]!==a?(u={live:!0,shardKey:a},e[4]=a,e[5]=u):u=e[5];let{data:c}=Oe(Ee.getMetricHistory,h,u),d,f,g,v,x,S,y,w,I,k,N,z,_;if(e[6]!==n||e[7]!==m||e[8]!==p||e[9]!==c||e[10]!==s||e[11]!==r){w=Symbol.for("react.early_return_sentinel");e:{let L=Wt(n),E=gt(p)===Xt;if(m!==null&&!E){let q;e[25]!==r?(q=r("Instruments"),e[25]=r,e[26]=q):q=e[26];let D;e[27]!==q?(D=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:q}),e[27]=q,e[28]=D):D=e[28];let F;e[29]!==m||e[30]!==r?(F=r("Instruments unavailable: {error}",{error:m}),e[29]=m,e[30]=r,e[31]=F):F=e[31];let P;e[32]!==F?(P=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:F}),e[32]=F,e[33]=P):P=e[33];let ie;e[34]!==D||e[35]!==P?(ie=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[D,P]}),e[34]=D,e[35]=P,e[36]=ie):ie=e[36],w=ie;break e}if(L.length===0){w=null;break e}let O=Yt(c),ue;e[37]!==r?(ue=b(q=>r(q==="counter"?"Counter":q==="gauge"?"Gauge":"Histogram"),"de"),e[37]=r,e[38]=ue):ue=e[38];let ge=ue;x="flex flex-col gap-2",S="mt-instruments";let T;e[39]!==r?(T=r("Instruments"),e[39]=r,e[40]=T):T=e[40],e[41]!==T?(y=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:T}),e[41]=T,e[42]=y):y=e[42],v=fe,_="overflow-hidden py-0",g=xe,z="px-0",f=Ze,k="mt-instruments-table";let U;e[43]!==r?(U=r("name"),e[43]=r,e[44]=U):U=e[44];let H;e[45]!==U?(H=(0,t.jsx)(oe,{children:U}),e[45]=U,e[46]=H):H=e[46];let G;e[47]!==r?(G=r("kind"),e[47]=r,e[48]=G):G=e[48];let J;e[49]!==G?(J=(0,t.jsx)(oe,{children:G}),e[49]=G,e[50]=J):J=e[50];let V;e[51]!==r?(V=r("value"),e[51]=r,e[52]=V):V=e[52];let W;e[53]!==V?(W=(0,t.jsx)(oe,{className:"text-right",children:V}),e[53]=V,e[54]=W):W=e[54];let X;e[55]!==r?(X=r("count"),e[55]=r,e[56]=X):X=e[56];let Y;e[57]!==X?(Y=(0,t.jsx)(oe,{className:"text-right",children:X}),e[57]=X,e[58]=Y):Y=e[58];let Z;e[59]!==r?(Z=r("range"),e[59]=r,e[60]=Z):Z=e[60];let ee;e[61]!==Z?(ee=(0,t.jsx)(oe,{className:"text-right",children:Z}),e[61]=Z,e[62]=ee):ee=e[62];let te;e[63]!==r?(te=r("trend"),e[63]=r,e[64]=te):te=e[64];let re;e[65]!==te?(re=(0,t.jsx)(oe,{children:te}),e[65]=te,e[66]=re):re=e[66];let ae;e[67]!==r?(ae=r("trace"),e[67]=r,e[68]=ae):ae=e[68];let se;e[69]!==ae?(se=(0,t.jsx)(oe,{children:ae}),e[69]=ae,e[70]=se):se=e[70];let le;e[71]!==r?(le=r("dimensions"),e[71]=r,e[72]=le):le=e[72];let ne;e[73]!==le?(ne=(0,t.jsx)(oe,{children:le}),e[73]=le,e[74]=ne):ne=e[74],e[75]!==H||e[76]!==J||e[77]!==W||e[78]!==Y||e[79]!==ee||e[80]!==re||e[81]!==se||e[82]!==ne?(N=(0,t.jsx)(et,{children:(0,t.jsxs)(Pe,{children:[H,J,W,Y,ee,re,se,ne]})}),e[75]=H,e[76]=J,e[77]=W,e[78]=Y,e[79]=ee,e[80]=re,e[81]=se,e[82]=ne,e[83]=N):N=e[83],d=tt,I=L.map(q=>{let D=Rt(q.attributes),F=Bt(q.kind,q.name,q.attributes),P=(O.get(F)??[]).map(ie=>Jt(q.kind,ie));return(0,t.jsxs)(Pe,{"data-testid":`mt-instrument-${q.name}`,children:[(0,t.jsx)(B,{className:"font-mono text-xs",title:q.functionPath,children:q.name}),(0,t.jsx)(B,{children:(0,t.jsx)(Je,{variant:Zt[q.kind],children:ge(q.kind)})}),(0,t.jsx)(B,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${q.name}`,children:dt(Vt(q))}),(0,t.jsx)(B,{className:"text-right tabular-nums text-muted-foreground",children:q.count.toLocaleString()}),(0,t.jsx)(B,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:q.min===q.max?"\u2014":`${dt(q.min)}\u2013${dt(q.max)}`}),(0,t.jsx)(B,{children:P.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:q.name}),className:"h-6 w-24 text-foreground",series:P,testId:`mt-instrument-trend-${q.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(B,{className:"font-mono text-xs",children:(0,t.jsx)(er,{name:q.name,onOpenTrace:s,traceId:q.exemplarTraceId})}),(0,t.jsx)(B,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:D,children:D===""?"\u2014":D})]},F)})}e[6]=n,e[7]=m,e[8]=p,e[9]=c,e[10]=s,e[11]=r,e[12]=d,e[13]=f,e[14]=g,e[15]=v,e[16]=x,e[17]=S,e[18]=y,e[19]=w,e[20]=I,e[21]=k,e[22]=N,e[23]=z,e[24]=_}else d=e[12],f=e[13],g=e[14],v=e[15],x=e[16],S=e[17],y=e[18],w=e[19],I=e[20],k=e[21],N=e[22],z=e[23],_=e[24];if(w!==Symbol.for("react.early_return_sentinel"))return w;let C;e[84]!==d||e[85]!==I?(C=(0,t.jsx)(d,{children:I}),e[84]=d,e[85]=I,e[86]=C):C=e[86];let R;e[87]!==f||e[88]!==C||e[89]!==k||e[90]!==N?(R=(0,t.jsxs)(f,{"data-testid":k,children:[N,C]}),e[87]=f,e[88]=C,e[89]=k,e[90]=N,e[91]=R):R=e[91];let M;e[92]!==g||e[93]!==R||e[94]!==z?(M=(0,t.jsx)(g,{className:z,children:R}),e[92]=g,e[93]=R,e[94]=z,e[95]=M):M=e[95];let $;e[96]!==v||e[97]!==M||e[98]!==_?($=(0,t.jsx)(v,{className:_,children:M}),e[96]=v,e[97]=M,e[98]=_,e[99]=$):$=e[99];let A;return e[100]!==x||e[101]!==S||e[102]!==y||e[103]!==$?(A=(0,t.jsxs)("section",{className:x,"data-testid":S,children:[y,$]}),e[100]=x,e[101]=S,e[102]=y,e[103]=$,e[104]=A):A=e[104],A},"es"),rr=b(l=>{let e=(0,me.c)(74),{aggregate:s,shardResults:a}=l,r=he(),o;e[0]!==r?(o=r("Shards"),e[0]=r,e[1]=o):o=e[1];let i;e[2]!==s.failed||e[3]!==s.reachable||e[4]!==r?(i=s.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:s.failed,reachable:s.reachable}):r("{reachable} reachable",{reachable:s.reachable}),e[2]=s.failed,e[3]=s.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==o||e[7]!==i?(n=(0,t.jsx)(de,{label:o,testId:"mt-agg-shards",value:i}),e[6]=o,e[7]=i,e[8]=n):n=e[8];let m;e[9]!==r?(m=r("Total requests"),e[9]=r,e[10]=m):m=e[10];let p;e[11]!==s.totalRequests||e[12]!==m?(p=(0,t.jsx)(de,{label:m,testId:"mt-agg-requests",value:s.totalRequests}),e[11]=s.totalRequests,e[12]=m,e[13]=p):p=e[13];let h;e[14]!==r?(h=r("Total errors"),e[14]=r,e[15]=h):h=e[15];let u;e[16]!==s.totalErrors||e[17]!==h?(u=(0,t.jsx)(de,{label:h,testId:"mt-agg-errors",value:s.totalErrors}),e[16]=s.totalErrors,e[17]=h,e[18]=u):u=e[18];let c;e[19]!==r?(c=r("Total database size"),e[19]=r,e[20]=c):c=e[20];let d;e[21]!==s.totalDatabaseSize?(d=Ge(s.totalDatabaseSize),e[21]=s.totalDatabaseSize,e[22]=d):d=e[22];let f;e[23]!==c||e[24]!==d?(f=(0,t.jsx)(de,{label:c,testId:"mt-agg-db-size",value:d}),e[23]=c,e[24]=d,e[25]=f):f=e[25];let g;e[26]!==r?(g=r("Combined cache hit rate"),e[26]=r,e[27]=g):g=e[27];let v;e[28]!==s.hitRate||e[29]!==r?(v=s.hitRate===null?r("no cache configured"):`${(s.hitRate*100).toFixed(1)}%`,e[28]=s.hitRate,e[29]=r,e[30]=v):v=e[30];let x;e[31]!==g||e[32]!==v?(x=(0,t.jsx)(de,{label:g,testId:"mt-agg-cache",value:v}),e[31]=g,e[32]=v,e[33]=x):x=e[33];let S;e[34]!==f||e[35]!==x||e[36]!==n||e[37]!==p||e[38]!==u?(S=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,p,u,f,x]}),e[34]=f,e[35]=x,e[36]=n,e[37]=p,e[38]=u,e[39]=S):S=e[39];let y;e[40]!==r?(y=r("shard"),e[40]=r,e[41]=y):y=e[41];let w;e[42]!==y?(w=(0,t.jsx)(oe,{children:y}),e[42]=y,e[43]=w):w=e[43];let I;e[44]!==r?(I=r("requests"),e[44]=r,e[45]=I):I=e[45];let k;e[46]!==I?(k=(0,t.jsx)(oe,{children:I}),e[46]=I,e[47]=k):k=e[47];let N;e[48]!==r?(N=r("errors"),e[48]=r,e[49]=N):N=e[49];let z;e[50]!==N?(z=(0,t.jsx)(oe,{children:N}),e[50]=N,e[51]=z):z=e[51];let _;e[52]!==r?(_=r("db size"),e[52]=r,e[53]=_):_=e[53];let C;e[54]!==_?(C=(0,t.jsx)(oe,{children:_}),e[54]=_,e[55]=C):C=e[55];let R;e[56]!==w||e[57]!==k||e[58]!==z||e[59]!==C?(R=(0,t.jsx)(et,{children:(0,t.jsxs)(Pe,{children:[w,k,z,C]})}),e[56]=w,e[57]=k,e[58]=z,e[59]=C,e[60]=R):R=e[60];let M;if(e[61]!==a||e[62]!==r){let E;e[64]!==r?(E=b(O=>(0,t.jsxs)(Pe,{"data-testid":`mt-agg-row-${O.shard}`,children:[(0,t.jsx)(B,{children:O.shard}),O.metrics===null?(0,t.jsx)(B,{className:"text-destructive",colSpan:3,children:O.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{className:"tabular-nums",children:O.metrics.requests}),(0,t.jsx)(B,{className:"tabular-nums",children:O.metrics.errors}),(0,t.jsx)(B,{className:"tabular-nums",children:Ge(O.metrics.databaseSize)})]})]},O.shard),"L"),e[64]=r,e[65]=E):E=e[65],M=a.map(E),e[61]=a,e[62]=r,e[63]=M}else M=e[63];let $;e[66]!==M?($=(0,t.jsx)(tt,{children:M}),e[66]=M,e[67]=$):$=e[67];let A;e[68]!==R||e[69]!==$?(A=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(xe,{className:"px-0",children:(0,t.jsxs)(Ze,{"data-testid":"mt-agg-table",children:[R,$]})})}),e[68]=R,e[69]=$,e[70]=A):A=e[70];let L;return e[71]!==S||e[72]!==A?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[S,A]}),e[71]=S,e[72]=A,e[73]=L):L=e[73],L},"ts"),ar=b(l=>{let e=(0,me.c)(75),{currentDelta:s,errorRate:a,history:r,latencyPercentiles:o,metrics:i}=l,n=he(),{cache:m}=i,p;e[0]!==r||e[1]!==n?(p=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=p):p=e[2];let h;e[3]!==s||e[4]!==r.length||e[5]!==n?(h=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${s.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=s,e[4]=r.length,e[5]=n,e[6]=h):h=e[6];let u;e[7]!==n?(u=n("Requests"),e[7]=n,e[8]=u):u=e[8];let c;e[9]!==i.requests||e[10]!==p||e[11]!==h||e[12]!==u?(c=(0,t.jsx)(de,{chart:p,footer:h,label:u,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=p,e[11]=h,e[12]=u,e[13]=c):c=e[13];let d;e[14]!==a||e[15]!==n?(d=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=d):d=e[16];let f;e[17]!==n?(f=n("Errors"),e[17]=n,e[18]=f):f=e[18];let g;e[19]!==a||e[20]!==i.errors?(g=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=g):g=e[21];let v;e[22]!==d||e[23]!==f||e[24]!==g?(v=(0,t.jsx)(de,{footer:d,label:f,testId:"mt-errors",value:g}),e[22]=d,e[23]=f,e[24]=g,e[25]=v):v=e[25];let x;e[26]!==o.p90?(x=o.p90>0?`P90 ${ot(o.p90)}`:void 0,e[26]=o.p90,e[27]=x):x=e[27];let S;e[28]!==n?(S=n("P95 latency"),e[28]=n,e[29]=S):S=e[29];let y;e[30]!==o.p95?(y=o.p95>0?ot(o.p95):"\u2014",e[30]=o.p95,e[31]=y):y=e[31];let w;e[32]!==S||e[33]!==y||e[34]!==x?(w=(0,t.jsx)(de,{footer:x,label:S,testId:"mt-p95",value:y}),e[32]=S,e[33]=y,e[34]=x,e[35]=w):w=e[35];let I;e[36]!==m||e[37]!==n?(I=m?`${m.entries.toLocaleString()} ${n("cache entries")}`:void 0,e[36]=m,e[37]=n,e[38]=I):I=e[38];let k;e[39]!==n?(k=n("Database size"),e[39]=n,e[40]=k):k=e[40];let N;e[41]!==i.databaseSize?(N=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=N):N=e[42];let z;e[43]!==I||e[44]!==k||e[45]!==N?(z=(0,t.jsx)(de,{footer:I,label:k,testId:"mt-db-size",value:N}),e[43]=I,e[44]=k,e[45]=N,e[46]=z):z=e[46];let _;e[47]!==n?(_=n("Shard"),e[47]=n,e[48]=_):_=e[48];let C;e[49]!==i.shard||e[50]!==_?(C=(0,t.jsx)(de,{label:_,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=_,e[51]=C):C=e[51];let R;e[52]!==n?(R=n("Uptime"),e[52]=n,e[53]=R):R=e[53];let M;e[54]!==i.uptimeMs?(M=Pt(i.uptimeMs),e[54]=i.uptimeMs,e[55]=M):M=e[55];let $;e[56]!==R||e[57]!==M?($=(0,t.jsx)(de,{label:R,testId:"mt-uptime",value:M}),e[56]=R,e[57]=M,e[58]=$):$=e[58];let A;e[59]!==n?(A=n("Cache hit rate"),e[59]=n,e[60]=A):A=e[60];let L;e[61]!==m||e[62]!==n?(L=m?n("{rate} ({count} entries)",{count:m.entries,rate:jt(m.hits,m.misses)}):n("no cache configured"),e[61]=m,e[62]=n,e[63]=L):L=e[63];let E;e[64]!==A||e[65]!==L?(E=(0,t.jsx)(de,{label:A,testId:"mt-cache",value:L}),e[64]=A,e[65]=L,e[66]=E):E=e[66];let O;return e[67]!==w||e[68]!==z||e[69]!==C||e[70]!==$||e[71]!==E||e[72]!==c||e[73]!==v?(O=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[c,v,w,z,C,$,E]}),e[67]=w,e[68]=z,e[69]=C,e[70]=$,e[71]=E,e[72]=c,e[73]=v,e[74]=O):O=e[74],O},"ss"),We=b(l=>l>=100?"critical":l>=50?"warning":"good","Ge"),Qe=b(l=>l<1?`${(l*1e3).toFixed(0)}\u03BCs`:l<1e3?`${l.toFixed(1)}ms`:`${(l/1e3).toFixed(2)}s`,"Le"),Ve=b(l=>l>=1e9?`${(l/1e9).toFixed(1)}B`:l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toLocaleString(),"Ue"),sr=b(l=>{let e=(0,me.c)(3),{level:s}=l;if(s==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(Je,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(s==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"rs"),lr=b((l,e)=>{let s=[...l];return s.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),s},"ls"),nr=b(l=>{let e=(0,me.c)(161),{queryStats:s}=l,a=he(),[r,o]=(0,j.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,m]=(0,j.useState)(i),p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=b(_=>{_!==null&&o(_)},"p"),e[1]=p):p=e[1];let h=p,u,c,d,f,g,v,x,S,y,w;if(e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==a){d=Symbol.for("react.early_return_sentinel");e:{let _=lr(s,r),C;e[16]!==s?(C=s.filter(ir),e[16]=s,e[17]=C):C=e[17];let R=C.length,M;e[18]!==s?(M=s.filter(or),e[18]=s,e[19]=M):M=e[19];let $=M.length,A;e[20]!==s?(A=s.filter(dr),e[20]=s,e[21]=A):A=e[21];let L=A.length,E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=b(K=>{m(ce=>{let Q=new Set(ce);return Q.has(K)?Q.delete(K):Q.add(K),Q})},"L"),e[22]=E):E=e[22];let O=E;if(s.length===0){let K;e[23]!==a?(K=a("No query insights yet"),e[23]=a,e[24]=K):K=e[24];let ce;e[25]!==K?(ce=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:K}),e[25]=K,e[26]=ce):ce=e[26];let Q;e[27]!==a?(Q=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=Q):Q=e[28];let pe;e[29]!==Q?(pe=(0,t.jsx)("p",{className:"mt-1 text-sm",children:Q}),e[29]=Q,e[30]=pe):pe=e[30];let He;e[31]!==ce||e[32]!==pe?(He=(0,t.jsx)(fe,{children:(0,t.jsx)(xe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ce,pe]})})}),e[31]=ce,e[32]=pe,e[33]=He):He=e[33],d=He;break e}x="space-y-4",S="qi-root";let ue;e[34]!==a?(ue=a("Critical queries"),e[34]=a,e[35]=ue):ue=e[35];let ge;e[36]!==ue?(ge=(0,t.jsx)(De,{className:"pb-2",children:(0,t.jsx)(Fe,{className:"text-sm font-medium",children:ue})}),e[36]=ue,e[37]=ge):ge=e[37];let T;e[38]!==R?(T=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:R}),e[38]=R,e[39]=T):T=e[39];let U;e[40]!==a?(U=a(">100ms avg execution"),e[40]=a,e[41]=U):U=e[41];let H;e[42]!==U?(H=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:U}),e[42]=U,e[43]=H):H=e[43];let G;e[44]!==T||e[45]!==H?(G=(0,t.jsxs)(xe,{children:[T,H]}),e[44]=T,e[45]=H,e[46]=G):G=e[46];let J;e[47]!==ge||e[48]!==G?(J=(0,t.jsxs)(fe,{children:[ge,G]}),e[47]=ge,e[48]=G,e[49]=J):J=e[49];let V;e[50]!==a?(V=a("Moderate queries"),e[50]=a,e[51]=V):V=e[51];let W;e[52]!==V?(W=(0,t.jsx)(De,{className:"pb-2",children:(0,t.jsx)(Fe,{className:"text-sm font-medium",children:V})}),e[52]=V,e[53]=W):W=e[53];let X;e[54]!==$?(X=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:$}),e[54]=$,e[55]=X):X=e[55];let Y;e[56]!==a?(Y=a("50\u2013100ms avg execution"),e[56]=a,e[57]=Y):Y=e[57];let Z;e[58]!==Y?(Z=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:Y}),e[58]=Y,e[59]=Z):Z=e[59];let ee;e[60]!==X||e[61]!==Z?(ee=(0,t.jsxs)(xe,{children:[X,Z]}),e[60]=X,e[61]=Z,e[62]=ee):ee=e[62];let te;e[63]!==W||e[64]!==ee?(te=(0,t.jsxs)(fe,{children:[W,ee]}),e[63]=W,e[64]=ee,e[65]=te):te=e[65];let re;e[66]!==a?(re=a("Fast queries"),e[66]=a,e[67]=re):re=e[67];let ae;e[68]!==re?(ae=(0,t.jsx)(De,{className:"pb-2",children:(0,t.jsx)(Fe,{className:"text-sm font-medium",children:re})}),e[68]=re,e[69]=ae):ae=e[69];let se;e[70]!==L?(se=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:L}),e[70]=L,e[71]=se):se=e[71];let le;e[72]!==a?(le=a("<50ms avg execution"),e[72]=a,e[73]=le):le=e[73];let ne;e[74]!==le?(ne=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:le}),e[74]=le,e[75]=ne):ne=e[75];let q;e[76]!==se||e[77]!==ne?(q=(0,t.jsxs)(xe,{children:[se,ne]}),e[76]=se,e[77]=ne,e[78]=q):q=e[78];let D;e[79]!==ae||e[80]!==q?(D=(0,t.jsxs)(fe,{children:[ae,q]}),e[79]=ae,e[80]=q,e[81]=D):D=e[81],e[82]!==J||e[83]!==te||e[84]!==D?(y=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[J,te,D]}),e[82]=J,e[83]=te,e[84]=D,e[85]=y):y=e[85];let F;e[86]!==a?(F=a("Query leaderboard"),e[86]=a,e[87]=F):F=e[87];let P;e[88]!==F?(P=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:F}),e[88]=F,e[89]=P):P=e[89];let ie;e[90]!==r||e[91]!==a?(ie=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=ie):ie=e[92];let be;e[93]!==ie?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ie}),e[93]=ie,e[94]=be):be=e[94];let ve;e[95]!==P||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[P,be]}),e[95]=P,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Be;e[104]===Symbol.for("react.memo_cache_sentinel")?(Be=(0,t.jsx)(Ct,{}),e[104]=Be):Be=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(Mt,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Be}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let _e;e[109]!==qe?(_e=(0,t.jsx)(je,{value:"totalTime",children:qe}),e[109]=qe,e[110]=_e):_e=e[110];let ke;e[111]!==a?(ke=a("Avg time"),e[111]=a,e[112]=ke):ke=e[112];let Ce;e[113]!==ke?(Ce=(0,t.jsx)(je,{value:"avgTime",children:ke}),e[113]=ke,e[114]=Ce):Ce=e[114];let Me;e[115]!==a?(Me=a("Execution count"),e[115]=a,e[116]=Me):Me=e[116];let Ie;e[117]!==Me?(Ie=(0,t.jsx)(je,{value:"execCount",children:Me}),e[117]=Me,e[118]=Ie):Ie=e[118];let Re;e[119]!==a?(Re=a("Rows read"),e[119]=a,e[120]=Re):Re=e[120];let $e;e[121]!==Re?($e=(0,t.jsx)(je,{value:"rowsRead",children:Re}),e[121]=Re,e[122]=$e):$e=e[122];let Ae;e[123]!==_e||e[124]!==Ce||e[125]!==Ie||e[126]!==$e?(Ae=(0,t.jsxs)(It,{children:[_e,Ce,Ie,$e]}),e[123]=_e,e[124]=Ce,e[125]=Ie,e[126]=$e,e[127]=Ae):Ae=e[127];let ze;e[128]!==r||e[129]!==we||e[130]!==Ae?(ze=(0,t.jsxs)(kt,{onValueChange:h,value:r,children:[we,Ae]}),e[128]=r,e[129]=we,e[130]=Ae,e[131]=ze):ze=e[131];let Ke;e[132]!==Ne||e[133]!==ze?(Ke=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,ze]}),e[132]=Ne,e[133]=ze,e[134]=Ke):Ke=e[134],e[135]!==ve||e[136]!==Ke?(w=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Ke]}),e[135]=ve,e[136]=Ke,e[137]=w):w=e[137],c=fe;let Le;e[138]!==a?(Le=a("Statements"),e[138]=a,e[139]=Le):Le=e[139];let Te;e[140]!==Le?(Te=(0,t.jsx)(Fe,{children:Le}),e[140]=Le,e[141]=Te):Te=e[141],v=(0,t.jsxs)(De,{children:[Te,(0,t.jsx)(bt,{children:a("{count} tracked statements",{count:_.length})})]}),u=xe,f="space-y-2";let Ue;e[142]!==n||e[143]!==a?(Ue=b(K=>{let ce=K.normalizedSql,Q=n.has(ce),pe=We(K.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":Q,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:b(()=>{O(ce)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(sr,{level:pe}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:K.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(K.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(K.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),K.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(K.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(K.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),Q&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:K.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[K.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(K.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(K.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(K.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(K.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(K.rowsWritten)})]})]})]})]},ce)},"Ke"),e[142]=n,e[143]=a,e[144]=Ue):Ue=e[144],g=_.map(Ue)}e[2]=n,e[3]=s,e[4]=r,e[5]=a,e[6]=u,e[7]=c,e[8]=d,e[9]=f,e[10]=g,e[11]=v,e[12]=x,e[13]=S,e[14]=y,e[15]=w}else u=e[6],c=e[7],d=e[8],f=e[9],g=e[10],v=e[11],x=e[12],S=e[13],y=e[14],w=e[15];if(d!==Symbol.for("react.early_return_sentinel"))return d;let I;e[145]!==f||e[146]!==g?(I=(0,t.jsx)("div",{className:f,children:g}),e[145]=f,e[146]=g,e[147]=I):I=e[147];let k;e[148]!==u||e[149]!==I?(k=(0,t.jsx)(u,{children:I}),e[148]=u,e[149]=I,e[150]=k):k=e[150];let N;e[151]!==c||e[152]!==k||e[153]!==v?(N=(0,t.jsxs)(c,{children:[v,k]}),e[151]=c,e[152]=k,e[153]=v,e[154]=N):N=e[154];let z;return e[155]!==N||e[156]!==x||e[157]!==S||e[158]!==y||e[159]!==w?(z=(0,t.jsxs)("div",{className:x,"data-testid":S,children:[y,w,N]}),e[155]=N,e[156]=x,e[157]=S,e[158]=y,e[159]=w,e[160]=z):z=e[160],z},"as");function ir(l){return We(l.avgDurationMs)==="critical"}b(ir,"is");function or(l){return We(l.avgDurationMs)==="warning"}b(or,"ns");function dr(l){return We(l.avgDurationMs)==="good"}b(dr,"os");var cr=["1m","5m","15m","1h"],mr=b(l=>new Date(l).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ds"),ur=b(l=>l.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:mr(e.bucketMs)})),"ms"),hr=b(({shardKey:l=""})=>{let e=he(),[s,a]=(0,j.useState)("15m"),r=Oe(Ee.getQueryInsights,{range:s},{live:!0,shardKey:l}).data,o=ur(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:cr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===s,className:xt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===s&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:b(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(Je,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),o.length===0?(0,t.jsx)(vt,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(rt,{height:140,width:"100%",children:(0,t.jsxs)(Lt,{data:o,children:[(0,t.jsx)(st,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(lt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(nt,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(at,{}),(0,t.jsx)(zt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(rt,{height:140,width:"100%",children:(0,t.jsxs)(Kt,{data:o,children:[(0,t.jsx)(st,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(lt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(nt,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(at,{}),(0,t.jsx)(At,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(nr,{queryStats:r?.entries??[]})]})},"fs"),gr=mt(Ee.getMetrics),pr=[],fr=b((l,e)=>l?e:"overview","gs"),xr=b(l=>{let e=(0,me.c)(14),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={},e[0]=s):s=e[0];let a;e[1]!==l?(a={live:!0,shardKey:l},e[1]=l,e[2]=a):a=e[2];let r=Oe(Ee.getMetrics,s,a),{data:o}=r,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={points:[],shard:null},e[3]=i):i=e[3];let[n,m]=(0,j.useState)(i),p=(0,j.useRef)(null),h=(0,j.useRef)(null),u,c;e[4]!==o||e[5]!==l?(u=b(()=>{o!==void 0&&Nt(l)},"u"),c=[o,l],e[4]=o,e[5]=l,e[6]=u,e[7]=c):(u=e[6],c=e[7]),(0,j.useEffect)(u,c);let d,f;e[8]!==o?(d=b(()=>{if(o===void 0)return;let x=o,S=h.current!==null&&h.current!==x.shard,y=h.current===x.shard?p.current:null;if(h.current=x.shard,p.current=x.requests,S){m({points:[],shard:x.shard});return}y!==null&&x.requests>=y&&m(w=>({points:[...w.shard===x.shard?w.points:[],x.requests-y].slice(-30),shard:x.shard}))},"c"),f=[o],e[8]=o,e[9]=d,e[10]=f):(d=e[9],f=e[10]),(0,j.useEffect)(d,f);let g=n.shard!==null&&n.shard===o?.shard?n.points:pr,v;return e[11]!==r||e[12]!==g?(v={...r,history:g},e[11]=r,e[12]=g,e[13]=v):v=e[13],v},"ps"),br=b(l=>{let e=ft(),s=(0,j.useRef)(!0);(0,j.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let[a,r]=(0,j.useState)(null),[o,i]=(0,j.useState)(!1),n=b(async()=>{i(!0);let p=l,h=Ot(p,yt());try{let u=await Promise.all(h.map(async c=>{try{let d=await e.query(gr,{},ut(c));return{error:null,metrics:d,shard:c===""?d.shard:c}}catch(d){return{error:ht(d),metrics:null,shard:c===""?"__root__":c}}}));s.current&&r({results:u,shard:p})}finally{s.current&&i(!1)}},"a"),m=a?.shard===l?a.results:null;return{aggregate:m===null?null:Et(m),aggregating:o,clearAggregate:b(()=>{r(null)},"clearAggregate"),runAggregate:b(()=>{pt(n())},"runAggregate"),shardResults:m}},"xs"),vr=b(l=>{if(!l||!("queryStats"in l))return;let e=l.queryStats;if(!(!e||!Array.isArray(e)))return Ft(e)},"bs"),Qt=b(l=>`pb-2 text-sm font-medium transition-colors ${l?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"ot"),yr=b(l=>{let e=(0,me.c)(26),{activeTab:s,onSelect:a,queryCount:r}=l,o=he(),i;e[0]!==a?(i=b(()=>{a("overview")},"n"),e[0]=a,e[1]=i):i=e[1];let n=i,m;e[2]!==a?(m=b(()=>{a("query-insights")},"m"),e[2]=a,e[3]=m):m=e[3];let p=m,h=s==="overview",u;e[4]!==h?(u=Qt(h),e[4]=h,e[5]=u):u=e[5];let c;e[6]!==o?(c=o("Overview"),e[6]=o,e[7]=c):c=e[7];let d;e[8]!==n||e[9]!==u||e[10]!==c?(d=(0,t.jsx)("button",{className:u,"data-testid":"mt-tab-overview",onClick:n,type:"button",children:c}),e[8]=n,e[9]=u,e[10]=c,e[11]=d):d=e[11];let f=s==="query-insights",g;e[12]!==f?(g=Qt(f),e[12]=f,e[13]=g):g=e[13];let v;e[14]!==o?(v=o("Query insights"),e[14]=o,e[15]=v):v=e[15];let x;e[16]!==r?(x=r>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:r}),e[16]=r,e[17]=x):x=e[17];let S;e[18]!==p||e[19]!==x||e[20]!==g||e[21]!==v?(S=(0,t.jsxs)("button",{className:g,"data-testid":"mt-tab-query-insights",onClick:p,type:"button",children:[v,x]}),e[18]=p,e[19]=x,e[20]=g,e[21]=v,e[22]=S):S=e[22];let y;return e[23]!==S||e[24]!==d?(y=(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[d,S]}),e[23]=S,e[24]=d,e[25]=y):y=e[25],y},"vs"),Nr=b(l=>{let e=(0,me.c)(13),{history:s,metrics:a}=l,r;e[0]!==s?(r=s.at(-1)??0,e[0]=s,e[1]=r):r=e[1];let o;e[2]!==a.errors||e[3]!==a.requests?(o=a.requests===0?"\u2014":`${(a.errors/a.requests*100).toFixed(1)}%`,e[2]=a.errors,e[3]=a.requests,e[4]=o):o=e[4];let i;e[5]!==a?(i=Dt(a),e[5]=a,e[6]=i):i=e[6];let n;return e[7]!==s||e[8]!==a||e[9]!==r||e[10]!==o||e[11]!==i?(n=(0,t.jsx)(ar,{currentDelta:r,errorRate:o,history:s,latencyPercentiles:i,metrics:a}),e[7]=s,e[8]=a,e[9]=r,e[10]=o,e[11]=i,e[12]=n):n=e[12],n},"ys"),Sr=b(l=>{let e=(0,me.c)(25),{aggregating:s,liveError:a,onAggregate:r,onClearAggregate:o,onShardKeyChange:i,shardKey:n}=l,m=he(),p;e[0]!==i||e[1]!==n?(p=(0,t.jsx)(St,{onChange:i,testId:"mt-shard-input",value:n}),e[0]=i,e[1]=n,e[2]=p):p=e[2];let h;e[3]!==a?(h=(0,t.jsx)(qt,{message:a,prefix:"mt"}),e[3]=a,e[4]=h):h=e[4];let u;e[5]!==s||e[6]!==m?(u=m(s?"Aggregating\u2026":"All shards"),e[5]=s,e[6]=m,e[7]=u):u=e[7];let c;e[8]!==s||e[9]!==r||e[10]!==u?(c=(0,t.jsx)(Ye,{"data-testid":"mt-aggregate",disabled:s,onClick:r,size:"sm",type:"button",variant:"secondary",children:u}),e[8]=s,e[9]=r,e[10]=u,e[11]=c):c=e[11];let d;e[12]!==o||e[13]!==m?(d=o!==void 0&&(0,t.jsx)(Ye,{"data-testid":"mt-aggregate-clear",onClick:o,size:"sm",type:"button",variant:"ghost",children:m("Hide")}),e[12]=o,e[13]=m,e[14]=d):d=e[14];let f;e[15]!==m?(f=m("Open in Cloudflare"),e[15]=m,e[16]=f):f=e[16];let g;e[17]!==f?(g=(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:_t,rel:"noreferrer",target:"_blank",children:f}),e[17]=f,e[18]=g):g=e[18];let v;return e[19]!==p||e[20]!==h||e[21]!==c||e[22]!==d||e[23]!==g?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,h,c,d,g]}),e[19]=p,e[20]=h,e[21]=c,e[22]=d,e[23]=g,e[24]=v):v=e[24],v},"Ns"),Jr=b(l=>{let e=(0,me.c)(41),{initialShardKey:s}=l,{queryShardKey:a,setShardKey:r,shardKey:o}=wt(s),[i,n]=(0,j.useState)("overview"),m=$t(a),{data:p,error:h,history:u,liveError:c}=xr(a),d=p??null,{aggregate:f,aggregating:g,clearAggregate:v,runAggregate:x,shardResults:S}=br(o),y;e[0]!==d?(y=vr(d),e[0]=d,e[1]=y):y=e[1];let w=y,I=w!==void 0,k;e[2]!==i||e[3]!==I?(k=fr(I,i),e[2]=i,e[3]=I,e[4]=k):k=e[4];let N=k,z=S===null?void 0:v,_;e[5]!==g||e[6]!==c||e[7]!==x||e[8]!==r||e[9]!==o||e[10]!==z?(_=(0,t.jsx)(Sr,{aggregating:g,liveError:c,onAggregate:x,onClearAggregate:z,onShardKeyChange:r,shardKey:o}),e[5]=g,e[6]=c,e[7]=x,e[8]=r,e[9]=o,e[10]=z,e[11]=_):_=e[11];let C;e[12]!==h?(C=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:h}),e[12]=h,e[13]=C):C=e[13];let R;e[14]!==N||e[15]!==w?(R=w!==void 0&&(0,t.jsx)(yr,{activeTab:N,onSelect:n,queryCount:w.length}),e[14]=N,e[15]=w,e[16]=R):R=e[16];let M;e[17]!==N||e[18]!==a||e[19]!==w?(M=N==="query-insights"&&w!==void 0&&(0,t.jsx)(hr,{shardKey:a}),e[17]=N,e[18]=a,e[19]=w,e[20]=M):M=e[20];let $;e[21]!==N||e[22]!==u||e[23]!==d?($=N==="overview"&&d!==null&&(0,t.jsx)(Nr,{history:u,metrics:d}),e[21]=N,e[22]=u,e[23]=d,e[24]=$):$=e[24];let A;e[25]!==N||e[26]!==m||e[27]!==a?(A=N==="overview"&&(0,t.jsx)(tr,{onOpenTrace:m,shardKey:a}),e[25]=N,e[26]=m,e[27]=a,e[28]=A):A=e[28];let L;e[29]!==f||e[30]!==N||e[31]!==S?(L=N==="overview"&&f!==null&&S!==null&&(0,t.jsx)(rr,{aggregate:f,shardResults:S}),e[29]=f,e[30]=N,e[31]=S,e[32]=L):L=e[32];let E;return e[33]!==A||e[34]!==L||e[35]!==_||e[36]!==C||e[37]!==R||e[38]!==M||e[39]!==$?(E=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[_,C,R,M,$,A,L]}),e[33]=A,e[34]=L,e[35]=_,e[36]=C,e[37]=R,e[38]=M,e[39]=$,e[40]=E):E=e[40],E},"Js");export{Jr as MetricsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as nn}from"./chunk-NGZNXNRD.js";import{a as ae,b as tn,c as on}from"./chunk-2SNHKJXK.js";import{a as ho,b as ko,c as wo,d as _o,e as Lo,f as Go,g as qo,h as Qo}from"./chunk-BCUOQNI2.js";import{$ as dt,A as Ro,B as xo,C as ct,E as Mo,G as bo,I as Co,J as vo,M as Io,N as Eo,O as yo,P as Po,R as So,S as No,T as Oo,U as To,W as Ut,Y as Do,_ as Ao,aa as Vo,ba as Bo,ca as pt,ea as Uo,fa as Ho,j as uo,k as co,la as zo,ma as Yo,na as Ko,oa as $o,p as Gt,qa as Wo,r as po,ra as Jo,s as lo,sa as Xo,u as mo,v as it,w as at,x as fo,y as ut,z as go}from"./chunk-P5EVJEGC.js";import{b as jo}from"./chunk-D65UVZIA.js";import{i as Zo,k as en}from"./chunk-QAOZXPLU.js";import{D as Ne,H as nt,I as Ue,J as rt,K as st,M as y,N as re,a as Bt,b as Z,c as tt,e as Lt,l as so,o as io,p as Ft,q as ao,r as ot}from"./chunk-OWRKSQPE.js";import{a as lt,b as Fo,c as He}from"./chunk-CKEQX655.js";import{a as ie,c as Se,i as oo,q as no,t as ro,w as $e}from"./chunk-UD5REVU2.js";import{a as he,c as G,d as Ze,e as et,g as Ge,h as Ke,i as se,j as O}from"./chunk-T3ZCW3RG.js";import{x as Fe}from"./chunk-GNI37YCV.js";import{a as ir}from"./chunk-GWNGVKLG.js";import{a as E,b as me}from"./chunk-6G3E4PJ2.js";import{a as o,c as sr,d as M}from"./chunk-5PEAXTYQ.js";var Ve=M(ir(),1);var ee={};sr(ee,{Arrow:()=>sn,Backdrop:()=>un,CheckboxItem:()=>fn,CheckboxItemIndicator:()=>gn,Group:()=>Mn,GroupLabel:()=>bn,Handle:()=>qe,Item:()=>vn,LinkItem:()=>In,Popup:()=>yn,Portal:()=>Nn,Positioner:()=>On,RadioGroup:()=>kn,RadioItem:()=>Dn,RadioItemIndicator:()=>An,Root:()=>Dt,Separator:()=>nn,SubmenuRoot:()=>Un,SubmenuTrigger:()=>Jn,Trigger:()=>Kn,Viewport:()=>Wn,createHandle:()=>Xn});var rn=M(E(),1);var mt=M(E(),1);var Ht=mt.createContext(void 0);function K(t){let e=mt.useContext(Ht);if(e===void 0&&!t)throw new Error(G(33));return e}o(K,"useMenuPositionerContext");var ft=M(E(),1);var jt=ft.createContext(void 0);function D(t){let e=ft.useContext(jt);if(e===void 0&&!t)throw new Error(G(36));return e}o(D,"useMenuRootContext");var sn=rn.forwardRef(o(function(e,n){let{render:s,className:u,style:c,...i}=e,{store:p}=D(),{arrowRef:r,side:m,align:f,arrowUncentered:R,arrowStyles:h}=K(),P={open:p.useState("open"),side:m,align:f,uncentered:R};return O("div",e,{ref:[r,n],stateAttributesMapping:ao,state:P,props:{style:h,"aria-hidden":!0,...i}})},"MenuArrow"));var an=M(E(),1);var gt=M(E(),1);var ar=gt.createContext(void 0);function Oe(t=!0){let e=gt.useContext(ar);if(e===void 0&&!t)throw new Error(G(25));return e}o(Oe,"useContextMenuRootContext");var un=an.forwardRef(o(function(e,n){let{render:s,className:u,style:c,...i}=e,{store:p}=D(),r=p.useState("open"),m=p.useState("mounted"),f=p.useState("transitionStatus"),R=p.useState("lastOpenChangeReason"),h=Oe(),x={open:r,transitionStatus:f};return O("div",e,{ref:h?.backdropRef?[n,h.backdropRef]:n,state:x,stateAttributesMapping:ot,props:[{role:"presentation",hidden:!m,style:{pointerEvents:R===y.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i]})},"MenuBackdrop"));var Mt=M(E(),1);var Rt=M(E(),1);var zt=Rt.createContext(void 0);function cn(){let t=Rt.useContext(zt);if(t===void 0)throw new Error(G(30));return t}o(cn,"useMenuCheckboxItemContext");var je=M(E(),1);var dn=M(E(),1);function xt(t){let{closeOnClick:e,highlighted:n,id:s,nodeId:u,store:c,typingRef:i,itemRef:p,itemMetadata:r}=t,{events:m}=c.useState("floatingTreeRoot"),f=c.useState("open"),R=Oe(!0),h=R!==void 0;return dn.useMemo(()=>({id:s,role:"menuitem",tabIndex:f&&n?0:-1,onKeyDown(x){x.key===" "&&i?.current&&x.preventDefault()},onMouseMove(x){u&&m.emit("itemhover",{nodeId:u,target:x.currentTarget})},onClick(x){e&&m.emit("close",{domEvent:x,reason:y.itemPress})},onMouseUp(x){if(R){let P=R.initialCursorPointRef.current;if(R.initialCursorPointRef.current=null,h&&P&&Math.abs(x.clientX-P.x)<=1&&Math.abs(x.clientY-P.y)<=1||h&&!tt.os.mac&&x.button===2)return}p.current&&c.context.allowMouseUpTriggerRef.current&&(!h||x.button===2)&&r.type==="regular-item"&&Fo(p.current,x,{detail:1})}}),[e,n,s,m,u,f,c,i,p,R,h,r])}o(xt,"useMenuItemCommonProps");var Te={type:"regular-item"};function ke(t){let{closeOnClick:e,disabled:n,highlighted:s,id:u,store:c,typingRef:i=c.context.typingRef,nativeButton:p,itemMetadata:r,nodeId:m}=t,f=je.useRef(null),{getButtonProps:R,buttonRef:h}=He({disabled:n,focusableWhenDisabled:!0,native:p,composite:!0}),x=xt({closeOnClick:e,highlighted:s,id:u,nodeId:m,store:c,typingRef:i,itemRef:f,itemMetadata:r}),P=je.useCallback(A=>he(x,{onMouseEnter(){r.type==="submenu-trigger"&&r.setActive()}},A,R),[x,R,r]),S=et(f,h);return je.useMemo(()=>({getItemProps:P,itemRef:S}),[P,S])}o(ke,"useMenuItem");var pn="data-checked",ln="data-unchecked";var we={checked(t){return t?{[pn]:""}:{[ln]:""}},...so};var mn=M(me(),1);var fn=Mt.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,nativeButton:p=!1,disabled:r=!1,closeOnClick:m=!1,checked:f,defaultChecked:R,onCheckedChange:h,style:x,...P}=e,S=ae({guess:!0,label:i}),A=K(!0),d=Z(c),{store:g}=D(),l=g.useState("disabled"),V=r||l,v=g.useState("isActive",S.index),C=g.useState("itemProps"),[B,b]=st({controlled:f,default:R??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:z,itemRef:F}=ke({closeOnClick:m,disabled:V,highlighted:v,id:d,store:g,nativeButton:p,nodeId:A?.context.nodeId,itemMetadata:Te}),N=Mt.useMemo(()=>({disabled:V,highlighted:v,checked:B}),[V,v,B]);function a(Y){let T=re(y.itemPress,Y.nativeEvent,void 0,{preventUnmountOnClose:Ge});h?.(!B,T),!T.isCanceled&&b(k=>!k)}o(a,"handleClick");let H=O("div",e,{state:N,stateAttributesMapping:we,props:[C,{role:"menuitemcheckbox","aria-checked":B,onClick:a},P,z],ref:[F,n,S.ref]});return(0,mn.jsx)(zt.Provider,{value:N,children:H})},"MenuCheckboxItem"));var ht=M(E(),1);var gn=ht.forwardRef(o(function(e,n){let{render:s,className:u,style:c,keepMounted:i=!1,...p}=e,r=cn(),m=ht.useRef(null),{transitionStatus:f,mounted:R,setMounted:h}=rt(r.checked);Ue({batch:!0,enabled:!r.checked,open:r.checked,ref:m,onComplete(){r.checked||h(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:f};return O("span",e,{state:x,ref:[n,m],stateAttributesMapping:we,props:{"aria-hidden":!0,...p},enabled:i||R})},"MenuCheckboxItemIndicator"));var Ct=M(E(),1);var bt=M(E(),1);var We=bt.createContext(void 0);function Rn(){let t=bt.useContext(We);if(t===void 0)throw new Error(G(31));return t}o(Rn,"useMenuGroupRootContext");var xn=M(me(),1);var Mn=Ct.forwardRef(o(function(e,n){let{render:s,className:u,style:c,...i}=e,[p,r]=Ct.useState(void 0),m=O("div",e,{ref:n,props:{role:"group","aria-labelledby":p,...i}});return(0,xn.jsx)(We.Provider,{value:r,children:m})},"MenuGroup"));var hn=M(E(),1);var bn=hn.forwardRef(o(function(e,n){let{render:s,className:u,style:c,id:i,...p}=e,r=Z(i),m=Rn();return ie(()=>(m(r),()=>{m(f=>f===r?void 0:f)}),[m,r]),O("div",e,{ref:n,props:{id:r,"aria-hidden":!0,...p}})},"MenuGroupLabel"));var Cn=M(E(),1);var vn=Cn.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,nativeButton:p=!1,disabled:r=!1,closeOnClick:m=!0,style:f,...R}=e,h=ae({guess:!0,label:i}),x=K(!0),P=Z(c),{store:S}=D(),A=S.useState("disabled"),d=r||A,g=S.useState("isActive",h.index),l=S.useState("itemProps"),{getItemProps:V,itemRef:v}=ke({closeOnClick:m,disabled:d,highlighted:g,id:P,store:S,nativeButton:p,nodeId:x?.context.nodeId,itemMetadata:Te});return O("div",e,{state:{disabled:d,highlighted:g},props:[l,R,V],ref:[v,n,h.ref]})},"MenuItem"));var vt=M(E(),1);var In=vt.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,closeOnClick:p=!1,style:r,...m}=e,f=vt.useRef(null),R=ae({guess:!0,label:i}),x=K(!0)?.context.nodeId,P=Z(c),{store:S}=D(),A=S.useState("isActive",R.index),d=S.useState("itemProps"),g=S.context.typingRef,{getButtonProps:l,buttonRef:V}=He({native:!1,composite:!0}),v=xt({closeOnClick:p,highlighted:A,id:P,nodeId:x,store:S,typingRef:g,itemRef:f,itemMetadata:Te});function C(b){return he(v,b,l)}return o(C,"getItemProps"),O("a",e,{state:{highlighted:A},props:[d,m,C],ref:[f,V,n,R.ref]})},"MenuLinkItem"));var It=M(E(),1);var En=M(me(),1);var yn=It.forwardRef(o(function(e,n){let{render:s,className:u,style:c,finalFocus:i,...p}=e,{store:r}=D(),{side:m,align:f}=K(),R=Xo(!0)!=null,h=r.useState("open"),x=r.useState("transitionStatus"),P=r.useState("popupProps"),S=r.useState("mounted"),A=r.useState("instantType"),d=r.useState("activeTriggerElement"),g=r.useState("parent"),l=r.useState("lastOpenChangeReason"),V=r.useState("rootId"),v=r.useState("floatingRootContext"),C=r.useState("floatingTreeRoot"),B=r.useState("closeDelay"),b=r.useState("hoverEnabled"),z=r.useState("disabled"),F=r.useState("openMethod"),N=g.type==="context-menu";Ue({open:h,ref:r.context.popupRef,onComplete(){h&&r.context.onOpenChangeComplete?.(!0)}}),It.useEffect(()=>{function k(ue){r.setOpen(!1,re(ue.reason,ue.domEvent))}return o(k,"handleClose"),C.events.on("close",k),()=>{C.events.off("close",k)}},[C.events,r]),Ao(v,{enabled:b&&!z&&!N&&g.type!=="menubar",closeDelay:B});let a=r.useStateSetter("popupElement"),H={transitionStatus:x,side:m,align:f,open:h,nested:g.type==="menu",instant:A},Y=O("div",e,{state:H,ref:[n,r.context.popupRef,a],stateAttributesMapping:ot,props:[P,{onKeyDown(k){R&&Jo.has(k.key)&&k.stopPropagation()}},Ko(x),p,{"data-rootownerid":V}]}),T=g.type===void 0||N;return(d||g.type==="menubar"&&l!==y.outsidePress)&&(T=!0),(0,En.jsx)(xo,{context:v,openInteractionType:F,modal:N,disabled:!S,returnFocus:i===void 0?T:i,initialFocus:g.type!=="menu",restoreFocus:!0,externalTree:g.type!=="menubar"?C:void 0,previousFocusableElement:d,nextFocusableElement:g.type===void 0?r.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?r.context.beforeContentFocusGuardRef:void 0,children:Y})},"MenuPopup"));var Sn=M(E(),1);var Et=M(E(),1);var Yt=Et.createContext(void 0);function Pn(){let t=Et.useContext(Yt);if(t===void 0)throw new Error(G(32));return t}o(Pn,"useMenuPortalContext");var Kt=M(me(),1);var Nn=Sn.forwardRef(o(function(e,n){let{keepMounted:s=!1,...u}=e,{store:c,parent:i}=D();if(!(c.useState("mounted")||s))return null;let m=i.type==="menu"||i.type==="menubar"?"group":void 0;return(0,Kt.jsx)(Yt.Provider,{value:s,children:(0,Kt.jsx)(mo,{ref:n,...u,portalOwnerRole:m})})},"MenuPortal"));var be=M(E(),1);var ze=M(me(),1);var On=be.forwardRef(o(function(e,n){let{anchor:s,positionMethod:u="absolute",className:c,render:i,side:p,align:r,sideOffset:m=0,alignOffset:f=0,collisionBoundary:R="clipping-ancestors",collisionPadding:h=5,arrowPadding:x=5,sticky:P=!1,disableAnchorTracking:S=!1,collisionAvoidance:A=po,style:d,...g}=e,{store:l}=D(),V=Pn(),v=Oe(!0),C=l.useState("parent"),B=l.useState("floatingRootContext"),b=l.useState("floatingTreeRoot"),z=l.useState("mounted"),F=l.useState("open"),N=l.useState("modal"),a=l.useState("openMethod"),H=l.useState("activeTriggerElement"),Y=l.useState("transitionStatus"),T=l.useState("positionerElement"),k=l.useState("instantType"),ue=l.useState("adaptiveOrigin"),te=l.useState("lastOpenChangeReason"),W=l.useState("floatingNodeId"),ye=l.useState("floatingParentNodeId"),w=B.useState("domReferenceElement"),fe=be.useRef(null),ge=nt(T),ce=s,Ce=m,Re=f,de=r,X=A;C.type==="context-menu"&&(ce=s??C.context?.anchor,de=de??"start",!p&&de!=="center"&&(Re=e.alignOffset??2,Ce=e.sideOffset??-5));let oe=p,pe=de;C.type==="menu"?(oe=oe??"inline-end",pe=pe??"start",X=e.collisionAvoidance??lo):C.type==="menubar"&&(oe=oe??(C.context.orientation==="vertical"?"inline-end":"bottom"),pe=pe??"start");let q=C.type==="context-menu",ne=zo({anchor:ce,floatingRootContext:B,positionMethod:v?"fixed":u,mounted:z,side:oe,sideOffset:Ce,align:pe,alignOffset:Re,arrowPadding:q?0:x,collisionBoundary:R,collisionPadding:h,sticky:P,nodeId:W,keepMounted:V,disableAnchorTracking:S,collisionAvoidance:X,shift:q?{crossAxis:!("side"in X&&X.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:b,adaptiveOrigin:ue});be.useEffect(()=>{function L(_){_.open&&(_.parentNodeId===W&&l.set("hoverEnabled",!1),_.nodeId!==W&&_.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,re(y.siblingOpen)))}return o(L,"onMenuOpenChange"),b.events.on("menuopenchange",L),()=>{b.events.off("menuopenchange",L)}},[l,b.events,W]),be.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function L(_){if(_.open||_.nodeId!==l.select("floatingParentNodeId"))return;let Ie=_.reason??y.siblingOpen;l.setOpen(!1,re(Ie))}return o(L,"onParentClose"),b.events.on("menuopenchange",L),()=>{b.events.off("menuopenchange",L)}},[b.events,l]);let le=Ne();be.useEffect(()=>{F||le.clear()},[F,le]),be.useEffect(()=>{function L(_){if(!(!F||_.nodeId!==l.select("floatingParentNodeId")))if(_.target&&H&&H!==_.target){let Ie=l.select("closeDelay");Ie>0?le.isStarted()||le.start(Ie,()=>{l.setOpen(!1,re(y.siblingOpen))}):l.setOpen(!1,re(y.siblingOpen))}else le.clear()}return o(L,"onItemHover"),b.events.on("itemhover",L),()=>{b.events.off("itemhover",L)}},[b.events,F,H,l,le]),be.useEffect(()=>{let L={open:F,nodeId:W,parentNodeId:ye,reason:l.select("lastOpenChangeReason")};b.events.emit("menuopenchange",L)},[b.events,F,l,W,ye]),ie(()=>{let L=w,_=fe.current;if(L&&(fe.current=L),_&&L&&L!==_){l.set("instantType",void 0);let Ie=new AbortController;return ge(()=>{l.set("instantType","trigger-change")},Ie.signal),()=>{Ie.abort()}}},[w,ge,l]);let Be={open:F,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:C.type==="menu",instant:k},Le=C.type==="menubar"&&C.context.modal,xe=N&&te!==y.triggerHover;Wo(F&&(Le||xe),a==="touch",T,H);let Me=$o(e,Be,{styles:ne.positionerStyles,transitionStatus:Y,props:g,refs:[n,l.useStateSetter("positionerElement")],hidden:!z,inert:!F}),Pe=z&&C.type!=="menu"&&(C.type!=="menubar"&&N&&te!==y.triggerHover||C.type==="menubar"&&C.context.modal),ve=null;return C.type==="menubar"?ve=C.context.contentElement:C.type===void 0&&(ve=H),(0,ze.jsxs)(Ht.Provider,{value:ne,children:[Pe&&(0,ze.jsx)(Yo,{ref:C.type==="context-menu"||C.type==="nested-context-menu"?C.context.internalBackdropRef:null,inert:Ho(!F),cutout:ve}),(0,ze.jsx)(go,{id:W,children:(0,ze.jsx)(tn,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:Me})})]})},"MenuPositioner"));var _e=M(E(),1);var yt=M(E(),1);var $t=yt.createContext(void 0);function Tn(){let t=yt.useContext($t);if(t===void 0)throw new Error(G(34));return t}o(Tn,"useMenuRadioGroupContext");var Wt=M(me(),1);var kn=_e.memo(_e.forwardRef(o(function(e,n){let{render:s,className:u,value:c,defaultValue:i,onValueChange:p,disabled:r=!1,style:m,"aria-labelledby":f,...R}=e,[h,x]=_e.useState(void 0),[P,S]=st({controlled:c,default:i,name:"MenuRadioGroup"}),A=Se((V,v)=>{p?.(V,v),!v.isCanceled&&S(V)}),g=O("div",e,{state:{disabled:r},ref:n,props:{role:"group","aria-labelledby":f??h,"aria-disabled":r||void 0,...R}}),l=_e.useMemo(()=>({value:P,setValue:A,disabled:r}),[P,A,r]);return(0,Wt.jsx)(We.Provider,{value:x,children:(0,Wt.jsx)($t.Provider,{value:l,children:g})})},"MenuRadioGroup")));var St=M(E(),1);var Pt=M(E(),1);var Jt=Pt.createContext(void 0);function wn(){let t=Pt.useContext(Jt);if(t===void 0)throw new Error(G(35));return t}o(wn,"useMenuRadioItemContext");var _n=M(me(),1);var Dn=St.forwardRef(o(function(e,n){let{render:s,className:u,id:c,label:i,nativeButton:p=!1,disabled:r=!1,closeOnClick:m=!1,value:f,style:R,...h}=e,x=ae({guess:!0,label:i}),P=K(!0),S=Z(c),{store:A}=D(),d=A.useState("isActive",x.index),g=A.useState("itemProps"),{value:l,setValue:V,disabled:v}=Tn(),C=A.useState("disabled"),B=r||v||C,b=l===f,{getItemProps:z,itemRef:F}=ke({closeOnClick:m,disabled:B,highlighted:d,id:S,store:A,nativeButton:p,nodeId:P?.context.nodeId,itemMetadata:Te}),N=St.useMemo(()=>({disabled:B,highlighted:d,checked:b}),[B,d,b]);function a(Y){let T=re(y.itemPress,Y.nativeEvent,void 0,{preventUnmountOnClose:Ge});V(f,T)}o(a,"handleClick");let H=O("div",e,{state:N,stateAttributesMapping:we,props:[g,{role:"menuitemradio","aria-checked":b,onClick:a},h,z],ref:[F,n,x.ref]});return(0,_n.jsx)(Jt.Provider,{value:N,children:H})},"MenuRadioItem"));var Nt=M(E(),1);var An=Nt.forwardRef(o(function(e,n){let{render:s,className:u,style:c,keepMounted:i=!1,...p}=e,r=wn(),m=Nt.useRef(null),{transitionStatus:f,mounted:R,setMounted:h}=rt(r.checked);Ue({batch:!0,enabled:!r.checked,open:r.checked,ref:m,onComplete(){r.checked||h(!1)}});let x={checked:r.checked,disabled:r.disabled,highlighted:r.highlighted,transitionStatus:f};return O("span",e,{state:x,stateAttributesMapping:we,ref:[n,m],props:{"aria-hidden":!0,...p},enabled:i||R})},"MenuRadioItemIndicator"));var U=M(E(),1);var Ot=M(E(),1);var cr=Ot.createContext(null);function Tt(t){let e=Ot.useContext(cr);if(e===null&&!t)throw new Error(G(5));return e}o(Tt,"useMenubarContext");var Je=M(E(),1);var Vn={...wo,disabled:o(t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,"disabled"),modal:o(t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),"modal"),openMethod:o(t=>t.openMethod,"openMethod"),allowMouseEnter:o(t=>t.allowMouseEnter,"allowMouseEnter"),highlightItemOnHover:o(t=>t.highlightItemOnHover,"highlightItemOnHover"),parent:o(t=>t.parent,"parent"),rootId:o(t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,"rootId"),activeIndex:o(t=>t.activeIndex,"activeIndex"),isActive:o((t,e)=>t.activeIndex===e,"isActive"),hoverEnabled:o(t=>t.hoverEnabled,"hoverEnabled"),instantType:o(t=>t.instantType,"instantType"),lastOpenChangeReason:o(t=>t.openChangeReason,"lastOpenChangeReason"),floatingTreeRoot:o(t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,"floatingTreeRoot"),floatingNodeId:o(t=>t.floatingNodeId,"floatingNodeId"),floatingParentNodeId:o(t=>t.floatingParentNodeId,"floatingParentNodeId"),itemProps:o(t=>t.itemProps,"itemProps"),closeDelay:o(t=>t.closeDelay,"closeDelay"),adaptiveOrigin:o(t=>t.adaptiveOrigin,"adaptiveOrigin"),keyboardEventRelay:o(t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")},"keyboardEventRelay")},kt=class extends bo{static{o(this,"MenuStore")}constructor(e,n,s=!1){let u=new Ut,c=Fn(u,n,s,e);super(c,Ln(u),Vn),this.unsubscribeParentListener=this.observe("parent",i=>{if(this.unsubscribeParentListener?.(),i.type==="menu"){let p=i.store.select("rootId"),r=i.store.select("floatingTreeRoot"),m=i.store.select("keyboardEventRelay");this.unsubscribeParentListener=i.store.subscribe(()=>{let f=i.store.select("rootId"),R=i.store.select("floatingTreeRoot"),h=i.store.select("keyboardEventRelay");p===f&&r===R&&m===h||(p=f,r=R,m=h,this.notifyAll())}),this.context.allowMouseUpTriggerRef=i.store.context.allowMouseUpTriggerRef;return}i.type!==void 0&&(this.context.allowMouseUpTriggerRef=i.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}unsubscribeParentListener=null};function Bn(){let t=new Ut,e=new Lo(Object.freeze(Fn(t)),Object.freeze(Ln(t)),Vn);return Object.assign(e,{setOpen:Ge})}o(Bn,"createNullMenuStore");function Ln(t){return{positionerRef:Je.createRef(),popupRef:Je.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Je.createRef(),beforeContentFocusGuardRef:Je.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}o(Ln,"createInitialContext");function Fn(t,e,n=!1,s){return{...ko(t,e,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new it,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:se,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...s}}o(Fn,"createInitialState");var wt=M(E(),1);var Xt=wt.createContext(void 0);function _t(){return wt.useContext(Xt)}o(_t,"useMenuSubmenuRootContext");var Xe=M(me(),1);var Dt=uo(o(function(e){let{children:n,open:s,onOpenChange:u,onOpenChangeComplete:c,defaultOpen:i=!1,disabled:p=!1,modal:r,loopFocus:m=!0,orientation:f="vertical",actionsRef:R,closeParentOnEsc:h=!1,handle:x,triggerId:P,defaultTriggerId:S=null,highlightItemOnHover:A=!0}=e,d=Oe(!0),g=D(!0),l=Tt(!0),V=_t(),v=U.useMemo(()=>V&&g?{type:"menu",store:g.store}:l?{type:"menubar",context:l}:d&&!g?{type:"context-menu",context:d}:{type:void 0},[d,g,l,V]),C=Bt(),B=Bt(),b=at(),z=v.type==="menu"?v.store:void 0,F=(s??i)&&z?.state.transitionStatus==="starting",N=Ze(()=>F?z?.state.instantType:void 0).current,a=dr({open:i,openProp:s,activeTriggerId:S,triggerIdProp:P,parent:v,disabled:p,highlightItemOnHover:A,modal:v.type===void 0?r:void 0,rootId:C,instantType:N},B,b!=null);a.useControlledProp("openProp",s),a.useControlledProp("triggerIdProp",P),a.useContextCallback("onOpenChangeComplete",c);let H=a.useState("floatingTreeRoot"),Y=ut(H),T=a.useState("open"),k=a.useState("activeTriggerElement"),ue=a.useState("positionerElement"),te=a.useState("hoverEnabled"),W=a.useState("disabled"),ye=a.useState("lastOpenChangeReason"),w=a.useState("parent"),fe=a.useState("activeIndex"),ge=a.useState("payload"),ce=a.useState("floatingParentNodeId"),Ce=U.useRef(null),Re=U.useRef(w.type!=="context-menu"),de=Ne(),X=U.useRef(!0),oe=Ne(),pe=ce!=null,{openMethod:q,triggerProps:ne}=Uo(T);a.useSyncedValues({disabled:p,highlightItemOnHover:A,modal:w.type===void 0?r:void 0,openMethod:q,rootId:C}),No(a);let{forceUnmount:le,transitionStatus:Be}=Oo(T,a,()=>{a.set("allowMouseEnter",!1)},F),Le=nt(a.context.popupRef);U.useEffect(()=>{if(N===void 0)return;let I=o(()=>{a.state.instantType===N&&a.set("instantType",void 0)},"clearSeededInstantType");if(!T){I();return}if(Be!==void 0)return;if(a.context.popupRef.current==null){I();return}let j=new AbortController;return Le(I,j.signal),()=>{j.abort()}},[N,T,Be,Le,a]),ie(()=>{d&&!g?a.update({parent:{type:"context-menu",context:d},floatingNodeId:Y,floatingParentNodeId:b}):g&&a.update({floatingNodeId:Y,floatingParentNodeId:b})},[d,g,Y,b,a]),U.useEffect(()=>{if(T||(Ce.current=null),w.type==="context-menu"){if(!T){de.clear(),Re.current=!1;return}de.start(500,()=>{Re.current=!0})}},[de,T,w.type]),ie(()=>{!T&&!te&&a.set("hoverEnabled",!0)},[T,te,a]);let xe=Se((I,j)=>{let Q=j.reason;if(!I&&!a.select("open")||T===I&&j.trigger===k&&ye===Q)return;let nr=Po(j);if(!I&&j.trigger==null&&(j.trigger=k??void 0),u?.(I,j),j.isCanceled)return;a.state.floatingRootContext.dispatchOpenChange(I,j);let Vt=j.event;if(I===!1&&Vt?.type==="click"&&Vt.pointerType==="touch"&&!X.current)return;I&&Q===y.triggerFocus?(X.current=!1,oe.start(300,()=>{X.current=!0})):(X.current=!0,oe.clear());let to=(Q===y.triggerPress||Q===y.itemPress)&&Vt.detail===0,rr=!I&&(Q===y.escapeKey||Q==null);Ce.current=j.event;let Ye=yo(a.state,I,j.trigger,nr());Ye.openChangeReason=Q,w.type==="menubar"&&(Q===y.triggerFocus||Q===y.focusOut||Q===y.triggerHover||Q===y.listNavigation||Q===y.siblingOpen)?Ye.instantType="group":to||rr?Ye.instantType=to?"click":"dismiss":Ye.instantType=void 0,a.update(Ye)}),Me=Co({popupStore:a,floatingRootContext:a.state.floatingRootContext,floatingId:B,nested:b!=null,onOpenChange:xe}),Pe=Me.context.events;ie(()=>{let I=o(({open:j,eventDetails:Q})=>xe(j,Q),"handleSetOpenEvent");return Pe.on("setOpen",I),()=>{Pe?.off("setOpen",I)}},[Pe,xe]);let ve=U.useCallback(()=>{a.setOpen(!1,re(y.imperativeAction))},[a]);U.useImperativeHandle(R,()=>({unmount:le,close:ve}),[le,ve]);let L;w.type==="context-menu"&&(L=w.context),U.useImperativeHandle(L?.positionerRef,()=>ue,[ue]),U.useImperativeHandle(L?.actionsRef,()=>({setOpen:xe}),[xe]);let _=Mo(Me,{enabled:!W,bubbles:{escapeKey:h&&w.type==="menu"},outsidePress(){return w.type!=="context-menu"||Ce.current?.type==="contextmenu"?!0:Re.current},externalTree:pe?H:void 0}),Ie=jo(),qn=U.useCallback(I=>{a.select("activeIndex")!==I&&a.set("activeIndex",I)},[a]),Ae=Vo(Me,{enabled:!W,listRef:a.context.itemDomElements,activeIndex:fe,nested:w.type!==void 0,loopFocus:m,orientation:f,parentOrientation:w.type==="menubar"?w.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:Ke,onNavigate:qn,openOnArrowKeyDown:w.type!=="context-menu",externalTree:pe?H:void 0,focusItemOnHover:A}),Qn=U.useCallback(I=>{a.context.typingRef.current=I},[a]),Qe=Bo(Me,{enabled:!W,listRef:a.context.itemLabels,elementsRef:a.context.itemDomElements,activeIndex:fe,resetMs:500,onMatch:o(I=>{T&&I!==fe&&a.set("activeIndex",I)},"onMatch"),onTyping:Qn}),Zn=U.useMemo(()=>{let I=he(Qe.reference,Ae.reference,_.reference,{onMouseMove(){a.set("allowMouseEnter",!0)}},ne);return I["aria-haspopup"]="menu",I["aria-expanded"]=T,I},[a,Qe.reference,Ae.reference,_.reference,ne,T]),Zt=U.useMemo(()=>{let I=he(Ae.trigger,_.trigger,ne);return I["aria-haspopup"]="menu",I["aria-expanded"]=!1,I},[Ae.trigger,_.trigger,ne]);Ze(()=>(a.update({inactiveTriggerProps:Zt}),null));let er=U.useMemo(()=>he(vo,{id:B,role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":k?.id,onMouseMove(){a.set("allowMouseEnter",!0),w.type==="menu"&&a.set("hoverEnabled",!1)},onClick(){a.select("hoverEnabled")&&a.set("hoverEnabled",!1)},onKeyDown(I){let j=a.select("keyboardEventRelay");j&&!I.isPropagationStopped()&&j(I)}},Qe.floating,Ae.floating,_.floating),[k,B,f,w.type,a,Qe.floating,Ae.floating,_.floating]),tr=Ae.item??se;To(a,{floatingRootContext:Me,activeTriggerProps:Zn,inactiveTriggerProps:Zt,popupProps:er,itemProps:tr});let or=U.useMemo(()=>({store:a,parent:v}),[a,v]),eo=(0,Xe.jsxs)(jt.Provider,{value:or,children:[x&&(0,Xe.jsx)(Io,{handle:x,store:a}),typeof n=="function"?n({payload:ge}):n]});return w.type===void 0||w.type==="context-menu"?(0,Xe.jsx)(Ro,{externalTree:H,children:eo}):eo},"MenuRoot"));function dr(t,e,n){return Ze(()=>new kt(t,e,n)).current}o(dr,"useMenuRootStore");var Gn=M(E(),1);var qt=M(me(),1);function Un(t){let e=D().store,n=Gn.useMemo(()=>({parentMenu:e}),[e]);return(0,qt.jsx)(Xt.Provider,{value:n,children:(0,qt.jsx)(Dt,{...t})})}o(Un,"MenuSubmenuRoot");var $=M(E(),1);var Hn=M(E(),1);function jn(t={}){let{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:s}=lt(),{ref:u,index:c}=ae(t),i=n===c,p=Hn.useRef(null),r=et(u,p);return{compositeProps:{tabIndex:i?0:-1,onFocus(){s(c)},onMouseMove(){let f=p.current;if(!e||!f)return;let R=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!R&&f.focus()}},compositeRef:r,index:c}}o(jn,"useCompositeItem");function zn(t){let{render:e,className:n,style:s,state:u=se,props:c=Ke,refs:i=Ke,metadata:p,stateAttributesMapping:r,tag:m="div",...f}=t,{compositeProps:R,compositeRef:h}=jn({metadata:p});return O(m,t,{state:u,ref:[h,...i],props:[R,...c,f],stateAttributesMapping:r})}o(zn,"CompositeItem");function Qt(t){if(oo(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!no(t))return Qt(ro(t))}o(Qt,"findRootOwnerId");var At=M(E(),1);function Yn(t){let{enabled:e=!0,mouseDownAction:n,open:s}=t,u=At.useRef(!1);return At.useMemo(()=>e?{onMouseDown:o(c=>{(n==="open"&&!s||n==="close"&&s)&&(u.current=!0,$e(c.currentTarget).addEventListener("click",()=>{u.current=!1},{once:!0}))},"onMouseDown"),onClick:o(c=>{u.current&&(u.current=!1,c.preventBaseUIHandler())},"onClick")}:se,[e,n,s])}o(Yn,"useMixedToggleClickHandler");var De=M(me(),1);var Kn=co(o(function(e,n){let{render:s,className:u,style:c,disabled:i=!1,nativeButton:p=!0,id:r,openOnHover:m,delay:f=100,closeDelay:R=0,handle:h,payload:x,...P}=e,S=D(!0),d=_o(h)??S?.store;if(!d)throw new Error(G(85));let g=Z(r),l=d.useState("isTriggerActive",g),V=d.useState("floatingRootContext"),v=d.useState("isOpenedByTrigger",g),C=d.useState("triggerPopupId",g),B=$.useRef(null),b=lr(),z=lt(!0),F=fo(),N=$.useMemo(()=>F??new it,[F]),a=ut(N),H=at(),{registerTrigger:Y,isMountedByThisTrigger:T}=So(g,B,d,{payload:x,closeDelay:R,parent:b,floatingTreeRoot:N,floatingNodeId:a,floatingParentNodeId:H,keyboardEventRelay:z?.relayKeyboardEvent}),k=b.type==="menubar",ue=d.useState("disabled"),te=i||ue||k&&b.context.disabled,{getButtonProps:W,buttonRef:ye}=He({disabled:te,native:p});$.useEffect(()=>{!v&&b.type===void 0&&(d.context.allowMouseUpTriggerRef.current=!1)},[d,v,b.type]);let w=$.useRef(null),fe=Ne(),ge=Se(L=>{if(!w.current)return;fe.clear(),d.context.allowMouseUpTriggerRef.current=!1;let _=L.target;Lt(w.current,_)||Lt(d.select("positionerElement"),_)||_===w.current||_!=null&&Qt(_)===d.select("rootId")||on(L,w.current)||N.events.emit("close",{domEvent:L,reason:y.cancelOpen})});$.useEffect(()=>{v&&d.select("lastOpenChangeReason")===y.triggerHover&&$e(w.current).addEventListener("mouseup",ge,{once:!0})},[v,ge,d]);let ce=k&&b.context.hasSubmenuOpen,Re=dt(V,{enabled:(m??ce)&&!te&&(!k||ce&&!T),handleClose:pt({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:b.type===void 0?f:void 0,delay:{close:R},triggerElementRef:B,externalTree:N,isActiveTrigger:l,isClosing:o(()=>d.select("transitionStatus")==="ending","isClosing")}),de=pr(v,d.select("lastOpenChangeReason")),X=ct(V,{enabled:!te,event:v&&k?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:b.type===void 0?de:!1}),oe=Do(V,{enabled:!te&&ce}),pe=Yn({open:v,enabled:k,mouseDownAction:"open"}),q=$.useMemo(()=>he(oe.reference,X.reference),[oe.reference,X.reference]),ne=d.useState("triggerProps",T),{preFocusGuardRef:le,handlePreFocusGuardFocus:Be,handleFocusTargetFocus:Le}=Go(d,B),xe={disabled:te,open:v},Me=[w,n,ye,Y,B],Pe=[q,Re??se,ne,{"aria-haspopup":"menu","aria-controls":C,id:g,onMouseDown:o(L=>{if(d.select("open"))return;fe.start(200,()=>{d.context.allowMouseUpTriggerRef.current=!0}),$e(L.currentTarget).addEventListener("mouseup",ge,{once:!0})},"onMouseDown")},k?{role:"menuitem"}:{},pe,P,W],ve=O("button",e,{enabled:!k,stateAttributesMapping:Ft,state:xe,ref:Me,props:Pe});return k?(0,De.jsx)(zn,{tag:"button",render:s,className:u,style:c,state:xe,refs:Me,props:Pe,stateAttributesMapping:Ft}):v?(0,De.jsxs)($.Fragment,{children:[(0,De.jsx)(Gt,{ref:le,onFocus:Be},`${g}-pre-focus-guard`),(0,De.jsx)($.Fragment,{children:ve},g),(0,De.jsx)(Gt,{ref:d.context.triggerFocusTargetRef,onFocus:Le},`${g}-post-focus-guard`)]}):(0,De.jsx)($.Fragment,{children:ve},g)},"MenuTrigger"));function pr(t,e){let n=Ne(),[s,u]=$.useState(!1);return ie(()=>{t&&e===y.triggerHover?(u(!0),n.start(500,()=>{u(!1)})):t||(n.clear(),u(!1))},[t,e,n]),s}o(pr,"useStickIfOpen");function lr(){let t=Tt(!0);return $.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}o(lr,"useMenuParent");var $n=M(E(),1);var Wn=$n.forwardRef(o(function(e,n){let{render:s,className:u,style:c,children:i,...p}=e,{store:r}=D(),{side:m}=K(),f=r.useState("instantType"),{children:R,state:h}=Qo({store:r,side:m,children:i}),x={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:f};return O("div",e,{state:x,ref:n,props:[p,{children:R}],stateAttributesMapping:qo})},"MenuViewport"));var Ee=M(E(),1);var mr={"aria-expanded":void 0},Jn=Ee.forwardRef(o(function(e,n){let{render:s,className:u,style:c,label:i,id:p,nativeButton:r=!1,openOnHover:m=!0,delay:f=100,closeDelay:R=0,disabled:h=!1,...x}=e,P=_t();if(!P?.parentMenu)throw new Error(G(37));let S=ae({guess:!0,label:i}),A=K(),{store:d}=D(),g=Z(p),l=d.useState("open"),V=d.useState("floatingRootContext"),v=d.useState("floatingTreeRoot"),C=d.useState("triggerPopupId",g),B=Eo(g,d),b=Se(q=>{B(q),q!==null&&d.select("open")&&d.select("activeTriggerId")==null&&d.update({activeTriggerId:g??null,activeTriggerElement:q,closeDelay:R})}),z=Ee.useRef(null),F=Ee.useCallback(q=>{z.current=q,d.set("activeTriggerElement",q)},[d]);ie(()=>(b(z.current),()=>b(null)),[b,g,d]),d.useSyncedValue("closeDelay",R);let N=P.parentMenu,a=d.useState("disabled"),H=N.useState("disabled"),Y=h||a||H,T=N.useState("itemProps"),k=N.useState("isActive",S.index),ue=Ee.useMemo(()=>({type:"submenu-trigger",setActive(){N.select("highlightItemOnHover")&&N.set("activeIndex",S.index)}}),[N,S.index]),{getItemProps:te,itemRef:W}=ke({closeOnClick:!1,disabled:Y,highlighted:k,id:g,store:d,typingRef:N.context.typingRef,nativeButton:r,itemMetadata:ue,nodeId:A?.context.nodeId}),ye=d.useState("hoverEnabled"),w=dt(V,{enabled:ye&&m&&!Y,handleClose:pt({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:f,delay:{open:f,close:R},shouldOpen:f>0?()=>N.select("allowMouseEnter"):void 0,triggerElementRef:z,externalTree:v,isClosing:o(()=>d.select("transitionStatus")==="ending","isClosing"),guardStaleOpen:!0}),ge=ct(V,{enabled:!Y,event:"mousedown",toggle:!m,ignoreMouse:m,stickIfOpen:!1}).reference??se,ce=d.useState("triggerProps",!0);delete ce.id;let Ce={disabled:Y,highlighted:k,open:l},Re=d.useState("openMethod"),X=d.useState("lastOpenChangeReason")===y.listNavigation||Re==="keyboard",oe=l&&X&&tt.screenReader.voiceOver;return O("div",e,{state:Ce,stateAttributesMapping:io,props:[ge,w,ce,T,oe?mr:void 0,{"aria-controls":C,tabIndex:l||k?0:-1,onBlur(){k&&N.set("activeIndex",null)}},x,te],ref:[n,S.ref,W,b,F]})},"MenuSubmenuTrigger"));var qe=class extends ho{static{o(this,"MenuHandle")}constructor(){super(Bn(),"Menu")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Xn(){return new qe}o(Xn,"createMenuHandle");var J=M(me(),1);function Xc(t){let e=(0,Ve.c)(4),n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,J.jsx)(ee.Root,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=s):s=e[3],s}o(Xc,"N");function qc(t){let e=(0,Ve.c)(4),n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,J.jsx)(ee.Trigger,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}o(qc,"z");function Qc({align:t="start",alignOffset:e=0,side:n="bottom",sideOffset:s=4,className:u,...c}){return(0,J.jsx)(ee.Portal,{children:(0,J.jsx)(ee.Positioner,{className:"isolate z-50 outline-none",align:t,alignOffset:e,side:n,sideOffset:s,children:(0,J.jsx)(ee.Popup,{"data-slot":"dropdown-menu-content",className:Fe("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",u),...c})})})}o(Qc,"D");function Zc(t){let e=(0,Ve.c)(4),n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=(0,J.jsx)(ee.Group,{"data-slot":"dropdown-menu-group",...n}),e[2]=n,e[3]=s):s=e[3],s}o(Zc,"M");function ed(t){let e=(0,Ve.c)(10),n,s,u;e[0]!==t?({className:n,inset:s,...u}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=u):(n=e[1],s=e[2],u=e[3]);let c;e[4]!==n?(c=Fe("px-2 py-2 text-xs text-muted-foreground data-inset:ps-7",n),e[4]=n,e[5]=c):c=e[5];let i;return e[6]!==s||e[7]!==u||e[8]!==c?(i=(0,J.jsx)(ee.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":s,className:c,...u}),e[6]=s,e[7]=u,e[8]=c,e[9]=i):i=e[9],i}o(ed,"y");function td({className:t,inset:e,variant:n="default",...s}){return(0,J.jsx)(ee.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Fe("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",t),...s})}o(td,"I");function od(t){let e=(0,Ve.c)(15),n,s,u,c,i;e[0]!==t?({className:u,children:s,checked:n,inset:c,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=u,e[4]=c,e[5]=i):(n=e[1],s=e[2],u=e[3],c=e[4],i=e[5]);let p;e[6]!==u?(p=Fe("relative flex cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",u),e[6]=u,e[7]=p):p=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=(0,J.jsx)("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:(0,J.jsx)(ee.CheckboxItemIndicator,{children:(0,J.jsx)(en,{icon:Zo,strokeWidth:2})})}),e[8]=r):r=e[8];let m;return e[9]!==n||e[10]!==s||e[11]!==c||e[12]!==i||e[13]!==p?(m=(0,J.jsxs)(ee.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":c,className:p,checked:n,...i,children:[r,s]}),e[9]=n,e[10]=s,e[11]=c,e[12]=i,e[13]=p,e[14]=m):m=e[14],m}o(od,"_");function nd(t){let e=(0,Ve.c)(8),n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let u;e[3]!==n?(u=Fe("-mx-1 h-px bg-border",n),e[3]=n,e[4]=u):u=e[4];let c;return e[5]!==s||e[6]!==u?(c=(0,J.jsx)(ee.Separator,{"data-slot":"dropdown-menu-separator",className:u,...s}),e[5]=s,e[6]=u,e[7]=c):c=e[7],c}o(nd,"C");export{Xc as a,qc as b,Qc as c,Zc as d,ed as e,td as f,od as g,nd as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-RCXNYW7P.js";import{b as w}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as R}from"./chunk-IUGNIG6L.js";import"./chunk-LSEUUZN4.js";import{a as A,b as C,c as I,d as x,e as c,f as n}from"./chunk-7QEZ2SFW.js";import"./chunk-WCWP4EAW.js";import"./chunk-BX7TFVCC.js";import"./chunk-4PI2OSSP.js";import{a as y}from"./chunk-2W4UO5BC.js";import{c as N}from"./chunk-FBDIQ67D.js";import{a as S,e as $}from"./chunk-OK2QU2EV.js";import"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B as k}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as E}from"./chunk-GWNGVKLG.js";import{b as O}from"./chunk-6G3E4PJ2.js";import{a as f,d as b}from"./chunk-5PEAXTYQ.js";var j=b(E(),1);var r=b(O(),1);var _=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"I"),T={delete:2,list:3,read:0,write:1},B=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||T[t.on]-T[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"O"),q=f(()=>{let e=(0,j.c)(14),t=k(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=N(y.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=B(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(R,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(v,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(S,{className:"overflow-hidden py-0",children:(0,r.jsx)($,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(C,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(c,{children:t("Bucket")}),(0,r.jsx)(c,{children:t("Operation")}),(0,r.jsx)(c,{children:t("Key prefix")}),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(I,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(n,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(n,{children:(0,r.jsx)(w,{variant:"secondary",children:_(t,s.on)})}),(0,r.jsx)(n,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(n,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"M");export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as G}from"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import{a as H}from"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import{a as J}from"./chunk-RCXNYW7P.js";import"./chunk-T3ZCW3RG.js";import{a as Q,b as W,c as Z,d as V,e as C,f as S}from"./chunk-7QEZ2SFW.js";import{a as F,e as K}from"./chunk-OK2QU2EV.js";import{m as D}from"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B,j as $,r as A,s as z}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as X}from"./chunk-GWNGVKLG.js";import{a as U,b as Y}from"./chunk-6G3E4PJ2.js";import{a as I,d as M}from"./chunk-5PEAXTYQ.js";var L=M(X(),1),g=M(U(),1);var t=M(Y(),1);var _=10,E=I(h=>{let e=(0,L.c)(7),{label:i,value:l}=h,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let a=l??"\u2014",n;e[2]!==a?(n=(0,t.jsx)("span",{className:"font-mono text-sm",children:a}),e[2]=a,e[3]=n):n=e[3];let s;return e[4]!==r||e[5]!==n?(s=(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r,n]}),e[4]=r,e[5]=n,e[6]=s):s=e[6],s},"_"),ee=I(h=>{let e=(0,L.c)(38),{indexes:i,onSelect:l,selected:r}=h,a=B(),n;e[0]!==a?(n=a("name"),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==n?(s=(0,t.jsx)(C,{children:n}),e[2]=n,e[3]=s):s=e[3];let c;e[4]!==a?(c=a("table"),e[4]=a,e[5]=c):c=e[5];let o;e[6]!==c?(o=(0,t.jsx)(C,{children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==a?(d=a("dimensions"),e[8]=a,e[9]=d):d=e[9];let x;e[10]!==d?(x=(0,t.jsx)(C,{children:d}),e[10]=d,e[11]=x):x=e[11];let m;e[12]!==a?(m=a("metric"),e[12]=a,e[13]=m):m=e[13];let p;e[14]!==m?(p=(0,t.jsx)(C,{children:m}),e[14]=m,e[15]=p):p=e[15];let u;e[16]!==a?(u=a("vectors"),e[16]=a,e[17]=u):u=e[17];let v;e[18]!==u?(v=(0,t.jsx)(C,{children:u}),e[18]=u,e[19]=v):v=e[19];let y;e[20]!==v||e[21]!==s||e[22]!==o||e[23]!==x||e[24]!==p?(y=(0,t.jsx)(W,{children:(0,t.jsxs)(V,{children:[s,o,x,p,v]})}),e[20]=v,e[21]=s,e[22]=o,e[23]=x,e[24]=p,e[25]=y):y=e[25];let k;if(e[26]!==i||e[27]!==l||e[28]!==r){let q;e[30]!==l||e[31]!==r?(q=I(w=>(0,t.jsxs)(V,{className:w.name===r?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":w.name,"data-testid":`vector-row-${w.name}`,onClick:l,children:[(0,t.jsx)(S,{className:"font-mono text-xs",children:w.name}),(0,t.jsx)(S,{className:"font-mono text-xs",children:w.table}),(0,t.jsx)(S,{className:"tabular-nums",children:w.dimensions??"\u2014"}),(0,t.jsx)(S,{children:w.metric??"\u2014"}),(0,t.jsx)(S,{className:"tabular-nums",children:w.vectorsCount??"\u2014"})]},w.name),"q"),e[30]=l,e[31]=r,e[32]=q):q=e[32],k=i.map(q),e[26]=i,e[27]=l,e[28]=r,e[29]=k}else k=e[29];let N;e[33]!==k?(N=(0,t.jsx)(Z,{children:k}),e[33]=k,e[34]=N):N=e[34];let f;return e[35]!==y||e[36]!==N?(f=(0,t.jsx)(F,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(Q,{"data-testid":"vector-table",children:[y,N]})})}),e[35]=y,e[36]=N,e[37]=f):f=e[37],f},"X"),te=I(h=>{let e=(0,L.c)(27),{matches:i}=h,l=B();if(i.length===0){let u;e[0]!==l?(u=l("No matches."),e[0]=l,e[1]=u):u=e[1];let v;return e[2]!==u?(v=(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:u}),e[2]=u,e[3]=v):v=e[3],v}let r;e[4]!==l?(r=l("id"),e[4]=l,e[5]=r):r=e[5];let a;e[6]!==r?(a=(0,t.jsx)(C,{children:r}),e[6]=r,e[7]=a):a=e[7];let n;e[8]!==l?(n=l("score"),e[8]=l,e[9]=n):n=e[9];let s;e[10]!==n?(s=(0,t.jsx)(C,{children:n}),e[10]=n,e[11]=s):s=e[11];let c;e[12]!==l?(c=l("metadata"),e[12]=l,e[13]=c):c=e[13];let o;e[14]!==c?(o=(0,t.jsx)(C,{children:c}),e[14]=c,e[15]=o):o=e[15];let d;e[16]!==a||e[17]!==s||e[18]!==o?(d=(0,t.jsx)(W,{children:(0,t.jsxs)(V,{children:[a,s,o]})}),e[16]=a,e[17]=s,e[18]=o,e[19]=d):d=e[19];let x;e[20]!==i?(x=i.map(le),e[20]=i,e[21]=x):x=e[21];let m;e[22]!==x?(m=(0,t.jsx)(Z,{children:x}),e[22]=x,e[23]=m):m=e[23];let p;return e[24]!==d||e[25]!==m?(p=(0,t.jsx)(F,{className:"mt-3 overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(Q,{"data-testid":"vector-matches",children:[d,m]})})}),e[24]=d,e[25]=m,e[26]=p):p=e[26],p},"Y"),me=I(({loadIndexes:h,runQuery:e}={})=>{let i=D(),l=B(),[r,a]=(0,g.useState)(null),[n,s]=(0,g.useState)(null),[c,o]=(0,g.useState)(null),[d,x]=(0,g.useState)(""),[m,p]=(0,g.useState)(null),[u,v]=(0,g.useState)(null),[y,k]=(0,g.useState)(!1),N=(0,g.useRef)(0);(0,g.useEffect)(()=>{let b={cancelled:!1};return z((async()=>{try{let j=await(h??(()=>i.listVectorIndexes()))();b.cancelled||(a(j),s(null),o(T=>T??j[0]?.name??null))}catch(j){b.cancelled||(a(null),s($(j)))}})()),()=>{b.cancelled=!0}},[i,h]);let f=r?.find(b=>b.name===c)??null,q=I(b=>{N.current+=1,o(b.currentTarget.dataset.index??null),p(null),v(null),k(!1)},"q"),w=I(b=>{x(b.target.value)},"y"),O=I(async()=>{let b=d.trim();if(c===null||b==="")return;N.current+=1;let j=N.current;k(!0),v(null);try{let T=await(e??(R=>i.queryVectorIndex(R)))({name:c,text:b,topK:_});if(j!==N.current)return;p(T)}catch(T){if(j!==N.current)return;p(null),v($(T))}k(!1)},"H"),P=I(()=>{z(O())},"K");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:n}),r!==null&&r.length===0&&(0,t.jsx)(J,{description:l("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"})}),testId:"vector-empty",title:l("No vector indexes.")}),r!==null&&r.length>0&&(0,t.jsx)(ee,{indexes:r,onSelect:q,selected:c}),f!==null&&(0,t.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,t.jsx)(E,{label:l("field"),value:f.field}),(0,t.jsx)(E,{label:l("dimensions"),value:f.dimensions}),(0,t.jsx)(E,{label:l("metric"),value:f.metric}),(0,t.jsx)(E,{label:l("vectors"),value:f.vectorsCount})]}),f.metadata!==void 0&&f.metadata.length>0&&(0,t.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[l("metadata"),": ",(0,t.jsx)("span",{className:"font-mono",children:f.metadata.join(", ")})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(G,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:w,placeholder:l("Search by similarity\u2026"),value:d}),(0,t.jsx)(H,{"data-testid":"vector-search",disabled:y||d.trim()==="",onClick:P,children:l(y?"Searching\u2026":"Search")})]}),u!==null&&(0,t.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:u}),m!==null&&(0,t.jsx)(te,{matches:m})]})]})},"ue");function le(h){return(0,t.jsxs)(V,{"data-testid":`vector-match-${h.id}`,children:[(0,t.jsx)(S,{className:"font-mono text-xs",children:h.id}),(0,t.jsx)(S,{className:"tabular-nums",children:h.score.toFixed(4)}),(0,t.jsx)(S,{className:"max-w-md truncate font-mono text-xs",children:h.metadata===void 0?"\u2014":A(h.metadata)})]},h.id)}I(le,"ee");export{me as VectorBrowser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u,s as f}from"./chunk-GNI37YCV.js";import{a as S}from"./chunk-GWNGVKLG.js";import{a as h}from"./chunk-6G3E4PJ2.js";import{a as s,d as l}from"./chunk-5PEAXTYQ.js";var i=l(S(),1),c=l(h(),1);var g=s(()=>{let t=(0,i.c)(4),[a,n]=(0,c.useState)(!1),[e,m]=(0,c.useState)(null),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(p=>{f((async()=>{n(!0),m(null);try{await p()}catch(b){m(u(b))}n(!1)})())},"e"),t[0]=r):r=t[0];let y=r,o;return t[1]!==a||t[2]!==e?(o={busy:a,error:e,run:y},t[1]=a,t[2]=e,t[3]=o):o=t[3],o},"g");export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as y,r as w}from"./chunk-GNI37YCV.js";import{a as v}from"./chunk-GWNGVKLG.js";import{b as _}from"./chunk-6G3E4PJ2.js";import{a as m,d as g}from"./chunk-5PEAXTYQ.js";var x=g(v(),1);var a=g(_(),1);var k=m((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let n=[],l=s.toLowerCase(),o=e.toLowerCase(),t=0;for(let r=l.indexOf(o);r!==-1;r=l.indexOf(o,t))r>t&&n.push({match:!1,offset:t,text:s.slice(t,r)}),n.push({match:!0,offset:r,text:s.slice(r,r+e.length)}),t=r+e.length;return t<s.length&&n.push({match:!1,offset:t,text:s.slice(t)}),n},"N"),L=m(s=>{let e=(0,x.c)(9),{highlight:n,value:l}=s;if(l==null){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=(0,a.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=d):d=e[0],d}let o,t,r;if(e[1]!==n||e[2]!==l){r=Symbol.for("react.early_return_sentinel");e:{let d=w(l);if(n===void 0||n===""){r=(0,a.jsx)("span",{title:d,children:d});break e}o=d,t=k(d,n).map(j)}e[1]=n,e[2]=l,e[3]=o,e[4]=t,e[5]=r}else o=e[3],t=e[4],r=e[5];if(r!==Symbol.for("react.early_return_sentinel"))return r;let c;return e[6]!==o||e[7]!==t?(c=(0,a.jsx)("span",{title:o,children:t}),e[6]=o,e[7]=t,e[8]=c):c=e[8],c},"v"),O=m(s=>{let e=(0,x.c)(22),{columns:n,rows:l}=s,o=y(),t;e[0]!==o?(t=o("Field"),e[0]=o,e[1]=t):t=e[1];let r;e[2]!==t?(r=(0,a.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:t}),e[2]=t,e[3]=r):r=e[3];let c;if(e[4]!==l||e[5]!==o){let i;e[7]!==o?(i=m((b,p)=>(0,a.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:o("Row {n}",{n:p+1})},p),"c"),e[7]=o,e[8]=i):i=e[8],c=l.map(i),e[4]=l,e[5]=o,e[6]=c}else c=e[6];let d;e[9]!==r||e[10]!==c?(d=(0,a.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,a.jsxs)("tr",{children:[r,c]})}),e[9]=r,e[10]=c,e[11]=d):d=e[11];let f;if(e[12]!==n||e[13]!==l){let i;e[15]!==l?(i=m(b=>(0,a.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,a.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:b}),l.map((p,N)=>(0,a.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,a.jsx)(L,{value:p[b]})},N))]},b),"c"),e[15]=l,e[16]=i):i=e[16],f=n.map(i),e[12]=n,e[13]=l,e[14]=f}else f=e[14];let h;e[17]!==f?(h=(0,a.jsx)("tbody",{children:f}),e[17]=f,e[18]=h):h=e[18];let u;return e[19]!==d||e[20]!==h?(u=(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,a.jsxs)("table",{className:"border-collapse text-xs",children:[d,h]})}),e[19]=d,e[20]=h,e[21]=u):u=e[21],u},"T"),T=m(({children:s,layout:e="card",testId:n})=>(0,a.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":n,children:s}),"j");function j(s){return(0,a.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}m(j,"_");export{L as a,O as b,T as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{e}from"./chunk-TW4O2BA5.js";import"./chunk-4EPW63HS.js";import"./chunk-PDBW6GTJ.js";import"./chunk-6G3E4PJ2.js";import"./chunk-5PEAXTYQ.js";export{e as Mermaid};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as V,b as F,c as J,d as K,e as B,f as A,g as I,h as M}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-66BMMNUR.js";import{a as V,b as F,c as J,d as K,e as B,f as A,g as I,h as M}from"./chunk-JD6PRRFO.js";import{a as z}from"./chunk-YEVTA35E.js";import{B as L,p as D,r as U,s as Q,v as W}from"./chunk-GNI37YCV.js";import{a as te}from"./chunk-GWNGVKLG.js";import{a as ee,b as le}from"./chunk-6G3E4PJ2.js";import{a as g,d as q}from"./chunk-5PEAXTYQ.js";var _=q(te(),1),E=q(ee(),1);var T="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",fe=`${T} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;var s=q(le(),1);var X=g(l=>`"${l.replaceAll('"','""')}"`,"q"),ne=/["\n\r,]/u,oe=/^[=+\-@\t\r]/u,Y=g(l=>{if(l==null)return"";let e;return typeof l=="string"?e=oe.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=U(l),ne.test(e)?`"${e.replaceAll('"','""')}"`:e},"J"),ae=g((l,e)=>{let n=l.map(t=>Y(t)).join(","),o=e.map(t=>l.map(c=>Y(t[c])).join(","));return[n,...o].join(`
|
|
2
2
|
`)},"ne"),se=g(l=>JSON.stringify(l,D,2),"oe"),Z=500,re=g(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:U(l)).replaceAll("'","''")}'`,"K"),G="__doc__",ie=g((l,e,n,o)=>{if(e.length===0||n.length===0)return"";let t=o?.includes(G)===!0&&!e.includes(G)?e.filter(d=>!o.includes(d)):void 0,c=t===void 0?e:o,r=g((d,b)=>re(t===void 0||b!==G?d[b]:JSON.stringify(Object.fromEntries(t.map(u=>[u,d[u]])),D)),"i"),a=c.map(d=>X(d)).join(", "),i=[];for(let d=0;d<n.length;d+=Z){let b=n.slice(d,d+Z).map(u=>` (${c.map(m=>r(u,m)).join(", ")})`).join(`,
|
|
3
3
|
`);i.push(`INSERT INTO ${X(l)} (${a}) VALUES
|
|
4
4
|
${b};`)}return i.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Ue}from"./chunk-
|
|
2
|
-
`),e[5]=r,e[6]=n):n=e[6];let c=n,i=`storage-refs-${t}`,s;e[7]!==r.length||e[8]!==l?(s=r.length===1?l("1 record"):l("{count} records",{count:r.length}),e[7]=r.length,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==c||e[11]!==i||e[12]!==s?(u=(0,o.jsx)(ae,{"data-testid":i,title:c,variant:"secondary",children:s}),e[10]=c,e[11]=i,e[12]=s,e[13]=u):u=e[13],u},"De"),Ze=h(d=>{let e=(0,B.c)(7),{objectKey:t,onToggle:r,selected:l,t:n}=d,c;e[0]!==n?(c=n("Select row"),e[0]=n,e[1]=c):c=e[1];let i=`storage-select-${t}`,s;return e[2]!==r||e[3]!==l||e[4]!==c||e[5]!==i?(s=(0,o.jsx)(ke,{"aria-label":c,checked:l,"data-testid":i,onCheckedChange:r}),e[2]=r,e[3]=l,e[4]=c,e[5]=i,e[6]=s):s=e[6],s},"je");function vt(d){return`${d.table}\xB7${d.id}`}h(vt,"kt");var kt=h(d=>{let e=(0,B.c)(10),{colSpan:t,name:r,onEnter:l}=d,n;e[0]!==r||e[1]!==l?(n=h(()=>{l(r)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})}),e[3]=i):i=e[3];let s;e[4]!==c||e[5]!==r?(s=(0,o.jsxs)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:c,type:"button",children:[i,r]}),e[4]=c,e[5]=r,e[6]=s):s=e[6];let u;return e[7]!==t||e[8]!==s?(u=(0,o.jsx)(de,{children:(0,o.jsx)(X,{colSpan:t,children:s})}),e[7]=t,e[8]=s,e[9]=u):u=e[9],u},"St"),wt=h(d=>{let e=(0,B.c)(37),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,selected:s,showReferences:u,t:m}=d,f;e[0]!==l||e[1]!==n||e[2]!==c?(f=Ae(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=f):f=e[3];let{copy:g,download:w,name:a,remove:k,toggle:S}=f,x;e[4]!==n.key||e[5]!==s||e[6]!==m||e[7]!==S?(x=(0,o.jsx)(X,{className:"w-8",children:(0,o.jsx)(Ze,{objectKey:n.key,onToggle:S,selected:s,t:m})}),e[4]=n.key,e[5]=s,e[6]=m,e[7]=S,e[8]=x):x=e[8];let b;e[9]!==a?(b=(0,o.jsx)(X,{className:"font-mono text-xs",children:a}),e[9]=a,e[10]=b):b=e[10];let y;e[11]!==n.size?(y=xe(n.size),e[11]=n.size,e[12]=y):y=e[12];let v;e[13]!==y?(v=(0,o.jsx)(X,{className:"tabular-nums text-muted-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let j=n.httpMetadata?.contentType??"",N;e[15]!==j?(N=(0,o.jsx)(X,{children:j}),e[15]=j,e[16]=N):N=e[16];let C;e[17]!==n.key||e[18]!==i||e[19]!==u||e[20]!==m?(C=u&&(0,o.jsx)(X,{children:(0,o.jsx)(He,{objectKey:n.key,references:i,t:m})}),e[17]=n.key,e[18]=i,e[19]=u,e[20]=m,e[21]=C):C=e[21];let T=r===n.key,D;e[22]!==t||e[23]!==g||e[24]!==w||e[25]!==n.key||e[26]!==k||e[27]!==m||e[28]!==T?(D=(0,o.jsx)(X,{className:"text-right",children:(0,o.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,o.jsx)(We,{busy:t,copied:T,objectKey:n.key,onCopy:g,onDelete:k,onDownload:w,t:m})})}),e[22]=t,e[23]=g,e[24]=w,e[25]=n.key,e[26]=k,e[27]=m,e[28]=T,e[29]=D):D=e[29];let F;return e[30]!==D||e[31]!==x||e[32]!==b||e[33]!==v||e[34]!==N||e[35]!==C?(F=(0,o.jsxs)(de,{"data-testid":"fb-row",children:[x,b,v,N,C,D]}),e[30]=D,e[31]=x,e[32]=b,e[33]=v,e[34]=N,e[35]=C,e[36]=F):F=e[36],F},"wt"),St=h(d=>{let e=(0,B.c)(65),{allSelected:t,busy:r,copiedKey:l,files:n,folders:c,handlers:i,onEnterFolder:s,prefix:u,references:m,selected:f,showReferences:g,someSelected:w,t:a,toggleSelectAll:k}=d,S;e[0]!==a?(S=a("Select all rows"),e[0]=a,e[1]=S):S=e[1];let x;e[2]!==t||e[3]!==w||e[4]!==S||e[5]!==k?(x=(0,o.jsx)(te,{className:"w-8",children:(0,o.jsx)(ke,{"aria-label":S,checked:t,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:k})}),e[2]=t,e[3]=w,e[4]=S,e[5]=k,e[6]=x):x=e[6];let b;e[7]!==a?(b=a("key"),e[7]=a,e[8]=b):b=e[8];let y;e[9]!==b?(y=(0,o.jsx)(te,{children:b}),e[9]=b,e[10]=y):y=e[10];let v;e[11]!==a?(v=a("size"),e[11]=a,e[12]=v):v=e[12];let j;e[13]!==v?(j=(0,o.jsx)(te,{children:v}),e[13]=v,e[14]=j):j=e[14];let N;e[15]!==a?(N=a("content-type"),e[15]=a,e[16]=N):N=e[16];let C;e[17]!==N?(C=(0,o.jsx)(te,{children:N}),e[17]=N,e[18]=C):C=e[18];let T;e[19]!==g||e[20]!==a?(T=g&&(0,o.jsx)(te,{children:a("used by")}),e[19]=g,e[20]=a,e[21]=T):T=e[21];let D;e[22]!==a?(D=a("Actions"),e[22]=a,e[23]=D):D=e[23];let F;e[24]!==D?(F=(0,o.jsx)(te,{"aria-label":D}),e[24]=D,e[25]=F):F=e[25];let $;e[26]!==F||e[27]!==x||e[28]!==y||e[29]!==j||e[30]!==C||e[31]!==T?($=(0,o.jsx)(Ee,{children:(0,o.jsxs)(de,{children:[x,y,j,C,T,F]})}),e[26]=F,e[27]=x,e[28]=y,e[29]=j,e[30]=C,e[31]=T,e[32]=$):$=e[32];let O;if(e[33]!==c||e[34]!==s||e[35]!==g){let E;e[37]!==s||e[38]!==g?(E=h(I=>(0,o.jsx)(kt,{colSpan:g?6:5,name:I,onEnter:s},I),"D"),e[37]=s,e[38]=g,e[39]=E):E=e[39],O=c.map(E),e[33]=c,e[34]=s,e[35]=g,e[36]=O}else O=e[36];let R;if(e[40]!==r||e[41]!==l||e[42]!==n||e[43]!==i||e[44]!==u||e[45]!==m||e[46]!==f||e[47]!==g||e[48]!==a){let E;e[50]!==r||e[51]!==l||e[52]!==i||e[53]!==u||e[54]!==m||e[55]!==f||e[56]!==g||e[57]!==a?(E=h(I=>(0,o.jsx)(wt,{busy:r,copiedKey:l,handlers:i,object:I,prefix:u,references:m[I.key],selected:f.has(I.key),showReferences:g,t:a},I.key),"D"),e[50]=r,e[51]=l,e[52]=i,e[53]=u,e[54]=m,e[55]=f,e[56]=g,e[57]=a,e[58]=E):E=e[58],R=n.map(E),e[40]=r,e[41]=l,e[42]=n,e[43]=i,e[44]=u,e[45]=m,e[46]=f,e[47]=g,e[48]=a,e[49]=R}else R=e[49];let L;e[59]!==O||e[60]!==R?(L=(0,o.jsxs)(Le,{children:[O,R]}),e[59]=O,e[60]=R,e[61]=L):L=e[61];let _;return e[62]!==$||e[63]!==L?(_=(0,o.jsx)(De,{className:"overflow-hidden py-0",children:(0,o.jsx)(Te,{className:"px-0",children:(0,o.jsxs)(Oe,{"data-testid":"fb-table",children:[$,L]})})}),e[62]=$,e[63]=L,e[64]=_):_=e[64],_},"Ct"),Nt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],Ct=3600,Me=h((d,e)=>{if(e==="size")return d.size;if(e==="type")return d.httpMetadata?.contentType??"";if(e==="date"){if(d.uploaded===void 0)return 0;let t=new Date(d.uploaded).getTime();return Number.isNaN(t)?0:t}return e.startsWith("tag:")?d.customMetadata?.[e.slice(4)]??"":d.key},"we"),jt=h((d,e,t)=>{let r=t==="desc"?-1:1;return d.toSorted((l,n)=>{let c=Me(l,e),i=Me(n,e);return(typeof c=="number"&&typeof i=="number"?c-i:String(c).localeCompare(String(i)))*r})},"Et"),zt=h((d,e)=>{let t=new Set,r=[];for(let l of d){let n=l.key.slice(e.length),c=n.indexOf("/");c===-1?r.push(l):t.add(n.slice(0,c+1))}return{files:r,folders:[...t].toSorted((l,n)=>l.localeCompare(n))}},"_t"),Dt=h(d=>{let e=(0,B.c)(59),{bucket:t,buckets:r,busy:l,draftPrefix:n,expiry:c,fileInputRef:i,onBucketChange:s,onExpiryChange:u,onFileChange:m,onList:f,onPrefixChange:g,onUploadClick:w,t:a}=d,k;e[0]!==g?(k=h(A=>{g(A.target.value)},"v"),e[0]=g,e[1]=k):k=e[1];let S=k,x;e[2]!==s?(x=h(A=>{s(A.target.value)},"y"),e[2]=s,e[3]=x):x=e[3];let b=x,y;e[4]!==u?(y=h(A=>{u(Number.parseInt(A.target.value,10))},"b"),e[4]=u,e[5]=y):y=e[5];let v=y,j;e[6]!==t||e[7]!==r||e[8]!==b||e[9]!==a?(j=r.length>0&&(0,o.jsx)("select",{"aria-label":a("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:t,children:r.map($t)}),e[6]=t,e[7]=r,e[8]=b,e[9]=a,e[10]=j):j=e[10];let N;e[11]!==a?(N=a("Key prefix"),e[11]=a,e[12]=N):N=e[12];let C;e[13]!==a?(C=a("key prefix (optional)"),e[13]=a,e[14]=C):C=e[14];let T;e[15]!==n||e[16]!==S||e[17]!==N||e[18]!==C?(T=(0,o.jsx)(ze,{"aria-label":N,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:S,placeholder:C,value:n}),e[15]=n,e[16]=S,e[17]=N,e[18]=C,e[19]=T):T=e[19];let D;e[20]!==a?(D=a("List"),e[20]=a,e[21]=D):D=e[21];let F;e[22]!==l||e[23]!==f||e[24]!==D?(F=(0,o.jsx)(ee,{"data-testid":"fb-list",disabled:l,onClick:f,size:"sm",type:"button",children:D}),e[22]=l,e[23]=f,e[24]=D,e[25]=F):F=e[25];let $;e[26]!==l||e[27]!==a?($=a(l?"Uploading\u2026":"Upload"),e[26]=l,e[27]=a,e[28]=$):$=e[28];let O;e[29]!==l||e[30]!==w||e[31]!==$?(O=(0,o.jsx)(ee,{"data-testid":"storage-upload",disabled:l,onClick:w,size:"sm",type:"button",variant:"outline",children:$}),e[29]=l,e[30]=w,e[31]=$,e[32]=O):O=e[32];let R;e[33]!==i||e[34]!==m?(R=(0,o.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:m,ref:i,type:"file"}),e[33]=i,e[34]=m,e[35]=R):R=e[35];let L;e[36]!==a?(L=a("Link expiry"),e[36]=a,e[37]=L):L=e[37];let _;e[38]!==a?(_=Nt.map(A=>(0,o.jsx)("option",{value:A.seconds,children:a(A.label)},A.seconds)),e[38]=a,e[39]=_):_=e[39];let E;e[40]!==c||e[41]!==v||e[42]!==_?(E=(0,o.jsx)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:v,value:c,children:_}),e[40]=c,e[41]=v,e[42]=_,e[43]=E):E=e[43];let I;e[44]!==L||e[45]!==E?(I=(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[L,E]}),e[44]=L,e[45]=E,e[46]=I):I=e[46];let M;e[47]!==a?(M=a("Open in Cloudflare"),e[47]=a,e[48]=M):M=e[48];let P;e[49]!==M?(P=(0,o.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:Ue,rel:"noreferrer",target:"_blank",children:M}),e[49]=M,e[50]=P):P=e[50];let W;return e[51]!==O||e[52]!==R||e[53]!==I||e[54]!==P||e[55]!==j||e[56]!==T||e[57]!==F?(W=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,T,F,O,R,I,P]}),e[51]=O,e[52]=R,e[53]=I,e[54]=P,e[55]=j,e[56]=T,e[57]=F,e[58]=W):W=e[58],W},"$t"),Tt=h(d=>{let e=(0,B.c)(66),{onSortKeyChange:t,onThumbSizeChange:r,showGrid:l,showList:n,sortDirection:c,sortKey:i,t:s,tagKeys:u,thumbSize:m,toggleSortDirection:f,view:g}=d,w;e[0]!==t?(w=h(q=>{t(q.target.value)},"k"),e[0]=t,e[1]=w):w=e[1];let a=w,k;e[2]!==r?(k=h(q=>{r(Number.parseInt(q.target.value,10))},"v"),e[2]=r,e[3]=k):k=e[3];let S=k,x=g==="list",b;e[4]!==s?(b=s("List"),e[4]=s,e[5]=b):b=e[5];let y;e[6]!==n||e[7]!==x||e[8]!==b?(y=(0,o.jsx)("button",{"aria-pressed":x,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:n,type:"button",children:b}),e[6]=n,e[7]=x,e[8]=b,e[9]=y):y=e[9];let v=g==="grid",j;e[10]!==s?(j=s("Grid"),e[10]=s,e[11]=j):j=e[11];let N;e[12]!==l||e[13]!==v||e[14]!==j?(N=(0,o.jsx)("button",{"aria-pressed":v,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:l,type:"button",children:j}),e[12]=l,e[13]=v,e[14]=j,e[15]=N):N=e[15];let C;e[16]!==y||e[17]!==N?(C=(0,o.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[y,N]}),e[16]=y,e[17]=N,e[18]=C):C=e[18];let T;e[19]!==s?(T=s("Sort"),e[19]=s,e[20]=T):T=e[20];let D;e[21]!==s?(D=s("Name"),e[21]=s,e[22]=D):D=e[22];let F;e[23]!==D?(F=(0,o.jsx)("option",{value:"name",children:D}),e[23]=D,e[24]=F):F=e[24];let $;e[25]!==s?($=s("size"),e[25]=s,e[26]=$):$=e[26];let O;e[27]!==$?(O=(0,o.jsx)("option",{value:"size",children:$}),e[27]=$,e[28]=O):O=e[28];let R;e[29]!==s?(R=s("Type"),e[29]=s,e[30]=R):R=e[30];let L;e[31]!==R?(L=(0,o.jsx)("option",{value:"type",children:R}),e[31]=R,e[32]=L):L=e[32];let _;e[33]!==s?(_=s("Modified"),e[33]=s,e[34]=_):_=e[34];let E;e[35]!==_?(E=(0,o.jsx)("option",{value:"date",children:_}),e[35]=_,e[36]=E):E=e[36];let I;e[37]!==u?(I=u.map(Kt),e[37]=u,e[38]=I):I=e[38];let M;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==O||e[43]!==L||e[44]!==E||e[45]!==I?(M=(0,o.jsxs)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:a,value:i,children:[F,O,L,E,I]}),e[39]=a,e[40]=i,e[41]=F,e[42]=O,e[43]=L,e[44]=E,e[45]=I,e[46]=M):M=e[46];let P;e[47]!==T||e[48]!==M?(P=(0,o.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[T,M]}),e[47]=T,e[48]=M,e[49]=P):P=e[49];let W;e[50]!==s?(W=s("Toggle sort direction"),e[50]=s,e[51]=W):W=e[51];let A=c==="asc"?"\u2191":"\u2193",H;e[52]!==W||e[53]!==A||e[54]!==f?(H=(0,o.jsx)("button",{"aria-label":W,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:f,type:"button",children:A}),e[52]=W,e[53]=A,e[54]=f,e[55]=H):H=e[55];let V;e[56]!==S||e[57]!==s||e[58]!==m||e[59]!==g?(V=g==="grid"&&(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[s("Thumbnail size"),(0,o.jsx)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:S,step:8,type:"range",value:m})]}),e[56]=S,e[57]=s,e[58]=m,e[59]=g,e[60]=V):V=e[60];let re;return e[61]!==P||e[62]!==H||e[63]!==V||e[64]!==C?(re=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[C,P,H,V]}),e[61]=P,e[62]=H,e[63]=V,e[64]=C,e[65]=re):re=e[65],re},"Ft");function $t(d){return(0,o.jsx)("option",{value:d,children:d},d)}h($t,"Rt");function Kt(d){return(0,o.jsx)("option",{value:`tag:${d}`,children:d},d)}h(Kt,"zt");var Ft=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Ot=h(d=>(d.httpMetadata?.contentType??"").startsWith("image/")||Ft.test(d.key),"jt"),Et=h(()=>{let d=(0,B.c)(1),e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),d[0]=e):e=d[0],e},"Kt"),Lt=h(d=>{let e=(0,B.c)(13),{object:t,resolveUrl:r}=d,[l,n]=(0,z.useState)(null),[c,i]=(0,z.useState)(!1),s;e[0]!==t?(s=Ot(t),e[0]=t,e[1]=s):s=e[1];let u=s,m,f;e[2]!==u||e[3]!==t.key||e[4]!==r?(m=h(()=>{if(!u)return;let k={cancelled:!1};return Z((async()=>{try{let S=await r(t.key);k.cancelled||n(S)}catch{k.cancelled||i(!0)}})()),()=>{k.cancelled=!0}},"h"),f=[u,t.key,r],e[2]=u,e[3]=t.key,e[4]=r,e[5]=m,e[6]=f):(m=e[5],f=e[6]),(0,z.useEffect)(m,f);let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=h(()=>{i(!0)},"m"),e[7]=g):g=e[7];let w=g,a;return e[8]!==c||e[9]!==u||e[10]!==t.key||e[11]!==l?(a=(0,o.jsx)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:u&&l!==null&&!c?(0,o.jsx)("img",{alt:t.key,className:"size-full object-cover",loading:"lazy",onError:w,src:l}):(0,o.jsx)(Et,{})}),e[8]=c,e[9]=u,e[10]=t.key,e[11]=l,e[12]=a):a=e[12],a},"Bt"),It=h(d=>{let e=(0,B.c)(42),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,resolveUrl:s,selected:u,showReferences:m,t:f}=d,g;e[0]!==l||e[1]!==n||e[2]!==c?(g=Ae(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=g):g=e[3];let{copy:w,download:a,name:k,remove:S,toggle:x}=g,b;e[4]!==n||e[5]!==s?(b=(0,o.jsx)(Lt,{object:n,resolveUrl:s}),e[4]=n,e[5]=s,e[6]=b):b=e[6];let y;e[7]!==n.key||e[8]!==u||e[9]!==f||e[10]!==x?(y=(0,o.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,o.jsx)(Ze,{objectKey:n.key,onToggle:x,selected:u,t:f})}),e[7]=n.key,e[8]=u,e[9]=f,e[10]=x,e[11]=y):y=e[11];let v;e[12]!==b||e[13]!==y?(v=(0,o.jsxs)("div",{className:"relative",children:[b,y]}),e[12]=b,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==k?(j=(0,o.jsx)("p",{className:"truncate font-mono text-xs",title:k,children:k}),e[15]=k,e[16]=j):j=e[16];let N;e[17]!==n.size?(N=xe(n.size),e[17]=n.size,e[18]=N):N=e[18];let C;e[19]!==N?(C=(0,o.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:N}),e[19]=N,e[20]=C):C=e[20];let T;e[21]!==n.key||e[22]!==i||e[23]!==m||e[24]!==f?(T=m&&(0,o.jsx)("div",{className:"mt-1",children:(0,o.jsx)(He,{objectKey:n.key,references:i,t:f})}),e[21]=n.key,e[22]=i,e[23]=m,e[24]=f,e[25]=T):T=e[25];let D;e[26]!==j||e[27]!==C||e[28]!==T?(D=(0,o.jsxs)("div",{className:"min-w-0",children:[j,C,T]}),e[26]=j,e[27]=C,e[28]=T,e[29]=D):D=e[29];let F=r===n.key,$;e[30]!==t||e[31]!==w||e[32]!==a||e[33]!==n.key||e[34]!==S||e[35]!==f||e[36]!==F?($=(0,o.jsx)("div",{className:"flex items-center gap-1",children:(0,o.jsx)(We,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:n.key,onCopy:w,onDelete:S,onDownload:a,t:f})}),e[30]=t,e[31]=w,e[32]=a,e[33]=n.key,e[34]=S,e[35]=f,e[36]=F,e[37]=$):$=e[37];let O;return e[38]!==$||e[39]!==v||e[40]!==D?(O=(0,o.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[v,D,$]}),e[38]=$,e[39]=v,e[40]=D,e[41]=O):O=e[41],O},"Lt"),Rt=h(d=>{let e=(0,B.c)(9),{name:t,onEnter:r}=d,l;e[0]!==t||e[1]!==r?(l=h(()=>{r(t)},"n"),e[0]=t,e[1]=r,e[2]=l):l=e[2];let n=l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,o.jsx)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})})}),e[3]=c):c=e[3];let i;e[4]!==t?(i=(0,o.jsx)("span",{className:"truncate font-mono text-xs",title:t,children:t}),e[4]=t,e[5]=i):i=e[5];let s;return e[6]!==n||e[7]!==i?(s=(0,o.jsxs)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:n,type:"button",children:[c,i]}),e[6]=n,e[7]=i,e[8]=s):s=e[8],s},"It"),_t=h(d=>{let e=(0,B.c)(34),{busy:t,copiedKey:r,files:l,folders:n,handlers:c,onEnterFolder:i,prefix:s,references:u,resolveUrl:m,selected:f,showReferences:g,size:w,t:a}=d,k;e[0]!==w?(k=w.toString(),e[0]=w,e[1]=k):k=e[1];let S=`repeat(auto-fill, minmax(${k}px, 1fr))`,x;e[2]!==S?(x={gridTemplateColumns:S},e[2]=S,e[3]=x):x=e[3];let b=x,y;if(e[4]!==n||e[5]!==i){let N;e[7]!==i?(N=h(C=>(0,o.jsx)(Rt,{name:C,onEnter:i},C),"w"),e[7]=i,e[8]=N):N=e[8],y=n.map(N),e[4]=n,e[5]=i,e[6]=y}else y=e[6];let v;if(e[9]!==t||e[10]!==r||e[11]!==l||e[12]!==c||e[13]!==s||e[14]!==u||e[15]!==m||e[16]!==f||e[17]!==g||e[18]!==a){let N;e[20]!==t||e[21]!==r||e[22]!==c||e[23]!==s||e[24]!==u||e[25]!==m||e[26]!==f||e[27]!==g||e[28]!==a?(N=h(C=>(0,o.jsx)(It,{busy:t,copiedKey:r,handlers:c,object:C,prefix:s,references:u[C.key],resolveUrl:m,selected:f.has(C.key),showReferences:g,t:a},C.key),"w"),e[20]=t,e[21]=r,e[22]=c,e[23]=s,e[24]=u,e[25]=m,e[26]=f,e[27]=g,e[28]=a,e[29]=N):N=e[29],v=l.map(N),e[9]=t,e[10]=r,e[11]=l,e[12]=c,e[13]=s,e[14]=u,e[15]=m,e[16]=f,e[17]=g,e[18]=a,e[19]=v}else v=e[19];let j;return e[30]!==b||e[31]!==y||e[32]!==v?(j=(0,o.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[y,v]}),e[30]=b,e[31]=y,e[32]=v,e[33]=j):j=e[33],j},"Ot"),Ut=h(d=>{let e=(0,B.c)(23),{reference:t,t:r}=d,l=`fb-dangling-${t.table}-${t.id}-${t.column}`,n=`${t.table}\xB7${t.id}`,c;e[0]!==n?(c=(0,o.jsx)(ae,{variant:"secondary",children:n}),e[0]=n,e[1]=c):c=e[1];let i;e[2]!==t.column?(i=(0,o.jsx)("span",{className:"text-muted-foreground",children:t.column}),e[2]=t.column,e[3]=i):i=e[3];let s;e[4]!==r?(s=r("\u2192"),e[4]=r,e[5]=s):s=e[5];let u;e[6]!==s?(u=(0,o.jsx)("span",{className:"text-muted-foreground/60",children:s}),e[6]=s,e[7]=u):u=e[7];let m;e[8]!==t.key?(m=(0,o.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:t.key}),e[8]=t.key,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==i||e[12]!==u||e[13]!==m?(f=(0,o.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,i,u,m]}),e[10]=c,e[11]=i,e[12]=u,e[13]=m,e[14]=f):f=e[14];let g;e[15]!==r?(g=r("Missing object"),e[15]=r,e[16]=g):g=e[16];let w;e[17]!==g?(w=(0,o.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:g}),e[17]=g,e[18]=w):w=e[18];let a;return e[19]!==l||e[20]!==w||e[21]!==f?(a=(0,o.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":l,children:[f,w]}),e[19]=l,e[20]=w,e[21]=f,e[22]=a):a=e[22],a},"At"),Mt=h(d=>{let e=(0,B.c)(42),{busy:t,onCheck:r,references:l,t:n,truncated:c}=d,i;e[0]!==n?(i=n("Integrity"),e[0]=n,e[1]=i):i=e[1];let s;e[2]!==i?(s=(0,o.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[2]=i,e[3]=s):s=e[3];let u;e[4]!==n?(u=n("Orphaned objects"),e[4]=n,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)("span",{className:"text-sm font-medium text-foreground",children:u}),e[6]=u,e[7]=m):m=e[7];let f;e[8]!==n?(f=n("Find records whose file reference points at an object the bucket no longer has."),e[8]=n,e[9]=f):f=e[9];let g;e[10]!==f?(g=(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[10]=f,e[11]=g):g=e[11];let w;e[12]!==s||e[13]!==m||e[14]!==g?(w=(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[s,m,g]}),e[12]=s,e[13]=m,e[14]=g,e[15]=w):w=e[15];let a;e[16]!==t||e[17]!==n?(a=n(t?"Checking\u2026":"Check for orphans"),e[16]=t,e[17]=n,e[18]=a):a=e[18];let k;e[19]!==t||e[20]!==r||e[21]!==a?(k=(0,o.jsx)(ee,{"data-testid":"fb-orphans-check",disabled:t,onClick:r,size:"sm",type:"button",variant:"outline",children:a}),e[19]=t,e[20]=r,e[21]=a,e[22]=k):k=e[22];let S;e[23]!==w||e[24]!==k?(S=(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w,k]}),e[23]=w,e[24]=k,e[25]=S):S=e[25];let x;e[26]!==l||e[27]!==n||e[28]!==c?(x=c&&(0,o.jsx)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:l===void 0||l.length===0?n("The bucket is larger than the scan's key limit, so dangling references could not be checked."):n("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:l.length})}),e[26]=l,e[27]=n,e[28]=c,e[29]=x):x=e[29];let b;e[30]!==l?.length||e[31]!==n||e[32]!==c?(b=l?.length===0&&!c&&(0,o.jsx)(pe,{description:n("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:n("No dangling references.")}),e[30]=l?.length,e[31]=n,e[32]=c,e[33]=b):b=e[33];let y;e[34]!==l||e[35]!==n?(y=l!==void 0&&l.length>0&&(0,o.jsx)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:l.map(j=>(0,o.jsx)(Ut,{reference:j,t:n},`${j.table}\xB7${j.id}\xB7${j.column}`))}),e[34]=l,e[35]=n,e[36]=y):y=e[36];let v;return e[37]!==S||e[38]!==x||e[39]!==b||e[40]!==y?(v=(0,o.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[S,x,b,y]}),e[37]=S,e[38]=x,e[39]=b,e[40]=y,e[41]=v):v=e[41],v},"Ut"),Bt=h(function(d,e){let t=(0,B.c)(18),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,t[0]=r):r=t[0];let[l,n]=(0,z.useState)(r),c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=h(x=>{n(b=>{let y=new Set(b);return y.has(x)?y.delete(x):y.add(x),y})},"a"),t[1]=c):c=t[1];let i=c,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=h(()=>{n(new Set)},"o"),t[2]=s):s=t[2];let u=s,m,f,g;if(t[3]!==d||t[4]!==e||t[5]!==l){let x;t[9]!==e?(x=h(b=>e(b),"y"),t[9]=e,t[10]=x):x=t[10],f=d.map(x),m=f.length>0&&f.every(b=>l.has(b)),g=!m&&f.some(b=>l.has(b)),t[3]=d,t[4]=e,t[5]=l,t[6]=m,t[7]=f,t[8]=g}else m=t[6],f=t[7],g=t[8];let w=g,a;t[11]!==f?(a=h(()=>{n(x=>f.every(b=>x.has(b))?new Set:new Set(f))},"i"),t[11]=f,t[12]=a):a=t[12];let k=a,S;return t[13]!==m||t[14]!==l||t[15]!==w||t[16]!==k?(S={allSelected:m,clear:u,selected:l,someSelected:w,toggle:i,toggleAll:k},t[13]=m,t[14]=l,t[15]=w,t[16]=k,t[17]=S):S=t[17],S},"Mt"),Pt=be(ve.storageReferences),At=be(ve.storageOrphans),Be=1e4,Wt=1e3,Ht=h(async d=>{let e=[],t,r=!0,l=!1;for(;r&&e.length<Be;){let n=await d.list({cursor:t,limit:Wt}),c=Be-e.length;for(let i of n.objects.slice(0,c))e.push(i.key);l||=n.objects.length>c,t=n.cursor,r=t!==void 0}return{liveKeys:e,truncated:l||r}},"qt"),Zt=3600,qt=h((d,e)=>{if(!("document"in globalThis))return;let t=globalThis.document.createElement("a");t.href=d,t.download=e,t.rel="noopener",globalThis.document.body.append(t),t.click(),t.remove()},"Vt"),Gt=h(d=>d.key,"Zt"),Vt=h(({initialPrefix:d,pageSize:e})=>{let t=Ke(),[r,l]=(0,z.useState)(d??""),[n,c]=(0,z.useState)(d??""),[i,s]=(0,z.useState)(Ct),[u,m]=(0,z.useState)("list"),[f,g]=(0,z.useState)(128),[w,a]=(0,z.useState)("name"),[k,S]=(0,z.useState)("asc"),[x,b]=(0,z.useState)(void 0),[y,v]=(0,z.useState)(void 0),[j,N]=(0,z.useState)(!1),[C,T]=(0,z.useState)(void 0),[D,F]=(0,z.useState)(void 0),[$,O]=(0,z.useState)(""),[R,L]=(0,z.useState)({}),[_,E]=(0,z.useState)(!1),[I,M]=(0,z.useState)(void 0),[P,W]=(0,z.useState)(!1),[A,H]=(0,z.useState)(!1),[V,re]=(0,z.useState)([]),[q,we]=(0,z.useState)(""),ne=(0,z.useRef)(0),Q=(0,z.useRef)(0),ce=(0,z.useRef)(0);(0,z.useEffect)(()=>{let p={cancelled:!1};return Z((async()=>{try{let K=await t.listStorageBuckets();if(!p.cancelled){re(K);let[U]=K;U!==void 0&&we(J=>J===""?U:J)}}catch{}})()),()=>{p.cancelled=!0}},[t]);let G=(0,z.useMemo)(()=>({list:h(p=>t.listStorageObjects({...p,bucket:q}),"list"),remove:h(p=>t.deleteStorageObject(p,{bucket:q}),"remove"),signedUrl:h((p,K)=>t.signedStorageUrl(p,{...K,bucket:q}),"signedUrl"),upload:h(p=>t.uploadStorageObject({...p,bucket:q}),"upload")}),[q,t]),Y=(0,z.useCallback)(async(p,K,U,J=!1)=>{ne.current+=1;let me=ne.current;v(void 0),N(!0);try{let oe=await G.list({cursor:K,limit:e,prefix:p});if(me!==ne.current)return;b(Ce=>U&&Ce!==void 0?[...Ce,...oe.objects]:oe.objects),F(oe.cursor)}catch(oe){if(me!==ne.current)return;if(U||b(void 0),v(le(oe)),J)throw oe}finally{me===ne.current&&N(!1)}},[e,G]);(0,z.useEffect)(()=>{Z(Y(d??"",void 0,!1))},[Y,d]);let qe=(x?.length??0)<=e;Re(()=>Y(r,void 0,!1,!0),qe);let{files:ue,folders:Ge}=zt(x??[],r),Ve=(0,z.useMemo)(()=>{let p=new Set;for(let K of ue)for(let U of Object.keys(K.customMetadata??{}))p.add(U);return[...p].toSorted((K,U)=>K.localeCompare(U))},[ue]),ie=jt(ue,w,k),fe=(0,z.useMemo)(()=>[...new Set(ie.map(p=>p.key))].toSorted((p,K)=>p.localeCompare(K)).join(`
|
|
1
|
+
import{c as Ue}from"./chunk-P6VNMPWR.js";import{a as ke}from"./chunk-GJXCPZDN.js";import{a as Re}from"./chunk-J3BZWYJQ.js";import{e as _e}from"./chunk-KH6OXCG3.js";import"./chunk-66BMMNUR.js";import"./chunk-JD6PRRFO.js";import"./chunk-NGZNXNRD.js";import"./chunk-2SNHKJXK.js";import"./chunk-BCUOQNI2.js";import"./chunk-P5EVJEGC.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QAOZXPLU.js";import{a as Ie}from"./chunk-YEVTA35E.js";import{a as Fe}from"./chunk-FHLODLBC.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-QRA7AKYO.js";import{i as Te}from"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import{a as ee}from"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import{a as ve}from"./chunk-RCXNYW7P.js";import{b as ae}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as Oe,b as Ee,c as Le,d as de,e as te,f as X}from"./chunk-7QEZ2SFW.js";import{a as xe}from"./chunk-2W4UO5BC.js";import{a as $e,e as Ke}from"./chunk-OK2QU2EV.js";import{m as ze}from"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B as De,h as pe,i as be,j as le,o as ye,s as Z,v as je}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as yt}from"./chunk-GWNGVKLG.js";import{a as bt,b as xt}from"./chunk-6G3E4PJ2.js";import{a as h,d as ge}from"./chunk-5PEAXTYQ.js";var B=ge(yt(),1),z=ge(bt(),1);var o=ge(xt(),1);var Ae=h((d,e,t)=>{let{onCopy:r,onDelete:l,onDownload:n,onToggleSelect:c}=t,i=h(()=>{r(d.key)},"c"),s=h(()=>{n(d.key)},"o"),u=h(()=>{l(d.key)},"f"),m=h(()=>{c(d.key)},"h");return{copy:i,download:s,name:d.key.slice(e.length),remove:u,toggle:m}},"Re"),We=h(d=>{let e=(0,B.c)(31),{busy:t,buttonClassName:r,copied:l,objectKey:n,onCopy:c,onDelete:i,onDownload:s,t:u}=d,m=`storage-copy-${n}`,f;e[0]!==l||e[1]!==u?(f=u(l?"Copied":"Copy URL"),e[0]=l,e[1]=u,e[2]=f):f=e[2];let g;e[3]!==t||e[4]!==r||e[5]!==c||e[6]!==m||e[7]!==f?(g=(0,o.jsx)(ee,{className:r,"data-testid":m,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:f}),e[3]=t,e[4]=r,e[5]=c,e[6]=m,e[7]=f,e[8]=g):g=e[8];let w=`storage-download-${n}`,a;e[9]!==u?(a=u("Download"),e[9]=u,e[10]=a):a=e[10];let k;e[11]!==t||e[12]!==r||e[13]!==s||e[14]!==w||e[15]!==a?(k=(0,o.jsx)(ee,{className:r,"data-testid":w,disabled:t,onClick:s,size:"sm",type:"button",variant:"ghost",children:a}),e[11]=t,e[12]=r,e[13]=s,e[14]=w,e[15]=a,e[16]=k):k=e[16];let S;e[17]!==u?(S=u("Delete object?"),e[17]=u,e[18]=S):S=e[18];let x=`storage-delete-${n}`,b;e[19]!==u?(b=u("Delete"),e[19]=u,e[20]=b):b=e[20];let y;e[21]!==t||e[22]!==i||e[23]!==S||e[24]!==x||e[25]!==b?(y=(0,o.jsx)(Ie,{confirmLabel:S,disabled:t,onConfirm:i,testId:x,children:b}),e[21]=t,e[22]=i,e[23]=S,e[24]=x,e[25]=b,e[26]=y):y=e[26];let v;return e[27]!==y||e[28]!==g||e[29]!==k?(v=(0,o.jsxs)(o.Fragment,{children:[g,k,y]}),e[27]=y,e[28]=g,e[29]=k,e[30]=v):v=e[30],v},"ze"),He=h(d=>{let e=(0,B.c)(14),{objectKey:t,references:r,t:l}=d;if(r===void 0)return null;if(r.length===0){let m=`storage-orphan-${t}`,f;e[0]!==l?(f=l("Orphan"),e[0]=l,e[1]=f):f=e[1];let g;return e[2]!==m||e[3]!==f?(g=(0,o.jsx)(ae,{"data-testid":m,variant:"warning",children:f}),e[2]=m,e[3]=f,e[4]=g):g=e[4],g}let n;e[5]!==r?(n=r.map(vt).join(`
|
|
2
|
+
`),e[5]=r,e[6]=n):n=e[6];let c=n,i=`storage-refs-${t}`,s;e[7]!==r.length||e[8]!==l?(s=r.length===1?l("1 record"):l("{count} records",{count:r.length}),e[7]=r.length,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==c||e[11]!==i||e[12]!==s?(u=(0,o.jsx)(ae,{"data-testid":i,title:c,variant:"secondary",children:s}),e[10]=c,e[11]=i,e[12]=s,e[13]=u):u=e[13],u},"De"),Ze=h(d=>{let e=(0,B.c)(7),{objectKey:t,onToggle:r,selected:l,t:n}=d,c;e[0]!==n?(c=n("Select row"),e[0]=n,e[1]=c):c=e[1];let i=`storage-select-${t}`,s;return e[2]!==r||e[3]!==l||e[4]!==c||e[5]!==i?(s=(0,o.jsx)(ke,{"aria-label":c,checked:l,"data-testid":i,onCheckedChange:r}),e[2]=r,e[3]=l,e[4]=c,e[5]=i,e[6]=s):s=e[6],s},"je");function vt(d){return`${d.table}\xB7${d.id}`}h(vt,"kt");var kt=h(d=>{let e=(0,B.c)(10),{colSpan:t,name:r,onEnter:l}=d,n;e[0]!==r||e[1]!==l?(n=h(()=>{l(r)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})}),e[3]=i):i=e[3];let s;e[4]!==c||e[5]!==r?(s=(0,o.jsxs)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:c,type:"button",children:[i,r]}),e[4]=c,e[5]=r,e[6]=s):s=e[6];let u;return e[7]!==t||e[8]!==s?(u=(0,o.jsx)(de,{children:(0,o.jsx)(X,{colSpan:t,children:s})}),e[7]=t,e[8]=s,e[9]=u):u=e[9],u},"St"),wt=h(d=>{let e=(0,B.c)(37),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,selected:s,showReferences:u,t:m}=d,f;e[0]!==l||e[1]!==n||e[2]!==c?(f=Ae(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=f):f=e[3];let{copy:g,download:w,name:a,remove:k,toggle:S}=f,x;e[4]!==n.key||e[5]!==s||e[6]!==m||e[7]!==S?(x=(0,o.jsx)(X,{className:"w-8",children:(0,o.jsx)(Ze,{objectKey:n.key,onToggle:S,selected:s,t:m})}),e[4]=n.key,e[5]=s,e[6]=m,e[7]=S,e[8]=x):x=e[8];let b;e[9]!==a?(b=(0,o.jsx)(X,{className:"font-mono text-xs",children:a}),e[9]=a,e[10]=b):b=e[10];let y;e[11]!==n.size?(y=ye(n.size),e[11]=n.size,e[12]=y):y=e[12];let v;e[13]!==y?(v=(0,o.jsx)(X,{className:"tabular-nums text-muted-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let j=n.httpMetadata?.contentType??"",N;e[15]!==j?(N=(0,o.jsx)(X,{children:j}),e[15]=j,e[16]=N):N=e[16];let C;e[17]!==n.key||e[18]!==i||e[19]!==u||e[20]!==m?(C=u&&(0,o.jsx)(X,{children:(0,o.jsx)(He,{objectKey:n.key,references:i,t:m})}),e[17]=n.key,e[18]=i,e[19]=u,e[20]=m,e[21]=C):C=e[21];let T=r===n.key,D;e[22]!==t||e[23]!==g||e[24]!==w||e[25]!==n.key||e[26]!==k||e[27]!==m||e[28]!==T?(D=(0,o.jsx)(X,{className:"text-right",children:(0,o.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,o.jsx)(We,{busy:t,copied:T,objectKey:n.key,onCopy:g,onDelete:k,onDownload:w,t:m})})}),e[22]=t,e[23]=g,e[24]=w,e[25]=n.key,e[26]=k,e[27]=m,e[28]=T,e[29]=D):D=e[29];let F;return e[30]!==D||e[31]!==x||e[32]!==b||e[33]!==v||e[34]!==N||e[35]!==C?(F=(0,o.jsxs)(de,{"data-testid":"fb-row",children:[x,b,v,N,C,D]}),e[30]=D,e[31]=x,e[32]=b,e[33]=v,e[34]=N,e[35]=C,e[36]=F):F=e[36],F},"wt"),St=h(d=>{let e=(0,B.c)(65),{allSelected:t,busy:r,copiedKey:l,files:n,folders:c,handlers:i,onEnterFolder:s,prefix:u,references:m,selected:f,showReferences:g,someSelected:w,t:a,toggleSelectAll:k}=d,S;e[0]!==a?(S=a("Select all rows"),e[0]=a,e[1]=S):S=e[1];let x;e[2]!==t||e[3]!==w||e[4]!==S||e[5]!==k?(x=(0,o.jsx)(te,{className:"w-8",children:(0,o.jsx)(ke,{"aria-label":S,checked:t,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:k})}),e[2]=t,e[3]=w,e[4]=S,e[5]=k,e[6]=x):x=e[6];let b;e[7]!==a?(b=a("key"),e[7]=a,e[8]=b):b=e[8];let y;e[9]!==b?(y=(0,o.jsx)(te,{children:b}),e[9]=b,e[10]=y):y=e[10];let v;e[11]!==a?(v=a("size"),e[11]=a,e[12]=v):v=e[12];let j;e[13]!==v?(j=(0,o.jsx)(te,{children:v}),e[13]=v,e[14]=j):j=e[14];let N;e[15]!==a?(N=a("content-type"),e[15]=a,e[16]=N):N=e[16];let C;e[17]!==N?(C=(0,o.jsx)(te,{children:N}),e[17]=N,e[18]=C):C=e[18];let T;e[19]!==g||e[20]!==a?(T=g&&(0,o.jsx)(te,{children:a("used by")}),e[19]=g,e[20]=a,e[21]=T):T=e[21];let D;e[22]!==a?(D=a("Actions"),e[22]=a,e[23]=D):D=e[23];let F;e[24]!==D?(F=(0,o.jsx)(te,{"aria-label":D}),e[24]=D,e[25]=F):F=e[25];let $;e[26]!==F||e[27]!==x||e[28]!==y||e[29]!==j||e[30]!==C||e[31]!==T?($=(0,o.jsx)(Ee,{children:(0,o.jsxs)(de,{children:[x,y,j,C,T,F]})}),e[26]=F,e[27]=x,e[28]=y,e[29]=j,e[30]=C,e[31]=T,e[32]=$):$=e[32];let O;if(e[33]!==c||e[34]!==s||e[35]!==g){let E;e[37]!==s||e[38]!==g?(E=h(I=>(0,o.jsx)(kt,{colSpan:g?6:5,name:I,onEnter:s},I),"D"),e[37]=s,e[38]=g,e[39]=E):E=e[39],O=c.map(E),e[33]=c,e[34]=s,e[35]=g,e[36]=O}else O=e[36];let R;if(e[40]!==r||e[41]!==l||e[42]!==n||e[43]!==i||e[44]!==u||e[45]!==m||e[46]!==f||e[47]!==g||e[48]!==a){let E;e[50]!==r||e[51]!==l||e[52]!==i||e[53]!==u||e[54]!==m||e[55]!==f||e[56]!==g||e[57]!==a?(E=h(I=>(0,o.jsx)(wt,{busy:r,copiedKey:l,handlers:i,object:I,prefix:u,references:m[I.key],selected:f.has(I.key),showReferences:g,t:a},I.key),"D"),e[50]=r,e[51]=l,e[52]=i,e[53]=u,e[54]=m,e[55]=f,e[56]=g,e[57]=a,e[58]=E):E=e[58],R=n.map(E),e[40]=r,e[41]=l,e[42]=n,e[43]=i,e[44]=u,e[45]=m,e[46]=f,e[47]=g,e[48]=a,e[49]=R}else R=e[49];let L;e[59]!==O||e[60]!==R?(L=(0,o.jsxs)(Le,{children:[O,R]}),e[59]=O,e[60]=R,e[61]=L):L=e[61];let _;return e[62]!==$||e[63]!==L?(_=(0,o.jsx)($e,{className:"overflow-hidden py-0",children:(0,o.jsx)(Ke,{className:"px-0",children:(0,o.jsxs)(Oe,{"data-testid":"fb-table",children:[$,L]})})}),e[62]=$,e[63]=L,e[64]=_):_=e[64],_},"Ct"),Nt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],Ct=3600,Me=h((d,e)=>{if(e==="size")return d.size;if(e==="type")return d.httpMetadata?.contentType??"";if(e==="date"){if(d.uploaded===void 0)return 0;let t=new Date(d.uploaded).getTime();return Number.isNaN(t)?0:t}return e.startsWith("tag:")?d.customMetadata?.[e.slice(4)]??"":d.key},"we"),jt=h((d,e,t)=>{let r=t==="desc"?-1:1;return d.toSorted((l,n)=>{let c=Me(l,e),i=Me(n,e);return(typeof c=="number"&&typeof i=="number"?c-i:String(c).localeCompare(String(i)))*r})},"Et"),zt=h((d,e)=>{let t=new Set,r=[];for(let l of d){let n=l.key.slice(e.length),c=n.indexOf("/");c===-1?r.push(l):t.add(n.slice(0,c+1))}return{files:r,folders:[...t].toSorted((l,n)=>l.localeCompare(n))}},"_t"),Dt=h(d=>{let e=(0,B.c)(59),{bucket:t,buckets:r,busy:l,draftPrefix:n,expiry:c,fileInputRef:i,onBucketChange:s,onExpiryChange:u,onFileChange:m,onList:f,onPrefixChange:g,onUploadClick:w,t:a}=d,k;e[0]!==g?(k=h(A=>{g(A.target.value)},"v"),e[0]=g,e[1]=k):k=e[1];let S=k,x;e[2]!==s?(x=h(A=>{s(A.target.value)},"y"),e[2]=s,e[3]=x):x=e[3];let b=x,y;e[4]!==u?(y=h(A=>{u(Number.parseInt(A.target.value,10))},"b"),e[4]=u,e[5]=y):y=e[5];let v=y,j;e[6]!==t||e[7]!==r||e[8]!==b||e[9]!==a?(j=r.length>0&&(0,o.jsx)("select",{"aria-label":a("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:t,children:r.map($t)}),e[6]=t,e[7]=r,e[8]=b,e[9]=a,e[10]=j):j=e[10];let N;e[11]!==a?(N=a("Key prefix"),e[11]=a,e[12]=N):N=e[12];let C;e[13]!==a?(C=a("key prefix (optional)"),e[13]=a,e[14]=C):C=e[14];let T;e[15]!==n||e[16]!==S||e[17]!==N||e[18]!==C?(T=(0,o.jsx)(Te,{"aria-label":N,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:S,placeholder:C,value:n}),e[15]=n,e[16]=S,e[17]=N,e[18]=C,e[19]=T):T=e[19];let D;e[20]!==a?(D=a("List"),e[20]=a,e[21]=D):D=e[21];let F;e[22]!==l||e[23]!==f||e[24]!==D?(F=(0,o.jsx)(ee,{"data-testid":"fb-list",disabled:l,onClick:f,size:"sm",type:"button",children:D}),e[22]=l,e[23]=f,e[24]=D,e[25]=F):F=e[25];let $;e[26]!==l||e[27]!==a?($=a(l?"Uploading\u2026":"Upload"),e[26]=l,e[27]=a,e[28]=$):$=e[28];let O;e[29]!==l||e[30]!==w||e[31]!==$?(O=(0,o.jsx)(ee,{"data-testid":"storage-upload",disabled:l,onClick:w,size:"sm",type:"button",variant:"outline",children:$}),e[29]=l,e[30]=w,e[31]=$,e[32]=O):O=e[32];let R;e[33]!==i||e[34]!==m?(R=(0,o.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:m,ref:i,type:"file"}),e[33]=i,e[34]=m,e[35]=R):R=e[35];let L;e[36]!==a?(L=a("Link expiry"),e[36]=a,e[37]=L):L=e[37];let _;e[38]!==a?(_=Nt.map(A=>(0,o.jsx)("option",{value:A.seconds,children:a(A.label)},A.seconds)),e[38]=a,e[39]=_):_=e[39];let E;e[40]!==c||e[41]!==v||e[42]!==_?(E=(0,o.jsx)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:v,value:c,children:_}),e[40]=c,e[41]=v,e[42]=_,e[43]=E):E=e[43];let I;e[44]!==L||e[45]!==E?(I=(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[L,E]}),e[44]=L,e[45]=E,e[46]=I):I=e[46];let M;e[47]!==a?(M=a("Open in Cloudflare"),e[47]=a,e[48]=M):M=e[48];let P;e[49]!==M?(P=(0,o.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:Ue,rel:"noreferrer",target:"_blank",children:M}),e[49]=M,e[50]=P):P=e[50];let W;return e[51]!==O||e[52]!==R||e[53]!==I||e[54]!==P||e[55]!==j||e[56]!==T||e[57]!==F?(W=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,T,F,O,R,I,P]}),e[51]=O,e[52]=R,e[53]=I,e[54]=P,e[55]=j,e[56]=T,e[57]=F,e[58]=W):W=e[58],W},"$t"),Tt=h(d=>{let e=(0,B.c)(66),{onSortKeyChange:t,onThumbSizeChange:r,showGrid:l,showList:n,sortDirection:c,sortKey:i,t:s,tagKeys:u,thumbSize:m,toggleSortDirection:f,view:g}=d,w;e[0]!==t?(w=h(q=>{t(q.target.value)},"k"),e[0]=t,e[1]=w):w=e[1];let a=w,k;e[2]!==r?(k=h(q=>{r(Number.parseInt(q.target.value,10))},"v"),e[2]=r,e[3]=k):k=e[3];let S=k,x=g==="list",b;e[4]!==s?(b=s("List"),e[4]=s,e[5]=b):b=e[5];let y;e[6]!==n||e[7]!==x||e[8]!==b?(y=(0,o.jsx)("button",{"aria-pressed":x,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:n,type:"button",children:b}),e[6]=n,e[7]=x,e[8]=b,e[9]=y):y=e[9];let v=g==="grid",j;e[10]!==s?(j=s("Grid"),e[10]=s,e[11]=j):j=e[11];let N;e[12]!==l||e[13]!==v||e[14]!==j?(N=(0,o.jsx)("button",{"aria-pressed":v,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:l,type:"button",children:j}),e[12]=l,e[13]=v,e[14]=j,e[15]=N):N=e[15];let C;e[16]!==y||e[17]!==N?(C=(0,o.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[y,N]}),e[16]=y,e[17]=N,e[18]=C):C=e[18];let T;e[19]!==s?(T=s("Sort"),e[19]=s,e[20]=T):T=e[20];let D;e[21]!==s?(D=s("Name"),e[21]=s,e[22]=D):D=e[22];let F;e[23]!==D?(F=(0,o.jsx)("option",{value:"name",children:D}),e[23]=D,e[24]=F):F=e[24];let $;e[25]!==s?($=s("size"),e[25]=s,e[26]=$):$=e[26];let O;e[27]!==$?(O=(0,o.jsx)("option",{value:"size",children:$}),e[27]=$,e[28]=O):O=e[28];let R;e[29]!==s?(R=s("Type"),e[29]=s,e[30]=R):R=e[30];let L;e[31]!==R?(L=(0,o.jsx)("option",{value:"type",children:R}),e[31]=R,e[32]=L):L=e[32];let _;e[33]!==s?(_=s("Modified"),e[33]=s,e[34]=_):_=e[34];let E;e[35]!==_?(E=(0,o.jsx)("option",{value:"date",children:_}),e[35]=_,e[36]=E):E=e[36];let I;e[37]!==u?(I=u.map(Kt),e[37]=u,e[38]=I):I=e[38];let M;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==O||e[43]!==L||e[44]!==E||e[45]!==I?(M=(0,o.jsxs)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:a,value:i,children:[F,O,L,E,I]}),e[39]=a,e[40]=i,e[41]=F,e[42]=O,e[43]=L,e[44]=E,e[45]=I,e[46]=M):M=e[46];let P;e[47]!==T||e[48]!==M?(P=(0,o.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[T,M]}),e[47]=T,e[48]=M,e[49]=P):P=e[49];let W;e[50]!==s?(W=s("Toggle sort direction"),e[50]=s,e[51]=W):W=e[51];let A=c==="asc"?"\u2191":"\u2193",H;e[52]!==W||e[53]!==A||e[54]!==f?(H=(0,o.jsx)("button",{"aria-label":W,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:f,type:"button",children:A}),e[52]=W,e[53]=A,e[54]=f,e[55]=H):H=e[55];let V;e[56]!==S||e[57]!==s||e[58]!==m||e[59]!==g?(V=g==="grid"&&(0,o.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[s("Thumbnail size"),(0,o.jsx)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:S,step:8,type:"range",value:m})]}),e[56]=S,e[57]=s,e[58]=m,e[59]=g,e[60]=V):V=e[60];let re;return e[61]!==P||e[62]!==H||e[63]!==V||e[64]!==C?(re=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[C,P,H,V]}),e[61]=P,e[62]=H,e[63]=V,e[64]=C,e[65]=re):re=e[65],re},"Ft");function $t(d){return(0,o.jsx)("option",{value:d,children:d},d)}h($t,"Rt");function Kt(d){return(0,o.jsx)("option",{value:`tag:${d}`,children:d},d)}h(Kt,"zt");var Ft=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Ot=h(d=>(d.httpMetadata?.contentType??"").startsWith("image/")||Ft.test(d.key),"jt"),Et=h(()=>{let d=(0,B.c)(1),e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),d[0]=e):e=d[0],e},"Kt"),Lt=h(d=>{let e=(0,B.c)(13),{object:t,resolveUrl:r}=d,[l,n]=(0,z.useState)(null),[c,i]=(0,z.useState)(!1),s;e[0]!==t?(s=Ot(t),e[0]=t,e[1]=s):s=e[1];let u=s,m,f;e[2]!==u||e[3]!==t.key||e[4]!==r?(m=h(()=>{if(!u)return;let k={cancelled:!1};return Z((async()=>{try{let S=await r(t.key);k.cancelled||n(S)}catch{k.cancelled||i(!0)}})()),()=>{k.cancelled=!0}},"h"),f=[u,t.key,r],e[2]=u,e[3]=t.key,e[4]=r,e[5]=m,e[6]=f):(m=e[5],f=e[6]),(0,z.useEffect)(m,f);let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=h(()=>{i(!0)},"m"),e[7]=g):g=e[7];let w=g,a;return e[8]!==c||e[9]!==u||e[10]!==t.key||e[11]!==l?(a=(0,o.jsx)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:u&&l!==null&&!c?(0,o.jsx)("img",{alt:t.key,className:"size-full object-cover",loading:"lazy",onError:w,src:l}):(0,o.jsx)(Et,{})}),e[8]=c,e[9]=u,e[10]=t.key,e[11]=l,e[12]=a):a=e[12],a},"Bt"),It=h(d=>{let e=(0,B.c)(42),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,resolveUrl:s,selected:u,showReferences:m,t:f}=d,g;e[0]!==l||e[1]!==n||e[2]!==c?(g=Ae(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=g):g=e[3];let{copy:w,download:a,name:k,remove:S,toggle:x}=g,b;e[4]!==n||e[5]!==s?(b=(0,o.jsx)(Lt,{object:n,resolveUrl:s}),e[4]=n,e[5]=s,e[6]=b):b=e[6];let y;e[7]!==n.key||e[8]!==u||e[9]!==f||e[10]!==x?(y=(0,o.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,o.jsx)(Ze,{objectKey:n.key,onToggle:x,selected:u,t:f})}),e[7]=n.key,e[8]=u,e[9]=f,e[10]=x,e[11]=y):y=e[11];let v;e[12]!==b||e[13]!==y?(v=(0,o.jsxs)("div",{className:"relative",children:[b,y]}),e[12]=b,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==k?(j=(0,o.jsx)("p",{className:"truncate font-mono text-xs",title:k,children:k}),e[15]=k,e[16]=j):j=e[16];let N;e[17]!==n.size?(N=ye(n.size),e[17]=n.size,e[18]=N):N=e[18];let C;e[19]!==N?(C=(0,o.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:N}),e[19]=N,e[20]=C):C=e[20];let T;e[21]!==n.key||e[22]!==i||e[23]!==m||e[24]!==f?(T=m&&(0,o.jsx)("div",{className:"mt-1",children:(0,o.jsx)(He,{objectKey:n.key,references:i,t:f})}),e[21]=n.key,e[22]=i,e[23]=m,e[24]=f,e[25]=T):T=e[25];let D;e[26]!==j||e[27]!==C||e[28]!==T?(D=(0,o.jsxs)("div",{className:"min-w-0",children:[j,C,T]}),e[26]=j,e[27]=C,e[28]=T,e[29]=D):D=e[29];let F=r===n.key,$;e[30]!==t||e[31]!==w||e[32]!==a||e[33]!==n.key||e[34]!==S||e[35]!==f||e[36]!==F?($=(0,o.jsx)("div",{className:"flex items-center gap-1",children:(0,o.jsx)(We,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:n.key,onCopy:w,onDelete:S,onDownload:a,t:f})}),e[30]=t,e[31]=w,e[32]=a,e[33]=n.key,e[34]=S,e[35]=f,e[36]=F,e[37]=$):$=e[37];let O;return e[38]!==$||e[39]!==v||e[40]!==D?(O=(0,o.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[v,D,$]}),e[38]=$,e[39]=v,e[40]=D,e[41]=O):O=e[41],O},"Lt"),Rt=h(d=>{let e=(0,B.c)(9),{name:t,onEnter:r}=d,l;e[0]!==t||e[1]!==r?(l=h(()=>{r(t)},"n"),e[0]=t,e[1]=r,e[2]=l):l=e[2];let n=l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,o.jsx)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,o.jsx)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})})}),e[3]=c):c=e[3];let i;e[4]!==t?(i=(0,o.jsx)("span",{className:"truncate font-mono text-xs",title:t,children:t}),e[4]=t,e[5]=i):i=e[5];let s;return e[6]!==n||e[7]!==i?(s=(0,o.jsxs)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:n,type:"button",children:[c,i]}),e[6]=n,e[7]=i,e[8]=s):s=e[8],s},"It"),_t=h(d=>{let e=(0,B.c)(34),{busy:t,copiedKey:r,files:l,folders:n,handlers:c,onEnterFolder:i,prefix:s,references:u,resolveUrl:m,selected:f,showReferences:g,size:w,t:a}=d,k;e[0]!==w?(k=w.toString(),e[0]=w,e[1]=k):k=e[1];let S=`repeat(auto-fill, minmax(${k}px, 1fr))`,x;e[2]!==S?(x={gridTemplateColumns:S},e[2]=S,e[3]=x):x=e[3];let b=x,y;if(e[4]!==n||e[5]!==i){let N;e[7]!==i?(N=h(C=>(0,o.jsx)(Rt,{name:C,onEnter:i},C),"w"),e[7]=i,e[8]=N):N=e[8],y=n.map(N),e[4]=n,e[5]=i,e[6]=y}else y=e[6];let v;if(e[9]!==t||e[10]!==r||e[11]!==l||e[12]!==c||e[13]!==s||e[14]!==u||e[15]!==m||e[16]!==f||e[17]!==g||e[18]!==a){let N;e[20]!==t||e[21]!==r||e[22]!==c||e[23]!==s||e[24]!==u||e[25]!==m||e[26]!==f||e[27]!==g||e[28]!==a?(N=h(C=>(0,o.jsx)(It,{busy:t,copiedKey:r,handlers:c,object:C,prefix:s,references:u[C.key],resolveUrl:m,selected:f.has(C.key),showReferences:g,t:a},C.key),"w"),e[20]=t,e[21]=r,e[22]=c,e[23]=s,e[24]=u,e[25]=m,e[26]=f,e[27]=g,e[28]=a,e[29]=N):N=e[29],v=l.map(N),e[9]=t,e[10]=r,e[11]=l,e[12]=c,e[13]=s,e[14]=u,e[15]=m,e[16]=f,e[17]=g,e[18]=a,e[19]=v}else v=e[19];let j;return e[30]!==b||e[31]!==y||e[32]!==v?(j=(0,o.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[y,v]}),e[30]=b,e[31]=y,e[32]=v,e[33]=j):j=e[33],j},"Ot"),Ut=h(d=>{let e=(0,B.c)(23),{reference:t,t:r}=d,l=`fb-dangling-${t.table}-${t.id}-${t.column}`,n=`${t.table}\xB7${t.id}`,c;e[0]!==n?(c=(0,o.jsx)(ae,{variant:"secondary",children:n}),e[0]=n,e[1]=c):c=e[1];let i;e[2]!==t.column?(i=(0,o.jsx)("span",{className:"text-muted-foreground",children:t.column}),e[2]=t.column,e[3]=i):i=e[3];let s;e[4]!==r?(s=r("\u2192"),e[4]=r,e[5]=s):s=e[5];let u;e[6]!==s?(u=(0,o.jsx)("span",{className:"text-muted-foreground/60",children:s}),e[6]=s,e[7]=u):u=e[7];let m;e[8]!==t.key?(m=(0,o.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:t.key}),e[8]=t.key,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==i||e[12]!==u||e[13]!==m?(f=(0,o.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,i,u,m]}),e[10]=c,e[11]=i,e[12]=u,e[13]=m,e[14]=f):f=e[14];let g;e[15]!==r?(g=r("Missing object"),e[15]=r,e[16]=g):g=e[16];let w;e[17]!==g?(w=(0,o.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:g}),e[17]=g,e[18]=w):w=e[18];let a;return e[19]!==l||e[20]!==w||e[21]!==f?(a=(0,o.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":l,children:[f,w]}),e[19]=l,e[20]=w,e[21]=f,e[22]=a):a=e[22],a},"At"),Mt=h(d=>{let e=(0,B.c)(42),{busy:t,onCheck:r,references:l,t:n,truncated:c}=d,i;e[0]!==n?(i=n("Integrity"),e[0]=n,e[1]=i):i=e[1];let s;e[2]!==i?(s=(0,o.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[2]=i,e[3]=s):s=e[3];let u;e[4]!==n?(u=n("Orphaned objects"),e[4]=n,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)("span",{className:"text-sm font-medium text-foreground",children:u}),e[6]=u,e[7]=m):m=e[7];let f;e[8]!==n?(f=n("Find records whose file reference points at an object the bucket no longer has."),e[8]=n,e[9]=f):f=e[9];let g;e[10]!==f?(g=(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[10]=f,e[11]=g):g=e[11];let w;e[12]!==s||e[13]!==m||e[14]!==g?(w=(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[s,m,g]}),e[12]=s,e[13]=m,e[14]=g,e[15]=w):w=e[15];let a;e[16]!==t||e[17]!==n?(a=n(t?"Checking\u2026":"Check for orphans"),e[16]=t,e[17]=n,e[18]=a):a=e[18];let k;e[19]!==t||e[20]!==r||e[21]!==a?(k=(0,o.jsx)(ee,{"data-testid":"fb-orphans-check",disabled:t,onClick:r,size:"sm",type:"button",variant:"outline",children:a}),e[19]=t,e[20]=r,e[21]=a,e[22]=k):k=e[22];let S;e[23]!==w||e[24]!==k?(S=(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w,k]}),e[23]=w,e[24]=k,e[25]=S):S=e[25];let x;e[26]!==l||e[27]!==n||e[28]!==c?(x=c&&(0,o.jsx)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:l===void 0||l.length===0?n("The bucket is larger than the scan's key limit, so dangling references could not be checked."):n("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:l.length})}),e[26]=l,e[27]=n,e[28]=c,e[29]=x):x=e[29];let b;e[30]!==l?.length||e[31]!==n||e[32]!==c?(b=l?.length===0&&!c&&(0,o.jsx)(ve,{description:n("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:n("No dangling references.")}),e[30]=l?.length,e[31]=n,e[32]=c,e[33]=b):b=e[33];let y;e[34]!==l||e[35]!==n?(y=l!==void 0&&l.length>0&&(0,o.jsx)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:l.map(j=>(0,o.jsx)(Ut,{reference:j,t:n},`${j.table}\xB7${j.id}\xB7${j.column}`))}),e[34]=l,e[35]=n,e[36]=y):y=e[36];let v;return e[37]!==S||e[38]!==x||e[39]!==b||e[40]!==y?(v=(0,o.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[S,x,b,y]}),e[37]=S,e[38]=x,e[39]=b,e[40]=y,e[41]=v):v=e[41],v},"Ut"),Bt=h(function(d,e){let t=(0,B.c)(18),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,t[0]=r):r=t[0];let[l,n]=(0,z.useState)(r),c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=h(x=>{n(b=>{let y=new Set(b);return y.has(x)?y.delete(x):y.add(x),y})},"a"),t[1]=c):c=t[1];let i=c,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=h(()=>{n(new Set)},"o"),t[2]=s):s=t[2];let u=s,m,f,g;if(t[3]!==d||t[4]!==e||t[5]!==l){let x;t[9]!==e?(x=h(b=>e(b),"y"),t[9]=e,t[10]=x):x=t[10],f=d.map(x),m=f.length>0&&f.every(b=>l.has(b)),g=!m&&f.some(b=>l.has(b)),t[3]=d,t[4]=e,t[5]=l,t[6]=m,t[7]=f,t[8]=g}else m=t[6],f=t[7],g=t[8];let w=g,a;t[11]!==f?(a=h(()=>{n(x=>f.every(b=>x.has(b))?new Set:new Set(f))},"i"),t[11]=f,t[12]=a):a=t[12];let k=a,S;return t[13]!==m||t[14]!==l||t[15]!==w||t[16]!==k?(S={allSelected:m,clear:u,selected:l,someSelected:w,toggle:i,toggleAll:k},t[13]=m,t[14]=l,t[15]=w,t[16]=k,t[17]=S):S=t[17],S},"Mt"),Pt=pe(xe.storageReferences),At=pe(xe.storageOrphans),Be=1e4,Wt=1e3,Ht=h(async d=>{let e=[],t,r=!0,l=!1;for(;r&&e.length<Be;){let n=await d.list({cursor:t,limit:Wt}),c=Be-e.length;for(let i of n.objects.slice(0,c))e.push(i.key);l||=n.objects.length>c,t=n.cursor,r=t!==void 0}return{liveKeys:e,truncated:l||r}},"qt"),Zt=3600,qt=h((d,e)=>{if(!("document"in globalThis))return;let t=globalThis.document.createElement("a");t.href=d,t.download=e,t.rel="noopener",globalThis.document.body.append(t),t.click(),t.remove()},"Vt"),Gt=h(d=>d.key,"Zt"),Vt=h(({initialPrefix:d,pageSize:e})=>{let t=ze(),[r,l]=(0,z.useState)(d??""),[n,c]=(0,z.useState)(d??""),[i,s]=(0,z.useState)(Ct),[u,m]=(0,z.useState)("list"),[f,g]=(0,z.useState)(128),[w,a]=(0,z.useState)("name"),[k,S]=(0,z.useState)("asc"),[x,b]=(0,z.useState)(void 0),[y,v]=(0,z.useState)(void 0),[j,N]=(0,z.useState)(!1),[C,T]=(0,z.useState)(void 0),[D,F]=(0,z.useState)(void 0),[$,O]=(0,z.useState)(""),[R,L]=(0,z.useState)({}),[_,E]=(0,z.useState)(!1),[I,M]=(0,z.useState)(void 0),[P,W]=(0,z.useState)(!1),[A,H]=(0,z.useState)(!1),[V,re]=(0,z.useState)([]),[q,we]=(0,z.useState)(""),ne=(0,z.useRef)(0),Q=(0,z.useRef)(0),ce=(0,z.useRef)(0);(0,z.useEffect)(()=>{let p={cancelled:!1};return Z((async()=>{try{let K=await t.listStorageBuckets();if(!p.cancelled){re(K);let[U]=K;U!==void 0&&we(J=>J===""?U:J)}}catch{}})()),()=>{p.cancelled=!0}},[t]);let G=(0,z.useMemo)(()=>({list:h(p=>t.listStorageObjects({...p,bucket:q}),"list"),remove:h(p=>t.deleteStorageObject(p,{bucket:q}),"remove"),signedUrl:h((p,K)=>t.signedStorageUrl(p,{...K,bucket:q}),"signedUrl"),upload:h(p=>t.uploadStorageObject({...p,bucket:q}),"upload")}),[q,t]),Y=(0,z.useCallback)(async(p,K,U,J=!1)=>{ne.current+=1;let me=ne.current;v(void 0),N(!0);try{let oe=await G.list({cursor:K,limit:e,prefix:p});if(me!==ne.current)return;b(Ce=>U&&Ce!==void 0?[...Ce,...oe.objects]:oe.objects),F(oe.cursor)}catch(oe){if(me!==ne.current)return;if(U||b(void 0),v(le(oe)),J)throw oe}finally{me===ne.current&&N(!1)}},[e,G]);(0,z.useEffect)(()=>{Z(Y(d??"",void 0,!1))},[Y,d]);let qe=(x?.length??0)<=e;Re(()=>Y(r,void 0,!1,!0),qe);let{files:ue,folders:Ge}=zt(x??[],r),Ve=(0,z.useMemo)(()=>{let p=new Set;for(let K of ue)for(let U of Object.keys(K.customMetadata??{}))p.add(U);return[...p].toSorted((K,U)=>K.localeCompare(U))},[ue]),ie=jt(ue,w,k),fe=(0,z.useMemo)(()=>[...new Set(ie.map(p=>p.key))].toSorted((p,K)=>p.localeCompare(K)).join(`
|
|
3
3
|
`),[ie]);(0,z.useEffect)(()=>{let p=fe===""?[]:fe.split(`
|
|
4
|
-
`);if(p.length===0){L({});return}let K={current:!0};return Z((async()=>{try{let U=await t.query(Pt,{keys:p},
|
|
4
|
+
`);if(p.length===0){L({});return}let K={current:!0};return Z((async()=>{try{let U=await t.query(Pt,{keys:p},be($));K.current&&(L(U.references??{}),E(Object.keys(U.storageColumns??{}).length>0))}catch{K.current&&(L({}),E(!1))}})()),()=>{K.current=!1}},[t,fe,$]);let{allSelected:Qe,clear:se,selected:Se,someSelected:Xe,toggle:Ye,toggleAll:Je}=Bt(ie,Gt),et=h(()=>{l(n),se(),Z(Y(n,void 0,!1))},"Me"),tt=h(()=>{Z(Y(r,D,!0))},"Ge"),Ne=h(p=>{l(p),c(p),se(),Z(Y(p,void 0,!1))},"ve"),rt=h(p=>{Ne(`${r}${p}`)},"He"),nt=h(p=>G.signedUrl(p,{expiresInSeconds:Zt}),"Pe"),ot=h(()=>{m("list")},"qe"),lt=h(()=>{m("grid")},"We"),st=h(p=>{a(p)},"Ve"),at=h(()=>{S(p=>p==="asc"?"desc":"asc")},"Ze"),ct=h(p=>{g(p)},"Xe"),it=h(p=>{s(p)},"Ye"),he=h(p=>{let K=ce.current;v(void 0),N(!0),Z((async()=>{try{await p(),K===ce.current&&await Y(r,void 0,!1)}catch(U){v(le(U))}K===ce.current&&N(!1)})())},"me"),dt=h(()=>{he(async()=>{for(let p of Se)await G.remove(p);se()})},"Je"),ut=h(p=>{v(void 0),Z((async()=>{try{let K=await G.signedUrl(p,{expiresInSeconds:i});je(K)&&T(p)}catch(K){v(le(K))}})())},"Qe"),ft=h(p=>{v(void 0),Z((async()=>{try{let K=await G.signedUrl(p,{expiresInSeconds:i}),U=p.slice(p.lastIndexOf("/")+1)||p;qt(K,U)}catch(K){v(le(K))}})())},"et");(0,z.useEffect)(()=>{if(C===void 0)return;let p=globalThis.setTimeout(()=>{T(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[C]);let ht=h(p=>{he(async()=>{await G.remove(p)})},"tt"),mt=h(p=>{let K=`${r}${p.name}`;he(async()=>{let U=await p.arrayBuffer();await G.upload({body:U,contentType:p.type===""?void 0:p.type,key:K})})},"st");(0,z.useEffect)(()=>{Q.current+=1,M(void 0),H(!1)},[$]);let gt=h(()=>{Q.current+=1;let p=Q.current;v(void 0),W(!0),Z((async()=>{try{let{liveKeys:K,truncated:U}=await Ht(G);if(U)p===Q.current&&(M(void 0),H(!0));else{let J=await t.query(At,{liveKeys:K},be($));p===Q.current&&(M(J.references??[]),H(J.truncated===!0))}}catch(K){p===Q.current&&(M(void 0),H(!1),v(le(K)))}p===Q.current&&W(!1)})())},"lt"),pt=h(p=>{ne.current+=1,Q.current+=1,ce.current+=1,we(p),l(d??""),c(d??""),b(void 0),M(void 0),H(!1),se()},"nt");return{allSelected:Qe,bucket:q,buckets:V,bulkDelete:dt,busy:j,checkOrphans:gt,clearSelection:se,copiedKey:C,danglingBusy:P,danglingReferences:I,danglingTruncated:A,draftPrefix:n,enterFolder:rt,error:y,expiry:i,files:ie,folders:Ge,hasObjects:x!==void 0&&x.length>0,hasStorageColumns:_,listFirst:et,loaded:x!==void 0,loadMore:tt,navigate:Ne,nextCursor:D,onCopy:ut,onDelete:ht,onDownload:ft,onExpiryChange:it,onFile:mt,onSortKeyChange:st,onThumbSizeChange:ct,prefix:r,referenceShard:$,references:R,resolveUrl:nt,selectBucket:pt,selected:Se,setDraftPrefix:c,setReferenceShard:O,showGrid:lt,showList:ot,someSelected:Xe,sortDirection:k,sortKey:w,tagKeys:Ve,thumbSize:f,toggleSelect:Ye,toggleSelectAll:Je,toggleSortDirection:at,view:u}},"Xt"),Qt=100,Pe=h(d=>{let e=(0,B.c)(6),{label:t,onNavigate:r,target:l}=d,n;e[0]!==r||e[1]!==l?(n=h(()=>{r(l)},"l"),e[0]=r,e[1]=l,e[2]=n):n=e[2];let c=n,i;return e[3]!==c||e[4]!==t?(i=(0,o.jsx)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:c,type:"button",children:t}),e[3]=c,e[4]=t,e[5]=i):i=e[5],i},"Ne"),Xt=h(d=>{let e=(0,B.c)(11),{onNavigate:t,prefix:r,t:l}=d,n;if(e[0]!==t||e[1]!==r||e[2]!==l){let c=r.split("/").filter(Yt),i;e[4]!==l?(i=l("Folder path"),e[4]=l,e[5]=i):i=e[5];let s;e[6]!==l?(s=l("root"),e[6]=l,e[7]=s):s=e[7];let u;e[8]!==t||e[9]!==s?(u=(0,o.jsx)(Pe,{label:s,onNavigate:t,target:""}),e[8]=t,e[9]=s,e[10]=u):u=e[10],n=(0,o.jsxs)("nav",{"aria-label":i,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[u,c.map((m,f)=>(0,o.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,o.jsx)("span",{className:"text-muted-foreground/50",children:"/"}),(0,o.jsx)(Pe,{label:m,onNavigate:t,target:`${c.slice(0,f+1).join("/")}/`})]},`${m}-${f.toString()}`))]}),e[0]=t,e[1]=r,e[2]=l,e[3]=n}else n=e[3];return n},"Jt"),gr=h(({initialPrefix:d,pageSize:e=Qt})=>{let t=De(),r=Vt({initialPrefix:d,pageSize:e}),l=(0,z.useRef)(null),{onCopy:n,onDelete:c,onDownload:i,onFile:s,toggleSelect:u}=r,m={onCopy:n,onDelete:c,onDownload:i,onToggleSelect:u},f=h(()=>{l.current?.click()},"u"),g=h(a=>{let k=a.target,S=k.files?.[0];k.value="",S&&s(S)},"m"),w=r.loaded&&!r.hasObjects;return(0,o.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,o.jsx)(Dt,{bucket:r.bucket,buckets:r.buckets,busy:r.busy,draftPrefix:r.draftPrefix,expiry:r.expiry,fileInputRef:l,onBucketChange:r.selectBucket,onExpiryChange:r.onExpiryChange,onFileChange:g,onList:r.listFirst,onPrefixChange:r.setDraftPrefix,onUploadClick:f,t}),r.loaded&&(0,o.jsx)(Xt,{onNavigate:r.navigate,prefix:r.prefix,t}),r.hasObjects&&(0,o.jsx)(Tt,{onSortKeyChange:r.onSortKeyChange,onThumbSizeChange:r.onThumbSizeChange,showGrid:r.showGrid,showList:r.showList,sortDirection:r.sortDirection,sortKey:r.sortKey,t,tagKeys:r.tagKeys,thumbSize:r.thumbSize,toggleSortDirection:r.toggleSortDirection,view:r.view}),r.hasStorageColumns&&(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,o.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:t("References shard")}),(0,o.jsx)(Fe,{id:"fb-reference-shard-input",onChange:r.setReferenceShard,testId:"fb-reference-shard-input",value:r.referenceShard}),(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:t("Which shard's records are checked for references to these files. Empty = root shard.")})]}),r.hasStorageColumns&&(0,o.jsx)(Mt,{busy:r.danglingBusy,onCheck:r.checkOrphans,references:r.danglingReferences,t,truncated:r.danglingTruncated}),r.selected.size>0&&(0,o.jsx)(_e,{count:r.selected.size,editable:!0,onClear:r.clearSelection,onDelete:r.bulkDelete}),r.error!==void 0&&(0,o.jsx)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:r.error}),w&&(0,o.jsx)(ve,{description:t("Objects you upload to your R2 buckets will appear here."),icon:(0,o.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,o.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"}),(0,o.jsx)("path",{d:"M12 11v5m-2.5-2.5h5"})]}),testId:"fb-empty",title:t("No objects.")}),r.hasObjects&&r.view==="list"&&(0,o.jsx)(St,{allSelected:r.allSelected,busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:m,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,selected:r.selected,showReferences:r.hasStorageColumns,someSelected:r.someSelected,t,toggleSelectAll:r.toggleSelectAll}),r.hasObjects&&r.view==="grid"&&(0,o.jsx)(_t,{busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:m,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,resolveUrl:r.resolveUrl,selected:r.selected,showReferences:r.hasStorageColumns,size:r.thumbSize,t}),r.nextCursor!==void 0&&(0,o.jsx)("div",{children:(0,o.jsx)(ee,{"data-testid":"fb-next",disabled:r.busy,onClick:r.loadMore,size:"sm",type:"button",variant:"outline",children:t("Load more")})})]})},"xs");function Yt(d){return d!==""}h(Yt,"Qt");export{gr as FileBrowser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-5PEAXTYQ.js";var d=[{headings:["Vocabulary","The mental model","The components","Request lifecycle","The data tiers","Compute tiers","The consistency model","The real-time engine"],id:"architecture",summary:"The full picture \u2014 topology, request lifecycle, the data tiers, the consistency model, and the design decisions behind them.",title:"Architecture"},{headings:["How telemetry reaches the cloud","Traces","Issues","Logs","Metrics","Scoped ingest keys","Bring your own OpenTelemetry","Retention & scale"],id:"cloud/monitoring",summary:"The Lunora cloud is a managed OpenTelemetry backend + control plane \u2014 deploy to it and your traces, logs, metrics, and AI generations flow i",title:"Monitoring"},{headings:["When to use an action vs a mutation","ActionCtx","Calling queries and mutations from an action","Scheduling follow-up work"],id:"concepts/actions",summary:"Non-deterministic functions for external APIs and side effects \u2014 the action builder and its ActionCtx.",title:"Actions"},{headings:["Keep your session authority","Declare ownership once","Call Lunora from your own Worker","Dev proxy: two silent failures","Run both engines during the migration","Test it without a worker","When something is stuck"],id:"concepts/adopt-in-an-existing-app",summary:"Add Lunora to a working product that already has its own auth, Worker, and data layer \u2014 without rewriting either.",title:"Adopt in an existing app"},{headings:["Static lints","Runtime lints","Running advisors"],id:"concepts/advisors",summary:"Splinter-style lints that catch schema, performance, and security problems \u2014 many before you deploy.",title:"Advisors"},{headings:["Agent skills","Agent mode","The docs server","The local server","The MCP server","Keeping generated types honest"],id:"concepts/ai-tooling",summary:"Teach Claude Code, Cursor, and Copilot how to use Lunora \u2014 agent skills, agent-aware dev mode, the docs server, and the MCP server.",title:"AI coding agents"},{headings:["What lands in your project","Wire it up","The cards","Enabling the optional flows","Password rules","Username availability","Being an OAuth provider","Avatar and logo uploads"],id:"concepts/auth-ui",summary:"Copy-in sign-in, settings, and organization screens for React, Vue, Svelte, Solid, and Angular \u2014 the code lands in your project and you own ",title:"Auth UI"},{headings:["ctx.auth inside functions","@lunora/auth on the server","Routing /api/auth/*","The client side","Feeding row-level security","See also"],id:"concepts/authentication",summary:"How ctx.auth threads the signed-in user through queries, mutations, and actions \u2014 and feeds row-level security.",title:"Authentication"},{headings:["Point-in-time recovery","Snapshot backups","Export and import","Streaming data out continuously","Practising a restore"],id:"concepts/backups",summary:"Snapshot a deployment, recover a shard to any moment in the last 30 days, and move data in and out as NDJSON.",title:"Backups, export & import"},{headings:["Schema first","Reads","Writes","Inputs and safety","Scaling","Lean on Advisors"],id:"concepts/best-practices",summary:"The opinionated idioms that keep a Lunora app fast, safe, and reactive.",title:"Best practices"},{headings:["Enabling Workers Cache","Declarative cache headers on httpRoute","Programmatic cache purging","Why only HTTP actions?","Memoizing an expensive action result","Scaffolding cache-aware routes","Best practices"],id:"concepts/caching",summary:"Edge caching with Cloudflare Workers Cache \u2014 declarative headers on HTTP routes and programmatic cache purging from actions.",title:"Caching"},{headings:["The short version","Rows or events?","Live topics, whispers and rooms","Streams","Write a row, then tell the page","Things to know before you rely on a live topic"],id:"concepts/choosing-a-data-channel",summary:"Live query, stream, live topic, whisper, room or socket? Which one to use for which job.",title:"Choosing a data channel"},{headings:["Declaring it","What _commitSeq guarantees","Refreshed on every write","Three things it is not","When to reach for it"],id:"concepts/commit-ordering",summary:"Declare .commitOrdered() so every row carries _commitSeq \u2014 a per-shard sequence that orders commits, and the cursor a changefeed can page on",title:"Commit ordering"},{headings:["Defining one","Installing one","What the namespace guarantees","What a component does NOT get","In the architecture view","Migrations","See also"],id:"concepts/components",summary:"Package backend features \u2014 tables, functions, and context \u2014 as an installable unit that cannot collide with the app that installs it.",title:"Components"},{headings:["Constraint kinds","Unique","Non-null","Foreign-key integrity","Error codes"],id:"concepts/constraints",summary:"Unique, non-null and foreign-key integrity declared on the schema and enforced at write time.",title:"Constraints"},{headings:["What it pins","Pinning auth and voice","Pinning mail","Set it once: changing it strands data","Runbook: moving an app to a new jurisdiction"],id:"concepts/data-residency",summary:"Pin Durable Objects to a Cloudflare jurisdiction with .jurisdiction(), and the export\u2192import runbook for moving regions.",title:"Data residency"},{headings:["The type table","Numbers, bigints, and dates","Optional versus null","Values that JSON cannot carry","Size limits","Types outside the schema"],id:"concepts/data-types",summary:"The value types a Lunora document can hold, how each is stored, and which ones need the wire codec to survive JSON.",title:"Data types"},{headings:["Start with lunora doctor","Catch it before it runs","The error overlay","Structured logging with ctx.log","The Studio","Find the slow or failing function","Watch production","Debugging authentication"],id:"concepts/debugging",summary:"The tools to reach for when something is broken \u2014 doctor, the error overlay, ctx.log, the Studio, insights, and live logs.",title:"Debugging"},{headings:["How ids are minted","Typing a reference with v.id","Reading and following ids","Validating an id that came from outside","Ids in exports and imports"],id:"concepts/document-ids",summary:"Every row carries an _id and a _creationTime \u2014 how they are minted, how v.id types a reference, and what an id does and does not guarantee.",title:"Document IDs"},{headings:["Locally: .dev.vars","In production: secrets and vars","Accessing env inside your app","The rule: never commit secrets"],id:"concepts/environment-variables",summary:"Configure secrets and vars \u2014 .dev.vars locally, wrangler secrets in production, env bindings inside functions.",title:"Environment variables"},{headings:["Multiple environments","Linking a checkout to a deployment","Preview deployments","Moving traffic between versions","Build once, deploy many","Custom domains","Trying a deploy without an account","Who changed what"],id:"concepts/environments",summary:"Running staging next to production, shipping a preview per pull request, and rolling traffic back when something goes wrong.",title:"Environments & releases"},{headings:["Throwing from a handler","Expected vs. unexpected","Reading error state on the client","Optimistic updates roll back on rejection","See also"],id:"concepts/error-handling",summary:"Throwing inside handlers, how errors travel to the client, and reading error state without losing optimistic safety.",title:"Error handling"},{headings:["What reaches your tracker","Wire it once, to both halves","Sentry","PostHog","Datadog, Axiom, Better Stack, and the rest","Source maps","Privacy"],id:"concepts/error-tracking",summary:"Send Lunora's failed calls and error logs to Sentry, PostHog, Datadog, or any error tracker, with the thrown error's real stack and nothing ",title:"Error tracking"},{headings:["External provider or @lunora/auth?","The resolver","Client: hand over the token, refresh it","WebSockets and live queries","RLS with org claims","Memoization and revocation","Composing with @lunora/auth or Cloudflare Access","Walkthrough: Clerk"],id:"concepts/external-auth",summary:"Use Clerk, WorkOS AuthKit, Auth0, Supabase or any OIDC JWT issuer as your identity provider \u2014 verify its token at the Worker and feed ctx.au",title:"External auth"},{headings:["Which contexts expose what","Uploading","Serving files","Named buckets","Deleting","See also"],id:"concepts/file-storage",summary:"Typed R2 buckets exposed as ctx.storage \u2014 uploading, serving via signed URLs, and deleting files from your functions.",title:"File storage"},{headings:["Where the work happens","Choosing between them","When a bare filter is fine","How the advisors catch this","Composing","Inside an object column"],id:"concepts/filtering",summary:".filter() is a JavaScript predicate applied after rows are loaded \u2014 when to use it, and when to reach for an index instead.",title:"Filtering"},{headings:["The three context types","Surfaces on every ctx","ctx field matrix","Add-on surfaces (codegen-wired)"],id:"concepts/function-context",summary:"The ctx object passed to every query, mutation, and action \u2014 and what each kind is allowed to do with it.",title:"Function context"},{headings:["api.ts and internal.ts: function references","server.ts: typed helpers","dataModel.ts: Id and Doc","Importing the generated code","lunora/* vs @lunora/* imports","Linting and formatting","Regenerating"],id:"concepts/generated-code",summary:"What @lunora/codegen emits from your schema.ts, and how api / Id / Doc keep server and client in sync.",title:"Generated code"},{headings:["Declaring a point column and a geo index",'"Places near me": near(point, radiusMeters)',"Bounding box: within(box)","Single-shard scope","How the Advisors catch geo mistakes"],id:"concepts/geospatial",summary:'Store lat/lng points with v.geoPoint, index them with .geoIndex, and answer "places near me" and bounding-box reads with withGeoIndex.',title:"Geospatial"},{headings:["httpAction","HttpActionCtx","Typed routes with httpRoute","How routes mount in the worker"],id:"concepts/http-endpoints",summary:"Public HTTP routes with httpAction and the Hono-based httpRouter.",title:"HTTP endpoints"},{headings:["Declaring an index","Querying with withIndex","Why every filtered read should hit an index","How the Advisors catch unindexed reads","Checking a read with explain","Aggregate indexes"],id:"concepts/indexes",summary:"Declare B-tree indexes on tables and query them with withIndex \u2014 every filtered read should hit one.",title:"Indexes"},{headings:["Calling internal functions","Internal functions and scheduling"],id:"concepts/internal-functions",summary:"internalQuery / internalMutation / internalAction \u2014 server-only functions never exposed to the client.",title:"Internal functions"},{headings:["Declare the stream","Publish","Follow a topic in the browser","Authorization","Where delivery stops","Platform support","React Native"],id:"concepts/live-streams",summary:"Publish events to named topics from the server and follow many of them over one SSE connection.",title:"Live topic streams"},{headings:["Turn CDC on first","Why the DO topology fits","Shapes \u2014 partial replication","The poke diff protocol","Custom mutators \u2014 optimistic, server-authoritative","The client store","Cross-shard joins \u2014 the one limit"],id:"concepts/local-first",summary:"Shapes, the poke diff protocol, and custom mutators \u2014 the Zero-class sync engine.",title:"Local-first sync"},{headings:["Strategies","Roles and bypass","What's masked, what isn't","Sensitive arguments","Tooling","See also"],id:"concepts/masking",summary:"Column-level redaction on the read path \u2014 the companion to row-level security.",title:"Data masking"},{headings:["The lifetime","Rebuilding: onShardInit","What .memory() buys, and what it does not","Restrictions","Choosing between .memory() and .ttl()"],id:"concepts/memory-tables",summary:"Declare .memory() for state the shard rebuilds rather than remembers \u2014 presence, cursors, live counters \u2014 and onShardInit to bring it back a",title:"Memory tables"},{headings:["Attaching middleware","Augmenting ctx","Composing concerns"],id:"concepts/middleware",summary:"Compose cross-cutting concerns \u2014 auth checks, rate limiting, logging \u2014 and augment ctx for downstream handlers.",title:"Middleware"},{headings:["The deploy gate tells you when you need one","Schema migrations (global tables)","Data migrations (sharded tables)","Inspecting run-state in the Studio","One-off data edits without a deploy","Resetting local state"],id:"concepts/migrations",summary:"Schema-change SQL for global tables and online, resumable data migrations.",title:"Migrations"},{headings:["Queues and topics","What you get","Table ownership","Installed components"],id:"concepts/modules",summary:"Group lunora/ folders into modules and get a module catalog and an architecture diagram from codegen.",title:"Modules"},{headings:["Running as one node in a dev graph","Deploying from external IaC","Consuming the generated API from a sibling package","Calling the backend from a sibling Worker"],id:"concepts/monorepos-and-iac",summary:"Running the Lunora worker as one node in a larger dev graph, deploying it from Terraform/Pulumi/Alchemy, and consuming its generated API fro",title:"Monorepos and external IaC"},{headings:["The output is pinned to your CLI version","Wiring it into your project","What you get, and what you don't","Conformance"],id:"concepts/non-js-sdks",summary:"Generate a typed, self-contained Lunora client for Python, Go, Ruby, Rust, Swift, Java, Kotlin or Dart/Flutter \u2014 vendored into your project ",title:"Non-JS SDKs"},{headings:["Configure defineNotify","VAPID / FCM config via .dev.vars","Register a browser push subscription","Send from an action","Queue-backed fan-out"],id:"concepts/notifications",summary:"Configure defineNotify in lunora/notify.ts for Web Push + FCM, register browser subscriptions, and send via ctx.notify / ctx.push from an ac",title:"Push notifications"},{headings:["Sinks","Structured logging with ctx.log","Tracing sub-operations with ctx.trace","Database telemetry (ctx.db and ctx.sql)","Trace sampling","Source maps","Application metrics with ctx.metrics","Container telemetry"],id:"concepts/observability",summary:"Ship Lunora's logs, traces, and metrics to any OTLP collector \u2014 the otlpSink worker option, ctx.log/ctx.trace/ctx.metrics, the zero-config c",title:"Observability"},{headings:["Mutations are serialized, not retried","Where conflicts still happen","Handling a conflict on the client","Diagnosing a persistent conflict","Atomicity across shards",".global() tables"],id:"concepts/occ",summary:"Why mutations in one shard are serialized rather than retried, where optimistic-concurrency conflicts still arise, and what atomicity means ",title:"OCC & atomicity"},{headings:["Passing the adapters explicitly","What gets persisted","Surviving a breaking deploy","Multiple tabs","Sync status","Connection status UI","Boot with no network (the app shell)","The reconciliation model"],id:"concepts/offline-first",summary:"Persist reads and writes to disk so the app boots, renders, and accepts edits with no network.",title:"Offline-first"},{headings:["PaginationOptions","PaginationResult","Paging through a query","Ordering rows that hold NULL","Load more / infinite lists on the client",'Total count ("42 of 1,203")'],id:"concepts/pagination",summary:"Keyset pagination with .paginate(options) \u2014 page through a query and build an infinite list on the client.",title:"Pagination"},{headings:["ctx.db","ctx.auth","ctx.scheduler"],id:"concepts/queries-mutations",summary:"query / mutation / action \u2014 what each is for and how ctx is shaped.",title:"Queries & mutations"},{headings:["How this differs from a trigger","The convergence contract","What the handler receives","Execution and identity","Reads that should not wake you","Watching them work"],id:"concepts/reactors",summary:"Declare onQueryChange to run server logic when a query's result changes \u2014 the actor pattern, with no client on the other end and nothing pol",title:"Reactors (server-side reactivity)"},{headings:["Where a shard is created","Replica reads","Sockets near the client"],id:"concepts/read-replicas",summary:"Serve one-shot queries from a copy of the shard in the caller's region, pin where a shard is created, and terminate sockets near the client.",title:"Read replicas & placement"},{headings:["Hibernation","How an update reaches a subscriber","Reconnect","When WebSockets are blocked","Durable streams","Whispers (ephemeral peer messages)","Why no MQTT / Pub/Sub"],id:"concepts/realtime",summary:"How subscriptions, deltas, and hibernation fit together.",title:"Real-time"},{headings:["Using items","The manifest","Validation","Building the catalog","Distributing"],id:"concepts/registry-items",summary:"Package a reusable capability \u2014 schema, functions, bindings and env vars \u2014 as a registry item others install with one command.",title:"Authoring registry items"},{headings:["A worked example","The edge set","Directions","Depth, limit and score","Cycles and paging","It is an ordinary read","Fusing the graph into retrieval","From an AI agent"],id:"concepts/relation-graph",summary:"Traverse the foreign-key graph your schema already declares with ctx.db.related \u2014 depth-bounded, cycle-safe, scored by proximity, and fusabl",title:"Relation graph"},{headings:["The descriptors","Many-to-many","Index your foreign keys","Querying across a relation","Writing through a relation","Relations vs the relation graph"],id:"concepts/relations",summary:"Modeling many-to-one, one-to-many and many-to-many relationships with the one / many relation descriptors, foreign-key columns, join tables ",title:"Relations"},{headings:["Default-closed","URLs and methods","Arguments","Choosing a shard","Authentication","Rate limiting","Caching","OpenAPI"],id:"concepts/rest-api",summary:"Publish a query, mutation, or action as a plain REST endpoint with .expose({ rest: true }) \u2014 default-closed, routed through the procedure so",title:"Public REST API"},{headings:["Policies","Permissions and roles","Relation predicates","What's covered, what isn't","Testing policies","See also"],id:"concepts/rls",summary:"Server-side authorization that decides which rows a procedure can read or write.",title:"Row-level security"},{headings:["Node compatibility","Where the constraints bite","Bundling","The worker entry","Build once, deploy many"],id:"concepts/runtime",summary:"Everything runs on the Workers runtime \u2014 what that means for Node APIs, dependencies, and the 64 MiB bundle you have to fit into.",title:"Runtime & bundling"},{headings:["Deferring a function","Recurring jobs (Cron Triggers)","How dispatch works","See also"],id:"concepts/scheduling",summary:"Defer follow-up work with ctx.scheduler.runAfter / runAt, and run recurring jobs via Cron Triggers.",title:"Scheduling"},{headings:["Validators","Tier modifiers","Indexes"],id:"concepts/schema",summary:"Declarative tables, validators, indexes and sharding.",title:"Schema"},{headings:["Declaring a search index","Language","Running a search query","Matching rules","Filter fields","Relevance ordering, .take(n) and pagination","Limits","Backfill and staged"],id:"concepts/search",summary:"Declare a search index on a table and run relevance-ordered full-text queries.",title:"Full-text search"},{headings:["The HTTP edge","Auth, cookies, and secrets","Protecting public procedures","Securing sharded access","Advisor catalog","Config-time validation"],id:"concepts/security",summary:"Lunora's secure-by-default posture \u2014 the protections you get for free, how to opt out, and the advisor lints that catch the gaps.",title:"Security"},{headings:["From an SSR loader","From a script","From the terminal","From Python","From any language, over HTTP","Writing a new SDK"],id:"concepts/server-clients",summary:"Calling a Lunora deployment without a live subscription \u2014 from SSR loaders, scripts, other languages, or plain HTTP.",title:"Server-side & non-reactive clients"},{headings:["Declare a service","Call it from an action","What Lunora wires","Test an action that calls one","Make the service private","Smart Placement","Platforms","Migrating from URLs and HMAC"],id:"concepts/services",summary:"Call sibling Cloudflare Workers from actions over typed service bindings, run them in one dev session, and deploy them before the app.",title:"Services"},{headings:["When to shard","Migrating a populated table","What stays in the root DO","Going global","Cross-shard reads","The shard registry","Securing shard access"],id:"concepts/sharding",summary:"Default __root__ DO, opt-in .shardBy(), and .global() escape hatch.",title:"Sharding"},{headings:["The one caveat that matters","The read surface","_scheduled_functions","_storage"],id:"concepts/system-tables",summary:"Read pending scheduled jobs and stored file metadata through ctx.db.system \u2014 a read-only, eventually consistent view outside the mutation sn",title:"System tables"},{headings:["Install","Configure","Write a test","Run in CI"],id:"concepts/testing-ai-features",summary:"Drive a Lunora app's AI flows in a real browser with the e2e runner, and judge non-deterministic model output with natural-language assertio",title:"Testing AI features end to end"},{headings:["The in-memory harness","Asserting reactive results","Mail-catcher helpers (E2E)","Running in CI"],id:"concepts/testing",summary:"Unit-test queries, mutations, and actions in memory with lunoraTest \u2014 no worker, no network.",title:"Testing"},{headings:["Declaring a TTL","Sweep semantics: coarse, batched, bounded","Not on .global() tables","Interaction with soft delete","How the Advisors catch TTL mistakes"],id:"concepts/ttl",summary:"Declare a table-level .ttl() so a DO alarm sweep auto-deletes expired rows \u2014 sessions, OTPs, and other ephemeral data.",title:"TTL & auto-expiry"},{headings:["Where types come from","Do not restate what is inferred","Reach for Doc and Id","Pin the client contract with .output()","Optional versus null in types","Bringing your own validators","Project configuration","Keeping types honest in CI"],id:"concepts/typescript",summary:"Getting the most out of Lunora's end-to-end types \u2014 where types come from, what to annotate, and what to let inference do.",title:"TypeScript"},{headings:["Job 1: column types in defineTable","Job 2: argument and return validation","Return-type inference to the client","Common validators","Coming from zod","ValidationError"],id:"concepts/validation",summary:"The v.* validators that type your columns and parse query / mutation / action inputs and outputs end to end.",title:"Validation"},{headings:["Declaring an index","Automatic write sync","ctx.vectors","RAG with @lunora/ai","Binding & config wiring"],id:"concepts/vector-search",summary:"Typed Vectorize indexes on ctx.vectors \u2014 automatic write sync, similarity search, and RAG with embeddings.",title:"Vector search"},{headings:["The specification","Conformance fixtures","SDKs built on it"],id:"concepts/wire-protocol",summary:"The language-independent Lunora client\u2194server wire protocol and the golden fixtures every SDK is tested against.",title:"Wire protocol"},{headings:["wrangler.jsonc","lunora.config.ts","Secrets","Containers","Deploy","Durable Object class limit","Worker size","Streaming logs"],id:"deployment",summary:"Wrangler bindings, secrets, and the deploy flow.",title:"Deployment"},{headings:["Redacted codes","Build-time errors","Throwing your own","Error codes"],id:"errors",summary:"Every well-known Lunora error code \u2014 its HTTP status, what it means, and what to do about it.",title:"Errors & warnings reference"},{headings:["Branching on one","The same number, in the document","Where the numbers come from","From your own code"],id:"exit-codes",summary:"The exit code every lunora command terminates with \u2014 what each number means, and how it is derived from the error catalog.",title:"CLI exit codes"},{headings:["Install","Provide the client","Live queries","Mutations","Connection status","Reactive loaders"],id:"frameworks/angular",summary:"Use Lunora with Angular \u2014 provideLunora in your app config, signal-based liveQuery, imperative mutate, and a connectionStatus signal.",title:"Angular"},{headings:["Install","Exports","The integration","Single-worker composition with withLunora","Reactive-loader server helpers","Deploy"],id:"frameworks/astro",summary:"Compose Astro's @astrojs/cloudflare worker with Lunora realtime, plus reactive-loader server helpers for .astro frontmatter.",title:"Astro"},{headings:["One worker, two dispatch flows","Mount Lunora inside your framework","The per-framework matrix","Client adapters","Scaffolding","Vite composition"],id:"frameworks/bring-your-framework",summary:"Compose any meta-framework's SSR with Lunora realtime in one Cloudflare Worker.",title:"Bring your framework"},{headings:["One worker, two dispatch flows","Class A: Lunora owns the worker entry","Class B: the framework owns the CF adapter","Class C: SPA / SSR-less","Wrangler reconciliation"],id:"frameworks/deploy",summary:"One worker, one deploy \u2014 how a composed Lunora + meta-framework app ships to Cloudflare.",title:"Deploy your framework"},{headings:["Why two workers","Wiring them together","Client and server entry points","Loading data in a Server Component","Providing the client","Developing","Deploying"],id:"frameworks/nextjs",summary:"Run Lunora alongside Next.js on Cloudflare with the two-worker split \u2014 RSC loaders that hydrate into live subscriptions.",title:"Next.js"},{headings:["Install","Setup","How it works","Provide the client","Reactive loaders","Feature flags","Verify before deploy","Alternative: two-worker split"],id:"frameworks/nuxt",summary:"Run Lunora and Nuxt as one Cloudflare Worker \u2014 the @lunora/nuxt module mounts /_lunora/** into Nitro, plus reactive-loader server helpers.",title:"Nuxt"},{headings:["Scaffold a new app","Install","Create the client","Provide it","Live queries and mutations","HTTP streams","Local-first (shapes, custom mutators, TanStack DB)","Authentication (better-auth + Expo)"],id:"frameworks/react-native",summary:"Use Lunora in a React Native / Expo app \u2014 the same live hooks, plus an AsyncStorage-backed client and a better-auth Expo bridge.",title:"React Native / Expo"},{headings:["Install","Provide the client","Live queries","Mutations","Auth","Reactive loaders","One worker, one deploy"],id:"frameworks/react",summary:"Use Lunora with React \u2014 a provider, live useQuery/useMutation hooks, and the SSR-seed \u2192 live reactive-loader handoff.",title:"React"},{headings:["The problem with static loaders","The handoff","Why there's no flash","Identity continuity (SSR \u2192 client)","Sharding carries through","Status"],id:"frameworks/reactive-loaders",summary:"Your loaders are live \u2014 SSR data that hydrates into a real-time subscription with no flash.",title:"Reactive loaders"},{headings:["Install","Solid 1.x and Solid 2.0","Provide the client","Live queries","Mutations","Reactive loaders"],id:"frameworks/solid",summary:"Use Lunora with SolidJS \u2014 a provider, live createQuery/createMutation primitives, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Solid"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","One worker, one deploy"],id:"frameworks/svelte",summary:"Use Lunora with Svelte 5 / SvelteKit \u2014 context-provided client, live query/mutation stores, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Svelte"},{headings:["What you're proving","1. Scaffold","2. Dev","3. Prove SSR preload (curl the raw HTML)","4. Prove the live subscription attaches","5. Prove live update (two tabs)","Identity check (optional, with auth)",'What "pass" looks like'],id:"frameworks/verify-live-loaders",summary:"How to actually prove live loaders work \u2014 scaffold, SSR-curl the preloaded value, two-tab live update.",title:"Manual end-to-end verification"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","Worker composition"],id:"frameworks/vue",summary:"Use Lunora with Vue 3 \u2014 a client plugin, live useQuery/useMutation composables, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Vue"},{headings:["Requirements"],id:"getting-started",summary:"Scaffold a Lunora app and run the dev loop in under a minute.",title:"Getting started"},{headings:["Durable Objects","Statement limits (Durable Objects **and** D1)","D1","R2","Workers","Worker startup (error 10021)","Queues","Pipelines"],id:"limits",summary:"Cloudflare ceilings you should keep in your head.",title:"Limits"},{headings:["Two translations, not one","Schema: transposing the relation graph","Procedures: the shape deltas","Writes: .returning() does not survive","Components decompose by hand"],id:"migrating/from-a-convex-toolkit",summary:"The second translation step a Drizzle-style schema DSL and a tRPC-style procedure builder add on top of the raw Convex mapping.",title:"Migrating from a Convex toolkit"},{headings:["Bump strategy","Breaking changes already landed","Recommended (non-breaking) follow-ups","See also"],id:"migrating/from-alpha",summary:"How a 1.0.0-alpha.* app moves to stable \u2014 dependency bumps plus every breaking change already landed on the road to 1.0.",title:"Upgrading from alpha to 1.0"},{headings:["At a glance","Schema","Queries, mutations, actions","React","Auth","Scheduler","File storage","Subscriptions"],id:"migrating/from-convex",summary:"Side-by-side mapping \u2014 schema, queries, mutations, actions, React hooks.",title:"Migrating from Convex"},{headings:["At a glance","Schema","Reads: onSnapshot \u2192 useQuery","Writes: setDoc \u2192 mutation","Cloud Functions \u2192 actions","Auth","File storage","Scheduled work"],id:"migrating/from-firebase",summary:"Side-by-side mapping \u2014 Firestore, Cloud Functions, Auth, Storage, and real-time listeners.",title:"Migrating from Firebase"},{headings:["At a glance","Schema","Reads: supabase.from(...).select() \u2192 useQuery","Writes: .insert() \u2192 mutation","Row-level security","Edge Functions \u2192 actions","Auth","File storage"],id:"migrating/from-supabase",summary:"Side-by-side mapping \u2014 Postgres tables, RLS, Edge Functions, Auth, Storage, and Realtime.",title:"Migrating from Supabase"},{headings:["No arbitrary external SQL or ad-hoc cross-dataset joins","RPC-first, not REST-first","Cross-shard writes are eventual, not atomic","No data warehouse hosting in the framework","No managed control plane as a hard dependency","Also deliberately absent","See also"],id:"non-goals",summary:"The things Lunora deliberately does not do \u2014 each with the reason it's a boundary and the escape hatch when you need past it.",title:"Design boundaries"},{headings:["Why Lunora","Own it, or let us run it","How Lunora compares","Where it's rough","What ships in v1.0.0-alpha.1","Start building"],id:"overview",summary:"The Convex-style real-time backend that runs on your own Cloudflare account \u2014 typed end to end, live by default, ~$0 at idle.",title:"Overview"},{headings:["Bindings and wrangler config","Secrets","LUNORA_ADMIN_TOKEN and the admin plane","Rate limiting and abuse","Auth and row-level security","Migrations","Observability","Health and readiness endpoint"],id:"production-checklist",summary:"Everything to verify before a Lunora app takes real traffic \u2014 bindings, secrets, admin tokens, rate limits, RLS, migrations, observability.",title:"Production checklist"},{headings:["Pick a starting point","Adding Lunora to an app you already have","What you get either way","Next steps"],id:"quickstarts",summary:"Every starting point Lunora scaffolds \u2014 pick your framework, run one command, and get a live backend wired to it.",title:"Quickstarts"},{headings:["1. See where you stand","2. Create the usage alerts","3. Add the budget alert by hand","4. Check delivery","In CI"],id:"runaway-bill",summary:"Set Cloudflare usage alerts well above normal with `lunora cloudflare alerts`, add the budget alert the API cannot, and check what actually ",title:"Protect yourself from a runaway bill"},{headings:["Why startup grows with the app","Measure it locally","The fix: load function modules on demand","Keep heavy packages off the startup path"],id:"startup-cpu-limit",summary:'Why a large app fails to deploy with "Script startup exceeded CPU time limit", how to measure it, and how lazy function loading and lighter ',title:"Worker startup CPU limit (error 10021)"},{headings:["1. Scaffold","2. Model the data","3. Generate the migration","4. Write the query","5. Write the mutation","6. Wire the React app","7. Run the dev loop","8. Deploy"],id:"tutorial/realtime-chat",summary:"End-to-end Lunora walkthrough \u2014 schema, query, mutation, subscription, React, sharding.",title:"Build a real-time chat app in 15 minutes"},{headings:["Know when to act","Step 1: shard the messages","Step 2: put identities in a global table","Step 3: keep fan-out off the hot path","Step 4: lock down shard access","Step 5: migrate the data you already have","Checking your work","What you learned"],id:"tutorial/scaling",summary:"Take the chat app from one Durable Object to many \u2014 shard by channel, put identities in a global table, and keep cross-shard reads off the h",title:"Tutorial: scaling the chat app"},{headings:["Release channels","What SemVer means here","Stability tiers",'What "experimental" means',"See also"],id:"versioning",summary:"What SemVer means for Lunora packages \u2014 release channels, stability tiers, and the experimental surface.",title:"Versioning & stability"}],l="https://lunora.sh/docs/",u=4,m=3,g=200,p=4,y=3,f=2,w=1,v=r(t=>t.slice(0,g).toLowerCase().split(/[^a-z0-9.]+/u).filter(a=>a.length>=m),"w"),b=r((t,a)=>{let i=t.id.toLowerCase(),e=t.title.toLowerCase(),s=t.summary.toLowerCase(),c=t.headings.map(n=>n.toLowerCase()),o=0;for(let n of a)i.includes(n)&&(o+=p),e.includes(n)&&(o+=y),c.some(h=>h.includes(n))&&(o+=f),s.includes(n)&&(o+=w);return o},"v"),k=r(t=>{let a=v(typeof t=="string"?t:""),i=a.length===0?[]:d.map(e=>({candidate:e,rank:b(e,a)})).filter(e=>e.rank>0).sort((e,s)=>s.rank-e.rank).slice(0,u).map(e=>({...e.candidate,url:`${l}${e.candidate.id}`}));return{entries:i.length===0?d.map(e=>e.id):i}},"b"),S=r(t=>{let{entries:a}=k(t);return a.every(i=>typeof i=="string")?[`Documentation pages under ${l}: ${a.join(", ")}`]:a.map(i=>{let e=i;return`${e.title} (${e.url}): ${e.summary} Sections: ${e.headings.join(", ")}`})},"k");export{S as knowledgeExcerpts};
|