@lunora/studio 1.0.0-alpha.34 → 1.0.0-alpha.340
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/LICENSE.md +6 -0
- package/README.md +1 -1
- package/dist/index.d.mts +1597 -0
- package/dist/index.d.ts +991 -807
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +22 -0
- package/dist/mount.d.ts +11 -10
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +6 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-panel.mjs +1 -0
- package/dist/packem_chunks/architecture-panel.mjs +1 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
- package/dist/packem_chunks/auth-config-panel.mjs +1 -0
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
- package/dist/packem_chunks/containers-panel.mjs +1 -0
- package/dist/packem_chunks/dashboards-panel.mjs +1 -0
- package/dist/packem_chunks/evals-panel.mjs +1 -0
- package/dist/packem_chunks/fanout-panel.mjs +1 -0
- package/dist/packem_chunks/flags-panel.mjs +1 -0
- package/dist/packem_chunks/issues-panel.mjs +1 -0
- package/dist/packem_chunks/kv-browser.mjs +1 -0
- package/dist/packem_chunks/log-drains-panel.mjs +4 -0
- package/dist/packem_chunks/migrations-route.mjs +1 -0
- package/dist/packem_chunks/organizations-panel.mjs +1 -0
- package/dist/packem_chunks/payments-panel.mjs +1 -0
- package/dist/packem_chunks/permissions-panel.mjs +1 -0
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
- package/dist/packem_chunks/queues-panel.mjs +1 -0
- package/dist/packem_chunks/reactors-panel.mjs +1 -0
- package/dist/packem_chunks/rls-panel.mjs +1 -0
- package/dist/packem_chunks/schedule-panel.mjs +1 -0
- package/dist/packem_chunks/sparkline.mjs +1 -0
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
- package/dist/packem_chunks/sync-client-panel.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -0
- package/dist/packem_chunks/users-panel.mjs +1 -0
- package/dist/packem_chunks/vector-browser.mjs +1 -0
- package/dist/packem_chunks/workflows-panel.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-Py7C4ibM.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-DlYVADAy.mjs +1 -0
- package/dist/packem_shared/CommandPalette-CM1hqAOD.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DvhNw0BI.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
- package/dist/packem_shared/DataBrowser-DxlLv5x1.mjs +4 -0
- package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-TFTQpSVj.mjs +1 -0
- package/dist/packem_shared/HomePanel-BVz2sDQ4.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-fUyhbt0w.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-nYyfjjse.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-zSeU_6cN.mjs +1 -0
- package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
- package/dist/packem_shared/Studio-CNqMkRmB.mjs +1 -0
- package/dist/packem_shared/StudioApp-CUxEVr__.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
- package/dist/packem_shared/advisor-view-CXiPdw4B.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-D45VvUTx.d.mts +351 -0
- package/dist/packem_shared/app.d-D45VvUTx.d.ts +351 -0
- package/dist/packem_shared/auth-pager-DiDnXsfe.mjs +1 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
- package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
- package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
- package/dist/packem_shared/data-grid-BHTuvSI7.mjs +1 -0
- package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-BMLzao0Y.mjs +2 -0
- package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
- package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
- package/dist/packem_shared/error-alert-D-ftqyo-.mjs +1 -0
- package/dist/packem_shared/grid-features-CIdZ8Dqo.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
- package/dist/packem_shared/home-panel-CF-MfsnH.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-BXEjuLPN.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
- package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
- package/dist/packem_shared/log-line-BWDt_F56.mjs +1 -0
- package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-CFBkH4uZ.mjs +1 -0
- package/dist/packem_shared/reference-view-BrsL8UGn.mjs +13 -0
- package/dist/packem_shared/schema-diagram-ghsOCED7.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-COsfUSGc.mjs +1 -0
- package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-BcHsk7mT.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-DwqtHSHU.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-I1uILsUP.mjs +1 -0
- package/dist/packem_shared/use-admin-spec-BdNLZbTO.mjs +1 -0
- package/dist/packem_shared/use-async-submit-2eBBD0-m.mjs +1 -0
- package/dist/packem_shared/use-auth-config-DQ8tNyBh.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-B_0LbTD7.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-DetnUyFf.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/standalone/chunk-253UHWDX.js +1 -0
- package/dist/standalone/chunk-2I4NHEKA.js +1 -0
- package/dist/standalone/chunk-2IKDEUCX.js +1 -0
- package/dist/standalone/chunk-2SNK7KHX.js +1 -0
- package/dist/standalone/chunk-37WYCOQ2.js +1 -0
- package/dist/standalone/chunk-3FYMEXVB.js +1 -0
- package/dist/standalone/chunk-3N5PRV3V.js +1 -0
- package/dist/standalone/chunk-3YXASVTP.js +1 -0
- package/dist/standalone/chunk-43GV7LQK.js +1 -0
- package/dist/standalone/chunk-4CGBMYO3.js +6 -0
- package/dist/standalone/chunk-4NOMAGEO.js +1 -0
- package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
- package/dist/standalone/chunk-55UGUCQ6.js +1 -0
- package/dist/standalone/chunk-5B2RTXBS.js +1 -0
- package/dist/standalone/chunk-5QR2SQIS.js +1 -0
- package/dist/standalone/chunk-5SLTDY4C.js +1 -0
- package/dist/standalone/chunk-5Y5UTG4N.js +1 -0
- package/dist/standalone/chunk-6XKL22OG.js +3 -0
- package/dist/standalone/chunk-6ZSIPBTC.js +6 -0
- package/dist/standalone/chunk-74IYYDDI.js +19 -0
- package/dist/standalone/chunk-7G4Z6Q7X.js +1 -0
- package/dist/standalone/chunk-7GVT36VI.js +1 -0
- package/dist/standalone/chunk-7Q256NLI.js +1 -0
- package/dist/standalone/chunk-7RKB5KS7.js +1 -0
- package/dist/standalone/chunk-7Y3SY37W.js +1 -0
- package/dist/standalone/chunk-APEQELK3.js +1 -0
- package/dist/standalone/chunk-AUAECCXB.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-AUGKHAMQ.js} +1 -1
- package/dist/standalone/chunk-BFQMOALO.js +1 -0
- package/dist/standalone/chunk-BOMPSVRC.js +1 -0
- package/dist/standalone/chunk-BTG6YDYM.js +1 -0
- package/dist/standalone/chunk-BTQ72TPT.js +1 -0
- package/dist/standalone/chunk-CCDX5RYT.js +1 -0
- package/dist/standalone/chunk-CGQMJYCW.js +1 -0
- package/dist/standalone/chunk-CVXNHIQW.js +1 -0
- package/dist/standalone/chunk-DBHZXRL6.js +1 -0
- package/dist/standalone/chunk-DBZ4TBP5.js +1 -0
- package/dist/standalone/chunk-DEFCA7GG.js +5 -0
- package/dist/standalone/chunk-DHGPCQ2F.js +1 -0
- package/dist/standalone/chunk-E4PXACVL.js +3 -0
- package/dist/standalone/chunk-E5DXYVPB.js +1 -0
- package/dist/standalone/chunk-ECY2JC5F.js +1 -0
- package/dist/standalone/chunk-EE227HDE.js +1 -0
- package/dist/standalone/chunk-ENIA26XP.js +1 -0
- package/dist/standalone/chunk-EWMBX5N2.js +1 -0
- package/dist/standalone/chunk-FCXFQF2W.js +1 -0
- package/dist/standalone/chunk-FPI7AMQJ.js +1 -0
- package/dist/standalone/chunk-FUL4ROKH.js +1 -0
- package/dist/standalone/chunk-FUYEZFBP.js +1 -0
- package/dist/standalone/chunk-G2F22AMT.js +1 -0
- package/dist/standalone/chunk-GC4XRCRZ.js +1 -0
- package/dist/standalone/chunk-GHQ2VDI2.js +1 -0
- package/dist/standalone/chunk-GOFZ4Y74.js +1 -0
- package/dist/standalone/chunk-GUDC24NJ.js +1 -0
- package/dist/standalone/chunk-GWVYDOBH.js +1 -0
- package/dist/standalone/chunk-GYBCO7NN.js +1 -0
- package/dist/standalone/chunk-HCFJBY65.js +1 -0
- package/dist/standalone/chunk-HCTJKP5J.js +1 -0
- package/dist/standalone/chunk-HGHIVU76.js +1 -0
- package/dist/standalone/chunk-HH52IEFY.js +4 -0
- package/dist/standalone/chunk-HIJGQX6F.js +4 -0
- package/dist/standalone/chunk-HPYJUVCC.js +1 -0
- package/dist/standalone/chunk-I26MS5PJ.js +1 -0
- package/dist/standalone/chunk-ICRKYAYO.js +1 -0
- package/dist/standalone/chunk-IRSSZXC3.js +1 -0
- package/dist/standalone/chunk-ITT6MM23.js +1 -0
- package/dist/standalone/chunk-IWZ7GVQO.js +1 -0
- package/dist/standalone/chunk-JR4ROUBB.js +1 -0
- package/dist/standalone/chunk-K2EHRNYW.js +1 -0
- package/dist/standalone/chunk-K3UAOIR7.js +1 -0
- package/dist/standalone/chunk-KCFO2BVI.js +15 -0
- package/dist/standalone/chunk-KF7Y5S5O.js +1 -0
- package/dist/standalone/chunk-LHG2JVIM.js +2 -0
- package/dist/standalone/chunk-LXCVA5SP.js +1 -0
- package/dist/standalone/chunk-M3QKMHAP.js +15 -0
- package/dist/standalone/chunk-MVWZMWPD.js +1 -0
- package/dist/standalone/chunk-NCBLHBRW.js +1 -0
- package/dist/standalone/chunk-NCCORPSU.js +7 -0
- package/dist/standalone/chunk-NCPW7WHO.js +1 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NQZALRU3.js +1 -0
- package/dist/standalone/chunk-NRP22GKC.js +1 -0
- package/dist/standalone/chunk-NXQW5E6W.js +1 -0
- package/dist/standalone/chunk-O2FW4VRL.js +1 -0
- package/dist/standalone/chunk-OI5HX3ZO.js +1 -0
- package/dist/standalone/chunk-OLIKYC3C.js +59 -0
- package/dist/standalone/chunk-OPM7ESDV.js +1 -0
- package/dist/standalone/chunk-OQ6I6OXT.js +2 -0
- package/dist/standalone/chunk-OYCUPD3Q.js +1 -0
- package/dist/standalone/chunk-PSMQQV6S.js +1 -0
- package/dist/standalone/chunk-Q6ED4KUL.js +1 -0
- package/dist/standalone/chunk-Q6IT6ZD7.js +1 -0
- package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-QAQDMS6R.js} +1 -1
- package/dist/standalone/chunk-QJLHH3ET.js +1 -0
- package/dist/standalone/chunk-R3ADWOYR.js +1 -0
- package/dist/standalone/chunk-R6U22RSY.js +1 -0
- package/dist/standalone/chunk-RB3WPSY5.js +14 -0
- package/dist/standalone/chunk-RGMVGZV4.js +1 -0
- package/dist/standalone/chunk-RWVIV3U7.js +1 -0
- package/dist/standalone/chunk-S4Z7K55A.js +1 -0
- package/dist/standalone/chunk-SA2OGF3F.js +1 -0
- package/dist/standalone/chunk-SC6P4M3S.js +1 -0
- package/dist/standalone/chunk-SJQERRSZ.js +1 -0
- package/dist/standalone/chunk-SU6QNITV.js +1 -0
- package/dist/standalone/chunk-T6IV7OKH.js +1 -0
- package/dist/standalone/chunk-UC7MNI2F.js +1 -0
- package/dist/standalone/chunk-UIIKW4II.js +1 -0
- package/dist/standalone/chunk-UJQNKTYE.js +1 -0
- package/dist/standalone/chunk-UVL7N5IL.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-VCFEO3RI.js +1 -0
- package/dist/standalone/chunk-VDC6JP4A.js +1 -0
- package/dist/standalone/chunk-VENSZ6LF.js +1 -0
- package/dist/standalone/chunk-VESGIGMQ.js +1 -0
- package/dist/standalone/chunk-VJ7RCBJ7.js +1 -0
- package/dist/standalone/chunk-VNMKNORK.js +1 -0
- package/dist/standalone/chunk-VQRCJJXS.js +1 -0
- package/dist/standalone/chunk-VVCXVAA7.js +8 -0
- package/dist/standalone/chunk-VXJJSPX3.js +1 -0
- package/dist/standalone/chunk-WJRYEML4.js +1 -0
- package/dist/standalone/chunk-WUI2PUY6.js +1 -0
- package/dist/standalone/chunk-WVWCUB4S.js +1 -0
- package/dist/standalone/chunk-WVYIBXUH.js +1 -0
- package/dist/standalone/chunk-X4MAMXRE.js +1 -0
- package/dist/standalone/chunk-XBQ66PGW.js +1 -0
- package/dist/standalone/chunk-XGCIDUJF.js +1 -0
- package/dist/standalone/chunk-XKISL2CG.js +1 -0
- package/dist/standalone/chunk-Y3AYVFTK.js +1 -0
- package/dist/standalone/chunk-YZ72ZAGX.js +1 -0
- package/dist/standalone/chunk-ZJQIGWLG.js +1 -0
- package/dist/standalone/chunk-ZKJS6EBE.js +1 -0
- package/dist/standalone/chunk-ZKV2XC5B.js +1 -0
- package/dist/standalone/chunk-ZPNTFCVI.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/dist/styles.css +2 -2
- package/package.json +26 -22
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -27
- package/dist/packem_chunks/ApiTab.js +0 -251
- package/dist/packem_chunks/AuditPanel.js +0 -200
- package/dist/packem_chunks/ExportImportPanel.js +0 -198
- package/dist/packem_chunks/FileBrowser.js +0 -2932
- package/dist/packem_chunks/FunctionRunner.js +0 -343
- package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
- package/dist/packem_chunks/HealthPanel.js +0 -648
- package/dist/packem_chunks/InsightsPanel.js +0 -462
- package/dist/packem_chunks/LogsPanel.js +0 -827
- package/dist/packem_chunks/MailPanel.js +0 -441
- package/dist/packem_chunks/MetricsPanel.js +0 -1344
- package/dist/packem_chunks/MigrationsPanel.js +0 -239
- package/dist/packem_chunks/PitrPanel.js +0 -252
- package/dist/packem_chunks/SchemaViewer.js +0 -2513
- package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
- package/dist/packem_chunks/SettingsPanel.js +0 -391
- package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
- package/dist/packem_chunks/TableEditor.js +0 -313
- package/dist/packem_chunks/analytics-panel.js +0 -261
- package/dist/packem_chunks/auth-config-panel.js +0 -179
- package/dist/packem_chunks/auth-sessions-panel.js +0 -175
- package/dist/packem_chunks/containers-panel.js +0 -247
- package/dist/packem_chunks/dashboards-panel.js +0 -780
- package/dist/packem_chunks/fanout-panel.js +0 -482
- package/dist/packem_chunks/flags-panel.js +0 -176
- package/dist/packem_chunks/kv-browser.js +0 -1896
- package/dist/packem_chunks/log-drains-panel.js +0 -273
- package/dist/packem_chunks/organizations-panel.js +0 -670
- package/dist/packem_chunks/payments-panel.js +0 -186
- package/dist/packem_chunks/permissions-panel.js +0 -805
- package/dist/packem_chunks/queues-panel.js +0 -148
- package/dist/packem_chunks/rls-panel.js +0 -315
- package/dist/packem_chunks/schedule-panel.js +0 -831
- package/dist/packem_chunks/sparkline.js +0 -79
- package/dist/packem_chunks/storage-rules-panel.js +0 -140
- package/dist/packem_chunks/subscriptions-panel.js +0 -238
- package/dist/packem_chunks/users-panel.js +0 -1265
- package/dist/packem_chunks/vector-browser.js +0 -281
- package/dist/packem_chunks/workflows-panel.js +0 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js +0 -48
- package/dist/packem_shared/ApiDocsPanel-Cu6mD4u7.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
- package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-DSNK1tPg.js +0 -4493
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
- package/dist/packem_shared/HomePanel-DQk3P8xX.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/Studio-Biu37c3O.js +0 -16
- package/dist/packem_shared/StudioApp-D6a2ZmXS.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
- package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
- package/dist/packem_shared/home-panel-Bo-Mgrkn.js +0 -1639
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
- package/dist/packem_shared/select-UkNYCT3s.js +0 -273
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-C4sgu0F7.js +0 -4015
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
- package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
- package/dist/standalone/chunk-25VHPD2I.js +0 -1
- package/dist/standalone/chunk-2GGMGPEP.js +0 -1
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-3CJW6NWG.js +0 -4
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-4H2OJBXO.js +0 -1
- package/dist/standalone/chunk-4MLAVZP4.js +0 -1
- package/dist/standalone/chunk-4QHKBC77.js +0 -1
- package/dist/standalone/chunk-55YA7ZZI.js +0 -76
- package/dist/standalone/chunk-5OH3VPZF.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-5PQMXK24.js +0 -1
- package/dist/standalone/chunk-6GFEVKJP.js +0 -1
- package/dist/standalone/chunk-764T6X6X.js +0 -1
- package/dist/standalone/chunk-7M3F6U4L.js +0 -1
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-7VF3IAAW.js +0 -2
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AJIUI7DD.js +0 -1
- package/dist/standalone/chunk-AQGOX5DK.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-BET2625I.js +0 -1
- package/dist/standalone/chunk-BQUQS7QN.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-DCECRP45.js +0 -1
- package/dist/standalone/chunk-DFP2DADO.js +0 -1
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
- package/dist/standalone/chunk-DWDILV2E.js +0 -1
- package/dist/standalone/chunk-E6WUCLSI.js +0 -1
- package/dist/standalone/chunk-E7WLF6IU.js +0 -1
- package/dist/standalone/chunk-EVPLBWUT.js +0 -8
- package/dist/standalone/chunk-FCSPAJW4.js +0 -1
- package/dist/standalone/chunk-FKO3HO6I.js +0 -4
- package/dist/standalone/chunk-G2ICR3DL.js +0 -1
- package/dist/standalone/chunk-GJ6PGSES.js +0 -13
- package/dist/standalone/chunk-GMSGZDDH.js +0 -13
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-GVRM4U6W.js +0 -2
- package/dist/standalone/chunk-GZDWDDXN.js +0 -1
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-ISJAJWYI.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-JIDZFLTB.js +0 -4
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-K3GNLVYK.js +0 -1
- package/dist/standalone/chunk-K4ZDRTQM.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KTK3V4DC.js +0 -1
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-MFPTVCJ6.js +0 -1
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-O77VNUFD.js +0 -1
- package/dist/standalone/chunk-PA3LN4XJ.js +0 -1
- package/dist/standalone/chunk-PN5NCZDX.js +0 -1
- package/dist/standalone/chunk-PVZI3CXP.js +0 -19
- package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QBAT52GB.js +0 -1
- package/dist/standalone/chunk-QHIIRFG7.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-RSEEHNFI.js +0 -1
- package/dist/standalone/chunk-SEU5V7I6.js +0 -1
- package/dist/standalone/chunk-SGDQIWAR.js +0 -4
- package/dist/standalone/chunk-SVR644RF.js +0 -1
- package/dist/standalone/chunk-SYEIXTEU.js +0 -1
- package/dist/standalone/chunk-T5HRXUSY.js +0 -1
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TBMYIZIO.js +0 -1
- package/dist/standalone/chunk-TDL7NEWA.js +0 -1
- package/dist/standalone/chunk-TM7CMA7X.js +0 -1
- package/dist/standalone/chunk-TQ36RWOP.js +0 -1
- package/dist/standalone/chunk-TY7L2V4E.js +0 -1
- package/dist/standalone/chunk-U4OAQPBT.js +0 -1
- package/dist/standalone/chunk-UDSVXA42.js +0 -1
- package/dist/standalone/chunk-UII66UVF.js +0 -1
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-VEZO7G5Q.js +0 -3
- package/dist/standalone/chunk-VLXV72QE.js +0 -1
- package/dist/standalone/chunk-VSHUSN6T.js +0 -1
- package/dist/standalone/chunk-VYMCCC6O.js +0 -1
- package/dist/standalone/chunk-WXPWVBIY.js +0 -1
- package/dist/standalone/chunk-X72PYOEW.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XIGIWZLO.js +0 -4
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
- package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
- package/dist/standalone/chunk-YM6BBZDN.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as Fe,b as Ke}from"./chunk-KF7Y5S5O.js";import{a as We}from"./chunk-E5DXYVPB.js";import{d as He}from"./chunk-4CGBMYO3.js";import"./chunk-NQZALRU3.js";import"./chunk-OPM7ESDV.js";import"./chunk-Y3AYVFTK.js";import"./chunk-QJLHH3ET.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as ze}from"./chunk-IWZ7GVQO.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import"./chunk-OLIKYC3C.js";import"./chunk-AUGKHAMQ.js";import"./chunk-WJRYEML4.js";import"./chunk-LXCVA5SP.js";import{a as Pe}from"./chunk-7Q256NLI.js";import{b as Oe}from"./chunk-ZKJS6EBE.js";import{c as $e,d as pe,e as ve,f as ye,g as Ee}from"./chunk-RGMVGZV4.js";import{i as qe}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import{a as je}from"./chunk-NCPW7WHO.js";import{a as he}from"./chunk-4ZEL6BYL.js";import"./chunk-DHGPCQ2F.js";import{l as xe}from"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import"./chunk-HCTJKP5J.js";import{d as se,f as me,g as fe,h as Ae,q as ae}from"./chunk-74IYYDDI.js";import{a as i,d as ke,e as ct,f as dt,g as ut,i as ie}from"./chunk-I26MS5PJ.js";var X=ke(dt(),1);var j=ke(ct(),1);var u=ke(ut(),1);var be=class{static{i(this,"Diff")}diff(e,n,t={}){let o;typeof t=="function"?(o=t,t={}):"callback"in t&&(o=t.callback);let r=this.castInput(e,t),l=this.castInput(n,t),d=this.removeEmpty(this.tokenize(r,t)),a=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(d,a,t,o)}diffWithOptionsObj(e,n,t,o){var r;let l=i(h=>{if(h=this.postProcess(h,t),o){setTimeout(function(){o(h)},0);return}else return h},"done"),d=n.length,a=e.length,c=1,m=d+a;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let p=(r=t.timeout)!==null&&r!==void 0?r:1/0,f=Date.now()+p,v=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(v[0],n,e,0,t);if(v[0].oldPos+1>=a&&g+1>=d)return l(this.buildValues(v[0].lastComponent,n,e));let E=-1/0,x=1/0,y=i(()=>{for(let h=Math.max(E,-c);h<=Math.min(x,c);h+=2){let S,w=v[h-1],C=v[h+1];w&&(v[h-1]=void 0);let b=!1;if(C){let N=C.oldPos-h;b=C&&0<=N&&N<d}let k=w&&w.oldPos+1<a;if(!b&&!k){v[h]=void 0;continue}if(!k||b&&w.oldPos<C.oldPos?S=this.addToPath(C,!0,!1,0,t):S=this.addToPath(w,!1,!0,1,t),g=this.extractCommon(S,n,e,h,t),S.oldPos+1>=a&&g+1>=d)return l(this.buildValues(S.lastComponent,n,e))||!0;v[h]=S,S.oldPos+1>=a&&(x=Math.min(x,h-1)),g+1>=d&&(E=Math.max(E,h+1))}c++},"execEditLength");if(o)i(function h(){setTimeout(function(){if(c>m||Date.now()>f)return o(void 0);y()||h()},0)},"exec")();else for(;c<=m&&Date.now()<=f;){let h=y();if(h)return h}}addToPath(e,n,t,o,r){let l=e.lastComponent;return l&&!r.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,o,r){let l=n.length,d=t.length,a=e.oldPos,c=a-o,m=0;for(;c+1<l&&a+1<d&&this.equals(t[a+1],n[c+1],r);)c++,a++,m++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!r.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,c}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let o=[],r;for(;e;)o.push(e),r=e.previousComponent,delete e.previousComponent,e=r;o.reverse();let l=o.length,d=0,a=0,c=0;for(;d<l;d++){let m=o[d];if(m.removed)m.value=this.join(t.slice(c,c+m.count)),c+=m.count;else{if(!m.added&&this.useLongestToken){let p=n.slice(a,a+m.count);p=p.map(function(f,v){let g=t[c+v];return g.length>f.length?g:f}),m.value=this.join(p)}else m.value=this.join(n.slice(a,a+m.count));a+=m.count,m.added||(c+=m.count)}}return o}};var Te=class extends be{static{i(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=mt}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
2
|
+
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
3
|
+
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
5
|
+
`)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},Be=new Te;function Ie(s,e,n){return Be.diff(s,e,n)}i(Ie,"diffLines");function mt(s,e){e.stripTrailingCr&&(s=s.replace(/\r\n/g,`
|
|
6
|
+
`));let n=[],t=s.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let o=0;o<t.length;o++){let r=t[o];o%2&&!e.newlineIsToken?n[n.length-1]+=r:n.push(r)}return n}i(mt,"tokenize");var ft="x",Qe=" ",ht={'"':'"',"'":"'","[":"]","`":"`"},Ue=i((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
7
|
+
`;)n+=1;return n},"He"),Xe=i((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"Fe"),Ze=i(s=>{let e=s.split(""),n=0;for(;n<s.length;){let t=s[n]??"",o=ht[t];if(t==="-"&&s[n+1]==="-"){let r=Ue(s,n);e.fill(Qe,n,r),n=r}else if(t==="/"&&s[n+1]==="*"){let r=Xe(s,n);if(r===-1)return;e.fill(Qe,n,r),n=r}else if(o!==void 0){let r=n+1;for(;r<s.length;)if(s[r]!==o)r+=1;else if(o!=="]"&&s[r+1]===o)r+=2;else break;if(r>=s.length)return;e.fill(ft,n,r+1),n=r+1}else n+=1}for(let t=0;t<s.length;t+=1)s[t]===`
|
|
8
|
+
`&&(e[t]=`
|
|
9
|
+
`);return e.join("")},"We"),pt=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,bt=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|truncate|update|vacuum)\b|\breplace\b(?!\s*\()/iu,gt=/^\w+/u,xt=/;\s*$/u,vt=/\s/u,et=i(s=>{let e=0;for(;e<s.length;){let n=s[e];if(n!==void 0&&vt.test(n))e+=1;else if(n==="-"&&s[e+1]==="-")e=Ue(s,e);else if(n==="/"&&s[e+1]==="*"){let t=Xe(s,e);if(t===-1)break;e=t}else break}return e},"Ke"),yt=i(s=>{let e=et(s),n=s.slice(e).trimEnd();if(n==="")return{code:"SQL_EMPTY",message:"the query is empty"};let t=(Ze(n)??n).replace(xt,""),o=n.slice(0,t.length),r=t.indexOf(";");if(r!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+r};let l="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!pt.test(o))return{code:"SQL_NOT_READONLY",length:gt.exec(o)?.[0].length??1,message:l,offset:e};let d=bt.exec(o);if(d!==null)return{code:"SQL_NOT_READONLY",length:d[0].length,message:`${l} (\`${d[0].toUpperCase()}\` is not allowed)`,offset:e+d.index}},"xt"),wt=/^explain\b/iu,St=i(s=>wt.test(s.slice(et(s)))?s:`EXPLAIN QUERY PLAN ${s}`,"yt"),_e=i((s,e)=>{let n=s.trim();if(n==="")return[];let t=e+s.indexOf(n),o=yt(n);return o?.code==="SQL_EMPTY"?[]:[o===void 0?{offset:t,sql:n}:{offset:t,rejection:o,sql:n}]},"ke"),tt=i(s=>{let e=Ze(s);if(e===void 0)return _e(s,0);let n=[],t=0;for(let o=0;o<=e.length;o+=1)o!==e.length&&e[o]!==";"||(n.push(..._e(s.slice(t,o),t)),t=o+1);return n},"ze"),Ct=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Nt=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],Ne=String.fromCodePoint(0),kt=new RegExp(`${Ne}${String.raw`(\d+)`}${Ne}`,"gu"),qt=Ct.map(s=>({pattern:new RegExp(String.raw`\b${s.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:s})),Et=Nt.map(s=>({pattern:new RegExp(String.raw`\s+${s.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
10
|
+
${s}`})),Tt=i(s=>{let e=[],n=s.replaceAll(/'(?:[^']|'')*'/gu,t=>(e.push(t),`${Ne}${(e.length-1).toString()}${Ne}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:t,replacement:o}of qt)n=n.replaceAll(t,o);for(let{pattern:t,replacement:o}of Et)n=n.replaceAll(t,o);return n=n.replaceAll(kt,(t,o)=>e[Number(o)]??""),n},"kt"),It=/\b(?:from|join)\s+([a-z_][\w$]*)(?:\s+(?:as\s+)?([a-z_][\w$]*))?/giu,Lt=/(?:\bwith\s+(?:recursive\s+)?|,\s*)([a-z_][\w$]*)\s+as\s*\(/giu,_t=new Set(["cross","full","group","having","inner","join","left","limit","offset","on","order","right","union","using","where","window"]),Rt=/[^\n]/gu,Dt=i((s,e)=>{let n=s[e];if(n==="'"){let t=e+1;for(;t<s.length&&s[t]!=="'";)t+=1;return Math.min(t+1,s.length)}if(n==="-"&&s[e+1]==="-"){let t=s.indexOf(`
|
|
11
|
+
`,e);return t===-1?s.length:t}if(n==="/"&&s[e+1]==="*"){let t=s.indexOf("*/",e+2);return t===-1?s.length:t+2}return-1},"_t"),Mt=i(s=>{let e="",n=0;for(;n<s.length;){let t=Dt(s,n);t===-1?(e+=s.slice(n,n+1),n+=1):(e+=s.slice(n,t).replaceAll(Rt," "),n=t)}return e},"At"),At=i(s=>{let e=new Set;for(let n of s.matchAll(Lt))e.add((n[1]??"").toLowerCase());return e},"qt"),$t=i((s,e)=>{let n=new Map;for(let t of s.matchAll(It)){let o=(t[1]??"").toLowerCase(),r=(t[2]??"").toLowerCase();e.has(o)&&(n.set(o,o),r!==""&&!_t.has(r)&&n.set(r,o))}return n},"Dt"),nt=i((s,e)=>{let n=Mt(s),t=new Set(e.map(o=>o.toLowerCase()));return{ctes:At(n),masked:n,targets:$t(n,t)}},"Ue"),Ot=/^(?:__lunora|sqlite_)/iu,Pt=/\b(?:from|join)\s+([a-z_][\w$]*)/giu,jt=/\b([a-z_][\w$]*)\.([a-z_][\w$]*)/giu,zt=new Set(["cross","full","group","having","inner","join","lateral","left","limit","offset","order","right","select","union","where","window"]),Wt=i((s,e,n)=>{let t=[];for(let o of s.matchAll(Pt)){let r=o[1]??"",l=r.toLowerCase();!e.has(l)&&!n.has(l)&&!zt.has(l)&&!Ot.test(r)&&t.push({length:r.length,message:`unknown table \`${r}\``,offset:o.index+o[0].length-r.length,severity:"error",source:"schema"})}return t},"Pt"),Ht=i((s,e,n)=>{let t=[],o=new Map;for(let[r,l]of Object.entries(e.columns))o.set(r.toLowerCase(),new Set(l.map(d=>d.toLowerCase())));for(let r of s.matchAll(jt)){let l=(r[1]??"").toLowerCase(),d=r[2]??"",a=n.get(l),c=a===void 0?void 0:o.get(a);c!==void 0&&!c.has(d.toLowerCase())&&t.push({length:d.length,message:`\`${a??""}\` has no column \`${d}\``,offset:r.index+r[0].length-d.length,severity:"error",source:"schema"})}return t},"Ht"),Ft=/(?<![\w$."])(?:"([a-z_][\w$]*)"|([a-z_][\w$]*))(?![.(])/giu,Kt=/\bas\s+"?([a-z_][\w$]*)"?/giu,Bt=i((s,e,n,t)=>{let o=[...new Set(n.values())],r=new Map,l=new Set;for(let c of o){for(let m of e.columns[c]??[])l.add(m.toLowerCase());for(let m of e.docFields?.[c]??[])r.set(m.toLowerCase(),m)}if(r.size===0)return[];let d=new Set([...s.matchAll(Kt)].map(c=>(c[1]??"").toLowerCase())),a=[];for(let c of s.matchAll(Ft)){let m=c[1],p=m??c[2]??"",f=p.toLowerCase(),v=r.get(f);v===void 0||l.has(f)||d.has(f)||t.has(f)||n.has(f)||a.push({length:p.length,message:`\`${v}\` is a \`__doc__\` field, not a column \u2014 use \`json_extract(__doc__, '$.${v}')\``,offset:c.index+(m===void 0?0:1),severity:"error",source:"schema"})}return a},"Kt"),Qt=i((s,e)=>{if(s.trim()==="")return[];let n=tt(s),t=new Set(e.tables.map(r=>r.toLowerCase())),o=[];for(let r of n){let{offset:l,rejection:d}=r;if(d!==void 0){o.push({length:d.length,message:d.message,offset:d.offset===void 0?l:l+d.offset,severity:"error",source:"gate"});continue}let{ctes:a,masked:c,targets:m}=nt(r.sql,e.tables);o.push(...[...Wt(c,t,a),...Ht(c,e,m),...Bt(c,e,m,a)].map(p=>({...p,offset:p.offset===void 0?l:l+p.offset})))}return o},"zt"),Yt=me(he.lintSql),Jt=600,Vt=i((s,e,n)=>{let t=xe(),[o,r]=(0,j.useState)([]),l=(0,j.useMemo)(()=>Qt(s,e),[s,e]),d=ze(s,Jt),a=l.some(p=>p.source==="gate")||d.trim()==="",c=(0,j.useCallback)(async p=>{try{let f=await t.query(Yt,{sql:d},fe(n));p.cancelled||r(f.diagnostics??[])}catch{p.cancelled||r([])}},[t,d,n]);(0,j.useEffect)(()=>{if(a){r([]);return}let p={cancelled:!1};return ae(c(p)),()=>{p.cancelled=!0}},[c,a]);let m=d===s;return(0,j.useMemo)(()=>m?[...l,...o]:l,[l,o,m])},"Qt"),we=8,Gt=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],Ut=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),Xt=/[\w$]/,ot=i(s=>s!==void 0&&Xt.test(s),"je"),rt=i(s=>{let e=s.length;for(;e>0&&ot(s[e-1]);)e-=1;return s.slice(e)},"Qe"),st=i((s,e)=>{let n=e;for(;n>0&&ot(s[n-1]);)n-=1;return{end:e,start:n,text:s.slice(n,e)}},"Ye"),Ye=i((s,e)=>{let n=s.slice(0,e).trimEnd();return n.endsWith(".")||Ut.has(rt(n).toUpperCase())},"De"),Zt=i((s,e,n)=>{let t=s.slice(0,e);if(!t.endsWith("."))return;let o=rt(t.slice(0,-1));if(o!=="")return nt(s,n).targets.get(o.toLowerCase())??o},"Vt"),Re=i((s,e)=>s.toLowerCase().startsWith(e.toLowerCase()),"Ie"),Je=i((s,e,n,t)=>{let o=[];for(let r of s)if(Re(r,e)&&(o.push(t(r)),o.length>=n))break;return o},"Oe"),en=i((s,e,n)=>{let t=new Map;for(let[o,r]of Object.entries(s.columns))for(let l of r)if(Re(l,e)&&!t.has(l)&&(t.set(l,o),t.size>=n))return[...t].map(([d,a])=>({detail:a,kind:"column",label:d}));return[...t].map(([o,r])=>({detail:r,kind:"column",label:o}))},"Xt"),tn=i((s,e,n)=>{let t=st(s,e),o=Zt(s,t.start,n.tables);if(o!==void 0){let a=n.columns[o]??n.columns[o.toLowerCase()]??[];return Je(a,t.text,we,c=>({detail:o,kind:"column",label:c}))}if(t.text===""&&!Ye(s,t.start))return[];let r=Je(n.tables,t.text,we,a=>({kind:"table",label:a})),l=en(n,t.text,we),d=Gt.flatMap(a=>t.text!==""&&Re(a,t.text)&&a.toLowerCase()!==t.text.toLowerCase()?[{kind:"keyword",label:a}]:[]);return(Ye(s,t.start)?[...l,...r,...d]:[...r,...l,...d]).slice(0,we)},"Zt"),nn=i((s,e,n)=>{let t=st(s,e),o=s.slice(0,t.start)+n.label+s.slice(t.end);return{caret:t.start+n.label.length,value:o}},"en"),on=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],rn=i((s,e)=>{let n=globalThis.getComputedStyle(s),t=globalThis.document.createElement("div"),{style:o}=t;o.position="absolute",o.visibility="hidden",o.whiteSpace="pre-wrap",o.overflowWrap="break-word";for(let a of on)o[a]=n[a];t.textContent=s.value.slice(0,Math.max(0,e));let r=globalThis.document.createElement("span");r.textContent=s.value.slice(Math.max(0,e))||".",t.append(r),globalThis.document.body.append(t);let l=r.offsetLeft-s.scrollLeft,d=r.offsetTop-s.scrollTop;return t.remove(),{left:l,top:d}},"nn"),sn=i((s,e,n)=>{let t=(0,X.c)(16),[o,r]=(0,j.useState)(null),l;t[0]!==s||t[1]!==e?(l=i((y,h)=>{let S=tn(y,h,s);if(S.length===0){r(null);return}let w=e.current,{left:C,top:b}=w===null?{left:0,top:0}:rn(w,h);r(k=>k!==null&&k.active===0&&k.left===C&&k.top===b&&k.suggestions.length===S.length&&k.suggestions.every((N,R)=>{let q=S.at(R);return N.kind===q?.kind&&N.label===q.label&&N.detail===q.detail})?k:{active:0,left:C,suggestions:S,top:b})},"r"),t[0]=s,t[1]=e,t[2]=l):l=t[2];let d=l,a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=i(()=>{r(null)},"a"),t[3]=a):a=t[3];let c=a,m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i(y=>{r(h=>{if(h===null)return h;let S=h.suggestions.length,w=(h.active+y+S)%S;return{...h,active:w}})},"u"),t[4]=m):m=t[4];let p=m,f;t[5]!==n||t[6]!==o||t[7]!==e?(f=i(y=>{let h=e.current;if(o===null||h===null)return!1;let S=o.suggestions[y??o.active];if(S===void 0)return!1;let w=nn(h.value,h.selectionStart,S);return n(w.value),r(null),requestAnimationFrame(()=>{let C=e.current;C!==null&&(C.focus(),C.setSelectionRange(w.caret,w.caret))}),!0},"d"),t[5]=n,t[6]=o,t[7]=e,t[8]=f):f=t[8];let v=f,g;t[9]!==v?(g=i(()=>v(),"b"),t[9]=v,t[10]=g):g=t[10];let E=g,x;return t[11]!==E||t[12]!==v||t[13]!==d||t[14]!==o?(x={close:c,commit:E,commitAt:v,move:p,refresh:d,state:o},t[11]=E,t[12]=v,t[13]=d,t[14]=o,t[15]=x):x=t[15],x},"sn"),ln={column:"column",keyword:"keyword",table:"table"},an=20,cn=i(s=>{let e=(0,X.c)(17),{listboxId:n,onPick:t,state:o}=s,r=se(),l;e[0]!==o?(l=o===null?void 0:{left:o.left,top:o.top+an},e[0]=o,e[1]=l):l=e[1];let d=l;if(o===null)return null;let a;if(e[2]!==n||e[3]!==t||e[4]!==o.active||e[5]!==o.suggestions||e[6]!==r){let m;e[8]!==n||e[9]!==t||e[10]!==o.active||e[11]!==r?(m=i((p,f)=>(0,u.jsxs)("li",{"aria-selected":f===o.active,className:ie("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",f===o.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${n}-opt-${f.toString()}`,onMouseDown:i(v=>{v.preventDefault(),t(f)},"onMouseDown"),role:"option",children:[(0,u.jsx)("span",{className:"truncate font-mono",children:p.label}),p.detail!==void 0&&(0,u.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:p.detail}),(0,u.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:r(ln[p.kind])})]},`${p.kind}:${p.label}`),"u"),e[8]=n,e[9]=t,e[10]=o.active,e[11]=r,e[12]=m):m=e[12],a=o.suggestions.map(m),e[2]=n,e[3]=t,e[4]=o.active,e[5]=o.suggestions,e[6]=r,e[7]=a}else a=e[7];let c;return e[13]!==n||e[14]!==d||e[15]!==a?(c=(0,u.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:n,role:"listbox",style:d,children:a}),e[13]=n,e[14]=d,e[15]=a,e[16]=c):c=e[16],c},"rn"),dn=me(he.listTables),un=me(he.readTablePage),mn=i(s=>{let e=(0,X.c)(18),n=xe(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];let[o,r]=(0,j.useState)(t),l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={},e[1]=l):l=e[1];let[d,a]=(0,j.useState)(l),c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={},e[2]=c):c=e[2];let[m,p]=(0,j.useState)(c),f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=new Set,e[3]=f):f=e[3];let v=(0,j.useRef)(f),g,E;e[4]!==n||e[5]!==s?(g=i(()=>{let C={cancelled:!1};return ae((async()=>{try{let b=await n.query(dn,{},fe(s));C.cancelled||(r(b.map(hn)),a({}),p({}),v.current=new Set)}catch{C.cancelled||(r([]),a({}),p({}),v.current=new Set)}})()),()=>{C.cancelled=!0}},"b"),E=[n,s],e[4]=n,e[5]=s,e[6]=g,e[7]=E):(g=e[6],E=e[7]),(0,j.useEffect)(g,E);let x;e[8]!==n||e[9]!==s?(x=i(C=>{v.current.has(C)||(v.current.add(C),ae((async()=>{try{let b=await n.query(un,{limit:1,offset:0,table:C},fe(s)),{sqlColumns:k}=b;if(k===void 0){v.current.delete(C);return}let N=new Set(k),R=b.columns.filter(q=>!N.has(q));a(q=>({...q,[C]:k})),p(q=>({...q,[C]:R}))}catch{v.current.delete(C)}})()))},"m"),e[8]=n,e[9]=s,e[10]=x):x=e[10];let y=x,h;e[11]!==d||e[12]!==m||e[13]!==o?(h={columns:d,docFields:m,tables:o},e[11]=d,e[12]=m,e[13]=o,e[14]=h):h=e[14];let S=h,w;return e[15]!==y||e[16]!==S?(w={probe:y,schema:S},e[15]=y,e[16]=S,e[17]=w):w=e[17],w},"dn"),Le=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,fn=i(s=>{let e=new Set;Le.lastIndex=0;let n=Le.exec(s);for(;n!==null;)e.add(n[1]??n[2]),n=Le.exec(s);return[...e]},"un");function hn(s){return s.name}i(hn,"fn");var pn=i(s=>(s.metaKey||s.ctrlKey)&&!s.shiftKey&&!s.altKey&&s.key.toLowerCase()==="i","mn"),bn=i(s=>{let e=(0,X.c)(44),{inlineEditEnabled:n,onSubmit:t,probe:o,schema:r,setDraft:l}=s,d=(0,j.useId)(),[a,c]=(0,j.useState)(null),m=(0,j.useRef)(null),p=(0,j.useRef)(null),f=(0,j.useRef)(null),v=sn(r,f,l),{close:g,commit:E,commitAt:x,move:y,refresh:h,state:S}=v,w;e[0]!==x?(w=i(M=>{x(M)},"v"),e[0]=x,e[1]=w):w=e[1];let C=w,b;e[2]!==h?(b=i(()=>{let M=f.current;M!==null&&M===document.activeElement&&h(M.value,M.selectionStart)},"h"),e[2]=h,e[3]=b):b=e[3];let k;e[4]!==h||e[5]!==r?(k=[h,r],e[4]=h,e[5]=r,e[6]=k):k=e[6],(0,j.useEffect)(b,k);let N;e[7]!==o||e[8]!==h||e[9]!==l?(N=i(M=>{let{selectionStart:Y,value:U}=M.target;l(U),c(null);for(let W of fn(U))o(W);h(U,Y)},"T"),e[7]=o,e[8]=h,e[9]=l,e[10]=N):N=e[10];let R=N,q;e[11]!==h?(q=i(M=>{let Y=M.currentTarget;h(Y.value,Y.selectionStart)},"R"),e[11]=h,e[12]=q):q=e[12];let T=q,L;e[13]!==g||e[14]!==E||e[15]!==y?(L=i(M=>M.key==="ArrowDown"?(M.preventDefault(),y(1),!0):M.key==="ArrowUp"?(M.preventDefault(),y(-1),!0):M.key==="Escape"?(M.preventDefault(),g(),!0):(M.key==="Enter"||M.key==="Tab")&&!M.metaKey&&!M.ctrlKey&&E()?(M.preventDefault(),!0):!1,"_"),e[13]=g,e[14]=E,e[15]=y,e[16]=L):L=e[16];let _=L,I;e[17]!==S||e[18]!==g||e[19]!==n||e[20]!==_||e[21]!==t?(I=i(M=>{if(!(S!==null&&_(M))){if((M.metaKey||M.ctrlKey)&&M.key==="Enter"){M.preventDefault(),t();return}if(n&&pn(M)){M.preventDefault(),g();let{selectionEnd:Y,selectionStart:U,value:W}=M.currentTarget,[J,G]=U===Y?[0,W.length]:[U,Y];c({end:G,start:J,text:W.slice(J,G)})}}},"A"),e[17]=S,e[18]=g,e[19]=n,e[20]=_,e[21]=t,e[22]=I):I=e[22];let H=I,B;e[23]!==g?(B=i(()=>{requestAnimationFrame(()=>{g()})},"W"),e[23]=g,e[24]=B):B=e[24];let F=B,O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=i(M=>{let{scrollLeft:Y,scrollTop:U}=M.currentTarget;m.current!==null&&(m.current.scrollTop=U),p.current!==null&&(p.current.scrollTop=U,p.current.scrollLeft=Y)},"$"),e[25]=O):O=e[25];let K=O,$;e[26]===Symbol.for("react.memo_cache_sentinel")?($=i(M=>{let Y=f.current;Y===null||M.offset===void 0||(Y.focus(),Y.setSelectionRange(M.offset,M.offset+(M.length??0)))},"H"),e[26]=$):$=e[26];let D=$,A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=i(()=>{c(null),f.current?.focus()},"D"),e[27]=A):A=e[27];let Q=A,z;e[28]!==a||e[29]!==l?(z=i(M=>{let Y=f.current;if(a===null||Y===null)return;let{end:U,start:W,text:J}=a;if(Y.value.slice(W,U)!==J){Q();return}l(Y.value.slice(0,W)+M+Y.value.slice(U)),c(null),Y.focus(),requestAnimationFrame(()=>{Y.setSelectionRange(W,W+M.length)})},"P"),e[28]=a,e[29]=l,e[30]=z):z=e[30];let re=z,Z;e[31]!==R||e[32]!==F||e[33]!==H||e[34]!==T?(Z={onBlur:F,onChange:R,onKeyDown:H,onScroll:K,onSelect:T},e[31]=R,e[32]=F,e[33]=H,e[34]=T,e[35]=Z):Z=e[35];let oe;return e[36]!==re||e[37]!==S||e[38]!==g||e[39]!==a||e[40]!==d||e[41]!==C||e[42]!==Z?(oe={acceptInlineEdit:re,autocompleteState:S,closeAutocomplete:g,closeInlineEdit:Q,inlineEdit:a,handlers:Z,listboxId:d,onPickSuggestion:C,editorRef:f,gutterRef:m,overlayRef:p,revealDiagnostic:D},e[36]=re,e[37]=S,e[38]=g,e[39]=a,e[40]=d,e[41]=C,e[42]=Z,e[43]=oe):oe=e[43],oe},"pn"),gn="lunora-studio-sql-tabs",xn="lunora-studio-sql-active-tab",De=12,ge=i((s="",e="")=>({activeId:null,id:Ee("tab"),name:e,sql:s}),"pe"),vn=i(()=>ye(xn,""),"gn"),yn=i(s=>{let e=(0,X.c)(16),[n,t]=ve(gn),[o,r]=vn(),[l]=(0,j.useState)(s),d,a;e[0]!==l||e[1]!==t||e[2]!==n.length?(d=i(()=>{n.length===0&&t([l])},"c"),a=[l,t,n.length],e[0]=l,e[1]=t,e[2]=n.length,e[3]=d,e[4]=a):(d=e[3],a=e[4]),(0,j.useEffect)(d,a);let c;e[5]!==l||e[6]!==n?(c=n.length===0?[l]:n,e[5]=l,e[6]=n,e[7]=c):c=e[7];let m=c,p;e[8]!==o||e[9]!==m?(p=m.some(g=>g.id===o)?o:m[0]?.id??"",e[8]=o,e[9]=m,e[10]=p):p=e[10];let f=p,v;return e[11]!==f||e[12]!==r||e[13]!==t||e[14]!==m?(v={activeId:f,setActiveId:r,setTabs:t,tabs:m},e[11]=f,e[12]=r,e[13]=t,e[14]=m,e[15]=v):v=e[15],v},"xn"),lt=i(s=>s.activeId===null&&s.sql.trim()!=="","Ge"),wn=i((s,e)=>[...s,e].slice(-De),"vn"),Sn=i((s,e,n)=>{let t=s.findIndex(r=>r.id===e);if(t===-1)return{activeId:s[0]?.id??"",tabs:[...s]};let o=s.filter(r=>r.id!==e);if(o.length===0){let r=n();return{activeId:r.id,tabs:[r]}}return{activeId:o[Math.min(t,o.length-1)].id,tabs:o}},"yn"),Cn=i((s,e)=>{let n=s.filter(t=>t.id===e);return n.length===0?{activeId:s[0]?.id??"",tabs:[...s]}:{activeId:e,tabs:n}},"Sn"),Nn=i((s,e,n)=>{let t=s.findIndex(r=>r.id===e);if(t===-1)return{activeId:n,tabs:[...s]};let o=s.slice(0,t+1);return{activeId:o.some(r=>r.id===n)?n:e,tabs:o}},"wn"),kn=i(s=>{let e=s();return{activeId:e.id,tabs:[e]}},"Nn"),qn=i((s,e,n)=>{if(s==="others")return e.filter(t=>t.id!==n);if(s==="right"){let t=e.findIndex(o=>o.id===n);return t===-1?[]:e.slice(t+1)}return[...e]},"Cn"),Ve={error:null,pane:"results",result:null,running:!1},En=i(s=>{let e=(0,X.c)(66),{activeId:n,setActiveId:t,setTabs:o,tabs:r}=yn(s),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let[d,a]=(0,j.useState)(l),[c,m]=(0,j.useState)(null),[p,f]=(0,j.useState)(null),v;e[1]!==n||e[2]!==r?(v=r.find(P=>P.id===n)??r[0]??ge(),e[1]=n,e[2]=r,e[3]=v):v=e[3];let g=v,E=d[g.id]??Ve,x;e[4]!==g.id||e[5]!==o?(x=i(P=>{o(V=>V.map(ne=>ne.id===g.id?{...ne,...P}:ne))},"m"),e[4]=g.id,e[5]=o,e[6]=x):x=e[6];let y=x,h;e[7]!==g.id?(h=i(P=>{a(V=>{let ne=V[g.id]??Ve;return{...V,[g.id]:{...ne,...P}}})},"p"),e[7]=g.id,e[8]=h):h=e[8];let S=h,w;e[9]!==t||e[10]!==o||e[11]!==r.length?(w=i(()=>{if(r.length>=De)return;let P=ge();o(V=>wn(V,P)),t(P.id)},"v"),e[9]=t,e[10]=o,e[11]=r.length,e[12]=w):w=e[12];let C=w,b;e[13]!==t||e[14]!==o?(b=i(P=>{m(null),f(null),o(P.tabs),t(P.activeId);let V=new Set(P.tabs.map(Tn));a(ne=>Object.fromEntries(Object.entries(ne).filter(ce=>{let[de]=ce;return V.has(de)})))},"h"),e[13]=t,e[14]=o,e[15]=b):b=e[15];let k=b,N;e[16]!==k||e[17]!==r?(N=i(P=>{k(Sn(r,P,ge))},"T"),e[16]=k,e[17]=r,e[18]=N):N=e[18];let R=N,q;e[19]!==n||e[20]!==k||e[21]!==r?(q=i((P,V)=>{k(P==="others"?Cn(r,V):P==="right"?Nn(r,V,n):kn(ge))},"R"),e[19]=n,e[20]=k,e[21]=r,e[22]=q):q=e[22];let T=q,L;e[23]!==T||e[24]!==c||e[25]!==r?(L=i(P=>{c!==null&&(qn(P,r,c.id).some(In)?f(P):T(P,c.id))},"_"),e[23]=T,e[24]=c,e[25]=r,e[26]=L):L=e[26];let _=L,I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I=i((P,V)=>{V.preventDefault(),f(null),m({id:P,x:V.clientX,y:V.clientY})},"A"),e[27]=I):I=e[27];let H=I,B;e[28]===Symbol.for("react.memo_cache_sentinel")?(B=i(()=>{m(null),f(null)},"W"),e[28]=B):B=e[28];let F=B,O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=i(P=>{P.preventDefault(),m(null),f(null)},"$"),e[29]=O):O=e[29];let K=O,$;e[30]!==_?($=i(()=>{_("others")},"H"),e[30]=_,e[31]=$):$=e[31];let D=$,A;e[32]!==_?(A=i(()=>{_("right")},"D"),e[32]=_,e[33]=A):A=e[33];let Q=A,z;e[34]!==_?(z=i(()=>{_("all")},"P"),e[34]=_,e[35]=z):z=e[35];let re=z,Z;e[36]!==T||e[37]!==p||e[38]!==c?(Z=i(()=>{c!==null&&p!==null&&T(p,c.id),f(null)},"Z"),e[36]=T,e[37]=p,e[38]=c,e[39]=Z):Z=e[39];let oe=Z,M;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=i(()=>{f(null)},"q"),e[40]=M):M=e[40];let Y=M,U;e[41]!==c?(U=c===null?void 0:{left:c.x,top:c.y},e[41]=c,e[42]=U):U=e[42];let W=U,J;e[43]!==o?(J=i(P=>{o(V=>V.map(ne=>ne.activeId===P?{...ne,activeId:null}:ne))},"U"),e[43]=o,e[44]=J):J=e[44];let G=J,ee;e[45]!==o?(ee=i((P,V)=>{o(ne=>ne.map(ce=>ce.id===P?{...ce,name:V}:ce))},"Y"),e[45]=o,e[46]=ee):ee=e[46];let le=ee,te;return e[47]!==g||e[48]!==n||e[49]!==C||e[50]!==R||e[51]!==oe||e[52]!==re||e[53]!==D||e[54]!==Q||e[55]!==E||e[56]!==S||e[57]!==y||e[58]!==p||e[59]!==le||e[60]!==t||e[61]!==c||e[62]!==W||e[63]!==r||e[64]!==G?(te={activeTab:g,activeTabId:n,addEditorTab:C,cancelBulk:Y,closeEditorTab:R,closeTabMenu:F,confirmBulk:oe,menuStyle:W,onBackdropContextMenu:K,onCloseAll:re,onCloseOthers:D,onCloseToRight:Q,openTabMenu:H,output:E,patchActiveOutput:S,patchActiveTab:y,pendingBulk:p,renameTab:le,setActiveTabId:t,tabMenu:c,tabs:r,unlinkQuery:G},e[47]=g,e[48]=n,e[49]=C,e[50]=R,e[51]=oe,e[52]=re,e[53]=D,e[54]=Q,e[55]=E,e[56]=S,e[57]=y,e[58]=p,e[59]=le,e[60]=t,e[61]=c,e[62]=W,e[63]=r,e[64]=G,e[65]=te):te=e[65],te},"En");function Tn(s){return s.id}i(Tn,"kn");function In(s){return lt(s)}i(In,"Tn");var Ln="lunora-studio-sql-queries",ue="lunora-studio-sql-history",_n="lunora-studio-sql-remember-history",Rn=25,Dn=i(s=>{let e=(0,X.c)(41),{loadIntoActiveTab:n,unlinkQuery:t}=s,o=se(),[r,l]=ve(Ln),[d,a]=ye(_n,!1),[c,m]=ve(ue,d?"local":"session"),p,f;e[0]!==d?(p=i(()=>{d||pe(ue,"local")},"g"),f=[d],e[0]=d,e[1]=p,e[2]=f):(p=e[1],f=e[2]),(0,j.useEffect)(p,f);let[v,g]=(0,j.useState)(""),E=(0,j.useRef)(null),x;e[3]!==m?(x=i(D=>{m(A=>A[0]?.sql===D?A:[{at:Date.now(),sql:D},...A.filter(Q=>Q.sql!==D)].slice(0,Rn))},"m"),e[3]=m,e[4]=x):x=e[4];let y=x,h;e[5]!==n||e[6]!==l||e[7]!==o?(h=i(()=>{let D={id:Ee("q"),name:o("Untitled query"),sql:""};l(A=>[D,...A]),n("",D.id)},"p"),e[5]=n,e[6]=l,e[7]=o,e[8]=h):h=e[8];let S=h,w;e[9]!==n||e[10]!==r?(w=i(D=>{let A=r.find(Q=>Q.id===D);A!==void 0&&(n(A.sql,D),E.current?.querySelector(`[data-testid="sql-query-${D}"]`)?.scrollIntoView({block:"nearest"}))},"v"),e[9]=n,e[10]=r,e[11]=w):w=e[11];let C=w,b;e[12]!==l||e[13]!==t?(b=i(D=>{l(A=>A.filter(Q=>Q.id!==D)),t(D)},"h"),e[12]=l,e[13]=t,e[14]=b):b=e[14];let k=b,N;e[15]!==n?(N=i(D=>{n(D.currentTarget.dataset.sql??"",null)},"T"),e[15]=n,e[16]=N):N=e[16];let R=N,q;e[17]!==n?(q=i(D=>{n(D.currentTarget.dataset.sql??"",null)},"R"),e[17]=n,e[18]=q):q=e[18];let T=q,L;e[19]!==m?(L=i(()=>{m([]),pe(ue,"local"),pe(ue,"session")},"_"),e[19]=m,e[20]=L):L=e[20];let _=L,I;e[21]!==c||e[22]!==a?(I=i(D=>{$e(ue,c,D?"local":"session"),D||pe(ue,"local"),a(D)},"A"),e[21]=c,e[22]=a,e[23]=I):I=e[23];let H=I,B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=i(D=>{g(D.target.value)},"W"),e[24]=B):B=e[24];let F=B,O;e[25]!==l?(O=i((D,A)=>{l(Q=>Q.map(z=>z.id===D?{...z,sql:A}:z))},"$"),e[25]=l,e[26]=O):O=e[26];let K=O,$;return e[27]!==_||e[28]!==k||e[29]!==c||e[30]!==T||e[31]!==R||e[32]!==S||e[33]!==r||e[34]!==y||e[35]!==d||e[36]!==v||e[37]!==C||e[38]!==H||e[39]!==K?($={clearHistory:_,deleteQuery:k,history:c,listRef:E,loadFromHistory:T,loadTemplate:R,newQuery:S,onSearchChange:F,queries:r,recordHistory:y,rememberHistory:d,search:v,selectQuery:C,setRememberHistory:H,updateQuerySql:K},e[27]=_,e[28]=k,e[29]=c,e[30]=T,e[31]=R,e[32]=S,e[33]=r,e[34]=y,e[35]=d,e[36]=v,e[37]=C,e[38]=H,e[39]=K,e[40]=$):$=e[40],$},"_n"),Me="p-3 font-mono text-xs leading-5 whitespace-pre-wrap break-words",Mn=i((s,e)=>{let n=[];for(let o of s){if(o.offset===void 0||o.length===void 0||o.length<=0)continue;let r=Math.max(0,Math.min(o.offset,e)),l=Math.max(r,Math.min(o.offset+o.length,e));r!==l&&n.push({end:l,severity:o.severity,start:r})}n.sort((o,r)=>o.start-r.start);let t=[];for(let o of n)o.start>=(t.at(-1)?.end??0)&&t.push(o);return t},"An"),it=i((s,e)=>e(s==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":s==="too-long"?"The statement is too long to rewrite. Select a shorter part of it.":s==="empty-response"?"The model returned nothing usable.":"The model could not be reached."),"Je"),An=i(s=>{let e=(0,X.c)(51),{assistant:n,failed:t,onGenerated:o}=s,r=se(),[l,d]=(0,j.useState)("");if(n.unavailable)return null;let a;e[0]!==n?(a=n.pending("sql"),e[0]=n,e[1]=a):a=e[1];let c=a,m;if(e[2]!==n||e[3]!==t||e[4]!==o||e[5]!==c||e[6]!==l||e[7]!==r){let p=n.reason("sql"),f;e[9]!==n||e[10]!==t||e[11]!==o||e[12]!==l?(f=i(T=>{let L=l.trim();L===""&&!T||ae((async()=>{let _=await n.generate(L===""?"fix the failing statement":L,T?t:void 0);_!==void 0&&o(_)})())},"d"),e[9]=n,e[10]=t,e[11]=o,e[12]=l,e[13]=f):f=e[13];let v=f,g;e[14]!==r?(g=r("Describe the query you want"),e[14]=r,e[15]=g):g=e[15];let E;e[16]===Symbol.for("react.memo_cache_sentinel")?(E=i(T=>{d(T.target.value)},"C"),e[16]=E):E=e[16];let x;e[17]!==v?(x=i(T=>{T.key==="Enter"&&(T.preventDefault(),v(!1))},"m"),e[17]=v,e[18]=x):x=e[18];let y;e[19]!==r?(y=r("Describe the query you want"),e[19]=r,e[20]=y):y=e[20];let h;e[21]!==c||e[22]!==l||e[23]!==g||e[24]!==x||e[25]!==y?(h=(0,u.jsx)(qe,{"aria-label":g,className:"h-7 flex-1 text-xs","data-testid":"sql-assistant-prompt",disabled:c,onChange:E,onKeyDown:x,placeholder:y,value:l}),e[21]=c,e[22]=l,e[23]=g,e[24]=x,e[25]=y,e[26]=h):h=e[26];let S=c&&"opacity-60",w;e[27]!==S?(w=ie("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",S),e[27]=S,e[28]=w):w=e[28];let C;e[29]!==c||e[30]!==l?(C=c||l.trim()==="",e[29]=c,e[30]=l,e[31]=C):C=e[31];let b;e[32]!==v?(b=i(()=>{v(!1)},"h"),e[32]=v,e[33]=b):b=e[33];let k;e[34]!==c||e[35]!==r?(k=r(c?"Thinking\u2026":"Draft SQL"),e[34]=c,e[35]=r,e[36]=k):k=e[36];let N;e[37]!==w||e[38]!==C||e[39]!==b||e[40]!==k?(N=(0,u.jsx)("button",{className:w,"data-testid":"sql-assistant-generate",disabled:C,onClick:b,type:"button",children:k}),e[37]=w,e[38]=C,e[39]=b,e[40]=k,e[41]=N):N=e[41];let R;e[42]!==t||e[43]!==c||e[44]!==v||e[45]!==r?(R=t!==void 0&&(0,u.jsx)("button",{className:"rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-assistant-fix",disabled:c,onClick:i(()=>{v(!0)},"onClick"),type:"button",children:r("Fix this")}),e[42]=t,e[43]=c,e[44]=v,e[45]=r,e[46]=R):R=e[46];let q;e[47]!==N||e[48]!==R||e[49]!==h?(q=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[h,N,R]}),e[47]=N,e[48]=R,e[49]=h,e[50]=q):q=e[50],m=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border px-3 py-2","data-testid":"sql-assistant",children:[q,p!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-assistant-reason",role:"status",children:it(p,r)})]}),e[2]=n,e[3]=t,e[4]=o,e[5]=c,e[6]=l,e[7]=r,e[8]=m}else m=e[8];return m},"qn"),$n=i(s=>{let e=(0,X.c)(8),{diagnostics:n,draft:t,scrollRef:o}=s,r,l;if(e[0]!==n||e[1]!==t){l=Symbol.for("react.early_return_sentinel");e:{let c=Mn(n,t.length);if(c.length===0){l=null;break e}r=[];let m=0;for(let[p,f]of c.entries())f.start>m&&r.push(t.slice(m,f.start)),r.push((0,u.jsx)("span",{className:ie("decoration-wavy underline underline-offset-4",f.severity==="error"?"decoration-destructive":"decoration-amber-500"),children:t.slice(f.start,f.end)},`${f.start.toString()}-${p.toString()}`)),m=f.end;r.push(t.slice(m))}e[0]=n,e[1]=t,e[2]=r,e[3]=l}else r=e[2],l=e[3];if(l!==Symbol.for("react.early_return_sentinel"))return l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=ie("pointer-events-none absolute inset-0 overflow-hidden text-transparent",Me),e[4]=d):d=e[4];let a;return e[5]!==r||e[6]!==o?(a=(0,u.jsx)("div",{"aria-hidden":"true",className:d,"data-testid":"sql-diagnostics-overlay",ref:o,children:r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a},"Dn"),On={gate:"read-only",plan:"plan",schema:"schema",syntax:"syntax"},Pn=i(s=>{let e=(0,X.c)(10),{diagnostics:n,onSelect:t}=s,o=se();if(n.length===0)return null;let r;e[0]!==o?(r=o("SQL problems"),e[0]=o,e[1]=r):r=e[1];let l;if(e[2]!==n||e[3]!==t){let a;e[5]!==t?(a=i((c,m)=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-start gap-2 px-3 py-1 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-problem",onClick:i(()=>{t(c)},"onClick"),type:"button",children:[(0,u.jsx)("span",{className:ie("mt-px shrink-0 rounded px-1 font-mono text-[10px] uppercase",c.severity==="error"?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"),children:On[c.source]}),(0,u.jsx)("span",{className:"min-w-0 text-muted-foreground",children:c.message})]})},`${c.source}-${(c.offset??m).toString()}-${m.toString()}`),"a"),e[5]=t,e[6]=a):a=e[6],l=n.map(a),e[2]=n,e[3]=t,e[4]=l}else l=e[4];let d;return e[7]!==r||e[8]!==l?(d=(0,u.jsx)("ul",{"aria-label":r,className:"max-h-24 shrink-0 overflow-y-auto border-t border-border bg-muted/30","data-testid":"sql-problems",children:l}),e[7]=r,e[8]=l,e[9]=d):d=e[9],d},"Mn"),jn=i(s=>(s.endsWith(`
|
|
12
|
+
`)?s.slice(0,-1):s).split(`
|
|
13
|
+
`),"$n"),zn=i((s,e)=>{let n=[],t=1,o=1;for(let r of Ie(s,e,{ignoreNewlineAtEof:!0}))for(let l of jn(r.value))r.added?(n.push({after:o,kind:"added",text:l}),o+=1):r.removed?(n.push({before:t,kind:"removed",text:l}),t+=1):(n.push({after:o,before:t,kind:"context",text:l}),t+=1,o+=1);return n},"Bn"),Wn={added:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",context:"text-muted-foreground",removed:"bg-destructive/10 text-destructive"},Hn={added:"+",context:" ",removed:"-"},Fn=i(s=>{let e=(0,X.c)(11),{lines:n}=s,t=se(),o;e[0]!==t?(o=t("Proposed edit"),e[0]=t,e[1]=o):o=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=ie("max-h-48 overflow-auto rounded-md border border-border bg-background",Me),e[2]=r):r=e[2];let l;if(e[3]!==n||e[4]!==t){let a;e[6]!==t?(a=i(c=>(0,u.jsxs)("li",{className:ie("flex gap-2",Wn[c.kind]),"data-kind":c.kind,children:[(0,u.jsx)("span",{"aria-hidden":"true",className:"shrink-0 select-none opacity-60",children:Hn[c.kind]}),c.kind!=="context"&&(0,u.jsx)("span",{className:"sr-only",children:c.kind==="added"?t("Added"):t("Removed")}),(0,u.jsx)("span",{className:"min-w-0",children:c.text===""?"\xA0":c.text})]},`${String(c.before)}:${String(c.after)}`),"a"),e[6]=t,e[7]=a):a=e[7],l=n.map(a),e[3]=n,e[4]=t,e[5]=l}else l=e[5];let d;return e[8]!==o||e[9]!==l?(d=(0,u.jsx)("ul",{"aria-label":o,className:r,"data-testid":"sql-inline-diff",children:l}),e[8]=o,e[9]=l,e[10]=d):d=e[10],d},"Fn"),Se="rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",Kn=i(s=>{let e=(0,X.c)(41),{onAccept:n,onCancel:t,rpc:o,source:r,whole:l}=s,d=se(),a=(0,j.useRef)(null),c=(0,j.useRef)(null),[m,p]=(0,j.useState)(""),[f,v]=(0,j.useState)(null),g,E;if(e[0]!==f?(g=i(()=>{f===null?a.current?.focus():c.current?.focus()},"b"),E=[f],e[0]=f,e[1]=g,e[2]=E):(g=e[1],E=e[2]),(0,j.useEffect)(g,E),o.unavailable)return null;let x;e[3]!==o?(x=o.pending("sql"),e[3]=o,e[4]=x):x=e[4];let y=x,h;if(e[5]!==m||e[6]!==n||e[7]!==t||e[8]!==y||e[9]!==f||e[10]!==o||e[11]!==r||e[12]!==d||e[13]!==l){let S=o.reason("sql"),w;e[15]!==m||e[16]!==o||e[17]!==r?(w=i(()=>{let _=m.trim();_===""||r.trim()===""||ae((async()=>{let I=await o.rewrite(_,r);I!==void 0&&v(I)})())},"v"),e[15]=m,e[16]=o,e[17]=r,e[18]=w):w=e[18];let C=w,b;e[19]!==t?(b=i(_=>{_.key==="Escape"&&(_.preventDefault(),t())},"h"),e[19]=t,e[20]=b):b=e[20];let k=b,N;e[21]!==d||e[22]!==l?(N=d(l?"Whole query":"Selection"),e[21]=d,e[22]=l,e[23]=N):N=e[23];let R;e[24]!==N?(R=(0,u.jsx)("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] uppercase text-muted-foreground","data-testid":"sql-inline-edit-scope",children:N}),e[24]=N,e[25]=R):R=e[25];let q;e[26]!==m||e[27]!==n||e[28]!==t||e[29]!==k||e[30]!==y||e[31]!==f||e[32]!==C||e[33]!==d?(q=f===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(qe,{"aria-label":d("Tell the model what to change"),className:"h-7 flex-1 text-xs","data-testid":"sql-inline-edit-prompt",disabled:y,onChange:i(_=>{p(_.target.value)},"onChange"),onKeyDown:i(_=>{if(_.key==="Enter"){_.preventDefault(),C();return}k(_)},"onKeyDown"),placeholder:d("Tell the model what to change"),ref:a,value:m}),(0,u.jsx)("button",{className:ie(Se,y&&"opacity-60"),"data-testid":"sql-inline-edit-submit",disabled:y||m.trim()==="",onClick:C,onKeyDown:k,type:"button",children:d(y?"Thinking\u2026":"Rewrite")}),(0,u.jsx)("button",{className:Se,"data-testid":"sql-inline-edit-cancel",onClick:t,onKeyDown:k,type:"button",children:d("Cancel")})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"flex-1 text-xs text-muted-foreground",children:d("Proposed edit")}),(0,u.jsx)("button",{className:Se,"data-testid":"sql-inline-edit-accept",onClick:i(()=>{n(f)},"onClick"),onKeyDown:k,ref:c,type:"button",children:d("Accept")}),(0,u.jsx)("button",{className:Se,"data-testid":"sql-inline-edit-reject",onClick:i(()=>{v(null)},"onClick"),onKeyDown:k,type:"button",children:d("Reject")})]}),e[26]=m,e[27]=n,e[28]=t,e[29]=k,e[30]=y,e[31]=f,e[32]=C,e[33]=d,e[34]=q):q=e[34];let T;e[35]!==R||e[36]!==q?(T=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[R,q]}),e[35]=R,e[36]=q,e[37]=T):T=e[37];let L;e[38]!==f||e[39]!==r?(L=f!==null&&(0,u.jsx)(Fn,{lines:zn(r,f)}),e[38]=f,e[39]=r,e[40]=L):L=e[40],h=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border bg-muted/20 px-3 py-2","data-testid":"sql-inline-edit",children:[T,L,S!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-inline-edit-reason",role:"status",children:it(S,d)})]}),e[5]=m,e[6]=n,e[7]=t,e[8]=y,e[9]=f,e[10]=o,e[11]=r,e[12]=d,e[13]=l,e[14]=h}else h=e[14];return h},"Wn"),Bn={minWidth:"2.75rem",paddingInline:"0.5rem"},Qn=i(s=>{let e=(0,X.c)(75),{assistant:n,autocomplete:t,diagnostics:o,draft:r,failed:l,handlers:d,editorRef:a,gutterRef:c,inlineEdit:m,listboxId:p,onAcceptInlineEdit:f,onCancelInlineEdit:v,onGenerated:g,onPickSuggestion:E,onRevealDiagnostic:x,overlayRef:y}=s,h=se(),S,w,C,b,k,N,R,q,T;if(e[0]!==n||e[1]!==r||e[2]!==l||e[3]!==c||e[4]!==m||e[5]!==f||e[6]!==v||e[7]!==g){let z=r.split(`
|
|
14
|
+
`).length;R="flex min-h-0 min-w-0 flex-1 flex-col",e[17]!==n||e[18]!==l||e[19]!==g?(q=(0,u.jsx)(An,{assistant:n,failed:l,onGenerated:g}),e[17]=n,e[18]=l,e[19]=g,e[20]=q):q=e[20],e[21]!==n||e[22]!==r.length||e[23]!==m||e[24]!==f||e[25]!==v?(T=m!==null&&(0,u.jsx)(Kn,{onAccept:f,onCancel:v,rpc:n,source:m.text,whole:m.start===0&&m.end===r.length},`${m.start.toString()}-${m.end.toString()}`),e[21]=n,e[22]=r.length,e[23]=m,e[24]=f,e[25]=v,e[26]=T):T=e[26],N="flex min-h-0 min-w-0 flex-1",S="true",w="shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",C=c,b=Bn,k=Array.from({length:z},Yn),e[0]=n,e[1]=r,e[2]=l,e[3]=c,e[4]=m,e[5]=f,e[6]=v,e[7]=g,e[8]=S,e[9]=w,e[10]=C,e[11]=b,e[12]=k,e[13]=N,e[14]=R,e[15]=q,e[16]=T}else S=e[8],w=e[9],C=e[10],b=e[11],k=e[12],N=e[13],R=e[14],q=e[15],T=e[16];let L;e[27]!==S||e[28]!==w||e[29]!==C||e[30]!==b||e[31]!==k?(L=(0,u.jsx)("div",{"aria-hidden":S,className:w,ref:C,style:b,children:k}),e[27]=S,e[28]=w,e[29]=C,e[30]=b,e[31]=k,e[32]=L):L=e[32];let _;e[33]!==o||e[34]!==r||e[35]!==y?(_=(0,u.jsx)($n,{diagnostics:o,draft:r,scrollRef:y}),e[33]=o,e[34]=r,e[35]=y,e[36]=_):_=e[36];let I;e[37]!==t||e[38]!==p?(I=t===null?void 0:`${p}-opt-${t.active.toString()}`,e[37]=t,e[38]=p,e[39]=I):I=e[39];let H=t===null?void 0:p,B=t!==null,F;e[40]!==h?(F=h("SQL query"),e[40]=h,e[41]=F):F=e[41];let O;e[42]!==r||e[43]!==a||e[44]!==d.onBlur||e[45]!==d.onChange||e[46]!==d.onKeyDown||e[47]!==d.onScroll||e[48]!==d.onSelect||e[49]!==I||e[50]!==H||e[51]!==B||e[52]!==F?(O=(0,u.jsx)("textarea",{"aria-activedescendant":I,"aria-autocomplete":"list","aria-controls":H,"aria-expanded":B,"aria-label":F,className:`relative size-full resize-none bg-transparent outline-none ${Me}`,"data-testid":"sql-input",onBlur:d.onBlur,onChange:d.onChange,onKeyDown:d.onKeyDown,onScroll:d.onScroll,onSelect:d.onSelect,placeholder:"SELECT * FROM \u2026",ref:a,role:"combobox",spellCheck:!1,value:r}),e[42]=r,e[43]=a,e[44]=d.onBlur,e[45]=d.onChange,e[46]=d.onKeyDown,e[47]=d.onScroll,e[48]=d.onSelect,e[49]=I,e[50]=H,e[51]=B,e[52]=F,e[53]=O):O=e[53];let K;e[54]!==t||e[55]!==p||e[56]!==E?(K=(0,u.jsx)(cn,{listboxId:p,onPick:E,state:t}),e[54]=t,e[55]=p,e[56]=E,e[57]=K):K=e[57];let $;e[58]!==_||e[59]!==O||e[60]!==K?($=(0,u.jsxs)("div",{className:"relative min-w-0 flex-1 bg-background",children:[_,O,K]}),e[58]=_,e[59]=O,e[60]=K,e[61]=$):$=e[61];let D;e[62]!==L||e[63]!==$||e[64]!==N?(D=(0,u.jsxs)("div",{className:N,children:[L,$]}),e[62]=L,e[63]=$,e[64]=N,e[65]=D):D=e[65];let A;e[66]!==o||e[67]!==x?(A=(0,u.jsx)(Pn,{diagnostics:o,onSelect:x}),e[66]=o,e[67]=x,e[68]=A):A=e[68];let Q;return e[69]!==D||e[70]!==A||e[71]!==R||e[72]!==q||e[73]!==T?(Q=(0,u.jsxs)("div",{className:R,children:[q,T,D,A]}),e[69]=D,e[70]=A,e[71]=R,e[72]=q,e[73]=T,e[74]=Q):Q=e[74],Q},"zn");function Yn(s,e){return(0,u.jsx)("div",{children:e+1},e)}i(Yn,"Un");var at=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],Jn=i(s=>{let e=(0,X.c)(29),{active:n,onDelete:t,onSelect:o,query:r}=s,l=se(),d;e[0]!==o||e[1]!==r.id?(d=i(()=>{o(r.id)},"c"),e[0]=o,e[1]=r.id,e[2]=d):d=e[2];let a=d,c;e[3]!==t||e[4]!==r.id?(c=i(b=>{b.stopPropagation(),t(r.id)},"i"),e[3]=t,e[4]=r.id,e[5]=c):c=e[5];let m=c,p=n?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",f;e[6]!==p?(f=ie("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",p),e[6]=p,e[7]=f):f=e[7];let v=`sql-query-${r.id}`,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M4 6h16M4 12h10M4 18h7"})}),e[8]=g):g=e[8];let E;e[9]!==r.name?(E=(0,u.jsx)("span",{className:"truncate",children:r.name}),e[9]=r.name,e[10]=E):E=e[10];let x;e[11]!==n||e[12]!==a||e[13]!==f||e[14]!==v||e[15]!==E?(x=(0,u.jsxs)("button",{"aria-pressed":n,className:f,"data-testid":v,onClick:a,type:"button",children:[g,E]}),e[11]=n,e[12]=a,e[13]=f,e[14]=v,e[15]=E,e[16]=x):x=e[16];let y;e[17]!==l?(y=l("Delete query"),e[17]=l,e[18]=y):y=e[18];let h;e[19]!==l?(h=l("Delete query"),e[19]=l,e[20]=h):h=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[21]=S):S=e[21];let w;e[22]!==m||e[23]!==h||e[24]!==y?(w=(0,u.jsx)("button",{"aria-label":y,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:m,title:h,type:"button",children:S}),e[22]=m,e[23]=h,e[24]=y,e[25]=w):w=e[25];let C;return e[26]!==w||e[27]!==x?(C=(0,u.jsxs)("li",{className:"group/q flex items-center",children:[x,w]}),e[26]=w,e[27]=x,e[28]=C):C=e[28],C},"jn"),Ge="sql-history-remember",Vn=i((s,e)=>{let n=e.trim().toLowerCase();return n===""?[...s]:s.filter(t=>t.name.toLowerCase().includes(n))},"Qn"),Gn=i(s=>{let e=(0,X.c)(66),{activeId:n,history:t,listRef:o,onClearHistory:r,onDelete:l,onLoadHistory:d,onLoadTemplate:a,onNew:c,onSearchChange:m,onSelect:p,onToggleRememberHistory:f,queries:v,rememberHistory:g,search:E}=s,x=se(),y,h,S,w,C;if(e[0]!==n||e[1]!==o||e[2]!==l||e[3]!==c||e[4]!==m||e[5]!==p||e[6]!==f||e[7]!==v||e[8]!==E||e[9]!==x){let I=Vn(v,E),H;e[15]!==f?(H=i(z=>{f(z.target.checked)},"M"),e[15]=f,e[16]=H):H=e[16],y=H,S="flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar";let B;e[17]!==x?(B=x("Search queries\u2026"),e[17]=x,e[18]=B):B=e[18];let F;e[19]!==m||e[20]!==E||e[21]!==B?(F=(0,u.jsx)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:m,placeholder:B,type:"text",value:E}),e[19]=m,e[20]=E,e[21]=B,e[22]=F):F=e[22];let O;e[23]!==x?(O=x("New query"),e[23]=x,e[24]=O):O=e[24];let K;e[25]!==x?(K=x("New query"),e[25]=x,e[26]=K):K=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[27]=$):$=e[27];let D;e[28]!==c||e[29]!==O||e[30]!==K?(D=(0,u.jsx)("button",{"aria-label":O,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:c,title:K,type:"button",children:$}),e[28]=c,e[29]=O,e[30]=K,e[31]=D):D=e[31],e[32]!==D||e[33]!==F?(w=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[F,D]}),e[32]=D,e[33]=F,e[34]=w):w=e[34],h="flex flex-1 flex-col gap-4 overflow-y-auto p-2";let A;e[35]!==x?(A=x("Private"),e[35]=x,e[36]=A):A=e[36];let Q;e[37]!==A?(Q=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:A}),e[37]=A,e[38]=Q):Q=e[38],C=(0,u.jsxs)("div",{children:[Q,I.length===0?(0,u.jsx)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:x("No saved queries yet \u2014 they save to this browser as you type.")}):(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:o,children:I.map(z=>(0,u.jsx)(Jn,{active:n===z.id,onDelete:l,onSelect:p,query:z},z.id))})]}),e[0]=n,e[1]=o,e[2]=l,e[3]=c,e[4]=m,e[5]=p,e[6]=f,e[7]=v,e[8]=E,e[9]=x,e[10]=y,e[11]=h,e[12]=S,e[13]=w,e[14]=C}else y=e[10],h=e[11],S=e[12],w=e[13],C=e[14];let b;e[39]!==x?(b=x("Reference"),e[39]=x,e[40]=b):b=e[40];let k;e[41]!==b?(k=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b}),e[41]=b,e[42]=k):k=e[42];let N;e[43]!==a?(N=at.map(I=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":I.sql,onClick:a,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"})}),I.label]})},I.label)),e[43]=a,e[44]=N):N=e[44];let R;e[45]!==N?(R=(0,u.jsx)("ul",{className:"flex flex-col gap-px",children:N}),e[45]=N,e[46]=R):R=e[46];let q;e[47]!==k||e[48]!==R?(q=(0,u.jsxs)("div",{children:[k,R]}),e[47]=k,e[48]=R,e[49]=q):q=e[49];let T;e[50]!==t||e[51]!==r||e[52]!==d||e[53]!==y||e[54]!==g||e[55]!==x?(T=t.length>0&&(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,u.jsx)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:x("History")}),(0,u.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:r,type:"button",children:x("Clear history")})]}),(0,u.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 pb-1.5 text-[11px] text-muted-foreground",htmlFor:Ge,children:[(0,u.jsx)("input",{checked:g,"data-testid":"sql-history-remember",id:Ge,onChange:y,type:"checkbox"}),x("Keep history on this browser")]}),(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:t.map(I=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":I.sql,"data-testid":"sql-history-item",onClick:d,title:I.sql,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"})}),(0,u.jsx)("span",{className:"truncate font-mono",children:I.sql})]})},`${I.at.toString()}:${I.sql}`))})]}),e[50]=t,e[51]=r,e[52]=d,e[53]=y,e[54]=g,e[55]=x,e[56]=T):T=e[56];let L;e[57]!==h||e[58]!==T||e[59]!==C||e[60]!==q?(L=(0,u.jsxs)("div",{className:h,children:[C,q,T]}),e[57]=h,e[58]=T,e[59]=C,e[60]=q,e[61]=L):L=e[61];let _;return e[62]!==L||e[63]!==S||e[64]!==w?(_=(0,u.jsxs)("aside",{className:S,children:[w,L]}),e[62]=L,e[63]=S,e[64]=w,e[65]=_):_=e[65],_},"Yn"),Ce=i(s=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${s?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"ve"),Un=i(s=>{let e=(0,X.c)(97),{assistant:n,chart:t,className:o,durationMs:r,error:l,onFormat:d,onInferChart:a,onRun:c,onSelectStatement:m,onShardKeyChange:p,onShowChart:f,onShowExplain:v,onShowResults:g,onToggleSplit:E,pane:x,result:y,running:h,script:S,shardKey:w,splitView:C}=s,b=se(),k=x==="results",N;e[0]!==k?(N=Ce(k),e[0]=k,e[1]=N):N=e[1];let R;e[2]!==b?(R=b("Results"),e[2]=b,e[3]=R):R=e[3];let q;e[4]!==g||e[5]!==N||e[6]!==R?(q=(0,u.jsx)("button",{className:N,"data-testid":"sql-tab-results",onClick:g,type:"button",children:R}),e[4]=g,e[5]=N,e[6]=R,e[7]=q):q=e[7];let T=x==="chart",L;e[8]!==T?(L=Ce(T),e[8]=T,e[9]=L):L=e[9];let _;e[10]!==b?(_=b("Chart"),e[10]=b,e[11]=_):_=e[11];let I;e[12]!==f||e[13]!==L||e[14]!==_?(I=(0,u.jsx)("button",{className:L,"data-testid":"sql-tab-chart",onClick:f,type:"button",children:_}),e[12]=f,e[13]=L,e[14]=_,e[15]=I):I=e[15];let H;e[16]!==n||e[17]!==a||e[18]!==x||e[19]!==y||e[20]!==b?(H=!n.unavailable&&x==="chart"&&y!==null&&(0,u.jsx)("button",{className:Ce(!1),"data-testid":"sql-infer-chart",disabled:n.pending("chart"),onClick:a,type:"button",children:n.pending("chart")?b("Thinking\u2026"):b("Suggest chart")}),e[16]=n,e[17]=a,e[18]=x,e[19]=y,e[20]=b,e[21]=H):H=e[21];let B=x==="explain",F;e[22]!==B?(F=Ce(B),e[22]=B,e[23]=F):F=e[23];let O;e[24]!==b?(O=b("Explain"),e[24]=b,e[25]=O):O=e[25];let K;e[26]!==v||e[27]!==F||e[28]!==O?(K=(0,u.jsx)("button",{className:F,"data-testid":"sql-tab-explain",onClick:v,type:"button",children:O}),e[26]=v,e[27]=F,e[28]=O,e[29]=K):K=e[29];let $;e[30]!==b?($=b("Split editor and results"),e[30]=b,e[31]=$):$=e[31];let D=`inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${C?"bg-accent text-foreground":"text-muted-foreground"}`,A;e[32]!==b?(A=b("Split editor and results"),e[32]=b,e[33]=A):A=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,u.jsxs)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:[(0,u.jsx)("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),(0,u.jsx)("path",{d:"M12 4v16"})]}),e[34]=Q):Q=e[34];let z;e[35]!==E||e[36]!==C||e[37]!==$||e[38]!==D||e[39]!==A?(z=(0,u.jsx)("button",{"aria-label":$,"aria-pressed":C,className:D,"data-testid":"sql-split-toggle",onClick:E,title:A,type:"button",children:Q}),e[35]=E,e[36]=C,e[37]=$,e[38]=D,e[39]=A,e[40]=z):z=e[40];let re;e[41]!==y?(re=y!==null&&y.columns.length>0&&(0,u.jsx)(He,{columns:y.columns,name:"query-result",rows:y.rows}),e[41]=y,e[42]=re):re=e[42];let Z;e[43]!==b?(Z=b("Format"),e[43]=b,e[44]=Z):Z=e[44];let oe;e[45]!==d||e[46]!==h||e[47]!==Z?(oe=(0,u.jsx)("button",{className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-format",disabled:h,onClick:d,type:"button",children:Z}),e[45]=d,e[46]=h,e[47]=Z,e[48]=oe):oe=e[48];let M;e[49]!==p||e[50]!==w?(M=(0,u.jsx)(Pe,{onChange:p,testId:"sql-shard-input",value:w}),e[49]=p,e[50]=w,e[51]=M):M=e[51];let Y;e[52]!==h||e[53]!==b?(Y=b(h?"Running\u2026":"Run"),e[52]=h,e[53]=b,e[54]=Y):Y=e[54];let U;e[55]===Symbol.for("react.memo_cache_sentinel")?(U=(0,u.jsx)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"}),e[55]=U):U=e[55];let W;e[56]!==c||e[57]!==h||e[58]!==Y?(W=(0,u.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-run",disabled:h,onClick:c,type:"button",children:[Y,U]}),e[56]=c,e[57]=h,e[58]=Y,e[59]=W):W=e[59];let J;e[60]!==z||e[61]!==re||e[62]!==oe||e[63]!==M||e[64]!==W?(J=(0,u.jsxs)("div",{className:"ms-auto flex items-center gap-2",children:[z,re,oe,M,W]}),e[60]=z,e[61]=re,e[62]=oe,e[63]=M,e[64]=W,e[65]=J):J=e[65];let G;e[66]!==K||e[67]!==J||e[68]!==q||e[69]!==I||e[70]!==H?(G=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[q,I,H,K,J]}),e[66]=K,e[67]=J,e[68]=q,e[69]=I,e[70]=H,e[71]=G):G=e[71];let ee;e[72]!==m||e[73]!==S?(ee=S!==void 0&&(0,u.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-3 py-1.5","data-testid":"sql-statements",children:S.runs.map((ce,de)=>(0,u.jsx)("button",{"aria-pressed":de===S.selected,className:`rounded-md border px-2 py-0.5 font-mono text-[11px] outline-none transition-colors ${de===S.selected?"border-foreground text-foreground":"border-border text-muted-foreground hover:text-foreground"} ${ce.error===null?"":"border-destructive/50 text-destructive"}`,"data-testid":`sql-statement-${de.toString()}`,onClick:i(()=>{m(de)},"onClick"),title:ce.sql,type:"button",children:de+1},`${de.toString()}:${ce.sql}`))}),e[72]=m,e[73]=S,e[74]=ee):ee=e[74];let le;e[75]!==l?(le=l!==null&&(0,u.jsx)(je,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:l}),e[75]=l,e[76]=le):le=e[76];let te;e[77]!==l||e[78]!==y||e[79]!==b?(te=l===null&&y===null&&(0,u.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:b("Click Run to execute your query.")}),e[77]=l,e[78]=y,e[79]=b,e[80]=te):te=e[80];let P;e[81]!==t||e[82]!==r||e[83]!==l||e[84]!==x||e[85]!==y||e[86]!==b?(P=l===null&&y!==null&&(0,u.jsxs)("div",{"data-testid":"sql-result",children:[x==="chart"?(0,u.jsx)(Fe,{axes:t,result:y}):(0,u.jsx)(Ke,{result:y}),(0,u.jsxs)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:[y.truncated?b("Showing the first {max} rows.",{max:y.rows.length}):b("{count} rows",{count:y.rowCount}),r!==void 0&&` \xB7 ${b("{ms} ms",{ms:Math.round(r)})}`]})]}),e[81]=t,e[82]=r,e[83]=l,e[84]=x,e[85]=y,e[86]=b,e[87]=P):P=e[87];let V;e[88]!==le||e[89]!==te||e[90]!==P?(V=(0,u.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto",children:[le,te,P]}),e[88]=le,e[89]=te,e[90]=P,e[91]=V):V=e[91];let ne;return e[92]!==o||e[93]!==G||e[94]!==ee||e[95]!==V?(ne=(0,u.jsxs)("div",{className:o,children:[G,ee,V]}),e[92]=o,e[93]=G,e[94]=ee,e[95]=V,e[96]=ne):ne=e[96],ne},"Gn"),Xn=i((s,e)=>s.trim()===""?e:(s.split(`
|
|
15
|
+
`)[0]??s).slice(0,24),"Jn"),Zn=i(s=>{s?.focus(),s?.select()},"Vn"),eo=i(s=>{let e=(0,X.c)(14),{initial:n,onCancel:t,onCommit:o,placeholder:r,testId:l}=s,d=se(),a;e[0]!==o?(a=i(g=>{o(g.currentTarget.value.trim())},"a"),e[0]=o,e[1]=a):a=e[1];let c=a,m;e[2]!==t||e[3]!==o?(m=i(g=>{g.key==="Enter"?o(g.currentTarget.value.trim()):g.key==="Escape"&&t()},"u"),e[2]=t,e[3]=o,e[4]=m):m=e[4];let p=m,f;e[5]!==d?(f=d("Tab title"),e[5]=d,e[6]=f):f=e[6];let v;return e[7]!==n||e[8]!==c||e[9]!==p||e[10]!==r||e[11]!==f||e[12]!==l?(v=(0,u.jsx)("input",{"aria-label":f,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":l,defaultValue:n,onBlur:c,onKeyDown:p,placeholder:r,ref:Zn,type:"text"}),e[7]=n,e[8]=c,e[9]=p,e[10]=r,e[11]=f,e[12]=l,e[13]=v):v=e[13],v},"Xn"),to=i(s=>{let e=(0,X.c)(29),{idBase:n,onDiscard:t,onKeep:o}=s,r=se(),l=`sql-tab-close-prompt-${n}`,d;e[0]!==r?(d=r("Discard?"),e[0]=r,e[1]=d):d=e[1];let a;e[2]!==d?(a=(0,u.jsx)("span",{className:"text-[11px] text-muted-foreground",children:d}),e[2]=d,e[3]=a):a=e[3];let c;e[4]!==r?(c=r("Discard changes"),e[4]=r,e[5]=c):c=e[5];let m=`sql-tab-close-confirm-${n}`,p;e[6]!==r?(p=r("Discard changes"),e[6]=r,e[7]=p):p=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 13l4 4L19 7"})}),e[8]=f):f=e[8];let v;e[9]!==t||e[10]!==c||e[11]!==m||e[12]!==p?(v=(0,u.jsx)("button",{"aria-label":c,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":m,onClick:t,title:p,type:"button",children:f}),e[9]=t,e[10]=c,e[11]=m,e[12]=p,e[13]=v):v=e[13];let g;e[14]!==r?(g=r("Keep editing"),e[14]=r,e[15]=g):g=e[15];let E=`sql-tab-close-cancel-${n}`,x;e[16]!==r?(x=r("Keep editing"),e[16]=r,e[17]=x):x=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})}),e[18]=y):y=e[18];let h;e[19]!==o||e[20]!==E||e[21]!==x||e[22]!==g?(h=(0,u.jsx)("button",{"aria-label":g,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":E,onClick:o,title:x,type:"button",children:y}),e[19]=o,e[20]=E,e[21]=x,e[22]=g,e[23]=h):h=e[23];let S;return e[24]!==l||e[25]!==h||e[26]!==a||e[27]!==v?(S=(0,u.jsxs)("span",{className:"flex shrink-0 items-center gap-1","data-testid":l,role:"group",children:[a,v,h]}),e[24]=l,e[25]=h,e[26]=a,e[27]=v,e[28]=S):S=e[28],S},"Zn"),no=i(s=>{let e=(0,X.c)(47),{active:n,canClose:t,onClose:o,onMenu:r,onRename:l,onSelect:d,tab:a}=s,c=se(),[m,p]=(0,j.useState)(!1),[f,v]=(0,j.useState)(!1),g;e[0]!==r||e[1]!==a.id?(g=i(z=>{r(a.id,z)},"b"),e[0]=r,e[1]=a.id,e[2]=g):g=e[2];let E=g,x;e[3]!==d||e[4]!==a.id?(x=i(()=>{d(a.id)},"m"),e[3]=d,e[4]=a.id,e[5]=x):x=e[5];let y=x,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i(()=>{p(!0)},"p"),e[6]=h):h=e[6];let S=h,w;e[7]!==o||e[8]!==a?(w=i(z=>{z.stopPropagation(),lt(a)?v(!0):o(a.id)},"v"),e[7]=o,e[8]=a,e[9]=w):w=e[9];let C=w,b;e[10]!==o||e[11]!==a.id?(b=i(z=>{z.stopPropagation(),v(!1),o(a.id)},"h"),e[10]=o,e[11]=a.id,e[12]=b):b=e[12];let k=b,N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=i(z=>{z.stopPropagation(),v(!1)},"T"),e[13]=N):N=e[13];let R=N,q;e[14]!==l||e[15]!==a.id?(q=i(z=>{l(a.id,z),p(!1)},"R"),e[14]=l,e[15]=a.id,e[16]=q):q=e[16];let T=q,L;e[17]===Symbol.for("react.memo_cache_sentinel")?(L=i(()=>{p(!1)},"_"),e[17]=L):L=e[17];let _=L,I;e[18]!==a.name?(I=a.name.trim(),e[18]=a.name,e[19]=I):I=e[19];let H=I,B;e[20]!==c||e[21]!==a.sql?(B=Xn(a.sql,c("Untitled")),e[20]=c,e[21]=a.sql,e[22]=B):B=e[22];let F=B,O=n?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",K;e[23]!==O?(K=ie("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",O),e[23]=O,e[24]=K):K=e[24];let $=`sql-tab-${a.id}`,D;e[25]!==n||e[26]!==T||e[27]!==H||e[28]!==F||e[29]!==m||e[30]!==y||e[31]!==c||e[32]!==a.id?(D=m?(0,u.jsx)(eo,{initial:H,onCancel:_,onCommit:T,placeholder:F,testId:`sql-tab-rename-${a.id}`}):(0,u.jsx)("button",{"aria-pressed":n,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${a.id}`,onClick:y,onDoubleClick:S,title:c("Double-click to rename"),type:"button",children:H===""?F:H}),e[25]=n,e[26]=T,e[27]=H,e[28]=F,e[29]=m,e[30]=y,e[31]=c,e[32]=a.id,e[33]=D):D=e[33];let A;e[34]!==t||e[35]!==k||e[36]!==f||e[37]!==C||e[38]!==c||e[39]!==a.id?(A=t&&(f?(0,u.jsx)(to,{idBase:a.id,onDiscard:k,onKeep:R}):(0,u.jsx)("button",{"aria-label":c("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${a.id}`,onClick:C,title:c("Close tab"),type:"button",children:(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})),e[34]=t,e[35]=k,e[36]=f,e[37]=C,e[38]=c,e[39]=a.id,e[40]=A):A=e[40];let Q;return e[41]!==E||e[42]!==K||e[43]!==$||e[44]!==D||e[45]!==A?(Q=(0,u.jsxs)("div",{className:K,"data-testid":$,onContextMenu:E,children:[D,A]}),e[41]=E,e[42]=K,e[43]=$,e[44]=D,e[45]=A,e[46]=Q):Q=e[46],Q},"es"),oo=i(s=>{let e=(0,X.c)(43),{model:n,onSelect:t}=s,o=se(),{activeTab:r,addEditorTab:l,cancelBulk:d,closeEditorTab:a,closeTabMenu:c,confirmBulk:m,menuStyle:p,onBackdropContextMenu:f,onCloseAll:v,onCloseOthers:g,onCloseToRight:E,openTabMenu:x,pendingBulk:y,renameTab:h,tabMenu:S,tabs:w}=n,C;if(e[0]!==r||e[1]!==a||e[2]!==t||e[3]!==x||e[4]!==h||e[5]!==w){let I;e[7]!==r||e[8]!==a||e[9]!==t||e[10]!==x||e[11]!==h||e[12]!==w.length?(I=i(H=>(0,u.jsx)(no,{active:H.id===r.id,canClose:w.length>1,onClose:a,onMenu:x,onRename:h,onSelect:t,tab:H},H.id),"A"),e[7]=r,e[8]=a,e[9]=t,e[10]=x,e[11]=h,e[12]=w.length,e[13]=I):I=e[13],C=w.map(I),e[0]=r,e[1]=a,e[2]=t,e[3]=x,e[4]=h,e[5]=w,e[6]=C}else C=e[6];let b;e[14]!==o?(b=o("New tab"),e[14]=o,e[15]=b):b=e[15];let k=w.length>=De,N;e[16]!==o?(N=o("New tab"),e[16]=o,e[17]=N):N=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[18]=R):R=e[18];let q;e[19]!==l||e[20]!==b||e[21]!==k||e[22]!==N?(q=(0,u.jsx)("button",{"aria-label":b,className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:k,onClick:l,title:N,type:"button",children:R}),e[19]=l,e[20]=b,e[21]=k,e[22]=N,e[23]=q):q=e[23];let T;e[24]!==C||e[25]!==q?(T=(0,u.jsxs)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[C,q]}),e[24]=C,e[25]=q,e[26]=T):T=e[26];let L;e[27]!==d||e[28]!==c||e[29]!==m||e[30]!==p||e[31]!==f||e[32]!==v||e[33]!==g||e[34]!==E||e[35]!==y||e[36]!==o||e[37]!==S||e[38]!==w?(L=S!==null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:c,onContextMenu:f,role:"presentation"}),(0,u.jsx)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:p,children:y===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:w.length<=1,onClick:g,role:"menuitem",type:"button",children:o("Close other tabs")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:w.findIndex(I=>I.id===S.id)>=w.length-1,onClick:E,role:"menuitem",type:"button",children:o("Close tabs to the right")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:v,role:"menuitem",type:"button",children:o("Close all tabs")})]}):(0,u.jsxs)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,u.jsx)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:o("Discard unsaved tabs?")}),(0,u.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:m,type:"button",children:o("Discard")}),(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:d,type:"button",children:o("Cancel")})]})]})})]}),e[27]=d,e[28]=c,e[29]=m,e[30]=p,e[31]=f,e[32]=v,e[33]=g,e[34]=E,e[35]=y,e[36]=o,e[37]=S,e[38]=w,e[39]=L):L=e[39];let _;return e[40]!==T||e[41]!==L?(_=(0,u.jsxs)(u.Fragment,{children:[T,L]}),e[40]=T,e[41]=L,e[42]=_):_=e[42],_},"ts"),ro=me(he.runSql),so="lunora-studio-sql-split-view",lo=i(()=>ge(at[0]?.sql??""),"os"),io=i(()=>performance.now(),"ls"),ao=i(()=>{let s=(0,X.c)(2),e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,s[0]=e):e=s[0];let n=(0,j.useRef)(e),t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t={advance:i(o=>{n.current.set(o,(n.current.get(o)??0)+1)},"advance"),begin:i(o=>{let r=n.current.get(o)??0;return()=>(n.current.get(o)??0)===r},"begin")},s[1]=t):t=s[1],t},"rs"),Do=i(({initialShardKey:s,now:e=io})=>{let n=xe(),t=En(lo),{activeTab:o,output:r,patchActiveOutput:l,patchActiveTab:d,setActiveTabId:a,unlinkQuery:c}=t,m=ao(),p=Dn({loadIntoActiveTab:i((W,J)=>{m.advance(o.id),d({activeId:J,sql:W}),l({chart:void 0,durationMs:void 0,error:null,failed:void 0,result:null,running:!1,script:void 0})},"loadIntoActiveTab"),unlinkQuery:c}),{recordHistory:f,updateQuerySql:v}=p,g=o.sql,{activeId:E}=o,{chart:x,error:y,failed:h,result:S,running:w}=r,C=r.pane,[b,k]=(0,j.useState)(s??""),[N,R]=ye(so,!1),{probe:q,schema:T}=mn(b),L=i(W=>{d({sql:W}),E!==null&&v(E,W)},"L"),_=Vt(g,T,b),I=We(b),H=i(()=>{S!==null&&ae((async()=>{let W=await I.inferChart({columns:S.columns,rowCount:S.rowCount,types:Object.fromEntries(S.columns.map(J=>[J,typeof(S.rows[0]?.[J]??"")]))});l({chart:W})})())},"W"),B=i(async W=>{let J=e();try{let G=await n.query(ro,{sql:W},fe(b)),ee=e()-J;return f(W),{durationMs:ee,error:null,result:G,sql:W}}catch(G){return{error:Ae(G),result:null,sql:W}}},"K"),F=i(async W=>{if(g.trim()==="")return;let J=m.begin(o.id);l({running:!0});let G=W==="explain"?_e(St(g),0):tt(g),ee=[];for(let P of G){let V={error:P.rejection?.message??"",result:null,sql:P.sql};ee.push(P.rejection===void 0?await B(P.sql):V)}if(Oe(b),!J())return;let le=Math.max(ee.length-1,0),te=ee[le];l({chart:void 0,durationMs:te?.durationMs,error:te?.error??null,failed:te?.error===null||te===void 0?void 0:{error:te.error,sql:te.sql},pane:W,result:te?.result??null,running:!1,script:ee.length>1?{runs:ee,selected:le}:void 0})},"$"),O=i(W=>{let J=r.script?.runs,G=J?.[W];J===void 0||G===void 0||l({chart:void 0,durationMs:G.durationMs,error:G.error,failed:G.error===null?void 0:{error:G.error,sql:G.sql},result:G.result,script:{runs:J,selected:W}})},"F"),K=i(()=>{ae(F("results"))},"H"),$=bn({inlineEditEnabled:!I.unavailable,onSubmit:i(()=>{ae(F(r.pane))},"onSubmit"),probe:q,schema:T,setDraft:L}),{closeAutocomplete:D,closeInlineEdit:A}=$,Q=i(()=>{L(Tt(g))},"P"),z=i(W=>{D(),A(),a(W)},"oe"),re=i(()=>{l({pane:"results"})},"Z"),Z=i(()=>{ae(F("explain"))},"ne"),oe=i(()=>{l({pane:"chart"})},"q"),M=i(()=>{R(!N)},"j"),Y=N?"flex min-h-0 flex-1 flex-row":"flex min-h-0 flex-1 flex-col",U=N?"flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border":"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border";return(0,u.jsxs)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[(0,u.jsx)(Gn,{activeId:E,history:p.history,listRef:p.listRef,onClearHistory:p.clearHistory,onDelete:p.deleteQuery,onLoadHistory:p.loadFromHistory,onLoadTemplate:p.loadTemplate,onNew:p.newQuery,onSearchChange:p.onSearchChange,onSelect:p.selectQuery,onToggleRememberHistory:p.setRememberHistory,queries:p.queries,rememberHistory:p.rememberHistory,search:p.search}),(0,u.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,u.jsx)(oo,{model:t,onSelect:z}),(0,u.jsxs)("div",{className:Y,children:[(0,u.jsx)(Qn,{assistant:I,autocomplete:$.autocompleteState,diagnostics:_,draft:g,editorRef:$.editorRef,failed:h,gutterRef:$.gutterRef,handlers:$.handlers,inlineEdit:$.inlineEdit,listboxId:$.listboxId,onAcceptInlineEdit:$.acceptInlineEdit,onCancelInlineEdit:$.closeInlineEdit,onGenerated:L,onPickSuggestion:$.onPickSuggestion,onRevealDiagnostic:$.revealDiagnostic,overlayRef:$.overlayRef}),(0,u.jsx)(Un,{assistant:I,chart:x,className:U,durationMs:r.durationMs,error:y,onFormat:Q,onInferChart:H,onRun:K,onSelectStatement:O,onShardKeyChange:k,onShowChart:oe,onShowExplain:Z,onShowResults:re,onToggleSplit:M,pane:C,result:S,running:w,script:r.script,shardKey:b,splitView:N})]})]})]})},"Es");export{Do as SqlEditorPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as P}from"./chunk-E5DXYVPB.js";import{c as K,d as X,e as z,f as L,h as B,i as E,j as G,k as q,l as A,m as O,n as W,o as $,p as D}from"./chunk-OLIKYC3C.js";import{a as F,b as H,c as I,d as S,e as J,f as M}from"./chunk-HCTJKP5J.js";import{d as C,p as j}from"./chunk-74IYYDDI.js";import{a as f,d as T,f as U,g as V}from"./chunk-I26MS5PJ.js";var N=T(U(),1);var t=T(V(),1);var _=50,R={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},Q=f(r=>{let a=r.columns.find(e=>r.rows.length>0&&r.rows.every(n=>typeof n[e]=="number"))??null;return{label:r.columns.find(e=>e!==a)??null,value:a}},"D"),Y=f(r=>{let a=(0,N.c)(3),{data:e,kind:n}=r,l;return a[0]!==e||a[1]!==n?(l=(0,t.jsx)(G,{className:"h-full w-full",config:R,children:n==="area"?(0,t.jsxs)(E,{data:e,children:[(0,t.jsx)(K,{vertical:!1}),(0,t.jsx)(L,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(A,{content:(0,t.jsx)(q,{})}),(0,t.jsx)(z,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):(0,t.jsxs)(B,{data:e,children:[(0,t.jsx)(K,{vertical:!1}),(0,t.jsx)(L,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(A,{content:(0,t.jsx)(q,{})}),(0,t.jsx)(X,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),a[0]=e,a[1]=n,a[2]=l):l=a[2],l},"J"),na=f(r=>{let a=(0,N.c)(21),{axes:e,kind:n,result:l}=r,u=C(),o;a[0]!==l?(o=Q(l),a[0]=l,a[1]=o):o=a[1];let d=o,m;a[2]!==l.columns?(m=new Set(l.columns),a[2]=l.columns,a[3]=m):m=a[3];let s=m,c=e!==void 0&&s.has(e.x)?e.x:d.label,p;a[4]!==e?.y||a[5]!==s?(p=e?.y.find(i=>s.has(i)),a[4]=e?.y,a[5]=s,a[6]=p):p=a[6];let x=p,y=x??d.value,b;a[7]!==c||a[8]!==l.rows||a[9]!==y?(b=y===null?[]:l.rows.slice(0,_).map((i,w)=>({label:c===null?`#${(w+1).toString()}`:j(i[c]),value:Number(i[y])||0})),a[7]=c,a[8]=l.rows,a[9]=y,a[10]=b):b=a[10];let k=b;if(y===null){let i;a[11]!==u?(i=u("No numeric column to chart."),a[11]=u,a[12]=i):i=a[12];let w;return a[13]!==i?(w=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:i}),a[13]=i,a[14]=w):w=a[14],w}let h=n??(e!==void 0&&x!==void 0?e.kind:"bar"),v;a[15]!==k||a[16]!==h?(v=h==="bar"?(0,t.jsxs)(O,{className:"h-full w-full",config:R,data:k,children:[(0,t.jsx)($,{dataKey:"label"}),(0,t.jsx)(W,{dataKey:"value"}),(0,t.jsx)(D,{})]}):(0,t.jsx)(Y,{data:k,kind:h}),a[15]=k,a[16]=h,a[17]=v):v=a[17];let g;return a[18]!==h||a[19]!==v?(g=(0,t.jsx)("div",{className:"h-80 w-full p-3","data-chart-kind":h,"data-testid":"sql-chart",children:v}),a[18]=h,a[19]=v,a[20]=g):g=a[20],g},"oe"),oa=f(r=>{let a=(0,N.c)(19),{result:e}=r,n=C();if(e.columns.length===0){let s;a[0]!==e.rowCount||a[1]!==n?(s=n("{count} rows",{count:e.rowCount}),a[0]=e.rowCount,a[1]=n,a[2]=s):s=a[2];let c;return a[3]!==s?(c=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:s}),a[3]=s,a[4]=c):c=a[4],c}let l;a[5]!==e.columns?(l=e.columns.map(Z),a[5]=e.columns,a[6]=l):l=a[6];let u;a[7]!==l?(u=(0,t.jsx)(H,{className:"sticky top-0 z-10 bg-muted",children:(0,t.jsx)(S,{children:l})}),a[7]=l,a[8]=u):u=a[8];let o;if(a[9]!==e.columns||a[10]!==e.rows){let s;a[12]!==e.columns?(s=f((c,p)=>(0,t.jsx)(S,{"data-testid":"sql-row",children:e.columns.map(x=>(0,t.jsx)(M,{className:"max-w-md truncate font-mono text-xs",children:(0,t.jsx)(P,{value:c[x]})},x))},p),"s"),a[12]=e.columns,a[13]=s):s=a[13],o=e.rows.map(s),a[9]=e.columns,a[10]=e.rows,a[11]=o}else o=a[11];let d;a[14]!==o?(d=(0,t.jsx)(I,{children:o}),a[14]=o,a[15]=d):d=a[15];let m;return a[16]!==u||a[17]!==d?(m=(0,t.jsxs)(F,{"data-testid":"sql-rows",children:[u,d]}),a[16]=u,a[17]=d,a[18]=m):m=a[18],m},"ne");function Z(r){return(0,t.jsx)(J,{children:r},r)}f(Z,"P");export{na as a,oa as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as fe}from"./chunk-ECY2JC5F.js";import"./chunk-NRP22GKC.js";import{a as ie}from"./chunk-Y3AYVFTK.js";import{a as pe}from"./chunk-5SLTDY4C.js";import"./chunk-UC7MNI2F.js";import{i as de}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as b}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as ne}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as he}from"./chunk-ZJQIGWLG.js";import"./chunk-NCPW7WHO.js";import"./chunk-IRSSZXC3.js";import"./chunk-55UGUCQ6.js";import{a as H}from"./chunk-4ZEL6BYL.js";import{c as ue}from"./chunk-DHGPCQ2F.js";import{l as le}from"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import{a as ce}from"./chunk-RWVIV3U7.js";import{d as oe,f as Z,g as ee,h as te,q as ae,t as me,u as re}from"./chunk-74IYYDDI.js";import{a as l,d as Y,e as ge,f as ve,g as Ne,i as se}from"./chunk-I26MS5PJ.js";var t=Y(Ne(),1);var be=Y(ve(),1);var v=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:se("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}l(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,xe=l(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),N=l(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"v"),Ce=/<a\s(?:[^>]*?\s)?href\s*=\s*["'](https?:\/\/[^"'\s]+)["']/iu,ke=/&(?:amp|#0*38|#x0*26);/giu,Se=l(a=>a===void 0?void 0:((a.html===void 0?void 0:Ce.exec(a.html)?.[1])??xe(a.text)??xe(a.html))?.replaceAll(ke,"&"),"ye"),Te=l((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${N(o.to)} ${N(o.cc)}`.toLowerCase().includes(s))},"Ce"),Le=l((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"Se"),je=Z(H.clearCapturedMail),Me=Z(H.sendTestMail),_e=l(a=>{let e=(0,be.c)(36),{limit:s}=a,o=le(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:I,error:y,errorSource:w,isLoading:g,poll:P,refetch:c}=ue(H.getCapturedMail,p),[C,f]=(0,v.useState)(null),[q,k]=(0,v.useState)(null),[i,u]=(0,v.useState)("html"),[x,B]=(0,v.useState)(""),r=I?.entries??[],m=y??C,D=y===null?C:w,S;e[2]!==o||e[3]!==c?(S=l(async()=>{f(null);try{await o.query(je,{},ee("")),k(null),c()}catch(d){f(te(d))}},"S"),e[2]=o,e[3]=c,e[4]=S):S=e[4];let R=S,T;e[5]!==o||e[6]!==c?(T=l(async()=>{f(null);try{await o.query(Me,{},ee("")),c()}catch(d){f(te(d))}},"T"),e[5]=o,e[6]=c,e[7]=T):T=e[7];let Q=T;pe(P,!0);let L;e[8]!==R?(L=l(()=>{ae(R())},"k"),e[8]=R,e[9]=L):L=e[9];let U=L,j;e[10]!==Q?(j=l(()=>{ae(Q())},"A"),e[10]=Q,e[11]=j):j=e[11];let W=j,M;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=l(d=>{B(d.currentTarget.value)},"E"),e[12]=M):M=e[12];let G=M,_;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=l(d=>{let{id:h}=d.currentTarget.dataset;h!==void 0&&k(h)},"L"),e[13]=_):_=e[13];let J=_,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=l(d=>{let h=d.currentTarget.dataset.tab;(h==="headers"||h==="html"||h==="text")&&u(h)},"_"),e[14]=z):z=e[14];let K=z,$=Te(r,x),A=Le($,q),n=Se(A),O;e[15]!==n?(O=l(()=>{n!==void 0&&me(n)},"j"),e[15]=n,e[16]=O):O=e[16];let V=O,F;e[17]!==n?(F=l(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"$"),e[17]=n,e[18]=F):F=e[18];let X=F,E;return e[19]!==r||e[20]!==m||e[21]!==D||e[22]!==x||e[23]!==g||e[24]!==n||e[25]!==U||e[26]!==V||e[27]!==G||e[28]!==X||e[29]!==J||e[30]!==K||e[31]!==W||e[32]!==A||e[33]!==i||e[34]!==$?(E={entries:r,error:m,errorSource:D,filter:x,isLoading:g,link:n,onClear:U,onCopyLink:V,onFilterChange:G,onOpenLink:X,onSelectMessage:J,onSelectTab:K,onSendTest:W,selected:A,tab:i,visible:$},e[19]=r,e[20]=m,e[21]=D,e[22]=x,e[23]=g,e[24]=n,e[25]=U,e[26]=V,e[27]=G,e[28]=X,e[29]=J,e[30]=K,e[31]=W,e[32]=A,e[33]=i,e[34]=$,e[35]=E):E=e[35],E},"Ae"),ze=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,$e=l(a=>`${ze}${a}`,"Le"),Ke=l(({limit:a=100})=>{let e=oe(),{entries:s,error:o,errorSource:p,filter:I,isLoading:y,link:w,onClear:g,onCopyLink:P,onFilterChange:c,onOpenLink:C,onSelectMessage:f,onSelectTab:q,onSendTest:k,selected:i,tab:u,visible:x}=_e({limit:a}),B=l(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"H");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b,{"data-testid":"mail-send-test",onClick:k,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(b,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(ne,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(he,{error:p,testId:"mail-error"}),o===null&&!y&&s.length===0&&(0,t.jsx)(ce,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(de,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:c,placeholder:e("Filter messages"),type:"search",value:I}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:x.map(r=>{let m=r.id===i?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${m?"bg-muted":""}`,"data-active":m,"data-id":r.id,"data-testid":"mail-list-item",onClick:f,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:N(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),i!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:i.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.to)}),i.cc!==void 0&&i.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(i.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(b,{"data-testid":"mail-copy-link",disabled:w===void 0,onClick:P,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(b,{"data-testid":"mail-open-link",disabled:w===void 0,onClick:C,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(b,{"aria-selected":u===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:q,role:"tab",size:"sm",type:"button",variant:u===r?"secondary":"ghost",children:B(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[u==="html"&&(i.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:$e(i.html),title:e("Email preview")})),u==="text"&&(i.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:i.text})),u==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(i.headers).map(([r,m])=>`${r}: ${m}`).join(`
|
|
2
|
+
`)}))]})]})]})]})},"Qe");export{Ke as MailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-7G4Z6Q7X.js";import{d}from"./chunk-74IYYDDI.js";import{a as e,d as r,e as h,g as k}from"./chunk-I26MS5PJ.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a}from"./chunk-I26MS5PJ.js";var r="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",T=/string or blob too big/iu,l={BAD_REQUEST:{status:400,title:"Bad request"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},DELIVERY_FENCED:{status:409,title:"Delivery authorization changed",hint:"The operation may have committed. Retry with the same transport key; a committed result from an older authority epoch returns DELIVERY_RECEIPT_FENCED. Do not automatically retry with a new transport key."},DELIVERY_RECEIPT_FENCED:{status:409,title:"Committed receipt authorization changed",hint:"The operation committed, but its stored result belongs to an older authority epoch. Do not automatically retry with a new transport ID. Recover through the application's durable operation key under current authorization."},CONFLICT:{hint:["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],status:409,title:"Conflict"},NOT_UNIQUE:{hint:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{hint:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},RUN_KIND_FORBIDDEN:{status:500,title:"Function kind may not be composed from a query"},TRANSACTION_LIMIT_EXCEEDED:{hint:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class."],status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},MIGRATION_DRIFT:{hint:["An applied SQL migration is never re-run, so the runner stopped before applying anything.","","- **Its text changed after it ran:** revert the edit and put the change in a new migration. If the edit is inert (a comment, whitespace, line endings), record the new hash with the `UPDATE` the message prints.","- **Tracking rows predate versions and match no migration:** set each row's `version` with the `UPDATE` the message prints, so the runner can tell what already ran."],status:409,title:"Migration drift"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},SHARD_TIMEOUT:{status:504,title:"Shard timeout"},SHARD_HTTP_ERROR:{status:502,title:"Shard HTTP error"},SUBSCRIPTION_PERSIST_FAILED:{status:500,title:"Subscription persist failed"},TOO_MANY_SUBSCRIPTIONS:{status:429,title:"Too many subscriptions"},LIVE_CONTROL_SUPERSEDED:{status:409,title:"A later live control call already applied"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},OFFLINE_NOT_QUEUED:{hint:"A mutation sent with `onlineOnly: true` found its connection down or reconnecting (the shard had connected before), or, on a shard that has never connected, its request failed on the wire. It was refused instead of queued. Nothing was persisted or replayed; issue the call again once the connection is back. See [keeping a write off the queue](/docs/concepts/offline-first#keeping-a-write-off-the-queue).",status:503,title:"Offline, write not queued"},IDENTITY_MISMATCH:{hint:["A write queued offline was replayed on a session that now belongs to someone else (a sign-out, or another user's sign-in, while it waited), so the worker refused it rather than commit it as them.","","`@lunora/client` re-resolves the session on this refusal and settles the write itself. If every replay is refused while the same user stays signed in, your worker's `resolveIdentity` returns a different `userId` than better-auth's `user.id`, or the RPC request carries no session cookie."],status:409,title:"Session changed since the write was queued"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},JURISDICTION_MOVE:{hint:["The schema declares `.jurisdiction(...)` and the project has DO-backed auth (`.auth({ namespace })`). Pinning the auth object to the jurisdiction resolves it to a new, empty one: every user, account and session stays in the unpinned object until copied across. Voice sessions are pinned without an acknowledgement: they store nothing, and their transcripts are rows in the already-pinned shards.","",'Acknowledge with `.jurisdiction("eu", { pinAuth: true })` and deploy, then copy the auth tables across with the `__lunora_admin__:copyAuthToJurisdiction` admin op and, once the counts check out, purge the unpinned copy with `__lunora_admin__:purgeUnpinnedAuth` (see [Pinning auth and voice](/docs/concepts/data-residency#pinning-auth-and-voice)). For D1-mode auth the acknowledgement changes nothing.'],status:422,title:"Unacknowledged jurisdiction move"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},X402_FACILITATOR_ERROR:{internal:!0,status:502,title:"Payment facilitator error"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},PRIVACY_COVERAGE:{status:500,title:"Privacy coverage check failed"},PRIVACY_REQUEST_OPEN:{status:409,title:"A privacy request is already open"},PRIVACY_SESSION_NOT_FRESH:{status:403,title:"Recent sign-in required"},EMAIL_DOMAIN_BLOCKED:{hint:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` in the `EmailGateConfig` you hand `assertEmailAllowed` / `classifyEmail` / `emailGateMiddleware` (`@lunora/auth/email-guard`)."],status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{hint:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_QUERY_ERROR:{status:502,title:"Analytics SQL query error"},BROWSER_RUN_ERROR:{status:502,title:"Browser Run API error"},BROWSER_TOO_MANY_REDIRECTS:{status:502,title:"Too many redirects"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},CONFIG_INVALID:{internal:!0,status:500,title:"Payment configuration invalid"},CURRENCY_MISMATCH:{status:400,title:"Currency mismatch"},PROVIDER_ERROR:{status:502,title:"Payment provider error"},WEBHOOK_EVENT_ID_MISSING:{status:400,title:"Webhook event id missing"},WEBHOOK_SIGNATURE_INVALID:{status:400,title:"Webhook signature invalid"},WEBHOOK_TIMESTAMP_INVALID:{status:400,title:"Webhook timestamp outside tolerance"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_MIGRATOR_UNSUPPORTED:{hint:["better-auth migrates only through its Kysely adapter, so `ensureMigrated` / `compileMigrationsSql` need the raw D1 binding as `database` \u2014 a custom adapter (`lunoraD1Adapter`, `lunoraAuthAdapter`, `lunoraDoAdapter`) cannot be migrated through, and neither can an absent `database`.","","Build a SECOND, migration-only instance over the raw binding \u2014 `createMigrationAuth({ ...options, database: env.DB })` (from `@lunora/auth/migrate`) \u2014 and hand that one to `ensureMigrated`. Keep the adapter on the instance that serves requests: the adapter exists to dodge a dev-runner hang in `$context`, which the migration instance never resolves.","","To compile the SQL off-platform (`compileMigrationsSql`), diff against an empty local database \u2014 `new DatabaseSync(':memory:')` from `node:sqlite` \u2014 rather than passing no `database` at all."],status:500,title:"Auth migrator cannot drive the configured database"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},AUTH_CIMD_FETCH_NOT_PUBLIC:{hint:'Add "global_fetch_strictly_public" to "compatibility_flags" in wrangler.jsonc, so CIMD metadata fetches cannot reach private addresses. `lunora doctor` reports it as `cimd-fetch-not-strictly-public`.',status:500,title:"CIMD transport needs the global_fetch_strictly_public flag"},AUTH_MCP_RESOURCE_AMBIGUOUS:{hint:'Use `mcp` from "@lunora/auth/plugins" (not `@better-auth/mcp`) and pass the plugin object as is: it records its `resource`, which the worker needs to serve the protected-resource metadata when the provider names several resources.',status:500,title:"MCP resource cannot be told apart from the provider's other resources"},AUTH_MCP_RESOURCE_INVALID:{hint:"Pass `resource` to `requireMcpAuth` (and `mcp()`) as the absolute URL of the MCP route, e.g. `https://app.example.com/mcp`: issued tokens are audience-bound to it.",status:500,title:"MCP resource missing or not an absolute URL"},MCP_STEP_UP_MISCONFIGURED:{hint:"Give `createAuthedMcpFetchHandler`'s `stepUp` a non-empty `scope` (such as `lunora:write`) and a `challenge` (`createInsufficientScopeError` from `@lunora/auth/plugins`), or leave `stepUp` out.",status:500,title:"MCP step-up misconfigured"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{hint:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{hint:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},EXPORT_SHARD_FAILED:{hint:["One or more shards failed to export, so the snapshot would have been short. Nothing is written when this fires \u2014 a partial export must never be mistaken for a complete one.","","The message names each failed shard key and its error. Re-run the export once those shards are reachable; a shard that fails repeatedly is usually over the per-request memory budget, which `backupTables` narrows."],status:502,title:"Export failed on one or more shards"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},ID_COLLISION:{hint:["The imported row carries an `_id` that is already held by a DIFFERENT table in this shard. Ids are per-table, so inserting it would leave two tables claiming one id and make a later lookup resolve to whichever one it reached first.","","This is reported per row rather than aborting the import: the remaining rows still apply. Re-mint the id on the source side, or import that table into a shard that does not already hold it."],status:409,title:"Document id already belongs to another table"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{hint:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{hint:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},AI_UNKNOWN_IMAGE_MODEL:{status:400,title:"Unknown image model"},RAG_DIMENSION_MISMATCH:{hint:["A stored vector and the query embedding have different widths, so they cannot be compared.","","This is what changing a RAG index's `embeddingModel` (or a provider's `dimensions` option) without reindexing looks like. Either put the previous model back, or reindex the namespace under the new one \u2014 bump `embeddingModelVersion` so the index rebuilds instead of mixing widths."],status:409,title:"Embedding dimension mismatch"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},AUTH_MOVE_NOT_CONFIGURED:{hint:"The copy needs DO-backed auth (`.auth({ namespace })`) pinned with `.jurisdiction(\u2026, { pinAuth: true })`, and the auth object's `internalSecret` set.",status:400,title:"Auth jurisdiction move not configured"},AUTH_MOVE_TARGET_NOT_EMPTY:{hint:"The pinned auth object holds users the copy did not write (someone signed up there), so copying into it would merge two user bases. Pass `force: true` to copy anyway: a copied row that collides with one of the pinned object's rows is left out and counted under `conflicts`.",status:409,title:"Pinned auth object is not empty"},AUTH_MOVE_CONFLICT:{hint:"A copied row has the same key or unique value (such as an email) as a row the pinned auth object holds on its own, or the pinned object changed a row the source changed too. Nothing from that page was written. Pass `force: true` to keep the pinned object's rows and count the collisions under `conflicts`.",status:409,title:"Auth copy conflict"},AUTH_MOVE_SOURCE_CHANGED:{hint:"The un-pinned auth object changed after the copy read it (an update, a delete, or a new row), for example during a gradual rollout or a rollback. Run the copy again: it reconciles the changed tables. Then purge.",status:409,title:"Un-pinned auth object changed since the copy"},AUTH_MOVE_SOURCE_PURGED:{hint:"The un-pinned auth object was already purged. Its tables may exist again (a rollback served requests there), but they hold only rows written since, so the copy refuses rather than read them as deletions and remove the pinned object's users. Nothing is left to copy.",status:409,title:"Un-pinned auth object already purged"},AUTH_MOVE_INCOMPLETE:{hint:"Run `__lunora_admin__:copyAuthToJurisdiction` until it answers `done: true`, check the per-table counts, then purge.",status:409,title:"Auth copy not finished"},AUTH_MOVE_FAILED:{hint:"The message names the step, the table and the class of the SQLite error; the auth object's log has the full error. The copy resumes where it stopped once the cause is fixed.",status:500,title:"Auth jurisdiction move failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_ROOM_NAME:{status:500,title:"Duplicate room name"},ROOM_NAME_NOT_LITERAL:{status:500,title:"Room name is not a string literal"},DUPLICATE_SOCKET_PATH:{status:500,title:"Duplicate socket route path"},SOCKET_AUTH_NOT_LITERAL:{status:500,title:"Socket route auth is not a literal boolean"},SOCKET_PATH_INVALID:{status:500,title:"Socket route path is not a plain URL path"},SOCKET_PATH_NOT_LITERAL:{status:500,title:"Socket route path is not a string literal"},LIVE_STREAM_DUPLICATE:{status:500,title:"Duplicate live stream id or export name"},LIVE_STREAM_NOT_EXPORTED:{status:500,title:"Live stream is not a named export"},LIVE_STREAM_NOT_LITERAL:{status:500,title:"Live stream declaration is not a literal"},LIVE_TOPIC_INVALID:{status:500,title:"Live topic name or key field is not allowed"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CASCADE_LIMIT:{status:400,title:"Cascade limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},DISPATCH_UNAUTHENTICATED:{hint:"The scheduler could not authenticate to the worker. Check that `LUNORA_SCHEDULER_SECRET` matches on both sides, or that `LUNORA_ADMIN_TOKEN` is set and current.",status:403,title:"Dispatch caller not authenticated"},DISPATCH_IN_PROGRESS:{hint:"A dispatch with this idempotency id is still running on the shard. Retry it; once the first attempt settles the same id is served from the replay cache.",status:409,title:"Dispatch already in progress"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},GLOBAL_SEARCH_SCORES_UNSUPPORTED:{status:400,title:"collectWithScores() is unsupported on a global table"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},FORBIDDEN_TOPIC:{status:403,title:"Live topic publish forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},INVALID_SCHEDULE_ID:{status:400,title:"Invalid schedule id"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SEARCH_INDEX_BUILDING:{status:503,title:"Search index is still building"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_MEMORY_TABLE:{status:400,title:"Shape over a memory table is unsupported"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},SHAPE_RELATION_PREDICATE:{status:400,title:"Shape filtered by a relation is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},WIRE_DECODE_FAILED:{status:502,title:"Could not decode a server frame"},WIRE_ENCODE_FAILED:{status:500,title:"Could not encode a return value"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},CDC_LOG_TRIMMED:{status:409,title:"CDC log trimmed"},CDC_TIMELINE_FORKED:{status:409,title:"CDC timeline forked"},CDC_PAYLOAD_COMPACTED:{status:409,title:"CDC payloads compacted"},EXPIRED:{status:404,title:"Session expired"},LIVE_CONNECTION_LIMIT:{status:503,title:"Live connection limit reached"},LIVE_CONNECTION_NOT_FOUND:{status:404,title:"Live connection not found"},LIVE_STREAMS_UNSUPPORTED:{status:501,title:"Live streams are not served by this worker"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SHAPE_REQUIRES_CDC:{status:409,title:"Shape requires change-data-capture"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},STREAM_ID_IN_USE:{status:409,title:"Stream id already in use"},STREAM_IDLE:{status:504,title:"Stream went idle"},STREAM_INTERRUPTED:{status:503,title:"Durable stream interrupted"},STREAM_TOO_LONG:{status:507,title:"Durable stream exceeded its chunk ceiling"},SUBSCRIPTION_RESULT_TOO_LARGE:{status:413,title:"Subscription result too large"},TOKEN_EXPIRED:{hint:["The caller's credential verified but its expiry has passed. The worker refuses an HTTP call with this code before it runs; a shard drops a socket with close code `4001` and the same code.","","It is a refusal of the credential, not of the call: `@lunora/client` holds a queued write, fires `onTokenExpired`, and re-sends it after `setAuthToken`. The held write survives the refresh only if you pass the same `subject` (the user id) with the new token, `setAuthToken(freshToken, user.id)`; without one a refresh reads as a user switch and the write is rejected `OFFLINE_IDENTITY_CHANGED`. Under a cookie session there is no token to replace: renew the cookie and the write is re-sent on a backoff. The worker can only tell expired from anonymous if your `resolveIdentity` returns the identity with its past `exp` (or `expiresAtMs`), or throws a `LunoraError` with this code. Returning `null` runs the call anonymous."],status:401,title:"Authentication token expired"},TOO_MANY_LIVE_TOPICS:{status:429,title:"Too many live topics"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},TOO_MANY_WHISPER_TOPICS:{hint:"Reuse a stable set of whisper topic names, or reconnect \u2014 the per-socket verdict memo is in-memory, so a new connection starts empty. Leaving a topic does not free its entry.",status:429,title:"Too many whisper topics"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},RELAY_SHAPE_UNROUTABLE:{status:500,title:"Relay shape unroutable"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_CALLBACK:{status:500,title:"HTTP stream callback threw"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{hint:["The `fetch` implementation resolved with a response that exposes neither a `body` stream nor a `text()` read \u2014 a broken `fetch` substitute, not a runtime limitation.","A response with no `body` stream that can still be read as text (React Native's `whatwg-fetch` polyfill) is buffered through `text()` instead and never raises this code. Check the `fetch` override passed to the client or the `httpStream` call."],status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"},LOCAL_DEPENDENCY_MISSING:{hint:["The command Lunora tried to run is not on your PATH, so nothing ran.","","Install it (or put it on PATH) and retry \u2014 `wrangler` ships as a dependency of a Lunora app, so `pnpm install` usually fixes that one; `git` and `docker` are installed separately."],status:500,title:"Required local tool not found"}},c=a(e=>Object.hasOwn(l,e)?l[e]:void 0,"h");var m=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
|
|
2
|
+
`),header:"Row too large for the storage engine",id:"lunora-row-too-big",test:a(e=>T.test(e),"test")},{body:["Lunora codegen couldn't find a schema to generate from.","","Create `lunora/schema.ts` exporting a `defineSchema(...)` call:","","```ts",'import { defineSchema, defineTable, v } from "@lunora/server";',"","export default defineSchema({"," messages: defineTable({ body: v.string() }),","});","```","","Or run `lunora init` to scaffold Lunora (a sample `lunora/schema.ts` included) into your app."].join(`
|
|
3
|
+
`),header:"No Lunora schema found",id:"lunora-schema-missing",test:a(e=>e.includes("defineSchema() not found")||e.includes("schema.ts not found at"),"test")},{body:["`defineSchema(...)` must be called with an **inline object literal** mapping table names to `defineTable(...)`:","","```ts","export default defineSchema({"," todos: defineTable({ title: v.string(), done: v.boolean() }),","});","```","","Codegen reads the schema statically, so it can't follow a variable or a spread \u2014 pass the object literal directly."].join(`
|
|
4
|
+
`),header:"`defineSchema()` needs an inline object literal",id:"lunora-schema-not-object-literal",test:a(e=>e.includes("defineSchema() expects an object literal"),"test")},{body:["This table name collides with a built-in `ctx.db` member, so the generated client can't expose it.","","Rename the table to anything that isn't a `ctx.db` member (the error names the one it hit) \u2014 e.g. `userAccounts` instead of `insert`, or `pageViews` instead of `count`."].join(`
|
|
5
|
+
`),header:"Table name is reserved",id:"lunora-table-reserved",test:a(e=>e.includes("is reserved")&&e.includes("ctx.db"),"test")},{body:["Two tables resolve to the same name \u2014 usually a base table and a schema **extension** both defining it.","","Rename one of them, or drop the duplicate from the extension. Each table name must be unique across `defineSchema(...)` and every `.extend(...)`."].join(`
|
|
6
|
+
`),header:"Duplicate table name",id:"lunora-table-duplicate",test:a(e=>e.includes("already exists")&&e.includes(".extend("),"test")},{body:['`.jurisdiction(...)` accepts only a **string literal** of `"eu"`, `"us"`, or `"fedramp"`:',"","```ts",'defineSchema({ /* \u2026 */ }).jurisdiction("eu");',"```"].join(`
|
|
7
|
+
`),header:"Invalid `.jurisdiction(...)` value",id:"lunora-jurisdiction",test:a(e=>e.includes("unknown jurisdiction")||e.includes("jurisdiction")&&e.includes('"eu", "us", or "fedramp"'),"test")},{body:["The `unique` flag on an index must be a **literal** `true` or `false`, not a computed value \u2014 codegen needs to read it statically:","","```ts",'defineTable({ email: v.string() }).index("by_email", ["email"], { unique: true });',"```"].join(`
|
|
8
|
+
`),header:"`unique` must be a literal",id:"lunora-unique-literal",test:a(e=>e.includes("must be a literal")&&e.includes("unique"),"test")},{body:["A declared container/workflow class isn't re-exported by your worker entry, so `wrangler deploy` would reject it.","","Add the generated re-export shown in the error to your worker entry (e.g. `src/index.ts`):","","```ts",'export * from "./lunora/_generated/containers";',"```"].join(`
|
|
9
|
+
`),header:"Binding not exported by your worker entry",id:"lunora-worker-entry-export-gap",test:a(e=>e.includes("not exported by your worker entry"),"test")},{body:["A row with the same value already exists in a `unique` index.","","- If you meant to upsert, use `ctx.db.<table>().upsert(...)` (or `.patch(...)` an existing row) instead of `.insert(...)`.",`- Otherwise pick a value that isn't already taken, and consider surfacing a friendly "already exists" message to the user.`].join(`
|
|
10
|
+
`),header:"Unique constraint violation",id:"lunora-runtime-unique",test:a(e=>e.includes("unique constraint violation on"),"test")},{body:l.CONFLICT.hint.join(`
|
|
11
|
+
`),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:a(e=>e.includes("optimistic concurrency conflict"),"test")}],d=[{causes:"the origin returned an empty, unknown, or malformed response Cloudflare couldn't interpret (often an origin crash or an oversized response header)",code:"520",docsUrl:r,family:"5xx",fix:"check your origin's logs for a crash, ensure it returns a valid HTTP response, and keep response headers under the size limit",summary:"Cloudflare got an unknown/empty response from your origin web server.",title:"Web server returns an unknown error"},{causes:"the origin refused the connection \u2014 the web server is down, or a firewall is blocking Cloudflare's IP ranges",code:"521",docsUrl:r,family:"5xx",fix:"confirm the origin process is running and allowlist Cloudflare's published IP ranges in your firewall/security groups",summary:"Cloudflare could not connect to your origin because it refused the connection.",title:"Web server is down"},{causes:"Cloudflare could not establish a TCP connection to the origin in time \u2014 the origin is overloaded, a firewall is dropping packets, or the origin IP is wrong",code:"522",docsUrl:r,family:"5xx",fix:"verify the origin is reachable and not overloaded, and that the DNS record points at the correct origin IP",summary:"The connection to your origin timed out before it was established.",title:"Connection timed out"},{causes:"Cloudflare cannot route to the origin at all \u2014 a bad DNS record, an origin IP that changed, or invalid routing",code:"523",docsUrl:r,family:"5xx",fix:"verify the DNS A/AAAA record points at a reachable origin IP and that no upstream network is blocking Cloudflare",summary:"Cloudflare could not reach your origin server.",title:"Origin is unreachable"},{causes:"Cloudflare made a TCP connection but the origin did not return an HTTP response within 100 seconds \u2014 a slow handler or long-running request",code:"524",docsUrl:r,family:"5xx",fix:"speed up the slow origin handler, or move long work off the request path into a background job (a Durable Object, Queue, or Workflow)",summary:"Cloudflare connected to your origin but it did not respond in time.",title:"A timeout occurred"},{causes:"the TLS handshake between Cloudflare and the origin failed \u2014 a missing/invalid origin certificate, or a cipher/SNI mismatch under Full (Strict) SSL",code:"525",docsUrl:r,family:"5xx",fix:"install a valid certificate on the origin and align your Cloudflare SSL/TLS mode with the origin's certificate setup",summary:"The SSL handshake with your origin failed.",title:"SSL handshake failed"},{causes:"Cloudflare could not validate the origin's certificate under Full (Strict) SSL \u2014 it is expired, self-signed, or issued for the wrong hostname",code:"526",docsUrl:r,family:"5xx",fix:"install a valid, publicly-trusted certificate on the origin (or use a Cloudflare Origin CA cert), matching the request hostname",summary:"Cloudflare could not validate your origin's SSL certificate.",title:"Invalid SSL certificate"},{causes:"a DNS record points at a Cloudflare IP or another prohibited address instead of your real origin",code:"1000",docsUrl:n,family:"1xxx",fix:"point the DNS record at your real origin IP, not a Cloudflare-owned or loopback address",summary:"DNS points to a prohibited IP.",title:"DNS points to prohibited IP"},{causes:"Cloudflare could not resolve the requested hostname \u2014 a Worker fetched an unresolvable host, or a DNS record is misconfigured",code:"1001",docsUrl:n,family:"1xxx",fix:"check the hostname you're requesting and the DNS records for the zone resolve to a valid origin",summary:"Cloudflare could not resolve the origin DNS.",title:"DNS resolution error"},{causes:"a Worker or DNS record targets a restricted IP (for example a Cloudflare-owned or loopback address)",code:"1002",docsUrl:n,family:"1xxx",fix:"change the Worker fetch target or DNS record to a valid, non-restricted origin address",summary:"DNS points to a prohibited IP (Worker/restricted).",title:"DNS points to a prohibited IP"},{causes:"the visitor's IP was blocked by an IP Access Rule, WAF rule, or security configuration on the zone",code:"1006",docsUrl:n,family:"1xxx",fix:"review the zone's Firewall/WAF and IP Access Rules to see why the address was banned, and adjust if it was blocked in error",summary:"Access denied: the visitor's IP has been banned.",title:"Access denied: your IP has been banned"},{causes:"your Worker threw an unhandled JavaScript exception during the request",code:"1101",docsUrl:n,family:"1xxx",fix:"reproduce with `wrangler tail` (or the Workers Logs / Studio Logs panel) to get the stack trace, then handle the throwing code path",summary:"A Worker threw a JavaScript exception.",title:"Worker threw a JavaScript exception"},{causes:"the Worker used more CPU time than a single invocation is allowed \u2014 usually a hot loop or heavy synchronous work",code:"1102",docsUrl:n,family:"1xxx",fix:"reduce per-request CPU (optimize hot loops, avoid heavy synchronous work) or offload the heavy work to a Durable Object, Queue, or Workflow",summary:"A Worker exceeded its CPU-time resource limit.",title:"Worker exceeded resource limits"}],u=a(e=>e!==void 0&&e>="0"&&e<="9","l"),g=a((e,t)=>{for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+t.length))if(!u(e[o-1])&&!u(e[o+t.length]))return!0;return!1},"_"),A=a((e,t)=>{for(let o of[`error ${t}`,`error: ${t}`])for(let i=e.indexOf(o);i!==-1;i=e.indexOf(o,i+o.length))if(!u(e[i+o.length]))return!0;return!1},"E"),O=/error|cloudflare/iu,p=a(e=>({body:[e.summary,"",`**Likely cause:** ${e.causes}.`,"",`**Fix:** ${e.fix}.`,"",`See [Cloudflare's ${e.family} error docs](${e.docsUrl}).`].join(`
|
|
12
|
+
`),header:`Cloudflare Error ${e.code}: ${e.title}`,id:`cloudflare-error-${e.code}`}),"c"),E=a(e=>{if(!O.test(e))return;let t=e.toLowerCase(),o=t.includes("error"),i=t.includes("cloudflare");if(o){for(let s of d)if(A(t,s.code))return p(s)}if(i){for(let s of d)if(g(t,s.code))return p(s)}},"T"),R=a(e=>(typeof e=="string"?e:e.join(`
|
|
13
|
+
`)).split(`
|
|
14
|
+
`).filter(t=>!t.startsWith("```")).join(`
|
|
15
|
+
`).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"A"),_=a(e=>{for(let t of m)if(t.test(e))return{body:t.body,header:t.header,id:t.id}},"u"),y=a(e=>_(e)??E(e),"O");var f=Symbol.for("@lunora/errors/LunoraError"),h=class e extends Error{static{a(this,"s")}static[Symbol.hasInstance](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):typeof t=="object"&&t!==null&&t[f]===!0}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;why;constructor(t,o,i={}){let s=c(t);super(o??t,i.cause===void 0?void 0:{cause:i.cause}),this.name=i.name??"LunoraError",this.hint=i.hint??s?.hint,this.title=i.title??s?.title,this.loc=i.location,this.code=t,this.status=i.status??s?.status??500,this.docsUrl=i.docsUrl??s?.docsUrl,this.data=i.data,this.why=i.why,Object.defineProperty(this,f,{value:!0}),i.internal!==void 0&&Object.defineProperty(this,"internal",{value:i.internal}),i.headers!==void 0&&Object.defineProperty(this,"headers",{value:i.headers})}};export{l as a,R as b,y as c,h as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Et}from"./chunk-7Y3SY37W.js";import{a as T,b as rt,c as S,h as nt,i as ot,j as st}from"./chunk-AUAECCXB.js";import{d as C,h as tt,i as et}from"./chunk-BOMPSVRC.js";import{a as r,c as p,d,e as A}from"./chunk-I26MS5PJ.js";var O=d(A(),1);var it=0;function Ct(t,e="mui"){let[n,o]=O.useState(t),s=t||n;return O.useEffect(()=>{n==null&&(it+=1,o(`${e}-${it}`))},[n,e]),s}r(Ct,"useGlobalId");var at=rt.useId;function ct(t,e){if(at!==void 0){let n=at();return t??(e?`${e}-${n}`:n)}return Ct(t,e)}r(ct,"useId");function $e(t){return ct(t,"base-ui")}r($e,"useBaseUiId");var D={};p(D,{engine:()=>L,env:()=>U,mediaQuery:()=>H,os:()=>F,screenReader:()=>q});var F={};p(F,{android:()=>pt,apple:()=>N,ios:()=>M,linux:()=>wt,mac:()=>ft,windows:()=>Pt});function Ot(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(Ot,"readRawData");var{userAgent:Dt,platform:It,maxTouchPoints:ut}=Ot(),m=Dt.toLowerCase(),g=It.toLowerCase();var M=/^i(os$|p)/.test(g)||g==="macintel"&&ut>1,lt="android",pt=g===lt||m.includes(lt),ft=!M&&g.startsWith("mac"),Pt=g.startsWith("win"),wt=!pt&&/^(linux|chrome os)/.test(g),N=ft||M;var L={};p(L,{blink:()=>kt,gecko:()=>_t,webkit:()=>$});var $=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),_t=!$&&m.includes("firefox"),kt=!$&&m.includes("chrom");var q={};p(q,{voiceOver:()=>vt});var vt=N;var U={};p(U,{jsdom:()=>yt});var yt=/jsdom|happydom/.test(m);var H={};p(H,{iOS:()=>Mt});var Mt="@supports (-webkit-touch-callout: none)";function Nt(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}r(Nt,"activeElement");function dt(t,e){if(!t||!e)return!1;let n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&st(n)){let o=e;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}r(dt,"contains");function Ft(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}r(Ft,"getTarget");var R="data-starting-style",I="data-ending-style";var $t={[R]:""},Lt={[I]:""},mt={transitionStatus(t){return t==="starting"?$t:t==="ending"?Lt:null}};var gt={};p(gt,{align:()=>Bt,anchorHidden:()=>K,closed:()=>G,endingStyle:()=>Ut,open:()=>W,side:()=>Ht,startingStyle:()=>qt});var W="data-open",G="data-closed",qt=R,Ut=I,K="data-anchor-hidden",Ht="data-side",Bt="data-align";var w={};p(w,{popupOpen:()=>P,pressed:()=>V});var P="data-popup-open",V="data-pressed";var Wt={[P]:""},Gt={[P]:"",[V]:""},Kt={[W]:""},Vt={[G]:""},jt={[K]:""},Xe={open(t){return t?Wt:null}},Ze={open(t){return t?Gt:null}},Yt={open(t){return t?Kt:Vt},anchorHidden(t){return t?jt:null}},tr={...Yt,...mt};var nr=w.popupOpen,j="data-trigger-disabled";var Y="data-base-ui-focusable";var z="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",or="ArrowLeft",sr="ArrowRight",ir="ArrowUp",ar="ArrowDown";function dr(t,e){if(!nt(t))return!1;let n=t;if(e.hasElement(n))return!n.hasAttribute(j);for(let[,o]of e.entries())if(dt(o,n))return!o.hasAttribute(j);return!1}r(dr,"isTargetInsideEnabledTrigger");function mr(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);let n=t;return n.target!=null&&e.contains(n.target)}r(mr,"isEventTargetWithin");function gr(t){return t.matches("html,body")}r(gr,"isRootElement");function Jt(t){return ot(t)&&t.matches(z)}r(Jt,"isTypeableElement");function xr(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${z}`)!=null}r(xr,"isInteractiveElement");function hr(t){return t?t.getAttribute("role")==="combobox"&&Jt(t):!1}r(hr,"isTypeableCombobox");function br(t){if(!t||D.env.jsdom)return!0;try{return t.matches(":focus-visible")}catch{return!0}}r(br,"matchesFocusVisible");function Ar(t){return t?t.hasAttribute(Y)?t:t.querySelector(`[${Y}]`)||t:null}r(Ar,"getFloatingFocusElement");var xt=d(A(),1);function _(t){xt.useEffect(t,tt)}r(_,"useOnMount");var E=0,J=class t{static{r(this,"Timeout")}static create(){return new t}currentId=E;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=E,n()},e)}isStarted(){return this.currentId!==E}clear=r(()=>{this.currentId!==E&&(clearTimeout(this.currentId),this.currentId=E)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function Ir(){let t=C(J.create).current;return _(t.disposeEffect),t}r(Ir,"useTimeout");var k=null,vr=globalThis.requestAnimationFrame,Q=class{static{r(this,"Scheduler")}callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=r(e=>{this.isScheduled=!1;let n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)},"tick");request(e){let n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){let n=e-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}},v=new Q;var l=class t{static{r(this,"AnimationFrame")}static create(){return new t}static request(e){return v.request(e)}static cancel(e){return v.cancel(e)}currentId=k;request(e){this.cancel(),this.currentId=v.request(()=>{this.currentId=k,e()})}cancel=r(()=>{this.currentId!==k&&(v.cancel(this.currentId),this.currentId=k)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function ht(){let t=C(l.create).current;return _(t.disposeEffect),t}r(ht,"useAnimationFrame");var X=d(Et(),1);function bt(t){return t==null?t:"current"in t?t.current:t}r(bt,"resolveRef");var y=null;function Qt(t){if(!y){let e=[];y=e,queueMicrotask(()=>{y=null,X.flushSync(()=>{for(let n of e)n()})})}y.push(t)}r(Qt,"flushBeforePaint");function At(t,e=!1,n=!1){let o=ht();return S((s,i=null)=>{o.cancel();let a=bt(t);if(a==null)return;let c=a,u=r(()=>{if(!n){X.flushSync(s);return}Qt(()=>{i?.aborted||s()})},"done");if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function f(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(c.getAnimations().some(b=>b.pending||b.playState!=="finished")){f();return}u()})}if(r(f,"exec"),e){let h=R;if(!c.hasAttribute(h)){o.request(f);return}let b=new MutationObserver(()=>{c.hasAttribute(h)||(b.disconnect(),f())});b.observe(c,{attributes:!0,attributeFilter:[h]}),i?.addEventListener("abort",()=>b.disconnect(),{once:!0});return}o.request(f)})}r(At,"useAnimationsFinished");var Tt=d(A(),1);function Gr(t){let{enabled:e=!0,open:n,ref:o,batch:s=!1,onComplete:i}=t,a=S(i),c=At(o,n,s);Tt.useEffect(()=>{if(!e)return;let u=new AbortController;return c(a,u.signal),()=>{u.abort()}},[e,n,a,c])}r(Gr,"useOpenChangeComplete");var Z=d(A(),1);function zr(t,e=!1,n=!1,o=!1){let[s,i]=Z.useState(t&&e?"idle":void 0),[a,c]=Z.useState(t&&!o);return t&&!a&&(c(!0),i("starting")),!t&&a&&s!=="ending"&&!n&&i("ending"),!t&&!a&&s==="ending"&&i(void 0),T(()=>{if(!t&&a&&s!=="ending"&&n){let u=l.request(()=>{i("ending")});return()=>{l.cancel(u)}}},[t,a,s,n]),T(()=>{if(!t||e)return;let u=l.request(()=>{i(void 0)});return()=>{l.cancel(u)}},[e,t]),T(()=>{if(!t||!e)return;t&&a&&s!=="idle"&&i("starting");let u=l.request(()=>{i("idle")});return()=>{l.cancel(u)}},[e,t,a,s]),{mounted:a,setMounted:c,transitionStatus:s}}r(zr,"useTransitionStatus");var x=d(A(),1);function Xr({controlled:t,default:e,name:n,state:o="value"}){let{current:s}=x.useRef(t!==void 0),[i,a]=x.useState(e),c=s&&t!==void 0?t:i,u=x.useCallback(f=>{s||a(f)},[]);return[c,u]}r(Xr,"useControlled");var St=d(A(),1);function nn(t,e){let n=St.useRef(t),o=S(e);T(()=>{n.current!==t&&o(n.current),n.current=t},[t,o])}r(nn,"useValueChanged");var Rt={};p(Rt,{cancelOpen:()=>Oe,chipRemovePress:()=>ae,clearPress:()=>ie,closePress:()=>oe,closeWatcher:()=>be,decrementPress:()=>le,disabled:()=>Ie,drag:()=>Re,escapeKey:()=>he,focusOut:()=>xe,imperativeAction:()=>_e,incrementPress:()=>ue,initial:()=>we,inputBlur:()=>de,inputChange:()=>pe,inputClear:()=>fe,inputPaste:()=>me,inputPress:()=>ge,itemPress:()=>ne,keyboard:()=>Te,linkPress:()=>se,listNavigation:()=>Ae,missing:()=>Pe,none:()=>Xt,outsidePress:()=>re,pointer:()=>Se,scrub:()=>Ce,siblingOpen:()=>De,swipe:()=>ke,trackPress:()=>ce,triggerFocus:()=>ee,triggerHover:()=>te,triggerPress:()=>Zt,wheel:()=>Ee,windowResize:()=>ve});var Xt="none",Zt="trigger-press",te="trigger-hover",ee="trigger-focus",re="outside-press",ne="item-press",oe="close-press",se="link-press",ie="clear-press",ae="chip-remove-press",ce="track-press",ue="increment-press",le="decrement-press",pe="input-change",fe="input-clear",de="input-blur",me="input-paste",ge="input-press",xe="focus-out",he="escape-key",be="close-watcher",Ae="list-navigation",Te="keyboard",Se="pointer",Re="drag",Ee="wheel",Ce="scrub",Oe="cancel-open",De="sibling-open",Ie="disabled",Pe="missing",we="initial",_e="imperative-action",ke="swipe",ve="window-resize";function un(t,e,n,o){let s=!1,i=!1,a=o??et;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...a}}r(un,"createChangeEventDetails");export{ct as a,$e as b,D as c,Nt as d,dt as e,Ft as f,Y as g,or as h,sr as i,ir as j,ar as k,mt as l,gt as m,w as n,Xe as o,Ze as p,Yt as q,tr as r,j as s,dr as t,mr as u,gr as v,Jt as w,xr as x,hr as y,br as z,Ar as A,_ as B,J as C,Ir as D,l as E,ht as F,bt as G,At as H,Gr as I,zr as J,Xr as K,nn as L,Rt as M,un as N};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as h,n as v}from"./chunk-OLIKYC3C.js";import{a as u,d as p,f as x,g as y,i as g}from"./chunk-I26MS5PJ.js";var b=p(x(),1);var n=p(y(),1);var w={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},j=u(i=>{let a=(0,b.c)(12),{ariaLabel:c,className:m,series:l,testId:d}=i;if(l.length<2)return null;let t;a[0]!==l?(t=l.slice(-40).map(N),a[0]=l,a[1]=t):t=a[1];let f=t,e;a[2]!==m?(e=g("h-6 w-[120px]",m),a[2]=m,a[3]=e):e=a[3];let o;a[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(v,{dataKey:"value"}),a[4]=o):o=a[4];let r;a[5]!==f?(r=(0,n.jsx)(h,{animationType:"none",barCategoryGap:1,className:"h-full w-full",config:w,data:f,children:o}),a[5]=f,a[6]=r):r=a[6];let s;return a[7]!==c||a[8]!==e||a[9]!==r||a[10]!==d?(s=(0,n.jsx)("div",{"aria-label":c,className:e,"data-testid":d,role:"img",children:r}),a[7]=c,a[8]=e,a[9]=r,a[10]=d,a[11]=s):s=a[11],s},"w");function N(i,a){return{index:a,value:i}}u(N,"b");export{j as a};
|