@lunora/studio 1.0.0-alpha.10 → 1.0.0-alpha.101
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/dist/index.d.ts +824 -781
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/AdvisorHealthPanel.js +1 -0
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +6 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-Cu_QmzO0.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-DuIU1P8B.js +1 -0
- package/dist/packem_shared/CommandPalette-mPR8-vIm.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-CPNKM0KZ.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-BSmyOO0n.js +1 -0
- package/dist/packem_shared/HomePanel-BUO6BcYQ.js +1 -0
- package/dist/packem_shared/MigrationsPanel-BAnvY79E.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-DXeffPFr.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-pHVlh2xU.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-DG_n-8Pc.js +1 -0
- package/dist/packem_shared/StudioApp-bavavhpe.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-CGcwvlMo.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-D1bPR8FO.d.ts +252 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-B8oDHgnw.js +6 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-BMKx5UdA.js +1 -0
- package/dist/packem_shared/cf-links-Dmg86v1D.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-Ci4-tZkk.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/dropdown-menu-BgS2zw1i.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-_2q2VtVG.js +1 -0
- package/dist/packem_shared/grid-features-Y2YSjhCf.js +6 -0
- package/dist/packem_shared/home-panel-Ir3YHReO.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-zkEvTqy8.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/log-line-CmtmbZNE.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DtUxwVNY.js +1 -0
- package/dist/packem_shared/reference-view-DncEStdm.js +12 -0
- package/dist/packem_shared/result-chart-0VgP_3FP.js +1 -0
- package/dist/packem_shared/schema-diagram-GVgnLWTf.js +2 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-BssZMiFY.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-BNvxiJj_.js +1 -0
- package/dist/packem_shared/stat-card-BGJdhfm6.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-C9Qvg13j.js +2 -0
- package/dist/packem_shared/table-DZAB8cs3.js +2 -0
- package/dist/packem_shared/table-list-sidebar-fz0m_4I4.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-D7j9TjUT.js +1 -0
- package/dist/packem_shared/use-admin-query-CnnyWJXM.js +1 -0
- package/dist/packem_shared/use-async-submit-B32whHJO.js +1 -0
- package/dist/packem_shared/use-auth-config-0EnNCdLu.js +1 -0
- package/dist/packem_shared/use-open-trace-D9XDDHHS.js +1 -0
- package/dist/packem_shared/use-shard-key-B2JtNa5m.js +1 -0
- package/dist/packem_shared/use-sql-assistant-Dtw55kKM.js +1 -0
- package/dist/packem_shared/useDebounced-CU-uftxO.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/packem_shared/wire-codec-DkrdsFXO.js +1 -0
- package/dist/standalone/chunk-2LU3W7JY.js +3 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2QSHLBCO.js +1 -0
- package/dist/standalone/chunk-322ZP3GW.js +1 -0
- package/dist/standalone/chunk-34SDRCH2.js +1 -0
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/chunk-3CWGJYBB.js +1 -0
- package/dist/standalone/chunk-3DH35OZ5.js +1 -0
- package/dist/standalone/chunk-3SCGCJYS.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4HNNNIDW.js +1 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-546EVK7X.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-55PVLIN3.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-6JBWLC63.js +4 -0
- package/dist/standalone/chunk-6MUFUH3T.js +13 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-6UPCJAAI.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-A6ZHBJ76.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-AYZUNJKK.js +1 -0
- package/dist/standalone/chunk-B2QO6Q52.js +1 -0
- package/dist/standalone/chunk-BCAPWLLU.js +8 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BQNVN2OD.js +1 -0
- package/dist/standalone/chunk-BUVIRYQM.js +1 -0
- package/dist/standalone/chunk-C2OHUG2J.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-CKPKUMYJ.js +1 -0
- package/dist/standalone/chunk-CZZWYUTR.js +1 -0
- package/dist/standalone/chunk-DBYTTQBC.js +1 -0
- package/dist/standalone/chunk-DGRAPESO.js +1 -0
- package/dist/standalone/chunk-DJZYD5I5.js +1 -0
- package/dist/standalone/chunk-DRDGV6G3.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-F2O4CDVZ.js +1 -0
- package/dist/standalone/chunk-F7IRBXWY.js +1 -0
- package/dist/standalone/chunk-FBQNAZHM.js +1 -0
- package/dist/standalone/chunk-FKAUVTSS.js +1 -0
- package/dist/standalone/chunk-FSXERBWP.js +1 -0
- package/dist/standalone/chunk-FURI47Z2.js +1 -0
- package/dist/standalone/chunk-GG6PIGQO.js +1 -0
- package/dist/standalone/chunk-GGADAESO.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GR62EIAU.js +4 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GVSKCIJR.js +1 -0
- package/dist/standalone/chunk-H23VFWFW.js +6 -0
- package/dist/standalone/chunk-HGSIVV32.js +59 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-I6A5C46N.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IGCNMZSB.js +1 -0
- package/dist/standalone/chunk-IUYFXK4X.js +19 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JNYM5V6I.js +2 -0
- package/dist/standalone/chunk-K2E4OECF.js +1 -0
- package/dist/standalone/chunk-K3PSOZXH.js +1 -0
- package/dist/standalone/chunk-KFQXMD7C.js +1 -0
- package/dist/standalone/chunk-KG6FVK5P.js +1 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LEJV3YKH.js +1 -0
- package/dist/standalone/chunk-LZFOZFYW.js +1 -0
- package/dist/standalone/chunk-M3NGYXDR.js +11 -0
- package/dist/standalone/chunk-M43KO276.js +1 -0
- package/dist/standalone/chunk-MLT5MMMY.js +1 -0
- package/dist/standalone/chunk-MWIKAR7F.js +1 -0
- package/dist/standalone/chunk-MZ2JNVMR.js +1 -0
- package/dist/standalone/chunk-N6DBTBBZ.js +1 -0
- package/dist/standalone/chunk-NBZH4PVA.js +1 -0
- package/dist/standalone/chunk-NE4N6I57.js +1 -0
- package/dist/standalone/chunk-NZZB7PPI.js +1 -0
- package/dist/standalone/chunk-O6XSMU4X.js +1 -0
- package/dist/standalone/chunk-OZ4CUX5O.js +1 -0
- package/dist/standalone/chunk-P4BOVBMR.js +1 -0
- package/dist/standalone/chunk-PLFTCTMX.js +1 -0
- package/dist/standalone/chunk-PVF5J5UD.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QJQWXV2E.js +1 -0
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/chunk-RA5DW5MU.js +1 -0
- package/dist/standalone/chunk-RMN2JN4S.js +1 -0
- package/dist/standalone/chunk-RTMMB3OY.js +1 -0
- package/dist/standalone/chunk-RX5D4SLS.js +1 -0
- package/dist/standalone/chunk-SBZXUGZ7.js +4 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SDVDPAD2.js +3 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-SO52T6RL.js +1 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TMGHRD6W.js +1 -0
- package/dist/standalone/chunk-UF6XZKV3.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-V76WCOMM.js +1 -0
- package/dist/standalone/chunk-VDW32UET.js +1 -0
- package/dist/standalone/chunk-VITTPKH5.js +1 -0
- package/dist/standalone/chunk-WJQLNYGX.js +1 -0
- package/dist/standalone/chunk-WMLKVJUX.js +1 -0
- package/dist/standalone/chunk-WPK2Q33V.js +6 -0
- package/dist/standalone/chunk-WQH3LT2P.js +1 -0
- package/dist/standalone/chunk-XAEG372C.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XF2B7P5A.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-Y32QIKBS.js +1 -0
- package/dist/standalone/chunk-Y7XGNPT6.js +1 -0
- package/dist/standalone/chunk-YC52XCPK.js +14 -0
- package/dist/standalone/chunk-Z4EWPIMU.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZKPKUHTX.js +1 -0
- package/dist/standalone/chunk-ZMYRKEA6.js +1 -0
- package/dist/standalone/studio.js +9 -378
- package/dist/styles.css +2 -2
- package/package.json +15 -14
- package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +0 -46
- package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-rwttyQ1-.js +0 -251
- package/dist/packem_shared/AuditPanel-D9Eh7j7E.js +0 -200
- package/dist/packem_shared/CommandPalette-BtgkBzZI.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-CyckZRwj.js +0 -4480
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-BGJqFK9X.js +0 -197
- package/dist/packem_shared/FileBrowser-0pCpdKPE.js +0 -2932
- package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-CXynSuqT.js +0 -375
- package/dist/packem_shared/GlobalDataBrowser-DAxzB-Br.js +0 -289
- package/dist/packem_shared/HealthPanel-CyLs7qZm.js +0 -648
- package/dist/packem_shared/HomePanel-BOkFRbuj.js +0 -1334
- package/dist/packem_shared/InsightsPanel-CvXMoZuv.js +0 -461
- package/dist/packem_shared/LogsPanel-BrUstOk6.js +0 -827
- package/dist/packem_shared/MailPanel-GnnrNqL6.js +0 -440
- package/dist/packem_shared/MetricsPanel-BN_uUU-_.js +0 -1611
- package/dist/packem_shared/MigrationsPanel-DaZuUHje.js +0 -239
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-LJGNP_IX.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-UmVaMbJy.js +0 -262
- package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-DTmjUNqt.js +0 -92
- package/dist/packem_shared/SettingsPanel-C2wDK-8F.js +0 -390
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +0 -13
- package/dist/packem_shared/Studio-DpgYe4qt.js +0 -33
- package/dist/packem_shared/StudioApp-C7aaizqc.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-DzK3Z6rL.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-Nbhpihxv.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- 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/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-9Mq0PdMi.js +0 -10831
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-4JQW2rr1.js +0 -88
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as U}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{a as F}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as q}from"./chunk-322ZP3GW.js";import"./chunk-XXQUMVWH.js";import"./chunk-P4BOVBMR.js";import"./chunk-QLQADHFE.js";import{a as O}from"./chunk-VDW32UET.js";import{c as H}from"./chunk-BQNVN2OD.js";import"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as B}from"./chunk-XQCVZAGU.js";import{a as G,b as J,c as K,d as M,e as a,f as o}from"./chunk-WJQLNYGX.js";import{a as V,e as W}from"./chunk-WQH3LT2P.js";import{d as T,r as D}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as n,e as E,f as re,g as se,h as ie}from"./chunk-3XIESWL4.js";var X=E(se(),1),z=E(re(),1);var t=E(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"R"),xe=n(()=>{let e=(0,X.c)(38),r=T(),[i,Y]=(0,z.useState)("all"),[l,Z]=(0,z.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:_,error:d,errorSource:v,isLoading:I,refetch:x}=H(O.listPushSubscriptions,g),N;if(e[1]!==_?.subscriptions||e[2]!==d||e[3]!==v||e[4]!==I||e[5]!==i||e[6]!==x||e[7]!==l||e[8]!==r){let L=_?.subscriptions??[],P=l.trim().toLowerCase(),A=L.filter(s=>i!=="all"&&s.kind!==i?!1:P===""?!0:`${Q(s)} ${s.userId??""}`.toLowerCase().includes(P)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(s=>{Z(s.target.value)},"b"),e[10]=b):b=e[10];let ee=b,w;e[11]!==x?(w=n(()=>{x()},"w"),e[11]=x,e[12]=w):w=e[12];let $=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,c;e[14]!==i||e[15]!==r?(c=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(s=>(0,t.jsx)(F,{"aria-selected":i===s,"data-testid":`nt-kind-${s}`,onClick:n(()=>{Y(s)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===s?"secondary":"ghost",children:s==="all"?r("All"):s},s))}),e[14]=i,e[15]=r,e[16]=c):c=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(U,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==$||e[28]!==f?(p=(0,t.jsx)(F,{className:"ml-auto","data-testid":"nt-refresh",onClick:$,size:"sm",type:"button",variant:"outline",children:f}),e[27]=$,e[28]=f,e[29]=p):p=e[29];let j=L.length>0&&(0,t.jsx)(C,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==j||e[32]!==c||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,u,p,j]}),e[30]=p,e[31]=j,e[32]=c,e[33]=u,e[34]=y):y=e[34];let S;e[35]!==d||e[36]!==v?(S=d!==null&&(0,t.jsx)(q,{error:v,testId:"nt-error"}),e[35]=d,e[36]=v,e[37]=S):S=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,S,d===null&&!I&&A.length===0&&(0,t.jsx)(B,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(V,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(M,{children:[(0,t.jsx)(a,{children:r("kind")}),(0,t.jsx)(a,{children:r("endpoint")}),(0,t.jsx)(a,{children:r("user")}),(0,t.jsx)(a,{children:r("last seen")}),(0,t.jsx)(a,{children:r("status")}),(0,t.jsx)(a,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(s=>{let R=Q(s);return(0,t.jsxs)(M,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(C,{variant:"outline",children:s.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:R,children:R}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:s.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:D(s.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(C,{"data-testid":`nt-status-${s.id}`,variant:ne(s.lastStatus),children:s.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:s.lastError??void 0,children:s.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},s.id)})})]})})})]}),e[1]=_?.subscriptions,e[2]=d,e[3]=v,e[4]=I,e[5]=i,e[6]=x,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ve");export{xe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,c as m,f as V}from"./chunk-3XIESWL4.js";var h=m(w=>{"use strict";var a=V();function z(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}s(z,"is");var I=typeof Object.is=="function"?Object.is:z,M=a.useState,_=a.useEffect,g=a.useLayoutEffect,G=a.useDebugValue;function L(e,u){var t=u(),i=M({inst:{value:t,getSnapshot:u}}),r=i[0].inst,n=i[1];return g(function(){r.value=t,r.getSnapshot=u,y(r)&&n({inst:r})},[e,t,u]),_(function(){return y(r)&&n({inst:r}),e(function(){y(r)&&n({inst:r})})},[e]),G(t),t}s(L,"useSyncExternalStore$2");function y(e){var u=e.getSnapshot;e=e.value;try{var t=u();return!I(e,t)}catch{return!0}}s(y,"checkIfSnapshotChanged");function $(e,u){return u()}s($,"useSyncExternalStore$1");var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$:L;w.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:k});var O=m((T,D)=>{"use strict";D.exports=h()});var N=m(R=>{"use strict";var E=V(),C=O();function U(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}s(U,"is");var W=typeof Object.is=="function"?Object.is:U,A=C.useSyncExternalStore,B=E.useRef,F=E.useEffect,H=E.useMemo,J=E.useDebugValue;R.useSyncExternalStoreWithSelector=function(e,u,t,i,r){var n=B(null);if(n.current===null){var c={hasValue:!1,value:null};n.current=c}else c=n.current;n=H(function(){function j(o){if(!S){if(S=!0,v=o,o=i(o),r!==void 0&&c.hasValue){var f=c.value;if(r(f,o))return d=f}return d=o}if(f=d,W(v,o))return f;var p=i(o);return r!==void 0&&r(f,p)?(v=o,f):(v=o,d=p)}s(j,"memoizedSelector");var S=!1,v,d,b=t===void 0?null:t;return[function(){return j(u())},b===null?void 0:function(){return j(b())}]},[u,t,i,r]);var l=A(e,n[0],n[1]);return F(function(){c.hasValue=!0,c.value=l},[l]),J(l),l}});var K=m((Z,q)=>{"use strict";q.exports=N()});export{O as a,K as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,j as a}from"./chunk-6ST5ECQA.js";import{a as o}from"./chunk-XBDKZZ67.js";import{a as r,j as n}from"./chunk-3XIESWL4.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-WQH3LT2P.js";import{a as x,e as u,g as h,h as N}from"./chunk-3XIESWL4.js";var b=u(h(),1);var t=u(N(),1);var v=x(g=>{let e=(0,b.c)(16),{chart:c,footer:n,label:i,testId:m,value:p}=g,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==m||e[3]!==p?(a=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":m,children:p}),e[2]=m,e[3]=p,e[4]=a):a=e[4];let s;e[5]!==c||e[6]!==a?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[5]=c,e[6]=a,e[7]=s):s=e[7];let l;e[8]!==r||e[9]!==s?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[r,s]}),e[8]=r,e[9]=s,e[10]=l):l=e[10];let o;e[11]!==n?(o=n!=null&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==l||e[14]!==o?(d=(0,t.jsxs)(f,{className:"justify-between gap-0 py-0",children:[l,o]}),e[13]=l,e[14]=o,e[15]=d):d=e[15],d},"j");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as W}from"./chunk-54MMVNPT.js";import{a as F}from"./chunk-3CWGJYBB.js";import{a as E}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as L}from"./chunk-322ZP3GW.js";import"./chunk-XXQUMVWH.js";import"./chunk-P4BOVBMR.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-VDW32UET.js";import{c as _}from"./chunk-BQNVN2OD.js";import"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as T}from"./chunk-XQCVZAGU.js";import{a as O,b as P,c as U,d as w,e as h,f as p}from"./chunk-WJQLNYGX.js";import{a as $,e as j}from"./chunk-WQH3LT2P.js";import{d as M}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as S,e as A,g as R,h as Z}from"./chunk-3XIESWL4.js";var B=A(R(),1);var t=A(Z(),1);var q=80,z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>q?`${e.slice(0,q)}\u2026`:e},"W"),G=S(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"B"),C=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),oe=S(a=>{let e=(0,B.c)(22),{initialShardKey:r}=a,n=M(),{queryShardKey:l,setShardKey:i,shardKey:m}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:u,refetch:J}=_(D.listSubscriptions,f,b);W(J,!0);let x;if(e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==i||e[7]!==m||e[8]!==n){let k=s===void 0?[]:G(s.connections),c;e[10]!==i||e[11]!==m?(c=(0,t.jsx)(E,{onChange:i,testId:"subs-shard-input",value:m}),e[10]=i,e[11]=m,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(y,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(y,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==u?(v=o!==null&&(0,t.jsx)(L,{error:u,testId:"subs-error"}),e[19]=o,e[20]=u,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)(T,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)($,{className:"overflow-hidden py-0",children:(0,t.jsx)(j,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(w,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(U,{children:k.map(N=>{let{subscription:I}=N,K=z(I?.args);return(0,t.jsxs)(w,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",N.connectionId,N.admin&&(0,t.jsx)(y,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??C}),(0,t.jsx)(p,{children:I?.table??C}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||C})]},N.key)})})]})})})]}),e[3]=o,e[4]=u,e[5]=s,e[6]=i,e[7]=m,e[8]=n,e[9]=x}else x=e[9];return x},"oe");export{oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,e as o,f as c,g as b,h as p,j as s}from"./chunk-3XIESWL4.js";var l=o(b(),1),g=o(c(),1);var u=o(p(),1);function v(d){let i=(0,l.c)(8),r,e;i[0]!==d?({className:r,...e}=d,i[0]=d,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=s("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=(0,u.jsx)("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}n(v,"p");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as u,n as d}from"./chunk-HGSIVV32.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import"./chunk-YC52XCPK.js";import{a as c,e as m,g as y,h as b}from"./chunk-3XIESWL4.js";var h=m(y(),1);var n=m(b(),1);var p={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},_=c(o=>{let e=(0,h.c)(6),{data:i}=o,a,r;if(e[0]!==i){r=Symbol.for("react.early_return_sentinel");e:{let f=i.slice(-16);if(f.length<3){r=null;break e}a=f.map(g)}e[0]=i,e[1]=a,e[2]=r}else a=e[1],r=e[2];if(r!==Symbol.for("react.early_return_sentinel"))return r;let s=a,t;e[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(d,{dataKey:"value"}),e[3]=t):t=e[3];let l;return e[4]!==s?(l=(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28",children:(0,n.jsx)(u,{animationType:"none",barCategoryGap:1,className:"h-8 w-full",config:p,data:s,children:t})}),e[4]=s,e[5]=l):l=e[5],l},"b");function g(o,e){return{index:e,value:o}}c(g,"h");export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _={aiAvailable:"__lunora_admin__:aiAvailable",aiChartConfig:"__lunora_admin__:aiChartConfig",aiGenerateSql:"__lunora_admin__:aiGenerateSql",aiTableFilter:"__lunora_admin__:aiTableFilter",assignIssue:"__lunora_admin__:assignIssue",backRelationCounts:"__lunora_admin__:backRelationCounts",clearCapturedMail:"__lunora_admin__:clearCapturedMail",clearQueueMessages:"__lunora_admin__:clearQueueMessages",clearTable:"__lunora_admin__:clearTable",createWorkflowInstance:"__lunora_admin__:createWorkflowInstance",deleteRows:"__lunora_admin__:deleteRows",describeTable:"__lunora_admin__:describeTable",describeTables:"__lunora_admin__:describeTables",explainIssue:"__lunora_admin__:explainIssue",exportShard:"__lunora_admin__:exportShard",facetColumn:"__lunora_admin__:facetColumn",getAdvisories:"__lunora_admin__:getAdvisories",getAdvisorProcedures:"__lunora_admin__:getAdvisorProcedures",getAuditLog:"__lunora_admin__:getAuditLog",getAuthAuditLog:"__lunora_admin__:getAuthAuditLog",getAuthMetrics:"__lunora_admin__:getAuthMetrics",getCapturedMail:"__lunora_admin__:getCapturedMail",getFanoutMetrics:"__lunora_admin__:getFanoutMetrics",getFunctionStats:"__lunora_admin__:getFunctionStats",getIssues:"__lunora_admin__:getIssues",lintSql:"__lunora_admin__:lintSql",listFlags:"__lunora_admin__:listFlags",listPushSubscriptions:"__lunora_admin__:listPushSubscriptions",listQueues:"__lunora_admin__:listQueues",listSubscriptions:"__lunora_admin__:listSubscriptions",listTableIndexes:"__lunora_admin__:listTableIndexes",listTablesIndexes:"__lunora_admin__:listTablesIndexes",listWorkflows:"__lunora_admin__:listWorkflows",getLogs:"__lunora_admin__:getLogs",getMetricHistory:"__lunora_admin__:getMetricHistory",getMetricSeries:"__lunora_admin__:getMetricSeries",getMetrics:"__lunora_admin__:getMetrics",getPitrBookmark:"__lunora_admin__:getPitrBookmark",getQueryInsights:"__lunora_admin__:getQueryInsights",getQueueMessages:"__lunora_admin__:getQueueMessages",getRequestLog:"__lunora_admin__:getRequestLog",getSecurityAudit:"__lunora_admin__:getSecurityAudit",getSettings:"__lunora_admin__:getSettings",getTraces:"__lunora_admin__:getTraces",getWorkflowInstanceStatus:"__lunora_admin__:getWorkflowInstanceStatus",ignoreIssue:"__lunora_admin__:ignoreIssue",importShard:"__lunora_admin__:importShard",listTables:"__lunora_admin__:listTables",maskPolicies:"__lunora_admin__:maskPolicies",migrationStatus:"__lunora_admin__:migrationStatus",pitrRestore:"__lunora_admin__:pitrRestore",readTablePage:"__lunora_admin__:readTablePage",replayQueueMessage:"__lunora_admin__:replayQueueMessage",resolveIssue:"__lunora_admin__:resolveIssue",rlsPolicies:"__lunora_admin__:rlsPolicies",schemaHistory:"__lunora_admin__:schemaHistory",schemaVersion:"__lunora_admin__:schemaVersion",runAs:"__lunora_admin__:runAs",runMigration:"__lunora_admin__:runMigration",runSql:"__lunora_admin__:runSql",sendQueueMessage:"__lunora_admin__:sendQueueMessage",sendTestMail:"__lunora_admin__:sendTestMail",setIssueSeverity:"__lunora_admin__:setIssueSeverity",storageOrphans:"__lunora_admin__:storageOrphans",storageReferences:"__lunora_admin__:storageReferences",storageRules:"__lunora_admin__:storageRules",studioFeatures:"__lunora_admin__:studioFeatures",writeRow:"__lunora_admin__:writeRow"};export{_ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as f}from"./chunk-K2E4OECF.js";import{e as m}from"./chunk-SMIESS7P.js";import{o as e}from"./chunk-IUYFXK4X.js";import{a as s,e as p,g as n}from"./chunk-3XIESWL4.js";var c=p(n(),1);var h=s(o=>{let r=(0,c.c)(3),a=m(),t;return r[0]!==a||r[1]!==o?(t=s(i=>{f({shardKey:o,traceId:i}),e(a({to:"/traces"}))},"t"),r[0]=a,r[1]=o,r[2]=t):t=r[2],t},"g");export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,e as m,f as b,g as i,h as u,j as c}from"./chunk-3XIESWL4.js";var n=m(i(),1),p=m(b(),1);var s=m(u(),1);function h(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("w-full caption-bottom text-xs",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-clip",children:(0,s.jsx)("table",{"data-slot":"table",className:l,...a})}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(h,"u");function x(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("bg-muted/50 [&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("thead",{"data-slot":"table-header",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(x,"p");function N(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("tbody",{"data-slot":"table-body",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(N,"f");function w(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("tr",{"data-slot":"table-row",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(w,"h");function g(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("h-9 border-e border-border px-3 text-start align-middle font-mono text-[11px] font-medium tracking-wide whitespace-nowrap text-muted-foreground uppercase last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("th",{"data-slot":"table-head",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(g,"x");function v(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("border-e border-border px-3 py-1.5 align-middle whitespace-nowrap last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("td",{"data-slot":"table-cell",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(v,"N");export{h as a,x as b,N as c,w as d,g as e,v as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as x}from"./chunk-VDW32UET.js";import{c as C}from"./chunk-BQNVN2OD.js";import{f as q}from"./chunk-M3NGYXDR.js";import{d as k,f as g,g as y,m as S}from"./chunk-IUYFXK4X.js";import{a as f,e as w,f as L,g as F,h as O}from"./chunk-3XIESWL4.js";var v=w(L(),1);var j={},I=g(x.aiGenerateSql),T=g(x.aiTableFilter),A=g(x.aiChartConfig),R=f(s=>{let e=q(),[l,d]=(0,v.useState)({}),[n,r]=(0,v.useState)({}),a=C(x.aiAvailable,j,{shardKey:s}),[u,i]=(0,v.useState)(!1),b=u||a.data?.available===!1,p=f(t=>{d(o=>({...o,[t]:!0})),r(o=>({...o,[t]:void 0}))},"n"),h=f((t,o)=>{d(c=>({...c,[t]:!1})),o!==void 0&&r(c=>({...c,[t]:o})),o==="no-ai-binding"&&i(!0)},"t");return{generate:f(async(t,o)=>{p("sql");try{let{result:c}=await e.query(I,{failedError:o?.error,failedSql:o?.sql,prompt:t},y(s));return h("sql",c.degraded?c.reason:void 0),c.degraded?void 0:c.sql}catch{h("sql","ai-error");return}},"generate"),inferChart:f(async t=>{p("chart");try{let{result:o}=await e.query(A,t,y(s));return h("chart",o.degraded?o.reason:void 0),o.degraded?void 0:o.chart}catch{h("chart","ai-error");return}},"inferChart"),pending:f(t=>l[t]===!0,"pending"),reason:f(t=>n[t],"reason"),suggestFilter:f(async(t,o)=>{p("filter");try{let{result:c}=await e.query(T,{prompt:t,table:o},y(s));return h("filter",c.degraded?c.reason:void 0),c.degraded?void 0:c.clauses}catch{h("filter","ai-error");return}},"suggestFilter"),unavailable:b}},"k");var N=w(F(),1);var m=w(O(),1);var U=f((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let l=[],d=s.toLowerCase(),n=e.toLowerCase(),r=0;for(let a=d.indexOf(n);a!==-1;a=d.indexOf(n,r))a>r&&l.push({match:!1,offset:r,text:s.slice(r,a)}),l.push({match:!0,offset:a,text:s.slice(a,a+e.length)}),r=a+e.length;return r<s.length&&l.push({match:!1,offset:r,text:s.slice(r)}),l},"N"),z=f(s=>{let e=(0,N.c)(9),{highlight:l,value:d}=s;if(d==null){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,m.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=i):i=e[0],i}let n,r,a;if(e[1]!==l||e[2]!==d){a=Symbol.for("react.early_return_sentinel");e:{let i=S(d);if(l===void 0||l===""){a=(0,m.jsx)("span",{title:i,children:i});break e}n=i,r=U(i,l).map(D)}e[1]=l,e[2]=d,e[3]=n,e[4]=r,e[5]=a}else n=e[3],r=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let u;return e[6]!==n||e[7]!==r?(u=(0,m.jsx)("span",{title:n,children:r}),e[6]=n,e[7]=r,e[8]=u):u=e[8],u},"v"),Q=f(s=>{let e=(0,N.c)(22),{columns:l,rows:d}=s,n=k(),r;e[0]!==n?(r=n("Field"),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==r?(a=(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let u;if(e[4]!==d||e[5]!==n){let t;e[7]!==n?(t=f((o,c)=>(0,m.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:n("Row {n}",{n:c+1})},c),"i"),e[7]=n,e[8]=t):t=e[8],u=d.map(t),e[4]=d,e[5]=n,e[6]=u}else u=e[6];let i;e[9]!==a||e[10]!==u?(i=(0,m.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,m.jsxs)("tr",{children:[a,u]})}),e[9]=a,e[10]=u,e[11]=i):i=e[11];let b;if(e[12]!==l||e[13]!==d){let t;e[15]!==d?(t=f(o=>(0,m.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:o}),d.map((c,_)=>(0,m.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,m.jsx)(z,{value:c[o]})},_))]},o),"i"),e[15]=d,e[16]=t):t=e[16],b=l.map(t),e[12]=l,e[13]=d,e[14]=b}else b=e[14];let p;e[17]!==b?(p=(0,m.jsx)("tbody",{children:b}),e[17]=b,e[18]=p):p=e[18];let h;return e[19]!==i||e[20]!==p?(h=(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,m.jsxs)("table",{className:"border-collapse text-xs",children:[i,p]})}),e[19]=i,e[20]=p,e[21]=h):h=e[21],h},"j"),V=f(({children:s,layout:e="card",testId:l})=>(0,m.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":l,children:s}),"O");function D(s){return(0,m.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}f(D,"k");export{R as a,z as b,Q as c,V as d};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as _,b as E,c as V,d as D,e as B,f as A,g as I,h as J}from"./chunk-GG6PIGQO.js";import{a as K}from"./chunk-ESVP44Y3.js";import{a as H}from"./chunk-Y32QIKBS.js";import{d as j,m as M,n as z,q as F}from"./chunk-IUYFXK4X.js";import{a as m,e as U,f as X,g as Y,h as Z}from"./chunk-3XIESWL4.js";var L=U(Y(),1),G=U(X(),1);var i=U(Z(),1);var T="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",ee=/["\n,]/u,te=/^[=+\-@\t\r]/u,P=m(t=>{if(t==null)return"";let e;return typeof t=="string"?e=te.test(t)?` ${t}`:t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?e=String(t):e=JSON.stringify(t),ee.test(e)?`"${e.replaceAll('"','""')}"`:e},"E"),le=m((t,e)=>{let n=t.map(o=>P(o)).join(","),a=e.map(o=>t.map(l=>P(o[l])).join(","));return[n,...a].join(`
|
|
2
|
+
`)},"Y"),ne=m(t=>JSON.stringify(t,z,2),"Z"),Q=500,W=m(t=>`"${t.replaceAll('"','""')}"`,"J"),oe=m(t=>t==null?"NULL":typeof t=="number"?Number.isFinite(t)?String(t):"NULL":typeof t=="bigint"?String(t):typeof t=="boolean"?t?"1":"0":`'${(typeof t=="string"?t:JSON.stringify(t)).replaceAll("'","''")}'`,"ee"),ae=m((t,e,n)=>{if(e.length===0||n.length===0)return"";let a=e.map(l=>W(l)).join(", "),o=[];for(let l=0;l<n.length;l+=Q){let r=n.slice(l,l+Q).map(s=>` (${e.map(c=>oe(s[c])).join(", ")})`).join(`,
|
|
3
|
+
`);o.push(`INSERT INTO ${W(t)} (${a}) VALUES
|
|
4
|
+
${r};`)}return o.join(`
|
|
5
|
+
|
|
6
|
+
`)},"te"),q=m((t,e,n)=>{if(!("document"in globalThis))return;let a=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),o=globalThis.document.createElement("a");o.href=a,o.download=t,globalThis.document.body.append(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(a)},"A"),ie=m(t=>{let e=(0,L.c)(36),{columns:n,name:a,rows:o}=t,l=j(),r;e[0]!==n||e[1]!==a||e[2]!==o?(r=m(()=>{q(`${a}.csv`,le(n,o),"text/csv;charset=utf-8")},"i"),e[0]=n,e[1]=a,e[2]=o,e[3]=r):r=e[3];let s=r,c;e[4]!==a||e[5]!==o?(c=m(()=>{q(`${a}.json`,ne(o),"application/json")},"s"),e[4]=a,e[5]=o,e[6]=c):c=e[6];let u=c,p;e[7]!==n||e[8]!==a||e[9]!==o?(p=m(()=>{q(`${a}.sql`,ae(a,n,o),"application/sql;charset=utf-8")},"g"),e[7]=n,e[8]=a,e[9]=o,e[10]=p):p=e[10];let d=p,f=o.length===0,h;e[11]!==f?(h=(0,i.jsx)(E,{className:T,"data-testid":"grid-export",disabled:f,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[11]=f,e[12]=h):h=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=(0,i.jsx)(B,{children:"Export loaded rows"}),e[13]=N):N=e[13];let g;e[14]!==l?(g=l("CSV"),e[14]=l,e[15]=g):g=e[15];let C;e[16]!==s||e[17]!==g?(C=(0,i.jsx)(A,{"data-testid":"grid-export-csv",onClick:s,children:g}),e[16]=s,e[17]=g,e[18]=C):C=e[18];let y;e[19]!==l?(y=l("JSON"),e[19]=l,e[20]=y):y=e[20];let x;e[21]!==u||e[22]!==y?(x=(0,i.jsx)(A,{"data-testid":"grid-export-json",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=x):x=e[23];let w;e[24]!==l?(w=l("SQL"),e[24]=l,e[25]=w):w=e[25];let b;e[26]!==d||e[27]!==w?(b=(0,i.jsx)(A,{"data-testid":"grid-export-sql",onClick:d,children:w}),e[26]=d,e[27]=w,e[28]=b):b=e[28];let k;e[29]!==x||e[30]!==b||e[31]!==C?(k=(0,i.jsxs)(V,{align:"end",children:[N,C,x,b]}),e[29]=x,e[30]=b,e[31]=C,e[32]=k):k=e[32];let v;return e[33]!==k||e[34]!==h?(v=(0,i.jsxs)(_,{children:[h,k]}),e[33]=k,e[34]=h,e[35]=v):v=e[35],v},"le"),se=m(t=>{let e=(0,L.c)(9),{column:n}=t,a;e[0]!==n?(a=m(()=>{n.toggleVisibility()},"a"),e[0]=n,e[1]=a):a=e[1];let o=a,l;e[2]!==n?(l=n.getIsVisible(),e[2]=n,e[3]=l):l=e[3];let r=`grid-column-${n.id}`,s;return e[4]!==n.id||e[5]!==o||e[6]!==l||e[7]!==r?(s=(0,i.jsx)(I,{checked:l,closeOnClick:!1,"data-testid":r,onCheckedChange:o,children:n.id}),e[4]=n.id,e[5]=o,e[6]=l,e[7]=r,e[8]=s):s=e[8],s},"ne"),re=[],ce=m(({backRelations:t=re,enabledBackRelations:e,onToggleBackRelation:n,table:a})=>{let o=j(),l=a.getIsAllColumnsVisible(),r=m(()=>{a.toggleAllColumnsVisible(!l)},"i");return(0,i.jsxs)(_,{children:[(0,i.jsx)(E,{className:T,"data-testid":"grid-columns",children:o("Columns")}),(0,i.jsxs)(V,{align:"end",className:"max-h-80 overflow-y-auto",children:[(0,i.jsxs)(D,{children:[(0,i.jsx)(B,{children:o("Columns")}),(0,i.jsx)(I,{checked:l,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:r,children:o(l?"Hide all":"Show all")}),(0,i.jsx)(J,{}),a.getAllLeafColumns().filter(s=>!s.id.startsWith("__back__:")).map(s=>(0,i.jsx)(se,{column:s},s.id))]}),t.length>0&&n!==void 0&&(0,i.jsxs)(D,{children:[(0,i.jsx)(J,{}),(0,i.jsx)(B,{children:o("Related")}),t.map(s=>{let c=`${s.table}.${s.column}`;return(0,i.jsx)(I,{checked:e?.has(c)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${c}`,onCheckedChange:m(()=>{n(c)},"onCheckedChange"),children:`\u2190 ${s.table}.${s.column}`},c)})]})]})]})},"ae"),de=m(t=>{let e=(0,L.c)(19),{count:n,editable:a,onClear:o,onDelete:l}=t,r=j(),s;e[0]!==n||e[1]!==r?(s=r("{count} selected",{count:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2];let c;e[3]!==s?(c=(0,i.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:s}),e[3]=s,e[4]=c):c=e[4];let u;e[5]!==r?(u=r("Clear"),e[5]=r,e[6]=u):u=e[6];let p;e[7]!==o||e[8]!==u?(p=(0,i.jsx)("button",{className:T,"data-testid":"grid-selection-clear",onClick:o,type:"button",children:u}),e[7]=o,e[8]=u,e[9]=p):p=e[9];let d;e[10]!==n||e[11]!==a||e[12]!==l||e[13]!==r?(d=a&&(0,i.jsx)(H,{confirmLabel:r("Delete {count} rows?",{count:n}),onConfirm:l,testId:"grid-selection-delete",children:r("Delete {count}",{count:n})}),e[10]=n,e[11]=a,e[12]=l,e[13]=r,e[14]=d):d=e[14];let f;return e[15]!==c||e[16]!==p||e[17]!==d?(f=(0,i.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[c,p,d]}),e[15]=c,e[16]=p,e[17]=d,e[18]=f):f=e[18],f},"re"),fe=m(t=>{let e=(0,L.c)(32),{column:n,onClose:a,value:o}=t,l=j(),[r,s]=(0,G.useState)(!1),c;e[0]!==o?(c=M(o),e[0]=o,e[1]=c):c=e[1];let u=c,p;e[2]!==u?(p=m(()=>{F(u)&&s(!0)},"g"),e[2]=u,e[3]=p):p=e[3];let d=p,f;e[4]!==l?(f=l("Cell value"),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==n?(h=(0,i.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:n}),e[6]=n,e[7]=h):h=e[7];let N;e[8]!==r||e[9]!==l?(N=l(r?"Copied":"Copy"),e[8]=r,e[9]=l,e[10]=N):N=e[10];let g;e[11]!==d||e[12]!==N?(g=(0,i.jsx)("button",{className:T,"data-testid":"grid-cell-copy",onClick:d,type:"button",children:N}),e[11]=d,e[12]=N,e[13]=g):g=e[13];let C;e[14]!==l?(C=l("Close"),e[14]=l,e[15]=C):C=e[15];let y;e[16]!==a||e[17]!==C?(y=(0,i.jsx)("button",{className:T,"data-testid":"grid-cell-close",onClick:a,type:"button",children:C}),e[16]=a,e[17]=C,e[18]=y):y=e[18];let x;e[19]!==g||e[20]!==y?(x=(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[g,y]}),e[19]=g,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==h||e[23]!==x?(w=(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[h,x]}),e[22]=h,e[23]=x,e[24]=w):w=e[24];let b;e[25]!==u?(b=(0,i.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:u}),e[25]=u,e[26]=b):b=e[26];let k;return e[27]!==a||e[28]!==w||e[29]!==b||e[30]!==f?(k=(0,i.jsxs)(K,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:f,onClose:a,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[w,b]}),e[27]=a,e[28]=w,e[29]=b,e[30]=f,e[31]=k):k=e[31],k},"be"),Ce=m(t=>{let e=(0,L.c)(36),{backRelations:n,enabledBackRelations:a,onToggleBackRelation:o,columns:l,editable:r,name:s,onBulkDelete:c,onToggleTranspose:u,rows:p,table:d,transposed:f}=t,h=j(),N;e[0]!==d?(N=d.getSelectedRowModel(),e[0]=d,e[1]=N):N=e[1];let g=N.rows,C;e[2]!==d?(C=m(()=>{d.resetRowSelection()},"f"),e[2]=d,e[3]=C):C=e[3];let y=C,x;e[4]!==c||e[5]!==g||e[6]!==d?(x=m(()=>{c(g.map(me)),d.resetRowSelection()},"C"),e[4]=c,e[5]=g,e[6]=d,e[7]=x):x=e[7];let w=x,b;e[8]!==l||e[9]!==s||e[10]!==p?(b=(0,i.jsx)(ie,{columns:l,name:s,rows:p}),e[8]=l,e[9]=s,e[10]=p,e[11]=b):b=e[11];let k;e[12]!==n||e[13]!==a||e[14]!==o||e[15]!==d?(k=(0,i.jsx)(ce,{backRelations:n,enabledBackRelations:a,onToggleBackRelation:o,table:d}),e[12]=n,e[13]=a,e[14]=o,e[15]=d,e[16]=k):k=e[16];let v;e[17]!==h?(v=h("Swap rows and columns"),e[17]=h,e[18]=v):v=e[18];let $;e[19]!==h?($=h("Transpose"),e[19]=h,e[20]=$):$=e[20];let R;e[21]!==u||e[22]!==v||e[23]!==$||e[24]!==f?(R=(0,i.jsx)("button",{"aria-pressed":f,className:T,"data-testid":"grid-transpose",onClick:u,title:v,type:"button",children:$}),e[21]=u,e[22]=v,e[23]=$,e[24]=f,e[25]=R):R=e[25];let S;e[26]!==r||e[27]!==y||e[28]!==w||e[29]!==g.length?(S=g.length>0&&(0,i.jsx)(de,{count:g.length,editable:r,onClear:y,onDelete:w}),e[26]=r,e[27]=y,e[28]=w,e[29]=g.length,e[30]=S):S=e[30];let O;return e[31]!==b||e[32]!==k||e[33]!==R||e[34]!==S?(O=(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[b,k,R,S]}),e[31]=b,e[32]=k,e[33]=R,e[34]=S,e[35]=O):O=e[35],O},"fe");function me(t){return t.id}m(me,"ie");export{ie as a,de as b,fe as c,Ce as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,e as m,f as n,g as p,h as u,j as c}from"./chunk-3XIESWL4.js";var l=m(p(),1),f=m(n(),1);var i=m(u(),1);function g({className:d,size:a="default",...t}){return(0,i.jsx)("div",{"data-slot":"card","data-size":a,className:c("group/card flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card py-4 text-xs/relaxed text-card-foreground shadow-xs has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-2 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-md *:[img:last-child]:rounded-md",d),...t})}o(g,"p");function h(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-md px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-header",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(h,"f");function b(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("font-heading text-sm font-medium group-data-[size=sm]/card:text-sm",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-title",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(b,"x");function N(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("text-xs/relaxed text-muted-foreground",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-description",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(N,"g");function z(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("px-4 group-data-[size=sm]/card:px-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-content",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(z,"h");export{g as a,h as b,b as c,N as d,z as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as R}from"./chunk-322ZP3GW.js";import"./chunk-XXQUMVWH.js";import"./chunk-P4BOVBMR.js";import"./chunk-QLQADHFE.js";import{a as v}from"./chunk-VDW32UET.js";import{c as $}from"./chunk-BQNVN2OD.js";import"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as S}from"./chunk-XQCVZAGU.js";import{a as A,b as I,c as j,d as x,e as n,f as c}from"./chunk-WJQLNYGX.js";import{a as k,e as w}from"./chunk-WQH3LT2P.js";import{d as b}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as f,e as N,g as _,h as D}from"./chunk-3XIESWL4.js";var T=N(_(),1);var r=N(D(),1);var E=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"E"),C={delete:2,list:3,read:0,write:1},O=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||C[t.on]-C[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"T"),q=f(()=>{let e=(0,T.c)(14),t=b(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(v.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=O(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(R,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(S,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(w,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(I,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(n,{children:t("Bucket")}),(0,r.jsx)(n,{children:t("Operation")}),(0,r.jsx)(n,{children:t("Key prefix")}),(0,r.jsx)(n,{children:t("Guarded by")})]})}),(0,r.jsx)(j,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(c,{children:(0,r.jsx)(y,{variant:"secondary",children:E(t,s.on)})}),(0,r.jsx)(c,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"W");export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,i as y}from"./chunk-3XIESWL4.js";var V=r(e=>typeof e=="boolean"?`${e}`:e===0?"0":e,"falsyToString"),N=y,j=r((e,l)=>n=>{var s;if(l?.variants==null)return N(e,n?.class,n?.className);let{variants:v,defaultVariants:d}=l,f=Object.keys(v).map(t=>{let a=n?.[t],u=d?.[t];if(a===null)return null;let i=V(a)||V(u);return v[t][i]}),c=n&&Object.entries(n).reduce((t,a)=>{let[u,i]=a;return i===void 0||(t[u]=i),t},{}),C=l==null||(s=l.compoundVariants)===null||s===void 0?void 0:s.reduce((t,a)=>{let{class:u,className:i,...x}=a;return Object.entries(x).every(O=>{let[m,o]=O;return Array.isArray(o)?o.includes({...d,...c}[m]):{...d,...c}[m]===o})?[...t,u,i]:t},[]);return N(e,f,C,n?.class,n?.className)},"cva");export{j as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="https://dash.cloudflare.com/?to=/:account",a=`${s}/workers-and-pages/observability`,r=`${s}/workers-and-pages`,o=`${s}/r2`,e=`${s}/workers/d1`,t=`${s}/workers/durable-objects`;export{a,r as b,o as c,e as d,t as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,e as g,g as b,h as j,j as h}from"./chunk-3XIESWL4.js";var v=g(b(),1);var t=g(j(),1);var z=u(N=>{let e=(0,v.c)(19),{action:a,className:x,description:c,icon:m,testId:f,title:p}=N,s;e[0]!==x?(s=h("flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border px-6 py-14 text-center",x),e[0]=x,e[1]=s):s=e[1];let r;e[2]!==m?(r=m!==void 0&&(0,t.jsx)("span",{className:"flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground [&_svg]:size-5",children:m}),e[2]=m,e[3]=r):r=e[3];let d;e[4]!==p?(d=(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:p}),e[4]=p,e[5]=d):d=e[5];let l;e[6]!==c?(l=c!==void 0&&(0,t.jsx)("p",{className:"max-w-sm text-sm text-muted-foreground",children:c}),e[6]=c,e[7]=l):l=e[7];let o;e[8]!==d||e[9]!==l?(o=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[d,l]}),e[8]=d,e[9]=l,e[10]=o):o=e[10];let i;e[11]!==a?(i=a!==void 0&&(0,t.jsx)("div",{className:"mt-1 flex items-center gap-2",children:a}),e[11]=a,e[12]=i):i=e[12];let n;return e[13]!==s||e[14]!==r||e[15]!==o||e[16]!==i||e[17]!==f?(n=(0,t.jsxs)("div",{className:s,"data-testid":f,children:[r,o,i]}),e[13]=s,e[14]=r,e[15]=o,e[16]=i,e[17]=f,e[18]=n):n=e[18],n},"y");export{z as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"./chunk-XBDKZZ67.js";import{a as l,e as c,g as f,h as g,j as v}from"./chunk-3XIESWL4.js";var u=c(f(),1);var s=c(g(),1);var p=b("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-border bg-muted/40 text-foreground",destructive:"border-destructive/40 bg-destructive/5 text-destructive",warning:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"}}}),j=l(x=>{let t=(0,u.c)(10),{children:d,className:i,icon:o,testId:m,variant:n}=x,e;t[0]!==i||t[1]!==n?(e=v(p({variant:n}),i),t[0]=i,t[1]=n,t[2]=e):e=t[2];let r;t[3]!==d?(r=(0,s.jsx)("div",{className:"min-w-0 flex-1",children:d}),t[3]=d,t[4]=r):r=t[4];let a;return t[5]!==o||t[6]!==e||t[7]!==r||t[8]!==m?(a=(0,s.jsxs)("div",{className:e,"data-testid":m,role:"alert",children:[o,r]}),t[5]=o,t[6]=e,t[7]=r,t[8]=m,t[9]=a):a=t[9],a},"N");export{j as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-MWIKAR7F.js";import{d}from"./chunk-IUYFXK4X.js";import{a as e,e as r,f as h,h as v}from"./chunk-3XIESWL4.js";var m=r(h(),1);var t=r(v(),1);var g=e(({children:c,confirmLabel:l,disabled:s=!1,onConfirm:p,testId:i})=>{let o=d(),[u,n]=(0,m.useState)(!1),f=e(()=>{n(!0)},"m"),b=e(()=>{n(!1)},"c"),C=e(()=>{n(!1),p()},"f");return u?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(a,{"data-testid":`${i}-confirm`,disabled:s,onClick:C,size:"sm",type:"button",variant:"destructive",children:l??o("Confirm")}),(0,t.jsx)(a,{"data-testid":`${i}-cancel`,onClick:b,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(a,{"data-testid":i,disabled:s,onClick:f,size:"sm",type:"button",variant:"outline",children:c})},"$");export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as g,n as b}from"./chunk-HGSIVV32.js";import{a as c,e as p,g as y,h as M,j as d}from"./chunk-3XIESWL4.js";var w=c(e=>{let t=0,s=0,r=0,a=0,i=0,l=0,o=0;for(let{metrics:n}of e){if(n===null){i+=1;continue}a+=1,t+=n.requests,s+=n.errors,r+=n.databaseSize??0,n.cache!==null&&(l+=n.cache.hits,o+=n.cache.hits+n.cache.misses)}return{failed:i,hitRate:o===0?null:l/o,reachable:a,totalDatabaseSize:r,totalErrors:s,totalRequests:t}},"u"),C=c((e,t)=>{let s=new Set,r=[];for(let a of["",e.trim(),...t])s.has(a)||(s.add(a),r.push(a));return r},"h"),v=c((e,t)=>{if(e.length===0)return 0;if(e.sort((r,a)=>r-a),t<=0)return e[0]??0;if(t>=100)return e.at(-1)??0;let s=Math.ceil(t/100*e.length)-1;return e[s]??0},"i"),N=c(e=>{let t=e.functions;if(!t||t.length===0)return{p90:0,p95:0};let s=1e3,r=[];for(let a of t){if(a.calls<=0)continue;let i=a.totalDurationMs/a.calls,l=Math.min(a.calls,s);for(let o=0;o<l;o+=1)r.push(i)}return r.length===0?{p90:0,p95:0}:{p90:v([...r],90),p95:v([...r],95)}},"f");var q=c(e=>e.map(t=>({...t,avgDurationMs:t.execCount>0?t.totalDurationMs/t.execCount:0})),"g");var x=p(y(),1);var m=p(M(),1);var S={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},T=c(e=>{let t=(0,x.c)(12),{ariaLabel:s,className:r,series:a,testId:i}=e;if(a.length<2)return null;let l;t[0]!==a?(l=a.slice(-40).map(D),t[0]=a,t[1]=l):l=t[1];let o=l,n;t[2]!==r?(n=d("h-6 w-[120px]",r),t[2]=r,t[3]=n):n=t[3];let f;t[4]===Symbol.for("react.memo_cache_sentinel")?(f=(0,m.jsx)(b,{dataKey:"value"}),t[4]=f):f=t[4];let u;t[5]!==o?(u=(0,m.jsx)(g,{animationType:"none",barCategoryGap:1,className:"h-full w-full",config:S,data:o,children:f}),t[5]=o,t[6]=u):u=t[6];let h;return t[7]!==s||t[8]!==n||t[9]!==u||t[10]!==i?(h=(0,m.jsx)("div",{"aria-label":s,className:n,"data-testid":i,role:"img",children:u}),t[7]=s,t[8]=n,t[9]=u,t[10]=i,t[11]=h):h=t[11],h},"S");function D(e,t){return{index:t,value:e}}c(D,"b");export{w as a,C as b,N as c,q as d,T as e};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{a}from"./chunk-3XIESWL4.js";var s="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/",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"},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"},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"},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"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},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` to `emailGate(...)` (`@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_ERROR:{status:502,title:"Analytics Engine SQL API error"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup 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_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"},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"},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"},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_BINDING:{status:500,title:"Duplicate agent binding"},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_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"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},RATE_LIMITED:{status:429,title:"Rate limited"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},EXPIRED:{status:404,title:"Session expired"},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"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},TOKEN_EXPIRED:{status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},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"},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_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{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"}},f=a(e=>Object.hasOwn(l,e)?l[e]:void 0,"h");var m=[{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(`
|
|
2
|
+
`),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(`
|
|
3
|
+
`),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 reserved name (the error lists them) \u2014 e.g. `userAccounts` instead of `insert`."].join(`
|
|
4
|
+
`),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(`
|
|
5
|
+
`),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(`
|
|
6
|
+
`),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(`
|
|
7
|
+
`),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(`
|
|
8
|
+
`),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(`
|
|
9
|
+
`),header:"Unique constraint violation",id:"lunora-runtime-unique",test:a(e=>e.includes("unique constraint violation on"),"test")},{body:l.CONFLICT.hint.join(`
|
|
10
|
+
`),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:a(e=>e.includes("optimistic concurrency conflict"),"test")}],u=[{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:s,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:s,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:s,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:s,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:s,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:s,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:s,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"}],d=a(e=>e!==void 0&&e>="0"&&e<="9","l"),p=a((e,t)=>{for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+t.length))if(!d(e[o-1])&&!d(e[o+t.length]))return!0;return!1},"m"),T=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(!d(e[i+o.length]))return!0;return!1},"_"),O=/error|cloudflare/iu,h=a(e=>({body:[e.summary,"",`**Likely cause:** ${e.causes}.`,"",`**Fix:** ${e.fix}.`,"",`See [Cloudflare's ${e.family} error docs](${e.docsUrl}).`].join(`
|
|
11
|
+
`),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 r of u)if(T(t,r.code))return h(r)}if(i){for(let r of u)if(p(t,r.code))return h(r)}},"T"),N=a(e=>(typeof e=="string"?e:e.join(`
|
|
12
|
+
`)).split(`
|
|
13
|
+
`).filter(t=>!t.startsWith("```")).join(`
|
|
14
|
+
`).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"N"),_=a(e=>{for(let t of m)if(t.test(e))return{body:t.body,header:t.header,id:t.id}},"u"),A=a(e=>_(e)??E(e),"O");var c=class extends Error{static{a(this,"c")}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(t,o,i={}){let r=f(t);super(o??t,i.cause===void 0?void 0:{cause:i.cause}),this.name=i.name??"LunoraError",this.hint=i.hint??r?.hint,this.title=i.title??r?.title,this.loc=i.location,this.code=t,this.status=i.status??r?.status??500,this.docsUrl=i.docsUrl??r?.docsUrl,this.data=i.data}};export{N as a,A as b,c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as me}from"./chunk-TMGHRD6W.js";import{a as Kt,b as Lt,c as At,d as Tt,e as it}from"./chunk-Y7XGNPT6.js";import{a as Ot}from"./chunk-VITTPKH5.js";import{a as zt}from"./chunk-K2E4OECF.js";import{e as _t}from"./chunk-XF2B7P5A.js";import{a as Dt,b as It,c as Ct,d as Rt,e as je}from"./chunk-RA5DW5MU.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as Mt}from"./chunk-IGCNMZSB.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as Ze,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-HGSIVV32.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import{a as $t}from"./chunk-3CWGJYBB.js";import{a as kt}from"./chunk-RMN2JN4S.js";import{a as wt,b as qt}from"./chunk-GRL5MG3Z.js";import"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{a as Ye}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as We}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as Le}from"./chunk-VDW32UET.js";import{c as Ee}from"./chunk-BQNVN2OD.js";import{f as ct}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as ht}from"./chunk-XQCVZAGU.js";import{a as st,b as lt,c as nt,d as Pe,e as ce,f as H}from"./chunk-WJQLNYGX.js";import{a as fe,b as Ae,c as Te,d as ut,e as pe}from"./chunk-WQH3LT2P.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as Ge,o as bt}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as o,e as Xe,f as Qt,g as Ut,h as Ft,j as mt}from"./chunk-3XIESWL4.js";var j=Xe(Qt(),1);var xe=Xe(Ut(),1);var t=Xe(Ft(),1);var Jt=o((s,e)=>s<e?-1:s>e?1:0,"Bt"),dt=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s))return`[${s.map(c=>dt(c)).join(",")}]`;let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let c=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${c} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).toSorted(Jt),r=[];for(let c of a){let i=l[c];i!==void 0&&r.push(`${JSON.stringify(c)}:${dt(i)}`)}return`{${r.join(",")}}`},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"ht"),jt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Ht=o((s,e)=>jt(s,e),"Jt"),Wt=o(s=>jt(s.kind,s),"Ht"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"Xe"),Gt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Bt="FUNCTION_NOT_FOUND",Vt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Xt={counter:"secondary",gauge:"default",histogram:"outline"},Yt=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,c=ge();if(r===void 0){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let m=`mt-instrument-trace-${l}`,g;return e[3]!==n||e[4]!==m||e[5]!==r?(g=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":m,title:r,children:n}),e[3]=n,e[4]=m,e[5]=r,e[6]=g):g=e[6],g}let S=`mt-instrument-trace-${l}`,v;e[7]!==a||e[8]!==r?(v=o(()=>{a(r)},"v"),e[7]=a,e[8]=r,e[9]=v):v=e[9];let w;e[10]!==c||e[11]!==r?(w=c("Open the exemplar trace {trace}",{trace:r}),e[10]=c,e[11]=r,e[12]=w):w=e[12];let h;return e[13]!==n||e[14]!==S||e[15]!==v||e[16]!==w?(h=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":S,onClick:v,title:w,type:"button",children:n}),e[13]=n,e[14]=S,e[15]=v,e[16]=w,e[17]=h):h=e[17],h},"Vt"),Zt=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:S,errorSource:v}=Ee(Le.getMetricSeries,c,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let h;e[4]!==a?(h={live:!0,shardKey:a},e[4]=a,e[5]=h):h=e[5];let{data:m}=Ee(Le.getMetricHistory,w,h),g,y,q,M,d,p,f,x,k,_,N,I,D;if(e[6]!==n||e[7]!==S||e[8]!==v||e[9]!==m||e[10]!==l||e[11]!==r){x=Symbol.for("react.early_return_sentinel");e:{let L=Gt(n),T=xt(v)===Bt;if(S!==null&&!T){let u;e[25]!==r?(u=r("Instruments"),e[25]=r,e[26]=u):u=e[26];let P;e[27]!==u?(P=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[27]=u,e[28]=P):P=e[28];let U;e[29]!==S||e[30]!==r?(U=r("Instruments unavailable: {error}",{error:S}),e[29]=S,e[30]=r,e[31]=U):U=e[31];let F;e[32]!==U?(F=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:U}),e[32]=U,e[33]=F):F=e[33];let de;e[34]!==P||e[35]!==F?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[P,F]}),e[34]=P,e[35]=F,e[36]=de):de=e[36],x=de;break e}if(L.length===0){x=null;break e}let K=Vt(m),E;e[37]!==r?(E=o(u=>r(u==="counter"?"Counter":u==="gauge"?"Gauge":"Histogram"),"K"),e[37]=r,e[38]=E):E=e[38];let Q=E;d="flex flex-col gap-2",p="mt-instruments";let A;e[39]!==r?(A=r("Instruments"),e[39]=r,e[40]=A):A=e[40],e[41]!==A?(f=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:A}),e[41]=A,e[42]=f):f=e[42],M=fe,D="overflow-hidden py-0",q=pe,I="px-0",y=st,_="mt-instruments-table";let W;e[43]!==r?(W=r("name"),e[43]=r,e[44]=W):W=e[44];let G;e[45]!==W?(G=(0,t.jsx)(ce,{children:W}),e[45]=W,e[46]=G):G=e[46];let B;e[47]!==r?(B=r("kind"),e[47]=r,e[48]=B):B=e[48];let V;e[49]!==B?(V=(0,t.jsx)(ce,{children:B}),e[49]=B,e[50]=V):V=e[50];let X;e[51]!==r?(X=r("value"),e[51]=r,e[52]=X):X=e[52];let Y;e[53]!==X?(Y=(0,t.jsx)(ce,{className:"text-right",children:X}),e[53]=X,e[54]=Y):Y=e[54];let Z;e[55]!==r?(Z=r("count"),e[55]=r,e[56]=Z):Z=e[56];let ee;e[57]!==Z?(ee=(0,t.jsx)(ce,{className:"text-right",children:Z}),e[57]=Z,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==V||e[77]!==Y||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(N=(0,t.jsx)(lt,{children:(0,t.jsxs)(Pe,{children:[G,V,Y,ee,re,se,ne,oe]})}),e[75]=G,e[76]=V,e[77]=Y,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=N):N=e[83],g=nt,k=L.map(u=>{let P=zt(u.attributes),U=Pt(u.kind,u.name,u.attributes),F=(K.get(U)??[]).map(de=>Ht(u.kind,de));return(0,t.jsxs)(Pe,{"data-testid":`mt-instrument-${u.name}`,children:[(0,t.jsx)(H,{className:"font-mono text-xs",title:u.functionPath,children:u.name}),(0,t.jsx)(H,{children:(0,t.jsx)(We,{variant:Xt[u.kind],children:Q(u.kind)})}),(0,t.jsx)(H,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${u.name}`,children:ot(Wt(u))}),(0,t.jsx)(H,{className:"text-right tabular-nums text-muted-foreground",children:u.count.toLocaleString()}),(0,t.jsx)(H,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:u.min===u.max?"\u2014":`${ot(u.min)}\u2013${ot(u.max)}`}),(0,t.jsx)(H,{children:F.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:u.name}),className:"h-6 w-24 text-foreground",series:F,testId:`mt-instrument-trend-${u.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(H,{className:"font-mono text-xs",children:(0,t.jsx)(Yt,{name:u.name,onOpenTrace:l,traceId:u.exemplarTraceId})}),(0,t.jsx)(H,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:P,children:P===""?"\u2014":P})]},U)})}e[6]=n,e[7]=S,e[8]=v,e[9]=m,e[10]=l,e[11]=r,e[12]=g,e[13]=y,e[14]=q,e[15]=M,e[16]=d,e[17]=p,e[18]=f,e[19]=x,e[20]=k,e[21]=_,e[22]=N,e[23]=I,e[24]=D}else g=e[12],y=e[13],q=e[14],M=e[15],d=e[16],p=e[17],f=e[18],x=e[19],k=e[20],_=e[21],N=e[22],I=e[23],D=e[24];if(x!==Symbol.for("react.early_return_sentinel"))return x;let C;e[84]!==g||e[85]!==k?(C=(0,t.jsx)(g,{children:k}),e[84]=g,e[85]=k,e[86]=C):C=e[86];let $;e[87]!==y||e[88]!==C||e[89]!==_||e[90]!==N?($=(0,t.jsxs)(y,{"data-testid":_,children:[N,C]}),e[87]=y,e[88]=C,e[89]=_,e[90]=N,e[91]=$):$=e[91];let b;e[92]!==q||e[93]!==$||e[94]!==I?(b=(0,t.jsx)(q,{className:I,children:$}),e[92]=q,e[93]=$,e[94]=I,e[95]=b):b=e[95];let R;e[96]!==M||e[97]!==b||e[98]!==D?(R=(0,t.jsx)(M,{className:D,children:b}),e[96]=M,e[97]=b,e[98]=D,e[99]=R):R=e[99];let O;return e[100]!==d||e[101]!==p||e[102]!==f||e[103]!==R?(O=(0,t.jsxs)("section",{className:d,"data-testid":p,children:[f,R]}),e[100]=d,e[101]=p,e[102]=f,e[103]=R,e[104]=O):O=e[104],O},"Zt"),er=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),c;e[0]!==r?(c=r("Shards"),e[0]=r,e[1]=c):c=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==c||e[7]!==i?(n=(0,t.jsx)(me,{label:c,testId:"mt-agg-shards",value:i}),e[6]=c,e[7]=i,e[8]=n):n=e[8];let S;e[9]!==r?(S=r("Total requests"),e[9]=r,e[10]=S):S=e[10];let v;e[11]!==l.totalRequests||e[12]!==S?(v=(0,t.jsx)(me,{label:S,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=S,e[13]=v):v=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let h;e[16]!==l.totalErrors||e[17]!==w?(h=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=h):h=e[18];let m;e[19]!==r?(m=r("Total database size"),e[19]=r,e[20]=m):m=e[20];let g;e[21]!==l.totalDatabaseSize?(g=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=(0,t.jsx)(me,{label:m,testId:"mt-agg-db-size",value:g}),e[23]=m,e[24]=g,e[25]=y):y=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let M;e[28]!==l.hitRate||e[29]!==r?(M=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=M):M=e[30];let d;e[31]!==q||e[32]!==M?(d=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:M}),e[31]=q,e[32]=M,e[33]=d):d=e[33];let p;e[34]!==y||e[35]!==d||e[36]!==n||e[37]!==v||e[38]!==h?(p=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,v,h,y,d]}),e[34]=y,e[35]=d,e[36]=n,e[37]=v,e[38]=h,e[39]=p):p=e[39];let f;e[40]!==r?(f=r("shard"),e[40]=r,e[41]=f):f=e[41];let x;e[42]!==f?(x=(0,t.jsx)(ce,{children:f}),e[42]=f,e[43]=x):x=e[43];let k;e[44]!==r?(k=r("requests"),e[44]=r,e[45]=k):k=e[45];let _;e[46]!==k?(_=(0,t.jsx)(ce,{children:k}),e[46]=k,e[47]=_):_=e[47];let N;e[48]!==r?(N=r("errors"),e[48]=r,e[49]=N):N=e[49];let I;e[50]!==N?(I=(0,t.jsx)(ce,{children:N}),e[50]=N,e[51]=I):I=e[51];let D;e[52]!==r?(D=r("db size"),e[52]=r,e[53]=D):D=e[53];let C;e[54]!==D?(C=(0,t.jsx)(ce,{children:D}),e[54]=D,e[55]=C):C=e[55];let $;e[56]!==x||e[57]!==_||e[58]!==I||e[59]!==C?($=(0,t.jsx)(lt,{children:(0,t.jsxs)(Pe,{children:[x,_,I,C]})}),e[56]=x,e[57]=_,e[58]=I,e[59]=C,e[60]=$):$=e[60];let b;if(e[61]!==a||e[62]!==r){let T;e[64]!==r?(T=o(K=>(0,t.jsxs)(Pe,{"data-testid":`mt-agg-row-${K.shard}`,children:[(0,t.jsx)(H,{children:K.shard}),K.metrics===null?(0,t.jsx)(H,{className:"text-destructive",colSpan:3,children:K.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H,{className:"tabular-nums",children:K.metrics.requests}),(0,t.jsx)(H,{className:"tabular-nums",children:K.metrics.errors}),(0,t.jsx)(H,{className:"tabular-nums",children:Ge(K.metrics.databaseSize)})]})]},K.shard),"A"),e[64]=r,e[65]=T):T=e[65],b=a.map(T),e[61]=a,e[62]=r,e[63]=b}else b=e[63];let R;e[66]!==b?(R=(0,t.jsx)(nt,{children:b}),e[66]=b,e[67]=R):R=e[67];let O;e[68]!==$||e[69]!==R?(O=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[$,R]})})}),e[68]=$,e[69]=R,e[70]=O):O=e[70];let L;return e[71]!==p||e[72]!==O?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[p,O]}),e[71]=p,e[72]=O,e[73]=L):L=e[73],L},"er"),tr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"tr"),rr=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"rr"),Et=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ot"),ar=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:c,metrics:i}=s,n=ge(),S;e[0]!==r||e[1]!==n?(S=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=S):S=e[2];let v;e[3]!==l||e[4]!==r.length||e[5]!==n?(v=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=v):v=e[6];let w;e[7]!==n?(w=n("Requests"),e[7]=n,e[8]=w):w=e[8];let h;e[9]!==i.requests||e[10]!==S||e[11]!==v||e[12]!==w?(h=(0,t.jsx)(me,{chart:S,footer:v,label:w,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=S,e[11]=v,e[12]=w,e[13]=h):h=e[13];let m;e[14]!==a||e[15]!==n?(m=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=m):m=e[16];let g;e[17]!==n?(g=n("Errors"),e[17]=n,e[18]=g):g=e[18];let y;e[19]!==a||e[20]!==i.errors?(y=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=y):y=e[21];let q;e[22]!==m||e[23]!==g||e[24]!==y?(q=(0,t.jsx)(me,{footer:m,label:g,testId:"mt-errors",value:y}),e[22]=m,e[23]=g,e[24]=y,e[25]=q):q=e[25];let M;e[26]!==c.p90?(M=c.p90>0?`P90 ${Et(c.p90)}`:void 0,e[26]=c.p90,e[27]=M):M=e[27];let d;e[28]!==n?(d=n("P95 latency"),e[28]=n,e[29]=d):d=e[29];let p;e[30]!==c.p95?(p=c.p95>0?Et(c.p95):"\u2014",e[30]=c.p95,e[31]=p):p=e[31];let f;e[32]!==d||e[33]!==p||e[34]!==M?(f=(0,t.jsx)(me,{footer:M,label:d,testId:"mt-p95",value:p}),e[32]=d,e[33]=p,e[34]=M,e[35]=f):f=e[35];let x;e[36]!==i.cache||e[37]!==n?(x=i.cache===null?void 0:`${i.cache.entries.toLocaleString()} ${n("cache entries")}`,e[36]=i.cache,e[37]=n,e[38]=x):x=e[38];let k;e[39]!==n?(k=n("Database size"),e[39]=n,e[40]=k):k=e[40];let _;e[41]!==i.databaseSize?(_=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=_):_=e[42];let N;e[43]!==x||e[44]!==k||e[45]!==_?(N=(0,t.jsx)(me,{footer:x,label:k,testId:"mt-db-size",value:_}),e[43]=x,e[44]=k,e[45]=_,e[46]=N):N=e[46];let I;e[47]!==n?(I=n("Shard"),e[47]=n,e[48]=I):I=e[48];let D;e[49]!==i.shard||e[50]!==I?(D=(0,t.jsx)(me,{label:I,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=I,e[51]=D):D=e[51];let C;e[52]!==n?(C=n("Uptime"),e[52]=n,e[53]=C):C=e[53];let $;e[54]!==i.uptimeMs?($=tr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=$):$=e[55];let b;e[56]!==C||e[57]!==$?(b=(0,t.jsx)(me,{label:C,testId:"mt-uptime",value:$}),e[56]=C,e[57]=$,e[58]=b):b=e[58];let R;e[59]!==n?(R=n("Cache hit rate"),e[59]=n,e[60]=R):R=e[60];let O;e[61]!==i.cache||e[62]!==n?(O=i.cache===null?n("no cache configured"):n("{rate} ({count} entries)",{count:i.cache.entries,rate:rr(i.cache.hits,i.cache.misses)}),e[61]=i.cache,e[62]=n,e[63]=O):O=e[63];let L;e[64]!==R||e[65]!==O?(L=(0,t.jsx)(me,{label:R,testId:"mt-cache",value:O}),e[64]=R,e[65]=O,e[66]=L):L=e[66];let T;return e[67]!==f||e[68]!==N||e[69]!==D||e[70]!==b||e[71]!==L||e[72]!==h||e[73]!==q?(T=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[h,q,f,N,D,b,L]}),e[67]=f,e[68]=N,e[69]=D,e[70]=b,e[71]=L,e[72]=h,e[73]=q,e[74]=T):T=e[74],T},"ar"),Ve=o(s=>s>=100?"critical":s>=50?"warning":"good","Ge"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Oe"),Be=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"Be"),sr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"lr"),lr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"sr"),nr=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,c]=(0,j.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,S]=(0,j.useState)(i),v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=o(D=>{D!==null&&c(D)},"v"),e[1]=v):v=e[1];let w=v,h,m,g,y,q,M,d,p,f,x;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){g=Symbol.for("react.early_return_sentinel");e:{let D=lr(l,r),C;e[16]!==l?(C=l.filter(ir),e[16]=l,e[17]=C):C=e[17];let $=C.length,b;e[18]!==l?(b=l.filter(or),e[18]=l,e[19]=b):b=e[19];let R=b.length,O;e[20]!==l?(O=l.filter(dr),e[20]=l,e[21]=O):O=e[21];let L=O.length,T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=o(z=>{S(ue=>{let J=new Set(ue);return J.has(z)?J.delete(z):J.add(z),J})},"A"),e[22]=T):T=e[22];let K=T;if(l.length===0){let z;e[23]!==a?(z=a("No query insights yet"),e[23]=a,e[24]=z):z=e[24];let ue;e[25]!==z?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:z}),e[25]=z,e[26]=ue):ue=e[26];let J;e[27]!==a?(J=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=J):J=e[28];let he;e[29]!==J?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:J}),e[29]=J,e[30]=he):he=e[30];let He;e[31]!==ue||e[32]!==he?(He=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=He):He=e[33],g=He;break e}d="space-y-4",p="qi-root";let E;e[34]!==a?(E=a("Critical queries"),e[34]=a,e[35]=E):E=e[35];let Q;e[36]!==E?(Q=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Te,{className:"text-sm font-medium",children:E})}),e[36]=E,e[37]=Q):Q=e[37];let A;e[38]!==$?(A=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:$}),e[38]=$,e[39]=A):A=e[39];let W;e[40]!==a?(W=a(">100ms avg execution"),e[40]=a,e[41]=W):W=e[41];let G;e[42]!==W?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:W}),e[42]=W,e[43]=G):G=e[43];let B;e[44]!==A||e[45]!==G?(B=(0,t.jsxs)(pe,{children:[A,G]}),e[44]=A,e[45]=G,e[46]=B):B=e[46];let V;e[47]!==Q||e[48]!==B?(V=(0,t.jsxs)(fe,{children:[Q,B]}),e[47]=Q,e[48]=B,e[49]=V):V=e[49];let X;e[50]!==a?(X=a("Moderate queries"),e[50]=a,e[51]=X):X=e[51];let Y;e[52]!==X?(Y=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Te,{className:"text-sm font-medium",children:X})}),e[52]=X,e[53]=Y):Y=e[53];let Z;e[54]!==R?(Z=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:R}),e[54]=R,e[55]=Z):Z=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==Z||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[Z,te]}),e[60]=Z,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Y||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Y,re]}),e[63]=Y,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Te,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==L?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:L}),e[70]=L,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let u;e[76]!==ne||e[77]!==oe?(u=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=u):u=e[78];let P;e[79]!==le||e[80]!==u?(P=(0,t.jsxs)(fe,{children:[le,u]}),e[79]=le,e[80]=u,e[81]=P):P=e[81],e[82]!==V||e[83]!==ae||e[84]!==P?(f=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[V,ae,P]}),e[82]=V,e[83]=ae,e[84]=P,e[85]=f):f=e[85];let U;e[86]!==a?(U=a("Query leaderboard"),e[86]=a,e[87]=U):U=e[87];let F;e[88]!==U?(F=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:U}),e[88]=U,e[89]=F):F=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==F||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[F,be]}),e[95]=F,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Ue;e[104]===Symbol.for("react.memo_cache_sentinel")?(Ue=(0,t.jsx)(It,{}),e[104]=Ue):Ue=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(Ct,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Ue}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let ke;e[109]!==qe?(ke=(0,t.jsx)(je,{value:"totalTime",children:qe}),e[109]=qe,e[110]=ke):ke=e[110];let $e;e[111]!==a?($e=a("Avg time"),e[111]=a,e[112]=$e):$e=e[112];let Me;e[113]!==$e?(Me=(0,t.jsx)(je,{value:"avgTime",children:$e}),e[113]=$e,e[114]=Me):Me=e[114];let _e;e[115]!==a?(_e=a("Execution count"),e[115]=a,e[116]=_e):_e=e[116];let De;e[117]!==_e?(De=(0,t.jsx)(je,{value:"execCount",children:_e}),e[117]=_e,e[118]=De):De=e[118];let Ie;e[119]!==a?(Ie=a("Rows read"),e[119]=a,e[120]=Ie):Ie=e[120];let Ce;e[121]!==Ie?(Ce=(0,t.jsx)(je,{value:"rowsRead",children:Ie}),e[121]=Ie,e[122]=Ce):Ce=e[122];let Re;e[123]!==ke||e[124]!==Me||e[125]!==De||e[126]!==Ce?(Re=(0,t.jsxs)(Rt,{children:[ke,Me,De,Ce]}),e[123]=ke,e[124]=Me,e[125]=De,e[126]=Ce,e[127]=Re):Re=e[127];let ze;e[128]!==r||e[129]!==we||e[130]!==Re?(ze=(0,t.jsxs)(Dt,{onValueChange:w,value:r,children:[we,Re]}),e[128]=r,e[129]=we,e[130]=Re,e[131]=ze):ze=e[131];let Oe;e[132]!==Ne||e[133]!==ze?(Oe=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,ze]}),e[132]=Ne,e[133]=ze,e[134]=Oe):Oe=e[134],e[135]!==ve||e[136]!==Oe?(x=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Oe]}),e[135]=ve,e[136]=Oe,e[137]=x):x=e[137],m=fe;let Ke;e[138]!==a?(Ke=a("Statements"),e[138]=a,e[139]=Ke):Ke=e[139];let Fe;e[140]!==Ke?(Fe=(0,t.jsx)(Te,{children:Ke}),e[140]=Ke,e[141]=Fe):Fe=e[141],M=(0,t.jsxs)(Ae,{children:[Fe,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:D.length})})]}),h=pe,y="space-y-2";let Je;e[142]!==n||e[143]!==a?(Je=o(z=>{let ue=z.normalizedSql,J=n.has(ue),he=Ve(z.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":J,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{K(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(sr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:z.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(z.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(z.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),z.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(z.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Be(z.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),J&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:z.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[z.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(z.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(z.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(z.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(z.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Be(z.rowsWritten)})]})]})]})]},ue)},"Ee"),e[142]=n,e[143]=a,e[144]=Je):Je=e[144],q=D.map(Je)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=h,e[7]=m,e[8]=g,e[9]=y,e[10]=q,e[11]=M,e[12]=d,e[13]=p,e[14]=f,e[15]=x}else h=e[6],m=e[7],g=e[8],y=e[9],q=e[10],M=e[11],d=e[12],p=e[13],f=e[14],x=e[15];if(g!==Symbol.for("react.early_return_sentinel"))return g;let k;e[145]!==y||e[146]!==q?(k=(0,t.jsx)("div",{className:y,children:q}),e[145]=y,e[146]=q,e[147]=k):k=e[147];let _;e[148]!==h||e[149]!==k?(_=(0,t.jsx)(h,{children:k}),e[148]=h,e[149]=k,e[150]=_):_=e[150];let N;e[151]!==m||e[152]!==_||e[153]!==M?(N=(0,t.jsxs)(m,{children:[M,_]}),e[151]=m,e[152]=_,e[153]=M,e[154]=N):N=e[154];let I;return e[155]!==N||e[156]!==d||e[157]!==p||e[158]!==f||e[159]!==x?(I=(0,t.jsxs)("div",{className:d,"data-testid":p,children:[f,x,N]}),e[155]=N,e[156]=d,e[157]=p,e[158]=f,e[159]=x,e[160]=I):I=e[160],I},"nr");function ir(s){return Ve(s.avgDurationMs)==="critical"}o(ir,"ir");function or(s){return Ve(s.avgDurationMs)==="warning"}o(or,"or");function dr(s){return Ve(s.avgDurationMs)==="good"}o(dr,"cr");var cr=["1m","5m","15m","1h"],mr=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"mr"),ur=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:mr(e.bucketMs)})),"ur"),hr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,j.useState)("15m"),r=Ee(Le.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,c=ur(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:cr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),c.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ze,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:c,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ze,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:c,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(nr,{queryStats:r?.entries??[]})]})},"hr"),gr=gt(Le.getMetrics),fr=o((s,e)=>s?e:"overview","fr"),Er=o(({initialShardKey:s})=>{let e=ct(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:c}=$t(s),[i,n]=(0,j.useState)("overview"),[S,v]=(0,j.useState)([]),w=(0,j.useRef)(null),h=(0,j.useRef)(null),m=(0,j.useRef)(!0);(0,j.useEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]);let g=Ot(a),{data:y,error:q,liveError:M}=Ee(Le.getMetrics,{},{live:!0,shardKey:a}),d=y??null;(0,j.useEffect)(()=>{if(y===void 0)return;qt(a);let K=y,E=w.current,Q=h.current!==null&&h.current!==K.shard;if(h.current=K.shard,w.current=K.requests,Q){v([]);return}E!==null&&K.requests>=E&&v(A=>[...A,K.requests-E].slice(-30))},[y,a]);let[p,f]=(0,j.useState)(null),[x,k]=(0,j.useState)(!1),_=o(async()=>{k(!0);let K=Lt(c,wt());try{let E=await Promise.all(K.map(async Q=>{try{let A=await e.query(gr,{},ft(Q));return{error:null,metrics:A,shard:Q===""?A.shard:Q}}catch(A){return{error:pt(A),metrics:null,shard:Q===""?"__root__":Q}}}));m.current&&f(E)}finally{m.current&&k(!1)}},"_"),N=p===null?null:Kt(p),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,D=S.length>0?S.at(-1):0,C=d?At(d):{p90:0,p95:0},$=(0,j.useMemo)(()=>{if(!d||!("queryStats"in d))return;let K=d.queryStats;if(!(!K||!Array.isArray(K)))return Tt(K)},[d]),b=fr($!==void 0,i),R=o(()=>{bt(_())},"D"),O=o(()=>{f(null)},"L"),L=o(()=>{n("overview")},"O"),T=o(()=>{n("query-insights")},"A");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(kt,{onChange:r,testId:"mt-shard-input",value:c}),(0,t.jsx)(Mt,{message:M,prefix:"mt"}),(0,t.jsx)(Ye,{"data-testid":"mt-aggregate",disabled:x,onClick:R,size:"sm",type:"button",variant:"secondary",children:l(x?"Aggregating\u2026":"All shards")}),p!==null&&(0,t.jsx)(Ye,{"data-testid":"mt-aggregate-clear",onClick:O,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:_t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),$!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${b==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:L,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${b==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:T,type:"button",children:[l("Query insights"),$.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:$.length})]})]}),b==="query-insights"&&$!==void 0&&(0,t.jsx)(hr,{shardKey:a}),b==="overview"&&d!==null&&(0,t.jsx)(ar,{currentDelta:D,errorRate:I,history:S,latencyPercentiles:C,metrics:d}),b==="overview"&&d===null&&null,b==="overview"&&(0,t.jsx)(Zt,{onOpenTrace:g,shardKey:a}),b==="overview"&&N!==null&&p!==null&&(0,t.jsx)(er,{aggregate:N,shardResults:p})]})},"Ur");export{Er as MetricsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunk-AVAC26HJ.js";import{a as t}from"./chunk-3XIESWL4.js";var s=t((o,i,m)=>h(o,e=>{i(e.height>0?e:{height:m,width:e.width})}),"m");export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Qe}from"./chunk-3DH35OZ5.js";import{a as Me}from"./chunk-DGRAPESO.js";import{a as Ve}from"./chunk-ESVP44Y3.js";import{a as Je}from"./chunk-3SCGCJYS.js";import{a as D}from"./chunk-5Y3QLNWX.js";import{a as He}from"./chunk-54MMVNPT.js";import{a as Ke}from"./chunk-FURI47Z2.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{R as B}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{a as z}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as T}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as Ge}from"./chunk-BQNVN2OD.js";import{f as E}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as Ze}from"./chunk-XQCVZAGU.js";import{a as Ue,b as _e,c as $e,d as L,e as U,f as _}from"./chunk-WJQLNYGX.js";import{a as we,e as Ce}from"./chunk-WQH3LT2P.js";import{d as W,h as je,m as Ae,o as ze,r as Ie}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as r,e as Le,f as Ye,g as et,h as tt}from"./chunk-3XIESWL4.js";var k=Le(Ye(),1);var Z=Le(et(),1);var t=Le(tt(),1);var at=r(()=>{let u=(0,Z.c)(3),{config:e,ready:l}=Me(),s;return u[0]!==e.capabilities||u[1]!==l?(s={capabilities:e.capabilities,ready:l},u[0]=e.capabilities,u[1]=l,u[2]=s):s=u[2],s},"et"),st={boolean:"checkbox",date:"datetime-local",number:"number",string:"text"},lt=r((u,e)=>u.type==="boolean"?!0:typeof e!="string"||e.trim()===""?!1:u.type!=="number"||!Number.isNaN(Number(e.trim())),"at"),rt=r((u,e)=>{if(u.type==="boolean")return e===!0?{value:!0}:u.required?{value:!1}:void 0;let l=typeof e=="string"?e.trim():"";if(l!==""){if(u.type==="number"){let s=Number(l);return Number.isNaN(s)?void 0:{value:s}}return{value:l}}},"lt"),it=r(u=>{let e=(0,Z.c)(105),{onClose:l,onCreated:s}=u,c=E(),a=W(),{config:o}=Me(),{busy:i,error:n,run:m}=Je(),[w,S]=(0,k.useState)(""),[b,C]=(0,k.useState)(""),[y,I]=(0,k.useState)(""),[h,g]=(0,k.useState)(""),v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={},e[0]=v):v=e[0];let[f,d]=(0,k.useState)(v),A;e[1]===Symbol.for("react.memo_cache_sentinel")?(A=r(p=>{S(p.target.value)},"C"),e[1]=A):A=e[1];let x=A,F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r(p=>{C(p.target.value)},"F"),e[2]=F):F=e[2];let O=F,P;e[3]===Symbol.for("react.memo_cache_sentinel")?(P=r(p=>{I(p.target.value)},"P"),e[3]=P):P=e[3];let Be=P,G;e[4]===Symbol.for("react.memo_cache_sentinel")?(G=r(p=>{g(p.target.value)},"O"),e[4]=G):G=e[4];let Te=G,H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=r((p,$)=>{d(V=>({...V,[p]:$}))},"G"),e[5]=H):H=e[5];let Pe=H,J;e[6]!==f?(J=r(p=>f[p.name]??(p.type==="boolean"?!1:""),"H"),e[6]=f,e[7]=J):J=e[7];let R=J,K;if(e[8]!==o.userFields||e[9]!==R){let p;e[11]!==R?(p=r($=>!$.required||lt($,R($)),"p"),e[11]=R,e[12]=p):p=e[12],K=o.userFields.every(p),e[8]=o.userFields,e[9]=R,e[10]=K}else K=e[10];let Fe=K,Q;e[13]!==i||e[14]!==w||e[15]!==b||e[16]!==Fe?(Q=!i&&w.trim()!==""&&b.trim()!==""&&Fe,e[13]=i,e[14]=w,e[15]=b,e[16]=Fe,e[17]=Q):Q=e[17];let De=Q,X;e[18]!==o.userFields||e[19]!==R?(X=r(()=>{let p={};for(let $ of o.userFields){let V=rt($,R($));V!==void 0&&(p[$.name]=V.value)}return Object.keys(p).length===0?void 0:p},"W"),e[18]=o.userFields,e[19]=R,e[20]=X):X=e[20];let Se=X,Y;e[21]!==Se||e[22]!==c||e[23]!==w||e[24]!==b||e[25]!==l||e[26]!==s||e[27]!==y||e[28]!==h||e[29]!==m?(Y=r(()=>{m(async()=>{await c.createAuthUser({data:Se(),email:w.trim(),name:b.trim(),password:y===""?void 0:y,role:h.trim()===""?void 0:h.trim()}),s(),l()})},"Z"),e[21]=Se,e[22]=c,e[23]=w,e[24]=b,e[25]=l,e[26]=s,e[27]=y,e[28]=h,e[29]=m,e[30]=Y):Y=e[30];let N=Y,j;e[31]!==a?(j=a("Create user"),e[31]=a,e[32]=j):j=e[32];let q;e[33]!==a?(q=a("Create user"),e[33]=a,e[34]=q):q=e[34];let M;e[35]!==q?(M=(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:q}),e[35]=q,e[36]=M):M=e[36];let ee;e[37]!==a?(ee=a("email"),e[37]=a,e[38]=ee):ee=e[38];let te;e[39]!==ee?(te=(0,t.jsx)(D,{htmlFor:"uc-email",children:ee}),e[39]=ee,e[40]=te):te=e[40];let ae;e[41]!==w?(ae=(0,t.jsx)(B,{"data-testid":"uc-email",id:"uc-email",onChange:x,type:"email",value:w}),e[41]=w,e[42]=ae):ae=e[42];let se;e[43]!==te||e[44]!==ae?(se=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[te,ae]}),e[43]=te,e[44]=ae,e[45]=se):se=e[45];let le;e[46]!==a?(le=a("name"),e[46]=a,e[47]=le):le=e[47];let re;e[48]!==le?(re=(0,t.jsx)(D,{htmlFor:"uc-name",children:le}),e[48]=le,e[49]=re):re=e[49];let ie;e[50]!==b?(ie=(0,t.jsx)(B,{"data-testid":"uc-name",id:"uc-name",onChange:O,value:b}),e[50]=b,e[51]=ie):ie=e[51];let ne;e[52]!==re||e[53]!==ie?(ne=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[re,ie]}),e[52]=re,e[53]=ie,e[54]=ne):ne=e[54];let de;e[55]!==a?(de=a("Password (optional)"),e[55]=a,e[56]=de):de=e[56];let oe;e[57]!==de?(oe=(0,t.jsx)(D,{htmlFor:"uc-password",children:de}),e[57]=de,e[58]=oe):oe=e[58];let ce;e[59]!==y?(ce=(0,t.jsx)(B,{"data-testid":"uc-password",id:"uc-password",onChange:Be,type:"password",value:y}),e[59]=y,e[60]=ce):ce=e[60];let ue;e[61]!==oe||e[62]!==ce?(ue=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[oe,ce]}),e[61]=oe,e[62]=ce,e[63]=ue):ue=e[63];let me;e[64]!==a?(me=a("Role (optional)"),e[64]=a,e[65]=me):me=e[65];let he;e[66]!==me?(he=(0,t.jsx)(D,{htmlFor:"uc-role",children:me}),e[66]=me,e[67]=he):he=e[67];let pe;e[68]!==h?(pe=(0,t.jsx)(B,{"data-testid":"uc-role",id:"uc-role",onChange:Te,value:h}),e[68]=h,e[69]=pe):pe=e[69];let fe;e[70]!==he||e[71]!==pe?(fe=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[he,pe]}),e[70]=he,e[71]=pe,e[72]=fe):fe=e[72];let ve;e[73]!==o.userFields||e[74]!==R||e[75]!==a?(ve=o.userFields.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border pt-3","data-testid":"uc-plugin-fields",children:[(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Plugin fields")}),o.userFields.map(p=>{let $=`uc-field-${p.name}`,V=p.required?"":` (${a("optional")})`;if(p.type==="boolean"){let qe=R(p)===!0;return(0,t.jsxs)("label",{className:"flex items-center gap-2",htmlFor:$,children:[(0,t.jsx)(Qe,{checked:qe,"data-testid":$,id:$,onCheckedChange:r(Xe=>{Pe(p.name,Xe)},"onCheckedChange")}),(0,t.jsxs)("span",{className:"text-sm",children:[p.name,V]})]},p.name)}let We=R(p);return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)(D,{htmlFor:$,children:[p.name,V]}),(0,t.jsx)(B,{"data-testid":$,id:$,onChange:r(qe=>{Pe(p.name,qe.target.value)},"onChange"),type:st[p.type],value:typeof We=="string"?We:""})]},p.name)})]}),e[73]=o.userFields,e[74]=R,e[75]=a,e[76]=ve):ve=e[76];let xe;e[77]!==n?(xe=n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"uc-error",role:"alert",children:n}),e[77]=n,e[78]=xe):xe=e[78];let be;e[79]!==a?(be=a("Cancel"),e[79]=a,e[80]=be):be=e[80];let ye;e[81]!==l||e[82]!==be?(ye=(0,t.jsx)(z,{"data-testid":"uc-cancel",onClick:l,size:"sm",type:"button",variant:"outline",children:be}),e[81]=l,e[82]=be,e[83]=ye):ye=e[83];let Oe=!De,ge;e[84]!==i||e[85]!==a?(ge=a(i?"Creating\u2026":"Create"),e[84]=i,e[85]=a,e[86]=ge):ge=e[86];let Ne;e[87]!==N||e[88]!==Oe||e[89]!==ge?(Ne=(0,t.jsx)(z,{"data-testid":"uc-submit",disabled:Oe,onClick:N,size:"sm",type:"button",children:ge}),e[87]=N,e[88]=Oe,e[89]=ge,e[90]=Ne):Ne=e[90];let ke;e[91]!==ye||e[92]!==Ne?(ke=(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[ye,Ne]}),e[91]=ye,e[92]=Ne,e[93]=ke):ke=e[93];let Re;return e[94]!==l||e[95]!==j||e[96]!==M||e[97]!==se||e[98]!==ne||e[99]!==ue||e[100]!==fe||e[101]!==ve||e[102]!==xe||e[103]!==ke?(Re=(0,t.jsxs)(Ve,{label:j,onClose:l,panelTestId:"uc-dialog",testId:"uc-overlay",variant:"dialog",children:[M,se,ne,ue,fe,ve,xe,ke]}),e[94]=l,e[95]=j,e[96]=M,e[97]=se,e[98]=ne,e[99]=ue,e[100]=fe,e[101]=ve,e[102]=xe,e[103]=ke,e[104]=Re):Re=e[104],Re},"st"),Ee=r(u=>{let e=(0,Z.c)(2),{children:l}=u,s;return e[0]!==l?(s=(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=s):s=e[1],s},"Le"),nt=r(u=>{let e=(0,Z.c)(29),{busy:l,runAction:s,userId:c,version:a}=u,o=E(),i=W(),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(null),b;e[0]!==o||e[1]!==c?(b=r(()=>{ze((async()=>{S(null);try{let x=await o.listAuthSessions({limit:50,userId:c});m(x.rows)}catch(x){let F=x;m(null),S(je(F))}})())},"x"),e[0]=o,e[1]=c,e[2]=b):b=e[2];let C;e[3]!==o||e[4]!==c||e[5]!==a?(C=[o,c,a],e[3]=o,e[4]=c,e[5]=a,e[6]=C):C=e[6],(0,k.useEffect)(b,C);let y;e[7]!==o||e[8]!==s?(y=r(x=>{s(()=>o.revokeAuthSession({sessionId:x}))},"y"),e[7]=o,e[8]=s,e[9]=y):y=e[9];let I=y,h;e[10]!==i?(h=i("Sessions"),e[10]=i,e[11]=h):h=e[11];let g;e[12]!==h?(g=(0,t.jsx)(Ee,{children:h}),e[12]=h,e[13]=g):g=e[13];let v;e[14]!==w?(v=w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-sessions-error",role:"alert",children:w}),e[14]=w,e[15]=v):v=e[15];let f;e[16]!==n||e[17]!==i?(f=n!==null&&n.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ud-sessions-empty",children:i("No active sessions.")}),e[16]=n,e[17]=i,e[18]=f):f=e[18];let d;e[19]!==l||e[20]!==I||e[21]!==n||e[22]!==i?(d=n!==null&&n.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"ud-sessions-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(U,{children:i("expires")}),(0,t.jsx)(U,{children:i("ip")}),(0,t.jsx)(U,{children:i("user agent")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)($e,{children:n.map(x=>(0,t.jsxs)(L,{"data-testid":`ud-session-${x.id}`,children:[(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(x.expiresAt)}),(0,t.jsx)(_,{children:x.ipAddress??""}),(0,t.jsx)(_,{className:"max-w-40 truncate",children:x.userAgent??""}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`ud-revoke-${x.id}`,disabled:l,onClick:r(()=>{I(x.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Revoke")})})]},x.id))})]})})}),e[19]=l,e[20]=I,e[21]=n,e[22]=i,e[23]=d):d=e[23];let A;return e[24]!==g||e[25]!==v||e[26]!==f||e[27]!==d?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-sessions",children:[g,v,f,d]}),e[24]=g,e[25]=v,e[26]=f,e[27]=d,e[28]=A):A=e[28],A},"rt"),dt=r(u=>{let e=(0,Z.c)(30),{busy:l,runAction:s,userId:c,version:a}=u,o=E(),i=W(),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(null),b;e[0]!==o||e[1]!==c?(b=r(()=>{ze((async()=>{S(null);try{m(await o.listAuthAccounts({userId:c}))}catch(x){let F=x;m(null),S(je(F))}})())},"x"),e[0]=o,e[1]=c,e[2]=b):b=e[2];let C;e[3]!==o||e[4]!==c||e[5]!==a?(C=[o,c,a],e[3]=o,e[4]=c,e[5]=a,e[6]=C):C=e[6],(0,k.useEffect)(b,C);let y;e[7]!==o||e[8]!==s||e[9]!==c?(y=r(x=>{s(()=>o.unlinkAuthAccount({accountId:x,userId:c}))},"y"),e[7]=o,e[8]=s,e[9]=c,e[10]=y):y=e[10];let I=y,h;e[11]!==i?(h=i("Linked accounts"),e[11]=i,e[12]=h):h=e[12];let g;e[13]!==h?(g=(0,t.jsx)(Ee,{children:h}),e[13]=h,e[14]=g):g=e[14];let v;e[15]!==w?(v=w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:w}),e[15]=w,e[16]=v):v=e[16];let f;e[17]!==n||e[18]!==i?(f=n!==null&&n.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("No linked accounts.")}),e[17]=n,e[18]=i,e[19]=f):f=e[19];let d;e[20]!==n||e[21]!==l||e[22]!==I||e[23]!==i?(d=n!==null&&n.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"ud-accounts-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(U,{children:i("provider")}),(0,t.jsx)(U,{children:i("created")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)($e,{children:n.map(x=>{let F=Ae(x.id);return(0,t.jsxs)(L,{"data-testid":`ud-account-${F}`,children:[(0,t.jsx)(_,{children:Ae(x.providerId)}),(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(x.createdAt)}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`ud-unlink-${F}`,disabled:l,onClick:r(()=>{I(F)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Unlink")})})]},F)})})]})})}),e[20]=n,e[21]=l,e[22]=I,e[23]=i,e[24]=d):d=e[24];let A;return e[25]!==g||e[26]!==v||e[27]!==f||e[28]!==d?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-accounts",children:[g,v,f,d]}),e[25]=g,e[26]=v,e[27]=f,e[28]=d,e[29]=A):A=e[29],A},"it"),ot=r(u=>{let e=(0,Z.c)(40),{busy:l,capabilities:s,runAction:c,userId:a,version:o}=u,i=E(),n=W(),[m,w]=(0,k.useState)(null),S;e[0]!==s.passkey||e[1]!==i||e[2]!==a?(S=r(()=>{s.passkey&&ze((async()=>{try{w(await i.listAuthPasskeys({userId:a}))}catch{w(null)}})())},"I"),e[0]=s.passkey,e[1]=i,e[2]=a,e[3]=S):S=e[3];let b;e[4]!==s.passkey||e[5]!==i||e[6]!==a||e[7]!==o?(b=[s.passkey,i,a,o],e[4]=s.passkey,e[5]=i,e[6]=a,e[7]=o,e[8]=b):b=e[8],(0,k.useEffect)(S,b);let C;e[9]!==i||e[10]!==c||e[11]!==a?(C=r(()=>{c(()=>i.disableAuthTwoFactor({userId:a}))},"w"),e[9]=i,e[10]=c,e[11]=a,e[12]=C):C=e[12];let y=C,I;e[13]!==i||e[14]!==c?(I=r(F=>{c(()=>i.deleteAuthPasskey({passkeyId:F}))},"A"),e[13]=i,e[14]=c,e[15]=I):I=e[15];let h=I,g;e[16]!==n?(g=n("Security"),e[16]=n,e[17]=g):g=e[17];let v;e[18]!==g?(v=(0,t.jsx)(Ee,{children:g}),e[18]=g,e[19]=v):v=e[19];let f;e[20]!==l||e[21]!==s.twoFactor||e[22]!==y||e[23]!==n?(f=s.twoFactor&&(0,t.jsx)(z,{"data-testid":"ud-disable-2fa",disabled:l,onClick:y,size:"sm",type:"button",variant:"outline",children:n("Disable two-factor")}),e[20]=l,e[21]=s.twoFactor,e[22]=y,e[23]=n,e[24]=f):f=e[24];let d;e[25]!==s.passkey||e[26]!==m||e[27]!==n?(d=s.passkey&&m!==null&&m.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("No passkeys.")}),e[25]=s.passkey,e[26]=m,e[27]=n,e[28]=d):d=e[28];let A;e[29]!==l||e[30]!==s.passkey||e[31]!==h||e[32]!==m||e[33]!==n?(A=s.passkey&&m!==null&&m.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"ud-passkeys-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(U,{children:n("name")}),(0,t.jsx)(U,{children:n("created")}),(0,t.jsx)(U,{"aria-label":n("Actions")})]})}),(0,t.jsx)($e,{children:m.map(F=>{let O=Ae(F.id);return(0,t.jsxs)(L,{"data-testid":`ud-passkey-${O}`,children:[(0,t.jsx)(_,{children:Ae(F.name)||O}),(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(F.createdAt)}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`ud-delete-passkey-${O}`,disabled:l,onClick:r(()=>{h(O)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Delete")})})]},O)})})]})})}),e[29]=l,e[30]=s.passkey,e[31]=h,e[32]=m,e[33]=n,e[34]=A):A=e[34];let x;return e[35]!==v||e[36]!==f||e[37]!==d||e[38]!==A?(x=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-security",children:[v,f,d,A]}),e[35]=v,e[36]=f,e[37]=d,e[38]=A,e[39]=x):x=e[39],x},"nt"),ct=/(?:at|expires)$/iu,ut=new Set(["banExpires","banned","banReason","email","emailVerified","id","name","role"]),mt=r((u,e)=>typeof e=="number"&&ct.test(u)?Ie(e):Ae(e),"ct"),ht=r(({capabilities:u,onChanged:e,onClose:l,user:s})=>{let c=E(),a=W(),o=s.banned===!0,[i,n]=(0,k.useState)(null),[m,w]=(0,k.useState)(!1),[S,b]=(0,k.useState)(0),[C,y]=(0,k.useState)(typeof s.role=="string"?s.role:""),[I,h]=(0,k.useState)(""),[g,v]=(0,k.useState)(""),[f,d]=(0,k.useState)(""),[A,x]=(0,k.useState)(null),[F,O]=(0,k.useState)(!1),P=r((N,j)=>{ze((async()=>{w(!0),n(null);try{let q=await N();j?.refresh!==!1&&(b(M=>M+1),e()),j?.onResult?.(q)}catch(q){n(je(q))}w(!1)})())},"P"),Be=r(N=>{y(N.target.value)},"De"),G=r(N=>{h(N.target.value)},"O"),Te=r(N=>{v(N.target.value)},"je"),H=r(N=>{d(N.target.value)},"G"),Pe=r(()=>{let N=C.trim();N!==""&&P(async()=>{await c.setAuthUserRole({role:N,userId:s.id})})},"Se"),J=r(()=>{let N=Number.parseInt(g,10),j=Number.isFinite(N)&&N>0?N*86400:void 0;P(async()=>{await c.banAuthUser({expiresInSeconds:j,reason:I.trim()===""?void 0:I.trim(),userId:s.id})})},"H"),R=r(()=>{P(async()=>{await c.unbanAuthUser({userId:s.id})})},"R"),K=r(()=>{P(async()=>{await c.setAuthUserPassword({newPassword:f,userId:s.id}),d("")})},"J"),Fe=r(()=>{P(()=>c.impersonateAuthUser({userId:s.id}),{onResult:r(N=>{x(N.token)},"onResult"),refresh:!1})},"we"),Q=r(()=>{P(async()=>{await c.revokeAuthUserSessions({userId:s.id})})},"K"),De=r(()=>{P(async()=>{await c.removeAuthUser({userId:s.id}),l()})},"Te"),X=r(()=>{O(!0)},"W"),Se=r(()=>{O(!1)},"Ce"),Y=Object.entries(s).filter(([N])=>!ut.has(N));return(0,t.jsxs)(Ve,{label:a("User details"),onClose:l,panelTestId:"ud-panel",testId:"ud-overlay",variant:"drawer",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:s.name??s.email??s.id}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:s.id}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1",children:[typeof s.role=="string"&&s.role!==""&&(0,t.jsx)(T,{variant:"secondary",children:s.role}),o?(0,t.jsx)(T,{variant:"destructive",children:a("Banned")}):(0,t.jsx)(T,{variant:"outline",children:a("Active")}),s.emailVerified===!0?(0,t.jsx)(T,{variant:"secondary",children:a("verified")}):(0,t.jsx)(T,{variant:"outline",children:a("unverified")})]})]}),(0,t.jsx)(z,{"data-testid":"ud-close",onClick:l,size:"sm",type:"button",variant:"ghost",children:a("Close")})]}),i!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-action-error",role:"alert",children:i}),u.admin&&(0,t.jsxs)(we,{className:"gap-0 py-0",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Actions")})}),(0,t.jsxs)(Ce,{className:"flex flex-col gap-3 p-3",children:[(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-role",children:a("Role")}),(0,t.jsx)(B,{"data-testid":"ud-role-input",id:"ud-role",onChange:Be,value:C})]}),(0,t.jsx)(z,{"data-testid":"ud-set-role",disabled:m||C.trim()==="",onClick:Pe,size:"sm",type:"button",variant:"outline",children:a("Set role")})]}),o?(0,t.jsx)(z,{"data-testid":"ud-unban",disabled:m,onClick:R,size:"sm",type:"button",variant:"outline",children:a("Unban")}):(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-ban-reason",children:a("Ban reason (optional)")}),(0,t.jsx)(B,{"data-testid":"ud-ban-reason",id:"ud-ban-reason",onChange:G,value:I})]}),(0,t.jsxs)("div",{className:"flex w-24 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-ban-days",children:a("Days")}),(0,t.jsx)(B,{"data-testid":"ud-ban-days",id:"ud-ban-days",onChange:Te,type:"number",value:g})]}),(0,t.jsx)(z,{"data-testid":"ud-ban",disabled:m,onClick:J,size:"sm",type:"button",variant:"destructive",children:a("Ban user")})]}),(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(D,{htmlFor:"ud-password",children:a("New password")}),(0,t.jsx)(B,{"data-testid":"ud-password",id:"ud-password",onChange:H,type:"password",value:f})]}),(0,t.jsx)(z,{"data-testid":"ud-set-password",disabled:m||f==="",onClick:K,size:"sm",type:"button",variant:"outline",children:a("Set password")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(z,{"data-testid":"ud-impersonate",disabled:m,onClick:Fe,size:"sm",type:"button",variant:"outline",children:a("Impersonate")}),(0,t.jsx)(z,{"data-testid":"ud-revoke-all",disabled:m,onClick:Q,size:"sm",type:"button",variant:"outline",children:a("Revoke all sessions")}),F?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z,{"data-testid":"ud-delete-confirm",disabled:m,onClick:De,size:"sm",type:"button",variant:"destructive",children:a("Confirm delete")}),(0,t.jsx)(z,{"data-testid":"ud-delete-cancel",onClick:Se,size:"sm",type:"button",variant:"ghost",children:a("Cancel")})]}):(0,t.jsx)(z,{"data-testid":"ud-delete",disabled:m,onClick:X,size:"sm",type:"button",variant:"destructive",children:a("Delete user")})]}),A!==null&&(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-impersonation",children:[(0,t.jsx)(D,{htmlFor:"ud-token",children:a("Impersonation token")}),(0,t.jsx)(B,{"data-testid":"ud-token",id:"ud-token",readOnly:!0,value:A})]})]})]}),(0,t.jsx)(nt,{busy:m,runAction:P,userId:s.id,version:S}),u.accounts&&(0,t.jsx)(dt,{busy:m,runAction:P,userId:s.id,version:S}),(u.twoFactor||u.passkey)&&(0,t.jsx)(ot,{busy:m,capabilities:u,runAction:P,userId:s.id,version:S}),(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-fields",children:[(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Fields")}),(0,t.jsx)("dl",{className:"flex flex-col",children:Y.map(([N,j])=>(0,t.jsxs)("div",{className:"flex flex-col border-t border-border py-1.5",children:[(0,t.jsx)("dt",{className:"text-xs font-semibold text-muted-foreground",children:N}),(0,t.jsx)("dd",{className:"m-0 font-mono text-xs break-words",children:mt(N,j)})]},N))})]})]})},"ut"),pt=50,$t=r(({pageSize:u=pt}={})=>{let e=E(),l=W(),[s,c]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),i=Ke(s),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(!1),{capabilities:b}=at(),C=i.trim(),y=a.trim(),I=Ge(["lunora-auth-users",C,y,u],()=>e.listAuthUsers({filterField:y===""?void 0:"role",filterValue:y===""?void 0:y,limit:u,search:C===""?void 0:C}),{keepPreviousData:!0}),h=I.data?.rows??null,g=I.error,v=r(()=>{I.refetch()},"v");He(()=>{I.refetch()},!0);let f=n===null?null:h?.find(d=>d.id===n)??null;return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-users",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(B,{"aria-label":l("Search users"),className:"w-56","data-testid":"us-search",onChange:r(d=>{c(d.target.value)},"onChange"),placeholder:l("Search by email or name\u2026"),value:s}),(0,t.jsx)(B,{"aria-label":l("Filter by role"),className:"w-40","data-testid":"us-role-filter",onChange:r(d=>{o(d.target.value)},"onChange"),placeholder:l("Filter by role"),value:a}),(0,t.jsx)(z,{"data-testid":"us-new",onClick:r(()=>{S(!0)},"onClick"),size:"sm",type:"button",children:l("New user")})]}),g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"us-users-error",role:"alert",children:g}),h!==null&&h.length===0&&(0,t.jsx)(Ze,{description:l("Users who sign up to your app will appear here."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85"})}),testId:"us-empty",title:l("No users.")}),h!==null&&h.length>0&&(0,t.jsx)(we,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Ue,{"data-testid":"us-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(U,{children:l("id")}),(0,t.jsx)(U,{children:l("email")}),(0,t.jsx)(U,{children:l("name")}),(0,t.jsx)(U,{children:l("role")}),(0,t.jsx)(U,{children:l("status")}),(0,t.jsx)(U,{children:l("verified")}),(0,t.jsx)(U,{children:l("created")}),(0,t.jsx)(U,{"aria-label":l("Actions")})]})}),(0,t.jsx)($e,{children:h.map(d=>(0,t.jsxs)(L,{"data-testid":`us-row-${d.id}`,children:[(0,t.jsx)(_,{className:"font-mono text-xs",children:d.id}),(0,t.jsx)(_,{children:d.email??""}),(0,t.jsx)(_,{children:d.name??""}),(0,t.jsx)(_,{children:typeof d.role=="string"&&d.role!==""?(0,t.jsx)(T,{variant:"secondary",children:d.role}):""}),(0,t.jsx)(_,{children:d.banned===!0?(0,t.jsx)(T,{variant:"destructive",children:l("Banned")}):(0,t.jsx)(T,{variant:"success",children:l("Active")})}),(0,t.jsx)(_,{children:d.emailVerified===!0?(0,t.jsx)(T,{variant:"success",children:l("yes")}):(0,t.jsx)(T,{variant:"outline",children:l("no")})}),(0,t.jsx)(_,{className:"text-muted-foreground tabular-nums",children:Ie(d.createdAt)}),(0,t.jsx)(_,{children:(0,t.jsx)(z,{"data-testid":`us-manage-${d.id}`,onClick:r(()=>{m(d.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Manage")})})]},d.id))})]})})}),f!==null&&(0,t.jsx)(ht,{capabilities:b,onChanged:v,onClose:r(()=>{m(null)},"onClose"),user:f}),w&&(0,t.jsx)(it,{onClose:r(()=>{S(!1)},"onClose"),onCreated:v})]})},"Pt");export{$t as UsersPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G}from"./chunk-V53KNYRN.js";import{a as g}from"./chunk-5Y3QLNWX.js";import{a as B}from"./chunk-RMN2JN4S.js";import{b as U}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as O}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{a as h}from"./chunk-MWIKAR7F.js";import"./chunk-DJZYD5I5.js";import"./chunk-2OUPA2WJ.js";import{b as w}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as M}from"./chunk-VDW32UET.js";import{f as D}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{d as K,e as _,f as z,h as P,o as q,r as E}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as s,e as T,f as ie,h as oe}from"./chunk-3XIESWL4.js";var i=T(ie(),1);var e=T(oe(),1);var de=s(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"ie"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"oe"),ue=s(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"de"),ce=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ue(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(M.runAs),fe=10,pe=s(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"me"),Fe=s(({functions:r,runAsIdentity:o=!1}={})=>{let a=K(),c=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),x=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[u,F]=(0,i.useState)(""),[f,W]=(0,i.useState)(""),[v,p]=(0,i.useState)("idle"),[X,y]=(0,i.useState)(void 0),[C,N]=(0,i.useState)(null),[$,Y]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(r!==void 0)return;let t=!1;return c.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(P(d))}),()=>{t=!0}},[c,r]);let R=I===""?x[0]?.path??"":I,n=x.find(t=>t.path===R),Z=s(async()=>{if(!n)return;let t;try{t=m.trim()===""?{}:JSON.parse(m)}catch(l){p("error"),y(void 0),N(a("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:n.path},j=u.trim()===""?{}:{shardKey:u.trim()},A=o?f.trim():"",J=s(l=>{Y(L=>[{argsText:m,at:Date.now(),id:(L[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:u,status:l},...L].slice(0,fe))},"j");p("running"),N(null);try{let l=A===""?await _(c,n.kind,d,t,j):await c.query(me,{args:t,functionPath:n.path,userId:A},j);U(u),y(l),p("success"),J("success")}catch(l){y(void 0),N(l.message),p("error"),J("error")}},"_"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"q"),te=s(t=>{S(t.target.value)},"B"),re=s(t=>{b(t.target.value)},"D"),ae=s(t=>{W(t.target.value)},"E"),se=s(()=>{q(Z())},"U"),ne=s(()=>{b(ce(n?.args))},"X");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(g,{htmlFor:"function-select",children:a("Function")}),(0,e.jsx)("select",{"aria-label":a("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:R,children:x.map(t=>(0,e.jsxs)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path))}),n!==void 0&&(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"mr-1.5 font-medium",children:a("Signature")}),(0,e.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:le(n.args)})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(g,{htmlFor:"args-input",children:a("Arguments")}),(0,e.jsx)(h,{"data-testid":"prefill-button",disabled:n===void 0,onClick:ne,size:"xs",type:"button",variant:"ghost",children:a("Prefill")})]}),(0,e.jsx)(G,{"aria-label":a("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:m})]}),(0,e.jsx)(B,{onChange:F,testId:"shard-input",value:u}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(g,{htmlFor:"run-as-input",children:a("Run as identity (userId)")}),(0,e.jsx)(O,{"aria-label":a("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:ae,placeholder:a("Leave empty to run as admin"),value:f}),(0,e.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(h,{"data-testid":"run-button",disabled:v==="running"||n===void 0,onClick:se,type:"button",children:a("Run")}),n!==void 0&&(0,e.jsx)(w,{variant:"outline",children:n.kind}),o&&f.trim()!==""&&(0,e.jsx)(w,{"data-testid":"run-as-badge",variant:"secondary",children:a("as {userId}",{userId:f.trim()})})]})]}),v==="error"&&C!==null&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C}),v==="success"&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:pe(X)}),$.length>0&&(0,e.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:$.map((t,d)=>(0,e.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsx)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"})," ",(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]})," ",(0,e.jsx)("time",{className:"text-xs text-muted-foreground",children:E(t.at)})," ",(0,e.jsx)(h,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:s(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Load")})]},t.id))})]})},"Ie");export{Fe as FunctionRunner};
|