@lunora/studio 1.0.0-alpha.349 → 1.0.0-alpha.350
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/README.md +3 -3
- package/dist/index.d.mts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.mjs +1 -1
- package/dist/mount.d.mts +3 -2
- package/dist/mount.d.ts +3 -2
- 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/DeploymentHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +5 -5
- package/dist/packem_chunks/FileBrowser.mjs +3 -3
- 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 +7 -7
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/agents-panel.mjs +1 -1
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
- package/dist/packem_chunks/analytics-panel.mjs +1 -1
- package/dist/packem_chunks/architecture-panel.mjs +1 -1
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/auth-config-panel.mjs +1 -1
- package/dist/packem_chunks/auth-sessions-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/organizations-panel.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/sync-client-panel.mjs +1 -1
- package/dist/packem_chunks/theme-indicator.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_chunks/users-panel.mjs +1 -1
- package/dist/packem_chunks/vector-browser.mjs +1 -1
- package/dist/packem_chunks/workflows-panel.mjs +1 -1
- package/dist/packem_shared/{ApiDocsPanel-Py7C4ibM.mjs → ApiDocsPanel-B_RaW7Br.mjs} +2 -2
- package/dist/packem_shared/ApiReferencePanel-u9Rrljdf.mjs +1 -0
- package/dist/packem_shared/{CommandPalette-CM1hqAOD.mjs → CommandPalette-5OsK8PNe.mjs} +1 -1
- package/dist/packem_shared/{ConfirmButton-DU4p72Er.mjs → ConfirmButton-CIXYF6Mg.mjs} +1 -1
- package/dist/packem_shared/{ConnectionBadge-B8Hj5DaE.mjs → ConnectionBadge-BfcoN-VE.mjs} +1 -1
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
- package/dist/packem_shared/{DataBrowser-DFjQeYYF.mjs → DataBrowser-Cc1qZX-4.mjs} +1 -1
- package/dist/packem_shared/{DataFilters-faurWYyX.mjs → DataFilters--ocFTVT2.mjs} +1 -1
- package/dist/packem_shared/GlobalDataBrowser-Hq6gTlkb.mjs +1 -0
- package/dist/packem_shared/{HomePanel-C8sb1fFJ.mjs → HomePanel-DeyYLVxc.mjs} +1 -1
- package/dist/packem_shared/MigrationsPanel-CMZYYcQ5.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-E9cDfHRv.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-D4CUj7aX.mjs +1 -0
- package/dist/packem_shared/{ShardInput-C6mjgAh4.mjs → ShardInput-CoySruKZ.mjs} +1 -1
- package/dist/packem_shared/Studio-BhTqTeGb.mjs +1 -0
- package/dist/packem_shared/StudioApp-B1d0beD4.mjs +1 -0
- package/dist/packem_shared/{StudioI18nProvider-fVsCSs5L.mjs → StudioI18nProvider-CGXCPnQn.mjs} +1 -1
- package/dist/packem_shared/{advisor-view-B8oIluyS.mjs → advisor-view-fNcNYW2Q.mjs} +1 -1
- package/dist/packem_shared/{app.d-D45VvUTx.d.mts → app.d-D425h1XO.d.mts} +4 -3
- package/dist/packem_shared/{app.d-D45VvUTx.d.ts → app.d-D425h1XO.d.ts} +4 -3
- package/dist/packem_shared/{auth-pager-DiDnXsfe.mjs → auth-pager-DW77WeZw.mjs} +1 -1
- package/dist/packem_shared/{data-grid-BHTuvSI7.mjs → data-grid-r3isM8Nq.mjs} +1 -1
- package/dist/packem_shared/{diagram-export-panel-BMLzao0Y.mjs → diagram-export-panel-aBDQdX4e.mjs} +1 -1
- package/dist/packem_shared/{error-alert-CNQjdAhi.mjs → error-alert-54TiaMvZ.mjs} +1 -1
- package/dist/packem_shared/{grid-features-8DoaKdS1.mjs → grid-features-2c5SaBtH.mjs} +1 -1
- package/dist/packem_shared/{grid-pagination-DgzyzfBh.mjs → grid-pagination-DY2erU65.mjs} +1 -1
- package/dist/packem_shared/home-panel-0XMGe1hP.mjs +3 -0
- package/dist/packem_shared/{live-status-BuJdUZFU.mjs → live-status-D1GasNsH.mjs} +1 -1
- package/dist/packem_shared/{recording-client-neIRrUNz.mjs → recording-client-MbGZ28I0.mjs} +1 -1
- package/dist/packem_shared/{reference-view-BrsL8UGn.mjs → reference-view-DCEC5kjY.mjs} +4 -4
- package/dist/packem_shared/{schema-diagram-ghsOCED7.mjs → schema-diagram-k7cFl7Wp.mjs} +1 -1
- package/dist/packem_shared/{sql-result-table-COsfUSGc.mjs → sql-result-table-CatgdmMh.mjs} +1 -1
- package/dist/packem_shared/studio-CA3ZKwVK.mjs +2 -0
- package/dist/packem_shared/{table-list-sidebar-B7IOSxLN.mjs → table-list-sidebar-nA7g7uSk.mjs} +1 -1
- package/dist/packem_shared/use-admin-query-BW9IuacC.mjs +1 -0
- package/dist/packem_shared/use-auth-config-KO9tnI39.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-DXnqbBs-.mjs +1 -0
- package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
- package/dist/standalone/chunk-26OKWFLO.js +1 -0
- package/dist/standalone/chunk-2EL4EMYZ.js +1 -0
- package/dist/standalone/chunk-2O6KKVH2.js +1 -0
- package/dist/standalone/{chunk-WX647YQ7.js → chunk-2WNL74MI.js} +3 -3
- package/dist/standalone/chunk-2X6O33OX.js +1 -0
- package/dist/standalone/chunk-2ZO7XY3Z.js +1 -0
- package/dist/standalone/{chunk-Y3AYVFTK.js → chunk-3GXPALXG.js} +1 -1
- package/dist/standalone/chunk-3Y5K3IQO.js +1 -0
- package/dist/standalone/{chunk-BOMPSVRC.js → chunk-4C4THJUD.js} +1 -1
- package/dist/standalone/{chunk-WVWCUB4S.js → chunk-4IEMXFUB.js} +1 -1
- package/dist/standalone/{chunk-5B2RTXBS.js → chunk-4SQBAPY6.js} +1 -1
- package/dist/standalone/{chunk-R6U22RSY.js → chunk-5DNGK3NT.js} +1 -1
- package/dist/standalone/{chunk-WOEHFC4J.js → chunk-5J32EGHF.js} +1 -1
- package/dist/standalone/chunk-5NZWQEEJ.js +1 -0
- package/dist/standalone/chunk-6I42AM75.js +1 -0
- package/dist/standalone/{chunk-RGMVGZV4.js → chunk-6M7FLLMT.js} +1 -1
- package/dist/standalone/{chunk-IWZ7GVQO.js → chunk-6QEXGYWH.js} +1 -1
- package/dist/standalone/chunk-7AZYREIY.js +1 -0
- package/dist/standalone/{chunk-G43F7LYA.js → chunk-7F3S5OQT.js} +1 -1
- package/dist/standalone/chunk-7MN724WR.js +1 -0
- package/dist/standalone/{chunk-Q6IT6ZD7.js → chunk-7RGYCU6F.js} +1 -1
- package/dist/standalone/{chunk-NRP22GKC.js → chunk-A566HCBX.js} +1 -1
- package/dist/standalone/{chunk-253UHWDX.js → chunk-AOHKAKKL.js} +1 -1
- package/dist/standalone/{chunk-OYCUPD3Q.js → chunk-AP4PC2M4.js} +1 -1
- package/dist/standalone/chunk-B3AXFXAD.js +1 -0
- package/dist/standalone/chunk-B7MHW3A5.js +1 -0
- package/dist/standalone/{chunk-CWPBPBWJ.js → chunk-BHOLL76W.js} +6 -6
- package/dist/standalone/{chunk-I57ZVLUB.js → chunk-BTRYFPZH.js} +1 -1
- package/dist/standalone/chunk-BVKQA5OL.js +1 -0
- package/dist/standalone/chunk-CGZVMM3P.js +1 -0
- package/dist/standalone/chunk-CIVMATZK.js +3 -0
- package/dist/standalone/chunk-CLINNLLE.js +1 -0
- package/dist/standalone/chunk-CTE6RPXC.js +1 -0
- package/dist/standalone/chunk-CW57Q264.js +1 -0
- package/dist/standalone/chunk-D7JK65OK.js +1 -0
- package/dist/standalone/{chunk-FUYEZFBP.js → chunk-DBVJ5VLI.js} +1 -1
- package/dist/standalone/{chunk-XCYFP44W.js → chunk-DS7HZKZ2.js} +1 -1
- package/dist/standalone/{chunk-2WDKJ74A.js → chunk-DX55P3KZ.js} +1 -1
- package/dist/standalone/{chunk-55UGUCQ6.js → chunk-E26OT26O.js} +1 -1
- package/dist/standalone/{chunk-YUPEDAX3.js → chunk-E32FS6PE.js} +2 -2
- package/dist/standalone/chunk-E3VSRIQU.js +1 -0
- package/dist/standalone/chunk-EDGOSJXL.js +1 -0
- package/dist/standalone/chunk-EOR73TZZ.js +1 -0
- package/dist/standalone/chunk-F5LTDUMB.js +1 -0
- package/dist/standalone/chunk-FLVDICZL.js +1 -0
- package/dist/standalone/{chunk-5J4FLDJH.js → chunk-FPIUVV7Q.js} +1 -1
- package/dist/standalone/chunk-GMW2DYFU.js +1 -0
- package/dist/standalone/{chunk-VFFW3ANI.js → chunk-GPOSJNMV.js} +5 -5
- package/dist/standalone/chunk-GQYA5W5T.js +1 -0
- package/dist/standalone/chunk-HFYFYNSX.js +1 -0
- package/dist/standalone/chunk-HKLF627N.js +1 -0
- package/dist/standalone/{chunk-PSMQQV6S.js → chunk-HKPDPKXD.js} +1 -1
- package/dist/standalone/chunk-HLAAOW33.js +1 -0
- package/dist/standalone/{chunk-75M6ZLLS.js → chunk-HOPAJ5F6.js} +2 -2
- package/dist/standalone/{chunk-7Y3SY37W.js → chunk-IBJVVHV5.js} +1 -1
- package/dist/standalone/{chunk-VESGIGMQ.js → chunk-IH2CJZF2.js} +1 -1
- package/dist/standalone/chunk-JAHK7RRJ.js +1 -0
- package/dist/standalone/chunk-JG2C7SS2.js +1 -0
- package/dist/standalone/chunk-JGMQQ3S7.js +1 -0
- package/dist/standalone/{chunk-3YXASVTP.js → chunk-JTGGWF7R.js} +1 -1
- package/dist/standalone/chunk-KFNDET5D.js +1 -0
- package/dist/standalone/{chunk-NXQW5E6W.js → chunk-KRPXOSBL.js} +1 -1
- package/dist/standalone/{chunk-7Q256NLI.js → chunk-KYONGQQ4.js} +1 -1
- package/dist/standalone/{chunk-OPM7ESDV.js → chunk-LIGOLZND.js} +1 -1
- package/dist/standalone/{chunk-VQRCJJXS.js → chunk-LKCO3E2B.js} +1 -1
- package/dist/standalone/chunk-LOV52GLG.js +1 -0
- package/dist/standalone/chunk-LPINY2IJ.js +19 -0
- package/dist/standalone/{chunk-XKISL2CG.js → chunk-LRXCL6IA.js} +1 -1
- package/dist/standalone/{chunk-OQ6I6OXT.js → chunk-LUHXNZI4.js} +1 -1
- package/dist/standalone/chunk-MD67S53Z.js +1 -0
- package/dist/standalone/{chunk-HIJGQX6F.js → chunk-MDAXV2XH.js} +1 -1
- package/dist/standalone/{chunk-ZN7TURF4.js → chunk-MFNO5BFR.js} +1 -1
- package/dist/standalone/chunk-MMJTKSHL.js +1 -0
- package/dist/standalone/chunk-NMVFSJM7.js +1 -0
- package/dist/standalone/chunk-NVHHB5EV.js +2 -0
- package/dist/standalone/chunk-O3FDK56W.js +1 -0
- package/dist/standalone/{chunk-C7FJ2JKY.js → chunk-OECMBE6Q.js} +1 -1
- package/dist/standalone/chunk-OSJ7HV7B.js +1 -0
- package/dist/standalone/chunk-OUFWXYEF.js +1 -0
- package/dist/standalone/chunk-OXFKZ4BM.js +1 -0
- package/dist/standalone/{chunk-63QLK2KW.js → chunk-P5GAJKDW.js} +1 -1
- package/dist/standalone/chunk-P6L6ABWO.js +1 -0
- package/dist/standalone/chunk-PZZWUL5U.js +1 -0
- package/dist/standalone/chunk-QAQVT4FS.js +1 -0
- package/dist/standalone/{chunk-VCFEO3RI.js → chunk-R36QXQZX.js} +1 -1
- package/dist/standalone/chunk-R3KLR5EP.js +1 -0
- package/dist/standalone/chunk-RXVXXRYD.js +1 -0
- package/dist/standalone/chunk-S7XAAH7U.js +1 -0
- package/dist/standalone/{chunk-E4PXACVL.js → chunk-SDQH4HR6.js} +1 -1
- package/dist/standalone/chunk-SFY646MC.js +1 -0
- package/dist/standalone/{chunk-VDC6JP4A.js → chunk-SJLEEYCR.js} +1 -1
- package/dist/standalone/{chunk-ZKJS6EBE.js → chunk-SLIDAWNX.js} +1 -1
- package/dist/standalone/chunk-SOO2HXV6.js +1 -0
- package/dist/standalone/chunk-SXD6JQXF.js +1 -0
- package/dist/standalone/{chunk-AUGKHAMQ.js → chunk-SYGCASPT.js} +1 -1
- package/dist/standalone/{chunk-2I4NHEKA.js → chunk-TDVDZ7XQ.js} +1 -1
- package/dist/standalone/chunk-TRZTGE4R.js +1 -0
- package/dist/standalone/chunk-TWMS2TMF.js +1 -0
- package/dist/standalone/chunk-U76DVXTR.js +21 -0
- package/dist/standalone/chunk-UTX6IBA3.js +1 -0
- package/dist/standalone/chunk-UZIBQZ2F.js +1 -0
- package/dist/standalone/chunk-VB6YJKPA.js +1 -0
- package/dist/standalone/{chunk-CVXNHIQW.js → chunk-VEWQWS3J.js} +1 -1
- package/dist/standalone/{chunk-UC7MNI2F.js → chunk-W2BCSK5S.js} +1 -1
- package/dist/standalone/chunk-W2XSKODB.js +1 -0
- package/dist/standalone/{chunk-MVWZMWPD.js → chunk-W7MRISE3.js} +1 -1
- package/dist/standalone/chunk-W7Z35E2E.js +1 -0
- package/dist/standalone/chunk-WIET27J3.js +1 -0
- package/dist/standalone/chunk-WQGT24W6.js +1 -0
- package/dist/standalone/{chunk-GZEWLX7U.js → chunk-WS36BO4R.js} +1 -1
- package/dist/standalone/chunk-WZTY3ZYI.js +1 -0
- package/dist/standalone/chunk-X5KWBDTF.js +1 -0
- package/dist/standalone/chunk-X74GEPSG.js +1 -0
- package/dist/standalone/chunk-XBZUJDHD.js +1 -0
- package/dist/standalone/chunk-XMEVNOCA.js +1 -0
- package/dist/standalone/chunk-XWEDIIIT.js +1 -0
- package/dist/standalone/{chunk-GHQ2VDI2.js → chunk-XYR5NST4.js} +1 -1
- package/dist/standalone/{chunk-XGCIDUJF.js → chunk-YHTHRYP5.js} +1 -1
- package/dist/standalone/{chunk-RX755NMO.js → chunk-YJ2WHOGO.js} +1 -1
- package/dist/standalone/chunk-YJWR6ZWC.js +1 -0
- package/dist/standalone/{chunk-CGQMJYCW.js → chunk-Z5EV64KS.js} +1 -1
- package/dist/standalone/{chunk-LVIL2SFA.js → chunk-ZBFWT34B.js} +1 -1
- package/dist/standalone/{chunk-AUAECCXB.js → chunk-ZBON5T5A.js} +1 -1
- package/dist/standalone/chunk-ZGSL4DPP.js +1 -0
- package/dist/standalone/chunk-ZMQ6PKLN.js +1 -0
- package/dist/standalone/{chunk-SJQERRSZ.js → chunk-ZTOREMGH.js} +1 -1
- package/dist/standalone/chunk-ZTOXQK4V.js +1 -0
- package/dist/standalone/chunk-ZWDORIZY.js +1 -0
- package/dist/standalone/chunk-ZZAJHNZ6.js +1 -0
- package/dist/standalone/studio.js +1 -1
- package/package.json +5 -5
- package/dist/packem_chunks/sparkline.mjs +0 -1
- package/dist/packem_shared/ApiReferencePanel-DlYVADAy.mjs +0 -1
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DvhNw0BI.mjs +0 -1
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +0 -1
- package/dist/packem_shared/GlobalDataBrowser-CPfjubP_.mjs +0 -1
- package/dist/packem_shared/MigrationsPanel-Dzjf42y8.mjs +0 -1
- package/dist/packem_shared/OpenRpcReferencePanel-nYyfjjse.mjs +0 -1
- package/dist/packem_shared/ScheduledJobs-BJ1uZW1U.mjs +0 -1
- package/dist/packem_shared/Studio-CgqntIfx.mjs +0 -1
- package/dist/packem_shared/StudioApp-DfFjQPGJ.mjs +0 -1
- package/dist/packem_shared/home-panel-BJXZsAaD.mjs +0 -3
- package/dist/packem_shared/studio-CFSjGWyw.mjs +0 -2
- package/dist/packem_shared/use-admin-query-CLStXJ7v.mjs +0 -1
- package/dist/packem_shared/use-auth-config-DtZeS_qf.mjs +0 -1
- package/dist/packem_shared/use-sql-assistant-DxNeNdCs.mjs +0 -1
- package/dist/standalone/chunk-2IKDEUCX.js +0 -1
- package/dist/standalone/chunk-37WYCOQ2.js +0 -1
- package/dist/standalone/chunk-4H5PBJNF.js +0 -1
- package/dist/standalone/chunk-4UBF7HMZ.js +0 -1
- package/dist/standalone/chunk-533J6WYA.js +0 -1
- package/dist/standalone/chunk-5QR2SQIS.js +0 -1
- package/dist/standalone/chunk-5ZNIQENA.js +0 -1
- package/dist/standalone/chunk-63Z6OJ6G.js +0 -1
- package/dist/standalone/chunk-74IYYDDI.js +0 -19
- package/dist/standalone/chunk-7EHAUFJY.js +0 -2
- package/dist/standalone/chunk-7G4Z6Q7X.js +0 -1
- package/dist/standalone/chunk-7RKB5KS7.js +0 -1
- package/dist/standalone/chunk-7TN6VTTF.js +0 -1
- package/dist/standalone/chunk-AWWECTQT.js +0 -1
- package/dist/standalone/chunk-AXL4YZJR.js +0 -1
- package/dist/standalone/chunk-COK5BCWN.js +0 -1
- package/dist/standalone/chunk-CULVXE3K.js +0 -1
- package/dist/standalone/chunk-E4BAGQ53.js +0 -1
- package/dist/standalone/chunk-EBTYSPZB.js +0 -1
- package/dist/standalone/chunk-EC5PMSQ6.js +0 -1
- package/dist/standalone/chunk-ECY2JC5F.js +0 -1
- package/dist/standalone/chunk-EWMBX5N2.js +0 -1
- package/dist/standalone/chunk-FPI7AMQJ.js +0 -1
- package/dist/standalone/chunk-GC5UHRDR.js +0 -1
- package/dist/standalone/chunk-GRHO2IUN.js +0 -1
- package/dist/standalone/chunk-GUDC24NJ.js +0 -1
- package/dist/standalone/chunk-H467GBSD.js +0 -1
- package/dist/standalone/chunk-HBO4SMAO.js +0 -15
- package/dist/standalone/chunk-HBTGWHTW.js +0 -1
- package/dist/standalone/chunk-HCTJKP5J.js +0 -1
- package/dist/standalone/chunk-HZTJLEIJ.js +0 -1
- package/dist/standalone/chunk-I26MS5PJ.js +0 -1
- package/dist/standalone/chunk-IRKWOUXO.js +0 -1
- package/dist/standalone/chunk-IUSKFS3B.js +0 -1
- package/dist/standalone/chunk-K2EHRNYW.js +0 -1
- package/dist/standalone/chunk-L5MI4PTP.js +0 -1
- package/dist/standalone/chunk-LXCVA5SP.js +0 -1
- package/dist/standalone/chunk-LYQZERWS.js +0 -1
- package/dist/standalone/chunk-MPEIBWCJ.js +0 -1
- package/dist/standalone/chunk-NCFYQR4L.js +0 -1
- package/dist/standalone/chunk-NCPW7WHO.js +0 -1
- package/dist/standalone/chunk-NOS2OC45.js +0 -1
- package/dist/standalone/chunk-NQZALRU3.js +0 -1
- package/dist/standalone/chunk-OQ2ORNN6.js +0 -1
- package/dist/standalone/chunk-OVBYLXPD.js +0 -1
- package/dist/standalone/chunk-OWQHP4KI.js +0 -1
- package/dist/standalone/chunk-PKSRXFSZ.js +0 -1
- package/dist/standalone/chunk-Q6ED4KUL.js +0 -1
- package/dist/standalone/chunk-QAQDMS6R.js +0 -1
- package/dist/standalone/chunk-QC2GLF3I.js +0 -1
- package/dist/standalone/chunk-QFK4UI4Q.js +0 -1
- package/dist/standalone/chunk-QJ4AALXU.js +0 -1
- package/dist/standalone/chunk-QJLHH3ET.js +0 -1
- package/dist/standalone/chunk-R3RBUT32.js +0 -1
- package/dist/standalone/chunk-RNYOBPQA.js +0 -1
- package/dist/standalone/chunk-RWVIV3U7.js +0 -1
- package/dist/standalone/chunk-RYBLB23Z.js +0 -1
- package/dist/standalone/chunk-S3EWTSAN.js +0 -1
- package/dist/standalone/chunk-S4AR74DJ.js +0 -3
- package/dist/standalone/chunk-S4Z7K55A.js +0 -1
- package/dist/standalone/chunk-SA2OGF3F.js +0 -1
- package/dist/standalone/chunk-SFMIR4YV.js +0 -1
- package/dist/standalone/chunk-SROQCZ3P.js +0 -1
- package/dist/standalone/chunk-T4SIZOJG.js +0 -1
- package/dist/standalone/chunk-U37BPX5J.js +0 -1
- package/dist/standalone/chunk-UFZVSXRW.js +0 -1
- package/dist/standalone/chunk-UQWGBWQ3.js +0 -1
- package/dist/standalone/chunk-V6LPISRQ.js +0 -1
- package/dist/standalone/chunk-WEPM5G3R.js +0 -1
- package/dist/standalone/chunk-WGBAHXMK.js +0 -1
- package/dist/standalone/chunk-WGUN4FNJ.js +0 -1
- package/dist/standalone/chunk-WJRYEML4.js +0 -1
- package/dist/standalone/chunk-WNMY5ZKL.js +0 -1
- package/dist/standalone/chunk-YBDF3DET.js +0 -7
- package/dist/standalone/chunk-YJI56OCF.js +0 -1
package/dist/packem_shared/{diagram-export-panel-BMLzao0Y.mjs → diagram-export-panel-aBDQdX4e.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{Download01Icon as k}from"@hugeicons/core-free-icons";import{HugeiconsIcon as j}from"@hugeicons/react";import{getNodesBounds as N,getViewportForBounds as A,useNodes as L,useReactFlow as O,Panel as R}from"@xyflow/react";import{useState as x}from"react";import{LunoraError as U}from"@lunora/errors";import{toBlob as C,toSvg as M}from"html-to-image";import{useT as _}from"./DEFAULT_LOCALE-
|
|
2
|
+
import{Download01Icon as k}from"@hugeicons/core-free-icons";import{HugeiconsIcon as j}from"@hugeicons/react";import{getNodesBounds as N,getViewportForBounds as A,useNodes as L,useReactFlow as O,Panel as R}from"@xyflow/react";import{useState as x}from"react";import{LunoraError as U}from"@lunora/errors";import{toBlob as C,toSvg as M}from"html-to-image";import{useT as _}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as w,b as G}from"./internal-BXEjuLPN.mjs";import{d as I,D as F,c as H,b as f}from"./dropdown-menu-jLZenfWH.mjs";import{jsxs as p,jsx as g}from"react/jsx-runtime";const c=1920,m=1080,y=32,h=(e,r)=>{const o=globalThis.document.createElement("a");o.href=e,o.download=r,globalThis.document.body.append(o),o.click(),o.remove()},J=(e,r,o="schema-diagram.json")=>{const n={edges:r,exportedAt:new Date().toISOString(),nodes:e},s=JSON.stringify(n,void 0,2),a=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));h(a,o),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(a)},0)},v=(e,r,o,n)=>{const s=N(e),{x:a,y:i,zoom:t}=A(s,r,o,.1,2,n);return{transform:[a,i,t],zoom:t}},P=async(e,r,o="schema-diagram.png")=>{const{transform:n}=v(r,c,m,y),[s,a,i]=n,t=await C(e,{backgroundColor:"#ffffff",height:m,style:{transform:`translate(${s.toString()}px, ${a.toString()}px) scale(${i.toString()})`,transformOrigin:"top left",width:`${c.toString()}px`},width:c});if(t===null)throw new U("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(t);h(d,o),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},q=async(e,r,o="schema-diagram.svg")=>{const{transform:n}=v(r,c,m,y),[s,a,i]=n,t=await M(e,{backgroundColor:"#ffffff",height:m,style:{transform:`translate(${s.toString()}px, ${a.toString()}px) scale(${i.toString()})`,transformOrigin:"top left",width:`${c.toString()}px`},width:c});h(t,o)},to=({containerRef:e,filenameBase:r,testIdPrefix:o})=>{const n=_(),s=L(),{getEdges:a}=O(),[i,t]=x(null),[d,u]=x(null),b=l=>{u(n("Export failed: {message}",{message:G(l)}))},S=async()=>{const l=e.current?.querySelector(".react-flow__viewport");if(l){t("png");try{await P(l,s,`${r}.png`)}finally{t(null)}}},E=async()=>{const l=e.current?.querySelector(".react-flow__viewport");if(l){t("svg");try{await q(l,s,`${r}.svg`)}finally{t(null)}}},D=()=>{t("json");try{J(s,a(),`${r}.json`)}finally{t(null)}},T=()=>{u(null),w(S(),b)},$=()=>{u(null),w(E(),b)};return p(R,{position:"top-right",children:[p(I,{children:[p(F,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${o}-export-trigger`,disabled:i!==null,children:[g(j,{className:"size-3.5",icon:k,strokeWidth:2}),n("Export")]}),p(H,{align:"end",children:[g(f,{"data-testid":`${o}-export-png`,disabled:i!==null,onClick:T,children:n("PNG")}),g(f,{"data-testid":`${o}-export-svg`,disabled:i!==null,onClick:$,children:n("SVG")}),g(f,{"data-testid":`${o}-export-json`,disabled:i!==null,onClick:D,children:n("JSON")})]})]}),d!==null&&g("p",{className:"mt-1 max-w-64 text-right text-xs text-destructive","data-testid":`${o}-export-error`,role:"alert",children:d})]})};export{to as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O}from"react/compiler-runtime";import{flattenHint as j}from"@lunora/errors";import{useT as q}from"./DEFAULT_LOCALE-
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{flattenHint as j}from"@lunora/errors";import{useT as q}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{e as E,a as H,b as S}from"./internal-BXEjuLPN.mjs";import{o as T}from"./recording-client-MbGZ28I0.mjs";import{u as U}from"./operation-console-provider-DoloEvon.mjs";import{A as V}from"./alert-PB5W11MM.mjs";import{jsx as h,jsxs as D}from"react/jsx-runtime";const K=I=>{const e=O(42),{className:N,error:t,testId:g}=I,C=q(),o=U();let i,s,n,a,c,m,r,l,f;if(e[0]!==N||e[1]!==t||e[2]!==o||e[3]!==g){const A=E(t);let b;e[13]!==t?(b=H(t),e[13]=t,e[14]=b):b=e[14],s=b;let w;e[15]!==t?(w=T(t),e[15]=t,e[16]=w):w=e[16];const k=w,v=t?.why;let y;e[17]!==o||e[18]!==k?(y=()=>{o?.openConsole({errorsOnly:!0,seq:k})},e[17]=o,e[18]=k,e[19]=y):y=e[19],n=y,i=V,a=N,c=g,m="destructive";let d;e[20]!==t?(d=S(t),e[20]=t,e[21]=d):d=e[21],e[22]!==d?(r=h("p",{className:"font-medium",children:d}),e[22]=d,e[23]=r):r=e[23],e[24]!==v?(l=typeof v=="string"?h("p",{className:"mt-1 text-xs opacity-90",children:v}):null,e[24]=v,e[25]=l):l=e[25],f=A===void 0?null:h("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:j(A)}),e[0]=N,e[1]=t,e[2]=o,e[3]=g,e[4]=i,e[5]=s,e[6]=n,e[7]=a,e[8]=c,e[9]=m,e[10]=r,e[11]=l,e[12]=f}else i=e[4],s=e[5],n=e[6],a=e[7],c=e[8],m=e[9],r=e[10],l=e[11],f=e[12];let p;e[26]!==s?(p=s===void 0?null:h("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:s,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[26]=s,e[27]=p):p=e[27];let u;e[28]!==o||e[29]!==n||e[30]!==C?(u=o===void 0?null:h("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:n,type:"button",children:C("Show in console")}),e[28]=o,e[29]=n,e[30]=C,e[31]=u):u=e[31];let x;return e[32]!==i||e[33]!==a||e[34]!==c||e[35]!==m||e[36]!==r||e[37]!==l||e[38]!==f||e[39]!==p||e[40]!==u?(x=D(i,{className:a,testId:c,variant:m,children:[r,l,f,p,u]}),e[32]=i,e[33]=a,e[34]=c,e[35]=m,e[36]=r,e[37]=l,e[38]=f,e[39]=p,e[40]=u,e[41]=x):x=e[41],x};export{K as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as v}from"react/compiler-runtime";import{useState as A,useEffect as Y}from"react";import{ConfirmButton as z}from"./ConfirmButton-
|
|
1
|
+
import{c as v}from"react/compiler-runtime";import{useState as A,useEffect as Y}from"react";import{ConfirmButton as z}from"./ConfirmButton-CIXYF6Mg.mjs";import{D as Q,a as I,b as O,c as H,d as P,e as V,f as U,g as F}from"./dropdown-menu-jLZenfWH.mjs";import{M as X}from"./modal-shell-CDztwLnv.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as B,g as Z,k as W,f as ee}from"./internal-BXEjuLPN.mjs";import{C as L}from"./control-button-BOZ5K-FC.mjs";import{jsx as m,jsxs as j}from"react/jsx-runtime";const q=l=>`"${l.replaceAll('"','""')}"`,te=/["\n\r,]/u,le=/^[=+\-@\t\r]/u,J=l=>{if(l==null)return"";let e;return typeof l=="string"?e=le.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=B(l),te.test(e)?`"${e.replaceAll('"','""')}"`:e},ne=(l,e)=>{const n=l.map(t=>J(t)).join(","),o=e.map(t=>l.map(c=>J(t[c])).join(","));return[n,...o].join(`
|
|
2
2
|
`)},oe=l=>JSON.stringify(l,W,2),G=500,K=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:B(l)).replaceAll("'","''")}'`,D="__doc__",se=(l,e,n,o)=>{if(e.length===0||n.length===0)return"";const t=o?.includes(D)===!0&&!e.includes(D)?e.filter(a=>!o.includes(a)):void 0,c=t===void 0?e:o,i=(a,u)=>K(t===void 0||u!==D?a[u]:JSON.stringify(Object.fromEntries(t.map(f=>[f,a[f]])),W)),s=c.map(a=>q(a)).join(", "),r=[];for(let a=0;a<n.length;a+=G){const u=n.slice(a,a+G).map(f=>` (${c.map(d=>i(f,d)).join(", ")})`).join(`,
|
|
3
3
|
`);r.push(`INSERT INTO ${q(l)} (${s}) VALUES
|
|
4
4
|
${u};`)}return r.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k}from"react/compiler-runtime";import{useT as M}from"./DEFAULT_LOCALE-
|
|
1
|
+
import{c as k}from"react/compiler-runtime";import{useT as M}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{jsxs as $,jsx as p}from"react/jsx-runtime";const w=[25,50,100,250],C=f=>{const e=k(18),{onChange:u,options:m,prefix:a,value:x}=f,t=M();let c;e[0]!==u?(c=h=>{u(Number.parseInt(h.target.value,10))},e[0]=u,e[1]=c):c=e[1];const n=c,b=`${a}-page-size`;let r;e[2]!==t?(r=t("Rows per page"),e[2]=t,e[3]=r):r=e[3];let o;e[4]!==r?(o=p("span",{children:r}),e[4]=r,e[5]=o):o=e[5];const d=`${a}-page-size`,l=`${a}-page-size`;let s;e[6]!==m?(s=m.map(E),e[6]=m,e[7]=s):s=e[7];let i;e[8]!==n||e[9]!==d||e[10]!==l||e[11]!==s||e[12]!==x?(i=p("select",{className:"h-6 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":d,id:l,onChange:n,value:x,children:s}),e[8]=n,e[9]=d,e[10]=l,e[11]=s,e[12]=x,e[13]=i):i=e[13];let g;return e[14]!==b||e[15]!==o||e[16]!==i?(g=$("label",{className:"flex items-center gap-1.5",htmlFor:b,children:[o,i]}),e[14]=b,e[15]=o,e[16]=i,e[17]=g):g=e[17],g},j=f=>{const e=k(25),{onJump:u,page:m,pages:a,prefix:x}=f,t=M();let c;e[0]!==u||e[1]!==a?(c=N=>{const P=Number.parseInt(N,10);Number.isNaN(P)||u(Math.min(Math.max(1,P),Math.max(1,a)))},e[0]=u,e[1]=a,e[2]=c):c=e[2];const n=c;let b;e[3]!==n?(b=N=>{N.key==="Enter"&&n(N.currentTarget.value)},e[3]=n,e[4]=b):b=e[4];const r=b;let o;e[5]!==n?(o=N=>{n(N.currentTarget.value)},e[5]=n,e[6]=o):o=e[6];const d=o;let l;e[7]!==t?(l=t("Page"),e[7]=t,e[8]=l):l=e[8];let s;e[9]!==t?(s=t("Page"),e[9]=t,e[10]=s):s=e[10];const i=`${x}-page-jump`,g=Math.max(1,a);let h;e[11]!==d||e[12]!==r||e[13]!==m||e[14]!==s||e[15]!==i||e[16]!==g?(h=p("input",{"aria-label":s,className:"h-6 w-12 rounded-md border border-border bg-background px-1 text-center tabular-nums outline-none focus-visible:border-ring","data-testid":i,defaultValue:m,max:g,min:1,onBlur:d,onKeyDown:r,type:"number"},m),e[11]=d,e[12]=r,e[13]=m,e[14]=s,e[15]=i,e[16]=g,e[17]=h):h=e[17];let v;e[18]!==a||e[19]!==t?(v=t("of {pages}",{pages:a}),e[18]=a,e[19]=t,e[20]=v):v=e[20];let y;return e[21]!==l||e[22]!==h||e[23]!==v?(y=$("span",{className:"flex items-center gap-1.5 tabular-nums",children:[l,h,v]}),e[21]=l,e[22]=h,e[23]=v,e[24]=y):y=e[24],y},_=({hasNext:f,hasPrevious:e,onJumpToPage:u,onNext:m,onPageSizeChange:a,onPrevious:x,pageSize:t,pageSizeOptions:c=w,prefix:n,rangeEnd:b,rangeStart:r,total:o})=>{const d=M(),l="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",s=t!==void 0&&t>0?Math.max(1,Math.ceil(o/t)):1,i=t!==void 0&&t>0?Math.floor(Math.max(0,r-1)/t)+1:1;return $("div",{className:"flex w-full items-center justify-between gap-3 text-xs text-muted-foreground",children:[$("div",{className:"flex items-center gap-3",children:[t!==void 0&&a!==void 0&&p(C,{onChange:a,options:c,prefix:n,value:t}),p("span",{className:"tabular-nums","data-testid":`${n}-page-info`,children:d("{rangeStart}-{rangeEnd} of {total}",{rangeEnd:b,rangeStart:r,total:o})})]}),$("div",{className:"flex items-center gap-3",children:[p("button",{className:l,"data-testid":`${n}-prev`,disabled:!e,onClick:x,type:"button",children:d("Previous")}),t!==void 0&&u!==void 0&&p(j,{onJump:u,page:i,pages:s,prefix:n}),p("button",{className:l,"data-testid":`${n}-next`,disabled:!f,onClick:m,type:"button",children:d("Next")})]})]})};function E(f){return p("option",{value:f,children:f},f)}export{_ as G};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as _}from"react/compiler-runtime";import{useNavigate as Xe}from"@tanstack/react-router";import{B as et}from"./badge-r_5B4LHP.mjs";import{C as P,a as tt}from"./card-By2O8ULa.mjs";import{E as nt}from"./empty-state-D7jEML_T.mjs";import{u as ve}from"./use-admin-query-BW9IuacC.mjs";import{useT as T}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as ye}from"./ADMIN_FUNCTIONS-B8yyk5BX.mjs";import{c as lt,f as Ne,d as at,w as rt,g as ot,n as it}from"./internal-BXEjuLPN.mjs";import{c as st}from"./utils-bhneXptQ.mjs";import{deriveInsights as ct}from"./DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs";import{useState as Ue,useEffect as qe}from"react";import{u as Ke}from"./use-studio-client-DCA50tF2.mjs";import{jsx as a,jsxs as h}from"react/jsx-runtime";import{B as He}from"./button-q0UYSmrn.mjs";const dt=lt(ye.studioFeatures),We={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,privacy:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},ut=t=>{if(t===null||typeof t!="object")return;const{id:e,name:n,unsupported:s}=t;if(!(typeof e!="string"||typeof n!="string"||!Array.isArray(s)))return{id:e,name:n,unsupported:s.filter(l=>typeof l=="string")}},mt=t=>{if(t===null||typeof t!="object")return We;const e=t,n=s=>typeof e[s]=="boolean"?e[s]:!0;return{analytics:n("analytics"),auth:n("auth"),containers:n("containers"),flags:n("flags"),kv:n("kv"),mail:n("mail"),notifications:n("notifications"),payments:n("payments"),privacy:n("privacy"),platform:ut(e.platform),queues:n("queues"),scheduler:n("scheduler"),storage:n("storage"),vectors:n("vectors"),workflows:n("workflows")}},ft={...We,settled:!1},pt=()=>{const t=_(3),e=Ke(),[n,s]=Ue(void 0);let l,r;return t[0]!==e?(l=()=>{const i=new AbortController;return Ne((async()=>{let o;try{o={...mt(await e.query(dt,{},at(""))),settled:!0}}catch{o={...We,settled:!0}}i.signal.aborted||s({client:e,features:o})})()),()=>{i.abort()}},r=[e],t[0]=e,t[1]=l,t[2]=r):(l=t[1],r=t[2]),qe(l,r),n?.client===e?n.features:ft},ht=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},gt=t=>{const e=_(24),{group:n}=t,s=T(),l=Xe();let r;e[0]!==n.tab||e[1]!==l?(r=()=>{Ne(l({to:`/${n.tab}`}))},e[0]=n.tab,e[1]=l,e[2]=r):r=e[2];const i=r,o=n.bindings.length;let c;e[3]!==n.label?(c=a("span",{className:"text-sm font-medium text-foreground",children:n.label}),e[3]=n.label,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=a(ht,{}),e[5]=u):u=e[5];let m;e[6]!==c?(m=h("div",{className:"flex items-center justify-between",children:[c,u]}),e[6]=c,e[7]=m):m=e[7];let d;e[8]!==o||e[9]!==s?(d=o===1?s("1 binding"):s("{count} bindings",{count:o}),e[8]=o,e[9]=s,e[10]=d):d=e[10];let f;e[11]!==d?(f=a("span",{className:"text-xs text-muted-foreground",children:d}),e[11]=d,e[12]=f):f=e[12];let p;e[13]!==o||e[14]!==n.bindings?(p=o>0&&a("div",{className:"flex flex-wrap gap-1.5",children:n.bindings.map(yt)}),e[13]=o,e[14]=n.bindings,e[15]=p):p=e[15];let g;e[16]!==m||e[17]!==f||e[18]!==p?(g=h(tt,{className:"flex flex-col gap-2 py-4",children:[m,f,p]}),e[16]=m,e[17]=f,e[18]=p,e[19]=g):g=e[19];let x;return e[20]!==n.testId||e[21]!==i||e[22]!==g?(x=a(P,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":n.testId,onClick:i,children:g}),e[20]=n.testId,e[21]=i,e[22]=g,e[23]=x):x=e[23],x},Ve=["kv","files","vectors"],xt=(t,e)=>[...t.filter(n=>n.tab!==e.tab),e].toSorted((n,s)=>Ve.indexOf(n.tab)-Ve.indexOf(s.tab)),bt=()=>{const t=_(19),e=Ke(),n=pt(),s=T();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[0]=l):l=t[0];const[r,i]=Ue(l);let o,c;if(t[1]!==e||t[2]!==n.kv||t[3]!==n.storage||t[4]!==n.vectors||t[5]!==s?(o=()=>{const g={cancelled:!1},x=[{enabled:n.kv,label:s("KV Namespaces"),load:async()=>(await e.listKvNamespaces()).map(vt),tab:"kv",testId:"home-binding-kv"},{enabled:n.storage,label:s("R2 Buckets"),load:()=>e.listStorageBuckets(),tab:"files",testId:"home-binding-r2"},{enabled:n.vectors,label:s("Vectorize Indexes"),load:async()=>(await e.listVectorIndexes()).map(Nt),tab:"vectors",testId:"home-binding-vectors"}];for(const b of x)b.enabled&&Ne((async()=>{try{const v=await b.load();if(!g.cancelled){const S={bindings:v,label:b.label,tab:b.tab,testId:b.testId};i(w=>xt(w,S))}}catch{}})());return()=>{g.cancelled=!0}},c=[e,n.kv,n.storage,n.vectors,s],t[1]=e,t[2]=n.kv,t[3]=n.storage,t[4]=n.vectors,t[5]=s,t[6]=o,t[7]=c):(o=t[6],c=t[7]),qe(o,c),r.length===0)return null;let u;t[8]!==s?(u=s("Bindings"),t[8]=s,t[9]=u):u=t[9];let m;t[10]!==u?(m=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=m):m=t[11];let d;t[12]!==r?(d=r.map(_t),t[12]=r,t[13]=d):d=t[13];let f;t[14]!==d?(f=a("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d}),t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==m||t[17]!==f?(p=h("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[m,f]}),t[16]=m,t[17]=f,t[18]=p):p=t[18],p};function yt(t){return a(et,{variant:"secondary",children:t},t)}function vt(t){return t.binding}function Nt(t){return t.name}function _t(t){return a(gt,{group:t},t.tab)}const St=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation — writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action — writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],wt=t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),kt=t=>{const e=St.map(n=>`- ${n.name} — ${n.summary}`).join(`
|
|
2
|
+
`);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
|
|
3
|
+
`)},Ct=1500,At=()=>{const t=_(40),e=T(),{url:n}=Ke();let s;t[0]!==n?(s=rt(n),t[0]=n,t[1]=s):s=t[1];const l=s,[r,i]=Ue(null);let o,c;t[2]!==r?(o=()=>{if(r===null)return;const I=globalThis.setTimeout(()=>{i(null)},Ct);return()=>{globalThis.clearTimeout(I)}},c=[r],t[2]=r,t[3]=o,t[4]=c):(o=t[3],c=t[4]),qe(o,c);let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=(I,L)=>{ot(L)&&i(I)},t[5]=u):u=t[5];const m=u;let d;t[6]!==l?(d=()=>{m("config",wt(l))},t[6]=l,t[7]=d):d=t[7];const f=d;let p;t[8]!==l?(p=()=>{m("prompt",kt(l))},t[8]=l,t[9]=p):p=t[9];const g=p;let x;t[10]!==e?(x=e("Connect an AI agent"),t[10]=e,t[11]=x):x=t[11];let b;t[12]!==x?(b=a("span",{className:"text-sm font-medium text-foreground",children:x}),t[12]=x,t[13]=b):b=t[13];let v;t[14]!==e?(v=e("Drive this deployment from an AI agent over the Model Context Protocol — it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[14]=e,t[15]=v):v=t[15];let S;t[16]!==v?(S=a("span",{className:"text-xs text-muted-foreground",children:v}),t[16]=v,t[17]=S):S=t[17];let w;t[18]!==b||t[19]!==S?(w=h("div",{className:"flex flex-col gap-1.5 p-4",children:[b,S]}),t[18]=b,t[19]=S,t[20]=w):w=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=a("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[21]=$):$=t[21];let y;t[22]!==r||t[23]!==e?(y=e(r==="config"?"Copied":"Copy MCP config"),t[22]=r,t[23]=e,t[24]=y):y=t[24];let k;t[25]!==f||t[26]!==y?(k=a(He,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:y}),t[25]=f,t[26]=y,t[27]=k):k=t[27];let C;t[28]!==r||t[29]!==e?(C=e(r==="prompt"?"Copied":"Copy agent prompt"),t[28]=r,t[29]=e,t[30]=C):C=t[30];let A;t[31]!==g||t[32]!==C?(A=a(He,{"data-testid":"home-connect-agent-copy-prompt",onClick:g,size:"xs",variant:"outline",children:C}),t[31]=g,t[32]=C,t[33]=A):A=t[33];let N;t[34]!==k||t[35]!==A?(N=h("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[$,h("div",{className:"flex flex-wrap gap-2",children:[k,A]})]}),t[34]=k,t[35]=A,t[36]=N):N=t[36];let M;return t[37]!==w||t[38]!==N?(M=h(P,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[w,N]}),t[37]=w,t[38]=N,t[39]=M):M=t[39],M},Mt=112,Qe=32,Le=5,Ge=1,$t=3,It=t=>{const e=t.slice(-16),n=Math.max(0,...e),s=Qe-Le*2,l=(Mt-Le*2)/e.length;return e.map((r,i)=>{const o=n>0?Math.max(0,r)/n*s:0;return{height:Math.max(0,o-$t),width:Math.max(0,l-Ge*2),x:Le+i*l+Ge,y:Qe-Le-o}})},Tt=t=>{const e=_(4),{data:n}=t;let s;e[0]!==n?(s=It(n).map(Lt),e[0]=n,e[1]=s):s=e[1];let l;return e[2]!==s?(l=a("svg",{"aria-hidden":"true",className:"h-8 w-28 fill-foreground","data-testid":"home-sparkline",viewBox:"0 0 112 32",children:s}),e[2]=s,e[3]=l):l=e[3],l};function Lt(t){return a("rect",{height:t.height,rx:2,width:t.width,x:t.x,y:t.y},t.x)}const Ot=3,Rt=(t,e)=>{if(e==null)return t("cache not enabled");const n=e.hits+e.misses;return n===0?t("no cache traffic yet"):`${Math.round(e.hits/n*100).toString()}% ${t("cache hit")}`},Fe=t=>{if(t<1e3)return`${String(Math.round(t))}ms`;const e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},Et=(t,e)=>{const n=Math.max(0,Math.round((e-t)/1e3));if(n<60)return`${String(n)}s ago`;const s=Math.round(n/60);if(s<60)return`${String(s)}m ago`;const l=Math.round(s/60);return l<24?`${String(l)}h ago`:`${String(Math.round(l/24))}d ago`},Je=(t,e)=>{if(t===void 0||t.length===0)return[];const n=new Map;for(const s of t)n.set(s.bucketMs,(n.get(s.bucketMs)??0)+s[e]);return[...n.entries()].toSorted(([s],[l])=>s-l).map(([,s])=>s)},Ye=(t,e=!0)=>{if(t.length<4)return null;const n=Math.floor(t.length/2),s=t.slice(0,n).reduce((i,o)=>i+o,0),l=t.slice(n).reduce((i,o)=>i+o,0);if(s===0)return null;const r=(l-s)/s*100;return{positive:e?r>=0:r<=0,text:`${r>=0?"+":""}${r.toFixed(1)}%`}},Oe=t=>{const e=_(24),{delta:n,footer:s,label:l,trend:r,unit:i,value:o}=t,c=T();let u;e[0]!==l?(u=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=u):u=e[1];let m;e[2]!==o?(m=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[2]=o,e[3]=m):m=e[3];let d;e[4]!==i?(d=i!==void 0&&a("span",{className:"text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=d):d=e[5];let f;e[6]!==m||e[7]!==d?(f=h("span",{className:"flex items-baseline gap-1.5",children:[m,d]}),e[6]=m,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==r?(p=r!==void 0&&r.length>=Ot&&a(Tt,{data:r}),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==f||e[12]!==p?(g=h("div",{className:"flex items-center justify-between gap-3",children:[f,p]}),e[11]=f,e[12]=p,e[13]=g):g=e[13];let x;e[14]!==u||e[15]!==g?(x=h("div",{className:"flex flex-col gap-2.5 p-4",children:[u,g]}),e[14]=u,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==n||e[18]!==s||e[19]!==c?(b=n==null?s!=null&&a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s}):h("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[a("span",{className:st("font-semibold",n.positive?"text-success":"text-destructive"),children:n.text})," ",a("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=n,e[18]=s,e[19]=c,e[20]=b):b=e[20];let v;return e[21]!==x||e[22]!==b?(v=h(P,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=v):v=e[23],v},Bt=()=>{const t=_(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},je=t=>{const e=_(7),{command:n,label:s}=t;let l;e[0]!==s?(l=a("div",{className:"p-4",children:a("span",{className:"text-sm font-medium text-foreground",children:s})}),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==n?(r=a("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:a("code",{className:"font-mono text-xs text-muted-foreground",children:n})}),e[2]=n,e[3]=r):r=e[3];let i;return e[4]!==l||e[5]!==r?(i=h(P,{className:"justify-between gap-0 py-0",children:[l,r]}),e[4]=l,e[5]=r,e[6]=i):i=e[6],i},Ze=t=>{const e=_(18),{count:n,onView:s,testId:l,title:r}=t,i=T();let o;e[0]!==r?(o=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=o):o=e[1];let c;e[2]!==n||e[3]!==i?(c=n===null?a("span",{className:"text-xs text-muted-foreground",children:i("No data yet")}):a(et,{variant:n>0?"destructive":"success",children:n>0?n:i("All clear")}),e[2]=n,e[3]=i,e[4]=c):c=e[4];let u;e[5]!==o||e[6]!==c?(u=h("div",{className:"flex items-start justify-between gap-2 p-4",children:[o,c]}),e[5]=o,e[6]=c,e[7]=u):u=e[7];let m;e[8]!==i?(m=i("View"),e[8]=i,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=a(Bt,{}),e[10]=d):d=e[10];let f;e[11]!==s||e[12]!==m?(f=h("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:s,type:"button",children:[m,d]}),e[11]=s,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f||e[16]!==l?(p=h(P,{className:"justify-between gap-0 py-0","data-testid":l,children:[u,f]}),e[14]=u,e[15]=f,e[16]=l,e[17]=p):p=e[17],p},Pt=t=>{const e=_(7),{functions:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=[...n].toSorted(Ut).slice(0,5);let i;e[3]!==s?(i=s("Top functions"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[o,r.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No functions called yet.")}):h("div",{className:"divide-y divide-border",children:[h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[a("span",{children:s("Function")}),a("span",{className:"text-end",children:s("Calls")}),a("span",{className:"w-12 text-end",children:s("Avg")}),a("span",{className:"w-8 text-end",children:s("Err")})]}),r.map(qt)]})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Dt=t=>{const e=_(26),{subs:n}=t,s=T();let l;e[0]!==s?(l=s("Live connections"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==l?(r=a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[2]=l,e[3]=r):r=e[3];const i=n?.totalConnections??0;let o;e[4]!==i?(o=i.toLocaleString(),e[4]=i,e[5]=o):o=e[5];let c;e[6]!==o?(c=a("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let u;e[8]!==s?(u=s("sockets"),e[8]=s,e[9]=u):u=e[9];let m;e[10]!==u?(m=a("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=m):m=e[11];let d;e[12]!==c||e[13]!==m?(d=h("span",{className:"flex items-baseline gap-1.5",children:[c,m]}),e[12]=c,e[13]=m,e[14]=d):d=e[14];const f=n?.totalSubscriptions??0;let p;e[15]!==f?(p=f.toLocaleString(),e[15]=f,e[16]=p):p=e[16];let g;e[17]!==s?(g=s("active subscriptions"),e[17]=s,e[18]=g):g=e[18];let x;e[19]!==p||e[20]!==g?(x=h("span",{className:"text-[11px] text-muted-foreground",children:[p," ",g]}),e[19]=p,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==r||e[24]!==d?(b=a(P,{"data-testid":"home-live-connections",children:h(tt,{className:"flex flex-col gap-2.5 py-4",children:[r,d,x]})}),e[22]=x,e[23]=r,e[24]=d,e[25]=b):b=e[25],b},jt=t=>{const e=_(7),{entries:n}=t,s=T();let l;if(e[0]!==n||e[1]!==s){const r=Date.now();let i;e[3]!==s?(i=s("Recent activity"),e[3]=s,e[4]=i):i=e[4];let o;e[5]!==i?(o=a("div",{className:"border-b border-border px-4 py-3",children:a("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[5]=i,e[6]=o):o=e[6],l=h(P,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[o,n.length===0?a("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No recent activity.")}):a("ul",{className:"divide-y divide-border",children:n.slice(0,5).map(c=>h("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[h("span",{className:"flex min-w-0 items-center gap-2",children:[a("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),h("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&h("span",{className:"text-muted-foreground",children:[" · ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),a("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Et(c.ts,r)})]},c.seq))})]}),e[0]=n,e[1]=s,e[2]=l}else l=e[2];return l},Ft=t=>{const e=t.reduce((n,s)=>n+s.calls,0);return e===0?null:t.reduce((n,s)=>n+s.totalDurationMs,0)/e},as=t=>{const e=_(149),{initialShardKey:n}=t,s=T(),l=Xe(),r=n??"";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let o;e[1]!==r?(o={shardKey:r},e[1]=r,e[2]=o):o=e[2];const c=ve(ye.getMetrics,i,o);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let m;e[4]!==r?(m={shardKey:r},e[4]=r,e[5]=m):m=e[5];const d=ve(ye.getFunctionStats,u,m);let f,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={},p={shardKey:""},e[6]=f,e[7]=p):(f=e[6],p=e[7]);const g=ve(ye.getSecurityAudit,f,p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==r?(b={shardKey:r},e[9]=r,e[10]=b):b=e[10];const v=ve(ye.listSubscriptions,x,b);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let w;e[12]!==r?(w={shardKey:r},e[12]=r,e[13]=w):w=e[13];const $=ve(ye.getAuditLog,S,w),y=c.data??null;let k,C,A,N,M,I,L,O,R,D,j,F,E,B,U,q,K,W;if(e[14]!==$.data||e[15]!==g.data||e[16]!==y||e[17]!==c.data||e[18]!==l||e[19]!==d.data||e[20]!==v.data||e[21]!==s){N=Array.isArray(d.data?.functions)?d.data.functions:[],L=v.data??null;let ke;e[40]!==$.data?(ke=Array.isArray($.data?.entries)?$.data.entries:[],e[40]=$.data,e[41]=ke):ke=e[41],C=ke,M=c.data===void 0||d.data===void 0?null:ct(y,N).length,I=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ce;e[42]!==l?(Ce=()=>{Ne(l({to:"/security"}))},e[42]=l,e[43]=Ce):Ce=e[43],W=Ce;let Ae;e[44]!==l?(Ae=()=>{Ne(l({to:"/insights"}))},e[44]=l,e[45]=Ae):Ae=e[45],K=Ae;const Me=Je(y?.history,"calls"),$e=Je(y?.history,"errors"),ze=Ft(N),Ie=Math.max(0,...N.map(Kt));let Te;e[46]!==y||e[47]!==s?(Te=y===null?void 0:Rt(s,y.cache),e[46]=y,e[47]=s,e[48]=Te):Te=e[48],A=Te,U="flex flex-col gap-6",q="lunora-home",j="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",F="home-health";const Ee=Ye(Me);let he;e[49]!==s?(he=s("Requests"),e[49]=s,e[50]=he):he=e[50];const Be=y?.requests??0;let ge;e[51]!==Be?(ge=Be.toLocaleString(),e[51]=Be,e[52]=ge):ge=e[52],e[53]!==Me||e[54]!==Ee||e[55]!==he||e[56]!==ge?(E=a(Oe,{delta:Ee,label:he,trend:Me,value:ge}),e[53]=Me,e[54]=Ee,e[55]=he,e[56]=ge,e[57]=E):E=e[57];const Pe=Ye($e,!1);let xe;e[58]!==s?(xe=s("Errors"),e[58]=s,e[59]=xe):xe=e[59];const De=y?.errors??0;let be;e[60]!==De?(be=De.toLocaleString(),e[60]=De,e[61]=be):be=e[61],e[62]!==$e||e[63]!==Pe||e[64]!==xe||e[65]!==be?(B=a(Oe,{delta:Pe,label:xe,trend:$e,value:be}),e[62]=$e,e[63]=Pe,e[64]=xe,e[65]=be,e[66]=B):B=e[66],k=Oe,e[67]!==Ie||e[68]!==s?(O=Ie>0?`${s("max")} ${Fe(Ie)}`:void 0,e[67]=Ie,e[68]=s,e[69]=O):O=e[69],e[70]!==s?(R=s("Avg latency"),e[70]=s,e[71]=R):R=e[71],D=ze===null?"—":Fe(ze),e[14]=$.data,e[15]=g.data,e[16]=y,e[17]=c.data,e[18]=l,e[19]=d.data,e[20]=v.data,e[21]=s,e[22]=k,e[23]=C,e[24]=A,e[25]=N,e[26]=M,e[27]=I,e[28]=L,e[29]=O,e[30]=R,e[31]=D,e[32]=j,e[33]=F,e[34]=E,e[35]=B,e[36]=U,e[37]=q,e[38]=K,e[39]=W}else k=e[22],C=e[23],A=e[24],N=e[25],M=e[26],I=e[27],L=e[28],O=e[29],R=e[30],D=e[31],j=e[32],F=e[33],E=e[34],B=e[35],U=e[36],q=e[37],K=e[38],W=e[39];let z;e[72]!==k||e[73]!==O||e[74]!==R||e[75]!==D?(z=a(k,{footer:O,label:R,value:D}),e[72]=k,e[73]=O,e[74]=R,e[75]=D,e[76]=z):z=e[76];let H;e[77]!==s?(H=s("Database size"),e[77]=s,e[78]=H):H=e[78];const Re=y?.databaseSize??null;let V;e[79]!==Re?(V=it(Re),e[79]=Re,e[80]=V):V=e[80];let Q;e[81]!==A||e[82]!==H||e[83]!==V?(Q=a(Oe,{footer:A,label:H,value:V}),e[81]=A,e[82]=H,e[83]=V,e[84]=Q):Q=e[84];let G;e[85]!==j||e[86]!==F||e[87]!==E||e[88]!==B||e[89]!==z||e[90]!==Q?(G=h("div",{className:j,"data-testid":F,children:[E,B,z,Q]}),e[85]=j,e[86]=F,e[87]=E,e[88]=B,e[89]=z,e[90]=Q,e[91]=G):G=e[91];let _e;e[92]===Symbol.for("react.memo_cache_sentinel")?(_e=a(bt,{}),e[92]=_e):_e=e[92];let J;e[93]!==N?(J=a("div",{className:"lg:col-span-2",children:a(Pt,{functions:N})}),e[93]=N,e[94]=J):J=e[94];let Y;e[95]!==L?(Y=a(Dt,{subs:L}),e[95]=L,e[96]=Y):Y=e[96];let Z;e[97]!==C?(Z=a(jt,{entries:C}),e[97]=C,e[98]=Z):Z=e[98];let X;e[99]!==Y||e[100]!==Z?(X=h("div",{className:"flex flex-col gap-3",children:[Y,Z]}),e[99]=Y,e[100]=Z,e[101]=X):X=e[101];let ee;e[102]!==J||e[103]!==X?(ee=h("div",{className:"grid gap-3 lg:grid-cols-3",children:[J,X]}),e[102]=J,e[103]=X,e[104]=ee):ee=e[104];let te;e[105]!==s?(te=s("Advisors"),e[105]=s,e[106]=te):te=e[106];let se;e[107]!==te?(se=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:te}),e[107]=te,e[108]=se):se=e[108];let ne;e[109]!==M||e[110]!==I||e[111]!==s||e[112]!==K||e[113]!==W?(ne=I===0&&M===0?a(nt,{description:s("No security or performance issues detected."),icon:h("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[a("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),a("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:s("No issues found")}):h("div",{className:"grid gap-3 sm:grid-cols-2",children:[a(Ze,{count:I,onView:W,testId:"home-security",title:s("Security findings")}),a(Ze,{count:M,onView:K,testId:"home-performance",title:s("Performance issues")})]}),e[109]=M,e[110]=I,e[111]=s,e[112]=K,e[113]=W,e[114]=ne):ne=e[114];let le;e[115]!==se||e[116]!==ne?(le=h("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[se,ne]}),e[115]=se,e[116]=ne,e[117]=le):le=e[117];let ae;e[118]!==s?(ae=s("Get connected"),e[118]=s,e[119]=ae):ae=e[119];let re;e[120]!==ae?(re=a("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ae}),e[120]=ae,e[121]=re):re=e[121];let oe;e[122]!==s?(oe=s("Client SDK"),e[122]=s,e[123]=oe):oe=e[123];let ie;e[124]!==oe?(ie=a(je,{command:"npm i @lunora/client",label:oe}),e[124]=oe,e[125]=ie):ie=e[125];let ce;e[126]!==s?(ce=s("React"),e[126]=s,e[127]=ce):ce=e[127];let de;e[128]!==ce?(de=a(je,{command:"npm i @lunora/react",label:ce}),e[128]=ce,e[129]=de):de=e[129];let ue;e[130]!==s?(ue=s("CLI"),e[130]=s,e[131]=ue):ue=e[131];let me;e[132]!==ue?(me=a(je,{command:"lunora dev",label:ue}),e[132]=ue,e[133]=me):me=e[133];let fe;e[134]!==ie||e[135]!==de||e[136]!==me?(fe=h("div",{className:"grid gap-3 sm:grid-cols-3",children:[ie,de,me]}),e[134]=ie,e[135]=de,e[136]=me,e[137]=fe):fe=e[137];let Se;e[138]===Symbol.for("react.memo_cache_sentinel")?(Se=a(At,{}),e[138]=Se):Se=e[138];let pe;e[139]!==re||e[140]!==fe?(pe=h("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[re,fe,Se]}),e[139]=re,e[140]=fe,e[141]=pe):pe=e[141];let we;return e[142]!==U||e[143]!==q||e[144]!==G||e[145]!==ee||e[146]!==le||e[147]!==pe?(we=h("div",{className:U,"data-testid":q,children:[G,_e,ee,le,pe]}),e[142]=U,e[143]=q,e[144]=G,e[145]=ee,e[146]=le,e[147]=pe,e[148]=we):we=e[148],we};function Ut(t,e){return e.calls-t.calls}function qt(t){return h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[a("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),a("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),a("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Fe(t.calls>0?t.totalDurationMs/t.calls:0)}),a("span",{className:st("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}function Kt(t){return t.maxDurationMs}export{as as H,Rt as c,pt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"react/compiler-runtime";import{useT as p}from"./DEFAULT_LOCALE-
|
|
1
|
+
import{c as m}from"react/compiler-runtime";import{useT as p}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{u as v}from"./operation-console-provider-DoloEvon.mjs";import{jsx as d,jsxs as x}from"react/jsx-runtime";const E=f=>{const e=m(14),{message:n,prefix:i}=f,o=p(),t=v();let l;e[0]!==t?(l=()=>{t?.openConsole({errorsOnly:!0})},e[0]=t,e[1]=l):l=e[1];const c=l;if(n===void 0)return null;const u=`${i}-live-error`;let r;e[2]!==n||e[3]!==o?(r=o("Live unavailable: {liveError}",{liveError:n}),e[2]=n,e[3]=o,e[4]=r):r=e[4];let s;e[5]!==t||e[6]!==i||e[7]!==c||e[8]!==o?(s=t===void 0?null:d("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":`${i}-live-error-console`,onClick:c,type:"button",children:o("Show in console")}),e[5]=t,e[6]=i,e[7]=c,e[8]=o,e[9]=s):s=e[9];let a;return e[10]!==u||e[11]!==r||e[12]!==s?(a=x("span",{className:"flex items-center gap-1.5 text-xs text-destructive","data-testid":u,role:"status",children:[r,s]}),e[10]=u,e[11]=r,e[12]=s,e[13]=a):a=e[13],a};export{E as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as u}from"./use-admin-query-
|
|
1
|
+
import{o as u}from"./use-admin-query-BW9IuacC.mjs";const b="__lunora_admin__:",d=new Set(["action","mutation","query"]),r=Symbol("lunora.operationSeq"),g=t=>{if(typeof t!="object"||t===null)return;const n=t[r];return typeof n=="number"?n:void 0},h=(t,n)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value:n,writable:!0})}catch{}},p=t=>{if(typeof t!="object"||t===null)return;const n=t.__lunoraRef;return typeof n=="string"&&n.startsWith(b)?n:void 0},O=t=>{if(typeof t!="object"||t===null)return"";const{shardKey:n}=t;return typeof n=="string"?n:""},E=t=>new Proxy(t,{get(n,c,a){const i=Reflect.get(n,c,a);if(typeof i!="function"||typeof c!="string"||!d.has(c))return typeof i=="function"?i.bind(n):i;const f=i;return async(...e)=>{const l=p(e[0]);if(l===void 0)return f.apply(n,e);const y=typeof e[1]=="object"&&e[1]!==null?e[1]:{},s=u.start(l,y,O(e[2]));try{const o=await f.apply(n,e);return u.settle(s,{result:o}),o}catch(o){throw u.settle(s,{error:o instanceof Error?o.message:String(o)}),h(o,s),o}}}});export{g as o,E as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as P}from"react/compiler-runtime";import{SentIcon as ie,Copy01Icon as ae,Search01Icon as le}from"@hugeicons/core-free-icons";import{HugeiconsIcon as F}from"@hugeicons/react";import{useState as B,createContext as de,use as ce}from"react";import{I as ue}from"./input-CXhxesPC.mjs";import{useT as J}from"./DEFAULT_LOCALE-
|
|
1
|
+
import{c as P}from"react/compiler-runtime";import{SentIcon as ie,Copy01Icon as ae,Search01Icon as le}from"@hugeicons/core-free-icons";import{HugeiconsIcon as F}from"@hugeicons/react";import{useState as B,createContext as de,use as ce}from"react";import{I as ue}from"./input-CXhxesPC.mjs";import{useT as J}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{B as W}from"./button-q0UYSmrn.mjs";import{g as X,f as fe,b as H,m as me,c as pe,d as he,k as ge}from"./internal-BXEjuLPN.mjs";import{jsx as i,jsxs as N,Fragment as xe}from"react/jsx-runtime";import{B as ye}from"./badge-r_5B4LHP.mjs";import{ShardInput as be}from"./ShardInput-CoySruKZ.mjs";import{L as U}from"./label-DKFzyHq6.mjs";import{T as ve}from"./textarea--40GKAyz.mjs";import{LunoraError as Ne}from"@lunora/errors";import{u as Se}from"./use-studio-client-DCA50tF2.mjs";import{c as Y}from"./utils-bhneXptQ.mjs";const we=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",Q=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},z=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>z(e)).join(" | "):t.type==="array"?`array<${z(t.items)}>`:t.type??"any",ke=t=>{const e=Q(t);return e!==void 0?t.type??we(e[0]):z(t)},Oe=t=>{const e=Q(t);return e===void 0?void 0:e.map(r=>JSON.stringify(r)).join(" | ")},$e=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const r=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const s=e.length>(r?2:1);return r||s?e.join(" "):void 0},Te=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},D=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return D(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[r,s]of Object.entries(t.properties??{}))e[r]=D(s);return e}case"string":return"";default:return null}},K=t=>{const e=P(7),{label:r,value:s}=t;let n;e[0]!==r?(n=i("span",{className:"text-muted-foreground",children:r}),e[0]=r,e[1]=n):n=e[1];let o;e[2]!==s?(o=i("span",{className:"text-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let l;return e[4]!==n||e[5]!==o?(l=N("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,o]}),e[4]=n,e[5]=o,e[6]=l):l=e[6],l},Ce=t=>{const e=P(40),{name:r,required:s,schema:n}=t,o=J();let l;e[0]!==n?(l=$e(n),e[0]=n,e[1]=l):l=e[1];const a=l;let y;e[2]!==n?(y=Oe(n),e[2]=n,e[3]=y):y=e[3];const d=y,c=n["x-lunora-table"],u=n.format!==void 0||a!==void 0||d!==void 0||c!==void 0;let b;e[4]!==n?(b=Te(n),e[4]=n,e[5]=b):b=e[5];const x=b,f=s?"*":"?";let m;e[6]!==f?(m=i("span",{className:"text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let v;e[8]!==r||e[9]!==m?(v=N("span",{className:"font-mono text-foreground",children:[r,m]}),e[8]=r,e[9]=m,e[10]=v):v=e[10];let w;e[11]!==n?(w=ke(n),e[11]=n,e[12]=w):w=e[12];let p;e[13]!==w?(p=i("span",{className:"font-mono text-muted-foreground",children:w}),e[13]=w,e[14]=p):p=e[14];let h;e[15]!==v||e[16]!==p?(h=N("div",{className:"flex items-baseline gap-2",children:[v,p]}),e[15]=v,e[16]=p,e[17]=h):h=e[17];let g;e[18]!==n.description?(g=n.description!==void 0&&i("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=g):g=e[19];let S;e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==n.format||e[24]!==o||e[25]!==d?(S=u&&N("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&i(K,{label:o("Format"),value:n.format}),a!==void 0&&i(K,{label:o("Range"),value:a}),d!==void 0&&i(K,{label:o("Value in"),value:d}),c!==void 0&&i(K,{label:o("relation"),value:c})]}),e[20]=u,e[21]=a,e[22]=c,e[23]=n.format,e[24]=o,e[25]=d,e[26]=S):S=e[26];let O;e[27]!==g||e[28]!==S||e[29]!==h?(O=N("div",{className:"flex flex-col gap-1 py-2",children:[h,g,S]}),e[27]=g,e[28]=S,e[29]=h,e[30]=O):O=e[30];const k=O;if(x===void 0){let $;return e[31]!==k?($=i("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=$):$=e[32],$}let T;e[33]!==k?(T=i("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=T):T=e[34];let R;e[35]!==x?(R=i("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:i(Z,{schema:x})}),e[35]=x,e[36]=R):R=e[36];let C;return e[37]!==T||e[38]!==R?(C=N("details",{className:"border-b border-border/50 last:border-b-0",children:[T,R]}),e[37]=T,e[38]=R,e[39]=C):C=e[39],C},Z=t=>{const e=P(7),{schema:r}=t;let s;e[0]!==r.required?(s=new Set(r.required),e[0]=r.required,e[1]=s):s=e[1];const n=s;let o;e[2]!==r.properties?(o=Object.entries(r.properties??{}),e[2]=r.properties,e[3]=o):o=e[3];const l=o;let a;return e[4]!==n||e[5]!==l?(a=i("div",{className:"flex flex-col",children:l.map(y=>{const[d,c]=y;return i(Ce,{name:d,required:n.has(d),schema:c},d)})}),e[4]=n,e[5]=l,e[6]=a):a=e[6],a},V=t=>{const e=P(10),{schema:r,testId:s}=t;if(r?.type!=="object"||Object.keys(r.properties??{}).length===0){let l;e[0]!==r?(l=z(r),e[0]=r,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==s?(a=i("p",{className:"font-mono text-xs text-muted-foreground","data-testid":s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}let n;e[5]!==r?(n=i(Z,{schema:r}),e[5]=r,e[6]=n):n=e[6];let o;return e[7]!==n||e[8]!==s?(o=i("div",{className:"text-xs","data-testid":s,children:n}),e[7]=n,e[8]=s,e[9]=o):o=e[9],o},Ee=["curl","javascript","lunora"],Re={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Ae=t=>`api.${t.replaceAll(/[/:]/g,".")}`,je=t=>{const e=D(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Ie=(t,e,r)=>{const s=`${r}${e.httpPath}`,n=JSON.stringify(je(e),void 0,2),o=JSON.stringify(D(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const l=e.method!=="GET"&&e.method!=="HEAD",a=[`curl -X ${e.method} ${JSON.stringify(s)}`];return l&&a.push(' -H "Content-Type: application/json"',` -d '${n}'`),a.join(` \\
|
|
2
2
|
`)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
|
|
3
3
|
import { api } from "./_generated/api";
|
|
4
4
|
|
|
@@ -8,6 +8,6 @@ await client.${e.kind??"query"}(${Ae(e.functionPath)}, ${o});`;default:{const a=
|
|
|
8
8
|
headers: { "Content-Type": "application/json" },
|
|
9
9
|
body: JSON.stringify(${n}),
|
|
10
10
|
}`:`{ method: ${JSON.stringify(e.method)} }`;return`const response = await fetch(${JSON.stringify(s)}, ${a});
|
|
11
|
-
const data = await response.json();`}}},Pe=t=>{const e=P(24),{operation:r,server:s}=t,n=J(),[o,l]=B("curl");let a;e[0]!==r||e[1]!==o||e[2]!==s?(a=Ie(o,r,s),e[0]=r,e[1]=o,e[2]=s,e[3]=a):a=e[3];const y=a;let d;e[4]!==y?(d=()=>{X(y)},e[4]=y,e[5]=d):d=e[5];const c=d;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=g=>{l(g.currentTarget.dataset.sample)},e[6]=u):u=e[6];const b=u;let x;e[7]!==o?(x=
|
|
12
|
-
`,"\r"]),G=" ",Je=t=>{let e="";for(const n of t)Me.has(n)||(e+=n);let r=0,s=e.length;for(;r<s&&(e[r]??"")<=G;)r+=1;for(;s>r&&(e[s-1]??"")<=G;)s-=1;return e.slice(r,s)},De=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,Ke=(t,e)=>{const r=globalThis.location?.origin??"",s=e===""?r:e,n=Je(t);if(s===""){if(De.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}const o=new URL(n,s);if(o.origin!==new URL(s).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${o.origin} is not ${s})`);return o.toString()},ze=async(t,e,r,s)=>{const n=t.method!=="GET"&&t.method!=="HEAD",o=Ke(t.httpPath,r),a=await(await fetch(o,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...s===null||s===""?{}:{authorization:`Bearer ${s}`}},method:t.method})).text();try{return JSON.parse(a)}catch{return a}},Fe=t=>JSON.stringify(D(t.argsSchema)??{},void 0,2),re=de(null),se=()=>{const t=ce(re);if(t===null)throw new Ne("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},We=({children:t,operation:e})=>{const r=J(),s=Se(),[n,o]=B(()=>Fe(e)),[l,a]=B(""),[y,d]=B("idle"),[c,u]=B(void 0),[b,x]=B(null),[f,m]=B(null),v=async()=>{let h;try{h=n.trim()===""?{}:JSON.parse(n)}catch(S){d("error"),u(void 0),m(null),x(r("Invalid JSON args: {message}",{message:H(S)}));return}d("running"),x(null);const g=performance.now();try{const S=await(e.functionPath===void 0?ze(e,h,s.url,s.getAuthToken()):me(s,e.kind,pe(e.functionPath),h,he(l)));u(S),m(Math.round(performance.now()-g)),d("success")}catch(S){u(void 0),m(Math.round(performance.now()-g)),x(H(S)),d("error")}};return i(re,{value:{argsText:n,durationMs:f,error:b,operation:e,response:c,send:()=>{fe(v())},setArgsText:o,setShardKey:a,shardKey:l,status:y},children:t})},qe=()=>{const t=P(48),e=J(),{argsText:r,operation:s,send:n,setArgsText:o,setShardKey:l,shardKey:a,status:y}=se();let d;t[0]!==o?(d=
|
|
13
|
-
`),t[27]=r,t[28]=T):T=t[28];const R=Math.min(12,Math.max(3,T.length));let E;t[29]!==r||t[30]!==c||t[31]!==b||t[32]!==R?(E=i(ve,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:c,onKeyDown:b,rows:R,spellCheck:!1,value:r}),t[29]=r,t[30]=c,t[31]=b,t[32]=R,t[33]=E):E=t[33];let $;t[34]!==k||t[35]!==E?($=N("div",{className:"flex flex-col gap-1.5",children:[k,E]}),t[34]=k,t[35]=E,t[36]=$):$=t[36];let A;t[37]!==s.functionPath||t[38]!==l||t[39]!==a||t[40]!==e?(A=s.functionPath!==void 0&&N("div",{className:"flex flex-col gap-1.5",children:[i(U,{htmlFor:"shard-input",children:e("Shard key (optional)")}),i(be,{id:"shard-input",onChange:l,testId:"shard-input",value:a})]}),t[37]=s.functionPath,t[38]=l,t[39]=a,t[40]=e,t[41]=A):A=t[41];let j;t[42]!==$||t[43]!==A?(j=N("div",{className:"flex flex-col gap-3 p-3",children:[$,A]}),t[42]=$,t[43]=A,t[44]=j):j=t[44];let I;return t[45]!==j||t[46]!==S?(I=N("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[S,j]}),t[45]=j,t[46]=S,t[47]=I):I=t[47],I},He=t=>{const e=P(51),{operation:r}=t,s=J(),n=`api-operation-${r.operationId}`,o=r.key;let l;e[0]!==r.kind||e[1]!==r.method?(l=i(q,{kind:r.kind,method:r.method,testId:"api-operation-method"}),e[0]=r.kind,e[1]=r.method,e[2]=l):l=e[2];const a=r.functionPath??r.httpPath;let y;e[3]!==a?(y=i("code",{className:"truncate font-mono text-xs text-muted-foreground",children:a}),e[3]=a,e[4]=y):y=e[4];let d;e[5]!==l||e[6]!==y?(d=N("div",{className:"flex items-center gap-2",children:[l,y]}),e[5]=l,e[6]=y,e[7]=d):d=e[7];let c;e[8]!==r.title?(c=i("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:r.title}),e[8]=r.title,e[9]=c):c=e[9];let u;e[10]!==r.description?(u=r.description!==void 0&&i("p",{className:"text-sm text-muted-foreground",children:r.description}),e[10]=r.description,e[11]=u):u=e[11];let b;e[12]!==d||e[13]!==c||e[14]!==u?(b=N("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[d,c,u]}),e[12]=d,e[13]=c,e[14]=u,e[15]=b):b=e[15];let x;e[16]!==s?(x=s("Try it"),e[16]=s,e[17]=x):x=e[17];let f;e[18]!==x?(f=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:x}),e[18]=x,e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i(qe,{}),e[20]=m):m=e[20];let v;e[21]!==f?(v=N("section",{className:"flex flex-col gap-2",children:[f,m]}),e[21]=f,e[22]=v):v=e[22];let w;e[23]!==s?(w=s("Request arguments"),e[23]=s,e[24]=w):w=e[24];let p;e[25]!==w?(p=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[25]=w,e[26]=p):p=e[26];let h;e[27]!==r.argsSchema?(h=i(V,{schema:r.argsSchema,testId:"api-operation-args"}),e[27]=r.argsSchema,e[28]=h):h=e[28];let g;e[29]!==p||e[30]!==h?(g=N("section",{className:"flex flex-col gap-2",children:[p,h]}),e[29]=p,e[30]=h,e[31]=g):g=e[31];let S;e[32]!==s?(S=s("Response body"),e[32]=s,e[33]=S):S=e[33];let O;e[34]!==S?(O=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:S}),e[34]=S,e[35]=O):O=e[35];let k;if(e[36]!==r.responses||e[37]!==s){let E;e[39]!==s?(E=$=>N("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[N("div",{className:"flex items-center justify-between gap-2",children:[N("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${ee($.status)}`,children:[i("span",{className:`size-1.5 rounded-full ${te($.status)}`}),$.status]}),$.schema!==void 0&&i("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:s("application/json")})]}),$.description!==void 0&&i("p",{className:"text-xs text-muted-foreground",children:$.description}),$.schema!==void 0&&i(V,{schema:$.schema,testId:`api-response-${$.status}`})]},$.status),e[39]=s,e[40]=E):E=e[40],k=r.responses.map(E),e[36]=r.responses,e[37]=s,e[38]=k}else k=e[38];let T;e[41]!==O||e[42]!==k?(T=N("section",{className:"flex flex-col gap-3",children:[O,k]}),e[41]=O,e[42]=k,e[43]=T):T=e[43];let R;return e[44]!==r.key||e[45]!==n||e[46]!==v||e[47]!==g||e[48]!==T||e[49]!==b?(R=N("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[b,v,g,T]},o),e[44]=r.key,e[45]=n,e[46]=v,e[47]=g,e[48]=T,e[49]=b,e[50]=R):R=e[50],R},Ue={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Ve=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Ge=/^\s*:/,Xe=(t,e,r)=>r.startsWith('"')?Ge.test(t.slice(e))?"key":"string":r==="true"||r==="false"||r==="null"?"boolean":"number",Ye=t=>{const e=[];let r=0;for(const s of t.matchAll(Ve)){const{index:n}=s,o=s[0],l=n+o.length;n>r&&e.push({kind:"plain",start:r,text:t.slice(r,n)}),e.push({kind:Xe(t,l,o),start:n,text:o}),r=l}return r<t.length&&e.push({kind:"plain",start:r,text:t.slice(r)}),e},Qe=t=>{const e=P(4),{code:r}=t;let s;e[0]!==r?(s=Ye(r).map(Ze),e[0]=r,e[1]=s):s=e[1];let n;return e[2]!==s?(n=i(xe,{children:s}),e[2]=s,e[3]=n):n=e[3],n};function Ze(t){return i("span",{className:Ue[t.kind],children:t.text},t.start)}const ne="__live__",et=t=>t.schema===void 0?"":JSON.stringify(D(t.schema),void 0,2),tt=(t,e,r)=>r?t??"":e===void 0?"":JSON.stringify(e,ge,2),rt=t=>{const e=P(18),{active:r,running:s,showError:n}=t,o=J();if(s){let u;e[0]!==o?(u=o("Sending…"),e[0]=o,e[1]=u):u=e[1];let b;return e[2]!==u?(b=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:u}),e[2]=u,e[3]=b):b=e[3],b}if(r===void 0||r.body===""){let u;e[4]!==r?.live||e[5]!==o?(u=r?.live===!0?o("Send a request to see the response."):o("No example for this response."),e[4]=r?.live,e[5]=o,e[6]=u):u=e[6];let b;return e[7]!==u?(b=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:u}),e[7]=u,e[8]=b):b=e[8],b}const l=n&&"text-destructive";let a;e[9]!==l?(a=Y("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",l),e[9]=l,e[10]=a):a=e[10];const y=n?"api-response-error":"api-response-body";let d;e[11]!==r.body||e[12]!==n?(d=n?r.body:i(Qe,{code:r.body}),e[11]=r.body,e[12]=n,e[13]=d):d=e[13];let c;return e[14]!==a||e[15]!==y||e[16]!==d?(c=i("pre",{className:a,"data-testid":y,children:d}),e[14]=a,e[15]=y,e[16]=d,e[17]=c):c=e[17],c},st=({durationMs:t,error:e,failed:r,operation:s,ran:n,response:o,t:l})=>{const a=s.responses.map(d=>({body:et(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:tt(e,o,r),durationMs:t,id:ne,label:l("Live"),live:!0,status:r?"error":"200"},...a]:a},nt=()=>{const t=P(19),e=J(),{durationMs:r,error:s,operation:n,response:o,status:l}=se(),a=l==="running",y=l==="error",d=l==="success"||y,c=st({durationMs:r,error:s,failed:y,operation:n,ran:d,response:o,t:e}),u=d?ne:c.find(ot)?.id??c[0]?.id??"",[b,x]=B(null),f=c.find(C=>C.id===(b??u))??c[0];let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=C=>{const{id:L}=C.currentTarget.dataset;L!==void 0&&x(L)},t[0]=m):m=t[0];const v=m,w=()=>{f!==void 0&&X(f.body)},p=f?.live===!0?f.durationMs:null,h=f?.live===!0&&f.status==="error",g="flex min-h-0 flex-col rounded-xl border border-border bg-card",S="api-response-panel";let O;t[1]!==e?(O=e("Response"),t[1]=e,t[2]=O):O=t[2];let k;t[3]!==O?(k=i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O}),t[3]=O,t[4]=k):k=t[4];const T=p!==null&&i("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:p})}),R=f!==void 0&&f.body!==""&&i(W,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:w,size:"icon-xs",type:"button",variant:"ghost",children:i(F,{icon:ae,strokeWidth:2})});let E;t[5]!==T||t[6]!==R?(E=N("div",{className:"flex items-center gap-2",children:[T,R]}),t[5]=T,t[6]=R,t[7]=E):E=t[7];let $;t[8]!==k||t[9]!==E?($=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,E]}),t[8]=k,t[9]=E,t[10]=$):$=t[10];const A=c.length>0&&i("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:c.map(C=>{const L=C.id===f?.id;return N("button",{"aria-selected":L,className:Y("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",L?ee(C.status):"text-muted-foreground"),"data-id":C.id,"data-testid":C.live?"api-response-tab-live":`api-response-tab-${C.status}`,onClick:v,role:"tab",type:"button",children:[i("span",{className:`size-1.5 rounded-full ${te(C.status)}`}),C.label]},C.id)})});let j;t[11]!==f||t[12]!==a||t[13]!==h?(j=i(rt,{active:f,running:a,showError:h}),t[11]=f,t[12]=a,t[13]=h,t[14]=j):j=t[14];let I;return t[15]!==j||t[16]!==$||t[17]!==A?(I=N("div",{className:g,"data-testid":S,children:[$,A,j]}),t[15]=j,t[16]=$,t[17]=A,t[18]=I):I=t[18],I};function ot(t){return t.status.startsWith("2")}const it=(t,e)=>{const r=e.trim().toLowerCase();return r===""?t:t.map(s=>({...s,operations:s.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(r))})).filter(s=>s.operations.length>0)},wt=t=>{const e=P(53),{model:r}=t,s=J(),n=r.groups[0]?.operations[0]?.key??"",[o,l]=B(n),[a,y]=B("");let d;e[0]!==n||e[1]!==r.operationByKey||e[2]!==o?(d=r.operationByKey.get(o)??r.operationByKey.get(n),e[0]=n,e[1]=r.operationByKey,e[2]=o,e[3]=d):d=e[3];const c=d;let u,b,x,f,m,v,w,p,h,g;if(e[4]!==a||e[5]!==r.groups||e[6]!==r.server||e[7]!==c?.key||e[8]!==s){u=it(r.groups,a);let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=M=>{const{key:_}=M.currentTarget.dataset;_!==void 0&&l(_)},e[19]=E):E=e[19];const $=E;let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=M=>{y(M.target.value)},e[20]=A):A=e[20];const j=A;b=r.server??"",h="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",g="api-reference",e[21]!==s?(m=s("API operations"),e[21]=s,e[22]=m):m=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",w="api-reference-nav";let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=i(F,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:le,strokeWidth:2}),e[23]=I):I=e[23];let C;e[24]!==s?(C=s("Filter operations"),e[24]=s,e[25]=C):C=e[25],e[26]!==a||e[27]!==C?(p=i("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:N("div",{className:"relative",children:[I,i(ue,{className:"h-7 pl-7","data-testid":"api-filter",onChange:j,placeholder:C,value:a})]})}),e[26]=a,e[27]=C,e[28]=p):p=e[28],x="flex flex-col gap-4 p-2";let L;e[29]!==c?.key||e[30]!==s?(L=M=>N("div",{className:"flex flex-col gap-1",children:[N("div",{className:"flex items-center justify-between px-2",children:[i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M.name||s("(root)")}),i("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:M.operations.length})]}),M.operations.map(_=>{const oe=_.key===c?.key;return N("button",{"aria-current":oe?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":_.key,"data-testid":`api-nav-${_.operationId}`,onClick:$,type:"button",children:[i("span",{className:"truncate",children:_.summary}),i(q,{kind:_.kind,method:_.method})]},_.key)})]},M.name),e[29]=c?.key,e[30]=s,e[31]=L):L=e[31],f=u.map(L),e[4]=a,e[5]=r.groups,e[6]=r.server,e[7]=c?.key,e[8]=s,e[9]=u,e[10]=b,e[11]=x,e[12]=f,e[13]=m,e[14]=v,e[15]=w,e[16]=p,e[17]=h,e[18]=g}else u=e[9],b=e[10],x=e[11],f=e[12],m=e[13],v=e[14],w=e[15],p=e[16],h=e[17],g=e[18];let S;e[32]!==u.length||e[33]!==s?(S=u.length===0&&i("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:s("No operations match your filter.")}),e[32]=u.length,e[33]=s,e[34]=S):S=e[34];let O;e[35]!==S||e[36]!==x||e[37]!==f?(O=N("div",{className:x,children:[f,S]}),e[35]=S,e[36]=x,e[37]=f,e[38]=O):O=e[38];let k;e[39]!==O||e[40]!==m||e[41]!==v||e[42]!==w||e[43]!==p?(k=N("nav",{"aria-label":m,className:v,"data-testid":w,children:[p,O]}),e[39]=O,e[40]=m,e[41]=v,e[42]=w,e[43]=p,e[44]=k):k=e[44];let T;e[45]!==c||e[46]!==b?(T=c===void 0?i("div",{className:"lg:col-span-2"}):N(We,{operation:c,children:[i("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:i(He,{operation:c})}),N("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[i(Pe,{operation:c,server:b}),i(nt,{})]})]},c.key),e[45]=c,e[46]=b,e[47]=T):T=e[47];let R;return e[48]!==k||e[49]!==T||e[50]!==h||e[51]!==g?(R=N("div",{className:h,"data-testid":g,children:[k,T]}),e[48]=k,e[49]=T,e[50]=h,e[51]=g,e[52]=R):R=e[52],R};export{wt as R};
|
|
11
|
+
const data = await response.json();`}}},Pe=t=>{const e=P(24),{operation:r,server:s}=t,n=J(),[o,l]=B("curl");let a;e[0]!==r||e[1]!==o||e[2]!==s?(a=Ie(o,r,s),e[0]=r,e[1]=o,e[2]=s,e[3]=a):a=e[3];const y=a;let d;e[4]!==y?(d=()=>{X(y)},e[4]=y,e[5]=d):d=e[5];const c=d;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=g=>{l(g.currentTarget.dataset.sample)},e[6]=u):u=e[6];const b=u;let x;e[7]!==o?(x=Ee.map(g=>i("button",{"aria-selected":o===g,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":g,"data-testid":`api-sample-${g}`,onClick:b,role:"tab",type:"button",children:Re[g]},g)),e[7]=o,e[8]=x):x=e[8];let f;e[9]!==x?(f=i("div",{className:"flex gap-1",role:"tablist",children:x}),e[9]=x,e[10]=f):f=e[10];let m;e[11]!==n?(m=n("Copy"),e[11]=n,e[12]=m):m=e[12];let v;e[13]!==c||e[14]!==m?(v=i(W,{"data-testid":"api-sample-copy",onClick:c,size:"xs",type:"button",variant:"ghost",children:m}),e[13]=c,e[14]=m,e[15]=v):v=e[15];let w;e[16]!==f||e[17]!==v?(w=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[f,v]}),e[16]=f,e[17]=v,e[18]=w):w=e[18];let p;e[19]!==y?(p=i("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:y}),e[19]=y,e[20]=p):p=e[20];let h;return e[21]!==w||e[22]!==p?(h=N("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[w,p]}),e[21]=w,e[22]=p,e[23]=h):h=e[23],h},Le={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},_e=t=>{switch(t.toUpperCase()){case"DELETE":return"red";case"GET":return"emerald";case"PATCH":return"orange";case"POST":return"blue";case"PUT":return"orange";default:return"neutral"}},Be=t=>{switch(t){case"action":return"violet";case"mutation":return"orange";case"query":return"emerald";default:return"neutral"}},q=t=>{const e=P(7),{kind:r,method:s,testId:n}=t;let o;e[0]!==r||e[1]!==s?(o=r??s.toUpperCase(),e[0]=r,e[1]=s,e[2]=o):o=e[2];const l=o,a=r===void 0?_e(s):Be(r),y=`${Le[a]} font-mono text-[10px] tracking-wide uppercase`;let d;return e[3]!==l||e[4]!==y||e[5]!==n?(d=i(ye,{className:y,"data-testid":n,variant:"ghost",children:l}),e[3]=l,e[4]=y,e[5]=n,e[6]=d):d=e[6],d},ee=t=>t.startsWith("2")?"text-emerald-600 dark:text-emerald-400":t==="default"||t.startsWith("4")||t.startsWith("5")?"text-red-600 dark:text-red-400":"text-muted-foreground",te=t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground",Me=new Set([" ",`
|
|
12
|
+
`,"\r"]),G=" ",Je=t=>{let e="";for(const n of t)Me.has(n)||(e+=n);let r=0,s=e.length;for(;r<s&&(e[r]??"")<=G;)r+=1;for(;s>r&&(e[s-1]??"")<=G;)s-=1;return e.slice(r,s)},De=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,Ke=(t,e)=>{const r=globalThis.location?.origin??"",s=e===""?r:e,n=Je(t);if(s===""){if(De.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}const o=new URL(n,s);if(o.origin!==new URL(s).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${o.origin} is not ${s})`);return o.toString()},ze=async(t,e,r,s)=>{const n=t.method!=="GET"&&t.method!=="HEAD",o=Ke(t.httpPath,r),a=await(await fetch(o,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...s===null||s===""?{}:{authorization:`Bearer ${s}`}},method:t.method})).text();try{return JSON.parse(a)}catch{return a}},Fe=t=>JSON.stringify(D(t.argsSchema)??{},void 0,2),re=de(null),se=()=>{const t=ce(re);if(t===null)throw new Ne("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},We=({children:t,operation:e})=>{const r=J(),s=Se(),[n,o]=B(()=>Fe(e)),[l,a]=B(""),[y,d]=B("idle"),[c,u]=B(void 0),[b,x]=B(null),[f,m]=B(null),v=async()=>{let h;try{h=n.trim()===""?{}:JSON.parse(n)}catch(S){d("error"),u(void 0),m(null),x(r("Invalid JSON args: {message}",{message:H(S)}));return}d("running"),x(null);const g=performance.now();try{const S=await(e.functionPath===void 0?ze(e,h,s.url,s.getAuthToken()):me(s,e.kind,pe(e.functionPath),h,he(l)));u(S),m(Math.round(performance.now()-g)),d("success")}catch(S){u(void 0),m(Math.round(performance.now()-g)),x(H(S)),d("error")}};return i(re,{value:{argsText:n,durationMs:f,error:b,operation:e,response:c,send:()=>{fe(v())},setArgsText:o,setShardKey:a,shardKey:l,status:y},children:t})},qe=()=>{const t=P(48),e=J(),{argsText:r,operation:s,send:n,setArgsText:o,setShardKey:l,shardKey:a,status:y}=se();let d;t[0]!==o?(d=E=>{o(E.target.value)},t[0]=o,t[1]=d):d=t[1];const c=d;let u;t[2]!==n?(u=E=>{E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),n())},t[2]=n,t[3]=u):u=t[3];const b=u,x=y==="running";let f;t[4]!==s.kind||t[5]!==s.method?(f=i(q,{kind:s.kind,method:s.method,testId:"api-try-method"}),t[4]=s.kind,t[5]=s.method,t[6]=f):f=t[6];const m=s.functionPath??s.httpPath;let v;t[7]!==m?(v=i("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:m}),t[7]=m,t[8]=v):v=t[8];const w=x?"animate-pulse":void 0;let p;t[9]!==w?(p=i(F,{className:w,icon:ie,strokeWidth:2}),t[9]=w,t[10]=p):p=t[10];let h;t[11]!==x||t[12]!==e?(h=e(x?"Sending…":"Send"),t[11]=x,t[12]=e,t[13]=h):h=t[13];let g;t[14]!==x||t[15]!==n||t[16]!==p||t[17]!==h?(g=N(W,{"data-testid":"api-try-send",disabled:x,onClick:n,size:"sm",type:"button",children:[p,h]}),t[14]=x,t[15]=n,t[16]=p,t[17]=h,t[18]=g):g=t[18];let S;t[19]!==f||t[20]!==v||t[21]!==g?(S=N("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[f,v,g]}),t[19]=f,t[20]=v,t[21]=g,t[22]=S):S=t[22];let O;t[23]!==e?(O=e("Arguments (JSON)"),t[23]=e,t[24]=O):O=t[24];let k;t[25]!==O?(k=i(U,{htmlFor:"api-try-args",children:O}),t[25]=O,t[26]=k):k=t[26];let T;t[27]!==r?(T=r.split(`
|
|
13
|
+
`),t[27]=r,t[28]=T):T=t[28];const R=Math.min(12,Math.max(3,T.length));let C;t[29]!==r||t[30]!==c||t[31]!==b||t[32]!==R?(C=i(ve,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:c,onKeyDown:b,rows:R,spellCheck:!1,value:r}),t[29]=r,t[30]=c,t[31]=b,t[32]=R,t[33]=C):C=t[33];let $;t[34]!==k||t[35]!==C?($=N("div",{className:"flex flex-col gap-1.5",children:[k,C]}),t[34]=k,t[35]=C,t[36]=$):$=t[36];let A;t[37]!==s.functionPath||t[38]!==l||t[39]!==a||t[40]!==e?(A=s.functionPath!==void 0&&N("div",{className:"flex flex-col gap-1.5",children:[i(U,{htmlFor:"shard-input",children:e("Shard key (optional)")}),i(be,{id:"shard-input",onChange:l,testId:"shard-input",value:a})]}),t[37]=s.functionPath,t[38]=l,t[39]=a,t[40]=e,t[41]=A):A=t[41];let j;t[42]!==$||t[43]!==A?(j=N("div",{className:"flex flex-col gap-3 p-3",children:[$,A]}),t[42]=$,t[43]=A,t[44]=j):j=t[44];let I;return t[45]!==j||t[46]!==S?(I=N("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[S,j]}),t[45]=j,t[46]=S,t[47]=I):I=t[47],I},He=t=>{const e=P(51),{operation:r}=t,s=J(),n=`api-operation-${r.operationId}`,o=r.key;let l;e[0]!==r.kind||e[1]!==r.method?(l=i(q,{kind:r.kind,method:r.method,testId:"api-operation-method"}),e[0]=r.kind,e[1]=r.method,e[2]=l):l=e[2];const a=r.functionPath??r.httpPath;let y;e[3]!==a?(y=i("code",{className:"truncate font-mono text-xs text-muted-foreground",children:a}),e[3]=a,e[4]=y):y=e[4];let d;e[5]!==l||e[6]!==y?(d=N("div",{className:"flex items-center gap-2",children:[l,y]}),e[5]=l,e[6]=y,e[7]=d):d=e[7];let c;e[8]!==r.title?(c=i("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:r.title}),e[8]=r.title,e[9]=c):c=e[9];let u;e[10]!==r.description?(u=r.description!==void 0&&i("p",{className:"text-sm text-muted-foreground",children:r.description}),e[10]=r.description,e[11]=u):u=e[11];let b;e[12]!==d||e[13]!==c||e[14]!==u?(b=N("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[d,c,u]}),e[12]=d,e[13]=c,e[14]=u,e[15]=b):b=e[15];let x;e[16]!==s?(x=s("Try it"),e[16]=s,e[17]=x):x=e[17];let f;e[18]!==x?(f=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:x}),e[18]=x,e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i(qe,{}),e[20]=m):m=e[20];let v;e[21]!==f?(v=N("section",{className:"flex flex-col gap-2",children:[f,m]}),e[21]=f,e[22]=v):v=e[22];let w;e[23]!==s?(w=s("Request arguments"),e[23]=s,e[24]=w):w=e[24];let p;e[25]!==w?(p=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[25]=w,e[26]=p):p=e[26];let h;e[27]!==r.argsSchema?(h=i(V,{schema:r.argsSchema,testId:"api-operation-args"}),e[27]=r.argsSchema,e[28]=h):h=e[28];let g;e[29]!==p||e[30]!==h?(g=N("section",{className:"flex flex-col gap-2",children:[p,h]}),e[29]=p,e[30]=h,e[31]=g):g=e[31];let S;e[32]!==s?(S=s("Response body"),e[32]=s,e[33]=S):S=e[33];let O;e[34]!==S?(O=i("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:S}),e[34]=S,e[35]=O):O=e[35];let k;if(e[36]!==r.responses||e[37]!==s){let C;e[39]!==s?(C=$=>N("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[N("div",{className:"flex items-center justify-between gap-2",children:[N("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${ee($.status)}`,children:[i("span",{className:`size-1.5 rounded-full ${te($.status)}`}),$.status]}),$.schema!==void 0&&i("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:s("application/json")})]}),$.description!==void 0&&i("p",{className:"text-xs text-muted-foreground",children:$.description}),$.schema!==void 0&&i(V,{schema:$.schema,testId:`api-response-${$.status}`})]},$.status),e[39]=s,e[40]=C):C=e[40],k=r.responses.map(C),e[36]=r.responses,e[37]=s,e[38]=k}else k=e[38];let T;e[41]!==O||e[42]!==k?(T=N("section",{className:"flex flex-col gap-3",children:[O,k]}),e[41]=O,e[42]=k,e[43]=T):T=e[43];let R;return e[44]!==r.key||e[45]!==n||e[46]!==v||e[47]!==g||e[48]!==T||e[49]!==b?(R=N("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[b,v,g,T]},o),e[44]=r.key,e[45]=n,e[46]=v,e[47]=g,e[48]=T,e[49]=b,e[50]=R):R=e[50],R},Ue={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Ve=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Ge=/^\s*:/,Xe=(t,e,r)=>r.startsWith('"')?Ge.test(t.slice(e))?"key":"string":r==="true"||r==="false"||r==="null"?"boolean":"number",Ye=t=>{const e=[];let r=0;for(const s of t.matchAll(Ve)){const{index:n}=s,o=s[0],l=n+o.length;n>r&&e.push({kind:"plain",start:r,text:t.slice(r,n)}),e.push({kind:Xe(t,l,o),start:n,text:o}),r=l}return r<t.length&&e.push({kind:"plain",start:r,text:t.slice(r)}),e},Qe=t=>{const e=P(4),{code:r}=t;let s;e[0]!==r?(s=Ye(r).map(Ze),e[0]=r,e[1]=s):s=e[1];let n;return e[2]!==s?(n=i(xe,{children:s}),e[2]=s,e[3]=n):n=e[3],n};function Ze(t){return i("span",{className:Ue[t.kind],children:t.text},t.start)}const ne="__live__",et=t=>t.schema===void 0?"":JSON.stringify(D(t.schema),void 0,2),tt=(t,e,r)=>r?t??"":e===void 0?"":JSON.stringify(e,ge,2),rt=t=>{const e=P(18),{active:r,running:s,showError:n}=t,o=J();if(s){let u;e[0]!==o?(u=o("Sending…"),e[0]=o,e[1]=u):u=e[1];let b;return e[2]!==u?(b=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:u}),e[2]=u,e[3]=b):b=e[3],b}if(r===void 0||r.body===""){let u;e[4]!==r?.live||e[5]!==o?(u=r?.live===!0?o("Send a request to see the response."):o("No example for this response."),e[4]=r?.live,e[5]=o,e[6]=u):u=e[6];let b;return e[7]!==u?(b=i("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:u}),e[7]=u,e[8]=b):b=e[8],b}const l=n&&"text-destructive";let a;e[9]!==l?(a=Y("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",l),e[9]=l,e[10]=a):a=e[10];const y=n?"api-response-error":"api-response-body";let d;e[11]!==r.body||e[12]!==n?(d=n?r.body:i(Qe,{code:r.body}),e[11]=r.body,e[12]=n,e[13]=d):d=e[13];let c;return e[14]!==a||e[15]!==y||e[16]!==d?(c=i("pre",{className:a,"data-testid":y,children:d}),e[14]=a,e[15]=y,e[16]=d,e[17]=c):c=e[17],c},st=({durationMs:t,error:e,failed:r,operation:s,ran:n,response:o,t:l})=>{const a=s.responses.map(d=>({body:et(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:tt(e,o,r),durationMs:t,id:ne,label:l("Live"),live:!0,status:r?"error":"200"},...a]:a},nt=()=>{const t=P(19),e=J(),{durationMs:r,error:s,operation:n,response:o,status:l}=se(),a=l==="running",y=l==="error",d=l==="success"||y,c=st({durationMs:r,error:s,failed:y,operation:n,ran:d,response:o,t:e}),u=d?ne:c.find(ot)?.id??c[0]?.id??"",[b,x]=B(null),f=c.find(E=>E.id===(b??u))??c[0];let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=E=>{const{id:L}=E.currentTarget.dataset;L!==void 0&&x(L)},t[0]=m):m=t[0];const v=m,w=()=>{f!==void 0&&X(f.body)},p=f?.live===!0?f.durationMs:null,h=f?.live===!0&&f.status==="error",g="flex min-h-0 flex-col rounded-xl border border-border bg-card",S="api-response-panel";let O;t[1]!==e?(O=e("Response"),t[1]=e,t[2]=O):O=t[2];let k;t[3]!==O?(k=i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:O}),t[3]=O,t[4]=k):k=t[4];const T=p!==null&&i("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:p})}),R=f!==void 0&&f.body!==""&&i(W,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:w,size:"icon-xs",type:"button",variant:"ghost",children:i(F,{icon:ae,strokeWidth:2})});let C;t[5]!==T||t[6]!==R?(C=N("div",{className:"flex items-center gap-2",children:[T,R]}),t[5]=T,t[6]=R,t[7]=C):C=t[7];let $;t[8]!==k||t[9]!==C?($=N("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,C]}),t[8]=k,t[9]=C,t[10]=$):$=t[10];const A=c.length>0&&i("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:c.map(E=>{const L=E.id===f?.id;return N("button",{"aria-selected":L,className:Y("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",L?ee(E.status):"text-muted-foreground"),"data-id":E.id,"data-testid":E.live?"api-response-tab-live":`api-response-tab-${E.status}`,onClick:v,role:"tab",type:"button",children:[i("span",{className:`size-1.5 rounded-full ${te(E.status)}`}),E.label]},E.id)})});let j;t[11]!==f||t[12]!==a||t[13]!==h?(j=i(rt,{active:f,running:a,showError:h}),t[11]=f,t[12]=a,t[13]=h,t[14]=j):j=t[14];let I;return t[15]!==j||t[16]!==$||t[17]!==A?(I=N("div",{className:g,"data-testid":S,children:[$,A,j]}),t[15]=j,t[16]=$,t[17]=A,t[18]=I):I=t[18],I};function ot(t){return t.status.startsWith("2")}const it=(t,e)=>{const r=e.trim().toLowerCase();return r===""?t:t.map(s=>({...s,operations:s.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(r))})).filter(s=>s.operations.length>0)},wt=t=>{const e=P(53),{model:r}=t,s=J(),n=r.groups[0]?.operations[0]?.key??"",[o,l]=B(n),[a,y]=B("");let d;e[0]!==n||e[1]!==r.operationByKey||e[2]!==o?(d=r.operationByKey.get(o)??r.operationByKey.get(n),e[0]=n,e[1]=r.operationByKey,e[2]=o,e[3]=d):d=e[3];const c=d;let u,b,x,f,m,v,w,p,h,g;if(e[4]!==a||e[5]!==r.groups||e[6]!==r.server||e[7]!==c?.key||e[8]!==s){u=it(r.groups,a);let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=M=>{const{key:_}=M.currentTarget.dataset;_!==void 0&&l(_)},e[19]=C):C=e[19];const $=C;let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=M=>{y(M.target.value)},e[20]=A):A=e[20];const j=A;b=r.server??"",h="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",g="api-reference",e[21]!==s?(m=s("API operations"),e[21]=s,e[22]=m):m=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",w="api-reference-nav";let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=i(F,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:le,strokeWidth:2}),e[23]=I):I=e[23];let E;e[24]!==s?(E=s("Filter operations"),e[24]=s,e[25]=E):E=e[25],e[26]!==a||e[27]!==E?(p=i("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:N("div",{className:"relative",children:[I,i(ue,{className:"h-7 pl-7","data-testid":"api-filter",onChange:j,placeholder:E,value:a})]})}),e[26]=a,e[27]=E,e[28]=p):p=e[28],x="flex flex-col gap-4 p-2";let L;e[29]!==c?.key||e[30]!==s?(L=M=>N("div",{className:"flex flex-col gap-1",children:[N("div",{className:"flex items-center justify-between px-2",children:[i("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M.name||s("(root)")}),i("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:M.operations.length})]}),M.operations.map(_=>{const oe=_.key===c?.key;return N("button",{"aria-current":oe?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":_.key,"data-testid":`api-nav-${_.operationId}`,onClick:$,type:"button",children:[i("span",{className:"truncate",children:_.summary}),i(q,{kind:_.kind,method:_.method})]},_.key)})]},M.name),e[29]=c?.key,e[30]=s,e[31]=L):L=e[31],f=u.map(L),e[4]=a,e[5]=r.groups,e[6]=r.server,e[7]=c?.key,e[8]=s,e[9]=u,e[10]=b,e[11]=x,e[12]=f,e[13]=m,e[14]=v,e[15]=w,e[16]=p,e[17]=h,e[18]=g}else u=e[9],b=e[10],x=e[11],f=e[12],m=e[13],v=e[14],w=e[15],p=e[16],h=e[17],g=e[18];let S;e[32]!==u.length||e[33]!==s?(S=u.length===0&&i("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:s("No operations match your filter.")}),e[32]=u.length,e[33]=s,e[34]=S):S=e[34];let O;e[35]!==S||e[36]!==x||e[37]!==f?(O=N("div",{className:x,children:[f,S]}),e[35]=S,e[36]=x,e[37]=f,e[38]=O):O=e[38];let k;e[39]!==O||e[40]!==m||e[41]!==v||e[42]!==w||e[43]!==p?(k=N("nav",{"aria-label":m,className:v,"data-testid":w,children:[p,O]}),e[39]=O,e[40]=m,e[41]=v,e[42]=w,e[43]=p,e[44]=k):k=e[44];let T;e[45]!==c||e[46]!==b?(T=c===void 0?i("div",{className:"lg:col-span-2"}):N(We,{operation:c,children:[i("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:i(He,{operation:c})}),N("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[i(Pe,{operation:c,server:b}),i(nt,{})]})]},c.key),e[45]=c,e[46]=b,e[47]=T):T=e[47];let R;return e[48]!==k||e[49]!==T||e[50]!==h||e[51]!==g?(R=N("div",{className:h,"data-testid":g,children:[k,T]}),e[48]=k,e[49]=T,e[50]=h,e[51]=g,e[52]=R):R=e[52],R};export{wt as R};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as y}from"react/compiler-runtime";import{Handle as L,Position as R,useNodesState as q,useEdgesState as Q,ReactFlow as Z,Background as J,Panel as k,Controls as X,MiniMap as ee,useNodesInitialized as te,useReactFlow as se}from"@xyflow/react";import{useState as D,useMemo as _,useRef as oe,useEffect as w}from"react";import{D as ae}from"./diagram-export-panel-BMLzao0Y.mjs";import{S as ne,T as x}from"./storage-tier-C2mKwYRj.mjs";import{B as E}from"./badge-r_5B4LHP.mjs";import{B as A}from"./button-q0UYSmrn.mjs";import{I as re}from"./input-CXhxesPC.mjs";import{useT as M}from"./DEFAULT_LOCALE-A1Yg5ORA.mjs";import{f as le}from"./internal-BXEjuLPN.mjs";import{c as N}from"./utils-bhneXptQ.mjs";import{jsx as c,jsxs as h}from"react/jsx-runtime";function ie(s){const e=y(10);let t,n,o;e[0]!==s?({className:t,selected:o,...n}=s,e[0]=s,e[1]=t,e[2]=n,e[3]=o):(t=e[1],n=e[2],o=e[3]);const r=o===!0?"":void 0;let a;e[4]!==t?(a=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=a):a=e[5];let l;return e[6]!==n||e[7]!==r||e[8]!==a?(l=c("div",{"data-slot":"base-node","data-selected":r,className:a,...n}),e[6]=n,e[7]=r,e[8]=a,e[9]=l):l=e[9],l}function ce(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-header",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}function de(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex flex-col",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-content",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}const me=3,fe=(s,e,t)=>{const n=e?s:s.slice(0,me),o=n.map(a=>JSON.stringify(a)).join(" | "),r=s.length-n.length;return r>0?`${o} ${t("+{count} more",{count:r})}`:o},H=(s,e,t)=>{const n=s.enumValues??[],o=n.length===0?s.type:fe(n,e,t),r=s.ref===void 0?o:`${o} → ${s.ref}`;return s.optional===!0?`${r}?`:r},ue=s=>{const e=y(23),{data:t,selected:n}=s,o=M();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==o?(r=t.loadError===!0?c("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:o("Columns unavailable")}):c("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=o,e[3]=r):r=e[3];const a=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=c("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=c("span",{className:"ms-auto",children:c(ne,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==d||e[9]!==m?(i=h(ce,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=i):i=e[10];let f;e[11]!==t.columns||e[12]!==t.label||e[13]!==a||e[14]!==o?(f=t.columns.length===0?a:t.columns.map(p=>h("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",p.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${p.name}`,children:[c(L,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Left,type:"target"}),c("span",{className:"truncate font-mono",title:p.name,children:p.name}),p.pk===!0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),p.ref!==void 0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),c("span",{className:"ms-auto truncate text-muted-foreground",title:H(p,!0,o),children:H(p,!1,o)}),c(L,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Right,type:"source"})]},p.name)),e[11]=t.columns,e[12]=t.label,e[13]=a,e[14]=o,e[15]=f):f=e[15];let u;e[16]!==f?(u=c(de,{children:f}),e[16]=f,e[17]=u):u=e[17];let b;return e[18]!==n||e[19]!==l||e[20]!==i||e[21]!==u?(b=h(ie,{className:"w-64 overflow-hidden","data-testid":l,selected:n,children:[i,u]}),e[18]=n,e[19]=l,e[20]=i,e[21]=u,e[22]=b):b=e[22],b},F=256,z=112,O=36,v=24,pe=480,he=1.4,ge=s=>{const e=Math.max(1,Math.round(Math.sqrt(he*s/(F+z))));return Math.max(pe,s/e)},be=38,xe=28,B=s=>be+Math.max(1,s)*xe,Ne=(s,e)=>{const t=new Map;for(const a of s)t.set(a,[]);for(const a of e)a.to!==a.from&&t.has(a.from)&&t.has(a.to)&&t.get(a.from)?.push(a.to);const n=new Map,o=new Set,r=a=>{const l=n.get(a);if(l!==void 0)return l;if(o.has(a))return 0;o.add(a);let d=0;for(const m of t.get(a)??[])d=Math.max(d,r(m)+1);return o.delete(a),n.set(a,d),d};for(const a of s)r(a);return n},ye=(s,e,t)=>{const n=Ne(s,e),o=new Map;for(const m of s){const i=n.get(m)??0,f=o.get(i);f===void 0?o.set(i,[m]):f.push(m)}const r=s.reduce((m,i)=>m+B(t.get(i)??0)+O,0),a=ge(r),l=[];let d=0;for(const m of[...o.keys()].toSorted((i,f)=>i-f)){let i=0,f=v;for(const u of o.get(m)??[]){const b=B(t.get(u)??0);f>v&&f+b>a&&(i+=1,f=v),l.push({name:u,x:v+(d+i)*(F+z),y:f}),f+=b+O}d+=i+1}return l},ve={databaseSchema:ue},G={backgroundColor:x.shard.color},I={backgroundColor:x.global.color},Ee={global:!0,shard:!0},Se={},_e=s=>{const e=s.find(t=>t.pk===!0)?.name;return e!==void 0?e:s.some(t=>t.name==="_id")?"_id":s.some(t=>t.name==="id")?"id":s[0]?.name??"_id"},K=s=>s.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),we=(s,e,t)=>{const n=s.map(l=>l.name),o=new Map(s.map(l=>[l.name,l.columns.length])),r=ye(n,K(s),o),a=new Map(s.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const i=a.get(l);return i===void 0?[]:[{className:t[l],data:{columns:i.columns,label:l,loadError:e,tier:i.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Me=s=>{const e=new Map(s.map(t=>[t.name,t.columns]));return K(s).flatMap(t=>{const n=e.get(t.to)??[],o=e.get(t.from)??[],r=_e(n);return!n.some(a=>a.name===r)||!o.some(a=>a.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ce=()=>{const s=y(15),e=M();let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),s[0]=t):t=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]}),s[1]=n):n=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),s[2]=o):o=s[2];let r;s[3]!==e?(r=e("Primary key"),s[3]=e,s[4]=r):r=s[4];let a;s[5]!==r?(a=h("span",{className:"flex items-center gap-1",children:[o,r]}),s[5]=r,s[6]=a):a=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),s[7]=l):l=s[7];let d;s[8]!==e?(d=e("Foreign key"),s[8]=e,s[9]=d):d=s[9];let m;s[10]!==d?(m=h("span",{className:"flex items-center gap-1",children:[l,d]}),s[10]=d,s[11]=m):m=s[11];let i;return s[12]!==a||s[13]!==m?(i=h("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,n,a,m]}),s[12]=a,s[13]=m,s[14]=i):i=s[14],i},$e=12,Te=s=>{const e=y(9),{containerRef:t,seedKey:n}=s,o=te(),{fitView:r}=se();let a;e[0]!==t||e[1]!==r||e[2]!==o?(a=()=>{if(!o)return;const d=()=>{le(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const i=new ResizeObserver(()=>{d()});return i.observe(m),()=>{i.disconnect()}},e[0]=t,e[1]=r,e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==o||e[7]!==n?(l=[t,r,o,n],e[4]=t,e[5]=r,e[6]=o,e[7]=n,e[8]=l):l=e[8],w(a,l),null},Ke=({columnsError:s,fill:e=!1,nodeClasses:t,tables:n,testIdPrefix:o})=>{const r=M(),[a,l]=D(Ee),[d,m]=D(""),i=_(()=>{const g=d.trim().toLowerCase();return n.filter(T=>a[T.tier]&&T.name.toLowerCase().includes(g))},[n,a,d]),f=_(()=>we(i,s??!1,t??Se),[i,s,t]),u=_(()=>Me(i),[i]),b=i.map(g=>g.name).join(","),[p,C,P]=q(f),[U,$,j]=Q(u),S=oe(null);w(()=>{C(f)},[f,C]),w(()=>{$(u)},[u,$]);const V=g=>{m(g.target.value)},W=()=>{l(g=>({...g,shard:!g.shard}))},Y=()=>{l(g=>({...g,global:!g.global}))};return n.length===0?c("section",{className:"flex flex-col gap-2","data-testid":`${o}-section`,children:c("p",{className:"text-sm text-muted-foreground","data-testid":`${o}-empty`,children:r("No tables to graph.")})}):c("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${o}-section`,children:c("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${o}-canvas`,ref:S,children:h(Z,{edges:U,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:p,nodesConnectable:!1,nodeTypes:ve,onEdgesChange:j,onNodesChange:P,children:[c(J,{}),c(k,{position:"top-left",children:h("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[c(re,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${o}-find`,onChange:V,placeholder:r("Find table…"),value:d}),h("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[h(A,{"aria-pressed":a.shard,className:"gap-1.5","data-testid":`${o}-tier-shard`,onClick:W,size:"xs",type:"button",variant:a.shard?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),h(A,{"aria-pressed":a.global,className:"gap-1.5","data-testid":`${o}-tier-global`,onClick:Y,size:"xs",type:"button",variant:a.global?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]})]})]})}),c(k,{position:"bottom-center",children:c(Ce,{})}),c(X,{showInteractive:!1}),i.length>$e&&c(ee,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),c(ae,{containerRef:S,filenameBase:`${o}-schema-diagram`,testIdPrefix:o}),c(Te,{containerRef:S,seedKey:b})]})})})};export{Ke as S};
|
|
2
|
+
import{c as y}from"react/compiler-runtime";import{Handle as L,Position as R,useNodesState as q,useEdgesState as Q,ReactFlow as Z,Background as J,Panel as k,Controls as X,MiniMap as ee,useNodesInitialized as te,useReactFlow as se}from"@xyflow/react";import{useState as D,useMemo as _,useRef as oe,useEffect as w}from"react";import{D as ae}from"./diagram-export-panel-aBDQdX4e.mjs";import{S as ne,T as x}from"./storage-tier-C2mKwYRj.mjs";import{B as E}from"./badge-r_5B4LHP.mjs";import{B as A}from"./button-q0UYSmrn.mjs";import{I as re}from"./input-CXhxesPC.mjs";import{useT as M}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as le}from"./internal-BXEjuLPN.mjs";import{c as N}from"./utils-bhneXptQ.mjs";import{jsx as c,jsxs as h}from"react/jsx-runtime";function ie(s){const e=y(10);let t,n,o;e[0]!==s?({className:t,selected:o,...n}=s,e[0]=s,e[1]=t,e[2]=n,e[3]=o):(t=e[1],n=e[2],o=e[3]);const r=o===!0?"":void 0;let a;e[4]!==t?(a=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=a):a=e[5];let l;return e[6]!==n||e[7]!==r||e[8]!==a?(l=c("div",{"data-slot":"base-node","data-selected":r,className:a,...n}),e[6]=n,e[7]=r,e[8]=a,e[9]=l):l=e[9],l}function ce(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-header",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}function de(s){const e=y(8);let t,n;e[0]!==s?({className:t,...n}=s,e[0]=s,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let o;e[3]!==t?(o=N("flex flex-col",t),e[3]=t,e[4]=o):o=e[4];let r;return e[5]!==n||e[6]!==o?(r=c("div",{"data-slot":"base-node-content",className:o,...n}),e[5]=n,e[6]=o,e[7]=r):r=e[7],r}const me=3,fe=(s,e,t)=>{const n=e?s:s.slice(0,me),o=n.map(a=>JSON.stringify(a)).join(" | "),r=s.length-n.length;return r>0?`${o} ${t("+{count} more",{count:r})}`:o},H=(s,e,t)=>{const n=s.enumValues??[],o=n.length===0?s.type:fe(n,e,t),r=s.ref===void 0?o:`${o} → ${s.ref}`;return s.optional===!0?`${r}?`:r},ue=s=>{const e=y(23),{data:t,selected:n}=s,o=M();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==o?(r=t.loadError===!0?c("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:o("Columns unavailable")}):c("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=o,e[3]=r):r=e[3];const a=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=c("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=c("span",{className:"ms-auto",children:c(ne,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==d||e[9]!==m?(i=h(ce,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=i):i=e[10];let f;e[11]!==t.columns||e[12]!==t.label||e[13]!==a||e[14]!==o?(f=t.columns.length===0?a:t.columns.map(p=>h("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",p.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${p.name}`,children:[c(L,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Left,type:"target"}),c("span",{className:"truncate font-mono",title:p.name,children:p.name}),p.pk===!0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),p.ref!==void 0&&c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),c("span",{className:"ms-auto truncate text-muted-foreground",title:H(p,!0,o),children:H(p,!1,o)}),c(L,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:R.Right,type:"source"})]},p.name)),e[11]=t.columns,e[12]=t.label,e[13]=a,e[14]=o,e[15]=f):f=e[15];let u;e[16]!==f?(u=c(de,{children:f}),e[16]=f,e[17]=u):u=e[17];let b;return e[18]!==n||e[19]!==l||e[20]!==i||e[21]!==u?(b=h(ie,{className:"w-64 overflow-hidden","data-testid":l,selected:n,children:[i,u]}),e[18]=n,e[19]=l,e[20]=i,e[21]=u,e[22]=b):b=e[22],b},F=256,z=112,O=36,v=24,pe=480,he=1.4,ge=s=>{const e=Math.max(1,Math.round(Math.sqrt(he*s/(F+z))));return Math.max(pe,s/e)},be=38,xe=28,B=s=>be+Math.max(1,s)*xe,Ne=(s,e)=>{const t=new Map;for(const a of s)t.set(a,[]);for(const a of e)a.to!==a.from&&t.has(a.from)&&t.has(a.to)&&t.get(a.from)?.push(a.to);const n=new Map,o=new Set,r=a=>{const l=n.get(a);if(l!==void 0)return l;if(o.has(a))return 0;o.add(a);let d=0;for(const m of t.get(a)??[])d=Math.max(d,r(m)+1);return o.delete(a),n.set(a,d),d};for(const a of s)r(a);return n},ye=(s,e,t)=>{const n=Ne(s,e),o=new Map;for(const m of s){const i=n.get(m)??0,f=o.get(i);f===void 0?o.set(i,[m]):f.push(m)}const r=s.reduce((m,i)=>m+B(t.get(i)??0)+O,0),a=ge(r),l=[];let d=0;for(const m of[...o.keys()].toSorted((i,f)=>i-f)){let i=0,f=v;for(const u of o.get(m)??[]){const b=B(t.get(u)??0);f>v&&f+b>a&&(i+=1,f=v),l.push({name:u,x:v+(d+i)*(F+z),y:f}),f+=b+O}d+=i+1}return l},ve={databaseSchema:ue},G={backgroundColor:x.shard.color},I={backgroundColor:x.global.color},Ee={global:!0,shard:!0},Se={},_e=s=>{const e=s.find(t=>t.pk===!0)?.name;return e!==void 0?e:s.some(t=>t.name==="_id")?"_id":s.some(t=>t.name==="id")?"id":s[0]?.name??"_id"},K=s=>s.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),we=(s,e,t)=>{const n=s.map(l=>l.name),o=new Map(s.map(l=>[l.name,l.columns.length])),r=ye(n,K(s),o),a=new Map(s.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const i=a.get(l);return i===void 0?[]:[{className:t[l],data:{columns:i.columns,label:l,loadError:e,tier:i.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Me=s=>{const e=new Map(s.map(t=>[t.name,t.columns]));return K(s).flatMap(t=>{const n=e.get(t.to)??[],o=e.get(t.from)??[],r=_e(n);return!n.some(a=>a.name===r)||!o.some(a=>a.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ce=()=>{const s=y(15),e=M();let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),s[0]=t):t=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=h("span",{className:"flex items-center gap-1",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]}),s[1]=n):n=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),s[2]=o):o=s[2];let r;s[3]!==e?(r=e("Primary key"),s[3]=e,s[4]=r):r=s[4];let a;s[5]!==r?(a=h("span",{className:"flex items-center gap-1",children:[o,r]}),s[5]=r,s[6]=a):a=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=c(E,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),s[7]=l):l=s[7];let d;s[8]!==e?(d=e("Foreign key"),s[8]=e,s[9]=d):d=s[9];let m;s[10]!==d?(m=h("span",{className:"flex items-center gap-1",children:[l,d]}),s[10]=d,s[11]=m):m=s[11];let i;return s[12]!==a||s[13]!==m?(i=h("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,n,a,m]}),s[12]=a,s[13]=m,s[14]=i):i=s[14],i},$e=12,Te=s=>{const e=y(9),{containerRef:t,seedKey:n}=s,o=te(),{fitView:r}=se();let a;e[0]!==t||e[1]!==r||e[2]!==o?(a=()=>{if(!o)return;const d=()=>{le(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const i=new ResizeObserver(()=>{d()});return i.observe(m),()=>{i.disconnect()}},e[0]=t,e[1]=r,e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==o||e[7]!==n?(l=[t,r,o,n],e[4]=t,e[5]=r,e[6]=o,e[7]=n,e[8]=l):l=e[8],w(a,l),null},Ke=({columnsError:s,fill:e=!1,nodeClasses:t,tables:n,testIdPrefix:o})=>{const r=M(),[a,l]=D(Ee),[d,m]=D(""),i=_(()=>{const g=d.trim().toLowerCase();return n.filter(T=>a[T.tier]&&T.name.toLowerCase().includes(g))},[n,a,d]),f=_(()=>we(i,s??!1,t??Se),[i,s,t]),u=_(()=>Me(i),[i]),b=i.map(g=>g.name).join(","),[p,C,P]=q(f),[U,$,j]=Q(u),S=oe(null);w(()=>{C(f)},[f,C]),w(()=>{$(u)},[u,$]);const V=g=>{m(g.target.value)},W=()=>{l(g=>({...g,shard:!g.shard}))},Y=()=>{l(g=>({...g,global:!g.global}))};return n.length===0?c("section",{className:"flex flex-col gap-2","data-testid":`${o}-section`,children:c("p",{className:"text-sm text-muted-foreground","data-testid":`${o}-empty`,children:r("No tables to graph.")})}):c("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${o}-section`,children:c("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${o}-canvas`,ref:S,children:h(Z,{edges:U,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:p,nodesConnectable:!1,nodeTypes:ve,onEdgesChange:j,onNodesChange:P,children:[c(J,{}),c(k,{position:"top-left",children:h("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[c(re,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${o}-find`,onChange:V,placeholder:r("Find table…"),value:d}),h("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[h(A,{"aria-pressed":a.shard,className:"gap-1.5","data-testid":`${o}-tier-shard`,onClick:W,size:"xs",type:"button",variant:a.shard?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:G}),x.shard.label]}),h(A,{"aria-pressed":a.global,className:"gap-1.5","data-testid":`${o}-tier-global`,onClick:Y,size:"xs",type:"button",variant:a.global?"default":"outline",children:[c("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:I}),x.global.label]})]})]})}),c(k,{position:"bottom-center",children:c(Ce,{})}),c(X,{showInteractive:!1}),i.length>$e&&c(ee,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),c(ae,{containerRef:S,filenameBase:`${o}-schema-diagram`,testIdPrefix:o}),c(Te,{containerRef:S,seedKey:b})]})})})};export{Ke as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k}from"react/compiler-runtime";import{AreaChart as R,CartesianGrid as g,XAxis as N,Area as B,LineChart as X,Line as $}from"recharts";import{useT as S}from"./DEFAULT_LOCALE-
|
|
1
|
+
import{c as k}from"react/compiler-runtime";import{AreaChart as R,CartesianGrid as g,XAxis as N,Area as B,LineChart as X,Line as $}from"recharts";import{useT as S}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as E}from"./internal-BXEjuLPN.mjs";import{E as H,X as _,B as j,T as G,C as O,a as A,b as K}from"./bar-chart-BCsEIQoQ.mjs";import{jsx as l,jsxs as T}from"react/jsx-runtime";import{c as V,a as z,b as L,e as F,d as I,T as M}from"./table-D0SBiDu-.mjs";import{C as U}from"./data-grid-r3isM8Nq.mjs";const W=50,q={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},D=o=>{const e=o.columns.find(n=>o.rows.length>0&&o.rows.every(a=>typeof a[n]=="number"))??null;return{label:o.columns.find(n=>n!==e)??null,value:e}},J=o=>{const e=k(3),{data:t,kind:n}=o;let a;return e[0]!==t||e[1]!==n?(a=l(O,{className:"h-full w-full",config:q,children:n==="area"?T(R,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l(B,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):T(X,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l($,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),e[0]=t,e[1]=n,e[2]=a):a=e[2],a},oe=o=>{const e=k(21),{axes:t,kind:n,result:a}=o,u=S();let r;e[0]!==a?(r=D(a),e[0]=a,e[1]=r):r=e[1];const d=r;let m;e[2]!==a.columns?(m=new Set(a.columns),e[2]=a.columns,e[3]=m):m=e[3];const s=m,i=t!==void 0&&s.has(t.x)?t.x:d.label;let h;e[4]!==t?.y||e[5]!==s?(h=t?.y.find(c=>s.has(c)),e[4]=t?.y,e[5]=s,e[6]=h):h=e[6];const b=h,C=b??d.value;let w;e[7]!==i||e[8]!==a.rows||e[9]!==C?(w=C===null?[]:a.rows.slice(0,W).map((c,v)=>({label:i===null?`#${(v+1).toString()}`:E(c[i]),value:Number(c[C])||0})),e[7]=i,e[8]=a.rows,e[9]=C,e[10]=w):w=e[10];const x=w;if(C===null){let c;e[11]!==u?(c=u("No numeric column to chart."),e[11]=u,e[12]=c):c=e[12];let v;return e[13]!==c?(v=l("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:c}),e[13]=c,e[14]=v):v=e[14],v}const f=n??(t!==void 0&&b!==void 0?t.kind:"bar");let p;e[15]!==x||e[16]!==f?(p=f==="bar"?T(H,{className:"h-full w-full",config:q,data:x,children:[l(_,{dataKey:"label"}),l(j,{dataKey:"value"}),l(G,{})]}):l(J,{data:x,kind:f}),e[15]=x,e[16]=f,e[17]=p):p=e[17];let y;return e[18]!==f||e[19]!==p?(y=l("div",{className:"h-80 w-full p-3","data-chart-kind":f,"data-testid":"sql-chart",children:p}),e[18]=f,e[19]=p,e[20]=y):y=e[20],y},ne=o=>{const e=k(19),{result:t}=o,n=S();if(t.columns.length===0){let s;e[0]!==t.rowCount||e[1]!==n?(s=n("{count} rows",{count:t.rowCount}),e[0]=t.rowCount,e[1]=n,e[2]=s):s=e[2];let i;return e[3]!==s?(i=l("p",{className:"p-4 text-sm text-muted-foreground",children:s}),e[3]=s,e[4]=i):i=e[4],i}let a;e[5]!==t.columns?(a=t.columns.map(P),e[5]=t.columns,e[6]=a):a=e[6];let u;e[7]!==a?(u=l(z,{className:"sticky top-0 z-10 bg-muted",children:l(L,{children:a})}),e[7]=a,e[8]=u):u=e[8];let r;if(e[9]!==t.columns||e[10]!==t.rows){let s;e[12]!==t.columns?(s=(i,h)=>l(L,{"data-testid":"sql-row",children:t.columns.map(b=>l(F,{className:"max-w-md truncate font-mono text-xs",children:l(U,{value:i[b]})},b))},h),e[12]=t.columns,e[13]=s):s=e[13],r=t.rows.map(s),e[9]=t.columns,e[10]=t.rows,e[11]=r}else r=e[11];let d;e[14]!==r?(d=l(I,{children:r}),e[14]=r,e[15]=d):d=e[15];let m;return e[16]!==u||e[17]!==d?(m=T(M,{"data-testid":"sql-rows",children:[u,d]}),e[16]=u,e[17]=d,e[18]=m):m=e[18],m};function P(o){return l(V,{children:o},o)}export{oe as S,ne as a};
|