@lunora/studio 1.0.0-alpha.12 → 1.0.0-alpha.120
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 +836 -786
- 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 +9 -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/evals-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/reactors-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-B6z7VLYt.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-BMzLPgvv.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-DXrGI45U.js +1 -0
- package/dist/packem_shared/CommandPalette-kQLn0xlS.js +1 -0
- package/dist/packem_shared/ConfirmButton-Cj2SOapE.js +1 -0
- package/dist/packem_shared/ConnectionBadge-Bh16X9-u.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-1Lrg55IV.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.js +1 -0
- package/dist/packem_shared/DataBrowser-C68K5QHO.js +4 -0
- package/dist/packem_shared/DataFilters-3nbW0uax.js +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-BHFgEqMl.js +1 -0
- package/dist/packem_shared/HomePanel-B-tcMcTZ.js +1 -0
- package/dist/packem_shared/MigrationsPanel-CLRWwPyL.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-DkYBLJGb.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DRmOKtDa.js +1 -0
- package/dist/packem_shared/ShardInput-CdawpUiS.js +1 -0
- package/dist/packem_shared/Studio-BYdUxnM5.js +1 -0
- package/dist/packem_shared/StudioApp-Bxmtp-Fi.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-Bl547evf.js +1 -0
- package/dist/packem_shared/advisor-view-CqCG22DB.js +1 -0
- package/dist/packem_shared/aggregateMetrics-A-Y7OH6R.js +1 -0
- package/dist/packem_shared/alert-C2SEhYS9.js +1 -0
- package/dist/packem_shared/app.d-D1bPR8FO.d.ts +252 -0
- package/dist/packem_shared/badge-cAk9Di1Q.js +1 -0
- package/dist/packem_shared/bar-chart-B6gzp_f9.js +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.js +1 -0
- package/dist/packem_shared/button-BOPLD1un.js +1 -0
- package/dist/packem_shared/card-BGlQzQY-.js +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.js +1 -0
- package/dist/packem_shared/checkbox-C5w53W-E.js +1 -0
- package/dist/packem_shared/data-grid-pjv4t5Yi.js +1 -0
- package/dist/packem_shared/data-view-params-qoSTqjAj.js +1 -0
- package/dist/packem_shared/dropdown-menu-U7Tjg1Nb.js +2 -0
- package/dist/packem_shared/empty-state-B939z6K2.js +1 -0
- package/dist/packem_shared/error-alert-CKqB2CiN.js +1 -0
- package/dist/packem_shared/grid-features-AzpmpR3Q.js +6 -0
- package/dist/packem_shared/home-panel-ecz6-nHV.js +3 -0
- package/dist/packem_shared/input-CY5W3wzv.js +1 -0
- package/dist/packem_shared/internal-7bgd8inO.js +2 -0
- package/dist/packem_shared/label-BOUo-DP0.js +1 -0
- package/dist/packem_shared/live-status-Bf7rR8o8.js +1 -0
- package/dist/packem_shared/log-fields-SBxKyBug.js +1 -0
- package/dist/packem_shared/log-line-D0XBZaDn.js +1 -0
- package/dist/packem_shared/modal-shell-wGW4CKEW.js +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.js +1 -0
- package/dist/packem_shared/recording-client-BPY8sYUl.js +1 -0
- package/dist/packem_shared/reference-view-CxW7paCK.js +12 -0
- package/dist/packem_shared/schema-diagram-DLhppqVE.js +2 -0
- package/dist/packem_shared/scroll-area-DSJftwu_.js +2 -0
- package/dist/packem_shared/select-BPISLTcv.js +2 -0
- package/dist/packem_shared/shard-history-DU5b3QDI.js +1 -0
- package/dist/packem_shared/shortcuts-lH4Vaqjc.js +1 -0
- package/dist/packem_shared/skeleton-DFBBaJU6.js +1 -0
- package/dist/packem_shared/sparkline-CYbJzfA1.js +1 -0
- package/dist/packem_shared/sql-result-table-blxdNVJ0.js +1 -0
- package/dist/packem_shared/stat-card-B9uIvAHg.js +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.js +1 -0
- package/dist/packem_shared/studio-Cvdwfzxm.js +2 -0
- package/dist/packem_shared/table-BMsuYFhk.js +2 -0
- package/dist/packem_shared/table-list-sidebar-BCxqrZ0s.js +1 -0
- package/dist/packem_shared/textarea-DpO3i-Qo.js +1 -0
- package/dist/packem_shared/trace-handoff-z9sy89Ci.js +1 -0
- package/dist/packem_shared/use-admin-query-DV9xmFl8.js +1 -0
- package/dist/packem_shared/use-async-submit-C9xXjXWX.js +1 -0
- package/dist/packem_shared/use-auth-config-DIAyVsa3.js +1 -0
- package/dist/packem_shared/use-open-trace-ClAdPkGD.js +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.js +1 -0
- package/dist/packem_shared/use-sql-assistant-CXgVX_PP.js +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.js +1 -0
- package/dist/packem_shared/wire-codec-Dl3VeNrd.js +1 -0
- package/dist/standalone/chunk-27IF4PXG.js +1 -0
- package/dist/standalone/chunk-2EJQ7SPV.js +1 -0
- package/dist/standalone/chunk-2F6FYL5O.js +1 -0
- package/dist/standalone/chunk-2QLWSNDL.js +1 -0
- package/dist/standalone/chunk-2RASQG3R.js +1 -0
- package/dist/standalone/chunk-2SFSTQS4.js +1 -0
- package/dist/standalone/chunk-2VLBFSIX.js +1 -0
- package/dist/standalone/chunk-4DJQV5UA.js +1 -0
- package/dist/standalone/chunk-4LVLLM6B.js +4 -0
- package/dist/standalone/chunk-4PVSXT34.js +1 -0
- package/dist/standalone/chunk-4Y2QHI65.js +1 -0
- package/dist/standalone/chunk-4YTSKL4R.js +1 -0
- package/dist/standalone/chunk-57VX76PR.js +1 -0
- package/dist/standalone/chunk-5COHJLQF.js +1 -0
- package/dist/standalone/chunk-5HICO276.js +1 -0
- package/dist/standalone/chunk-5JF2HAU4.js +1 -0
- package/dist/standalone/chunk-5JLIP2HH.js +1 -0
- package/dist/standalone/chunk-5QAT5NQ4.js +1 -0
- package/dist/standalone/chunk-5XMZP64Z.js +1 -0
- package/dist/standalone/chunk-6AJONHNM.js +1 -0
- package/dist/standalone/chunk-6J5TEYI5.js +3 -0
- package/dist/standalone/chunk-6KJLNWPJ.js +1 -0
- package/dist/standalone/chunk-6QKKYBML.js +1 -0
- package/dist/standalone/chunk-6UN4V2HB.js +1 -0
- package/dist/standalone/chunk-74ASA4WU.js +1 -0
- package/dist/standalone/chunk-7CVIN6KU.js +6 -0
- package/dist/standalone/chunk-7PIHTTND.js +1 -0
- package/dist/standalone/chunk-7SROZWKL.js +1 -0
- package/dist/standalone/chunk-A44VDLY3.js +1 -0
- package/dist/standalone/chunk-AFKLFS74.js +1 -0
- package/dist/standalone/chunk-AOAJGSYZ.js +2 -0
- package/dist/standalone/chunk-ATGYWQUI.js +1 -0
- package/dist/standalone/chunk-B3BKR5ZW.js +1 -0
- package/dist/standalone/chunk-BKM6PMSO.js +19 -0
- package/dist/standalone/chunk-BKW7FMAU.js +2 -0
- package/dist/standalone/chunk-BQK2C2Z4.js +1 -0
- package/dist/standalone/chunk-BWEXJENB.js +1 -0
- package/dist/standalone/chunk-BYJZGWWY.js +1 -0
- package/dist/standalone/chunk-CAOUXOL7.js +1 -0
- package/dist/standalone/chunk-CKTKI4IY.js +1 -0
- package/dist/standalone/chunk-CN2AINNY.js +1 -0
- package/dist/standalone/chunk-CP4ZFBVW.js +1 -0
- package/dist/standalone/chunk-CYX3OHJ3.js +1 -0
- package/dist/standalone/chunk-D3ZLKFO4.js +1 -0
- package/dist/standalone/chunk-D52S7TOI.js +1 -0
- package/dist/standalone/chunk-DKSLOJDQ.js +1 -0
- package/dist/standalone/chunk-DPNEFSEC.js +1 -0
- package/dist/standalone/chunk-DUDQV6XJ.js +1 -0
- package/dist/standalone/chunk-DYKGLIBC.js +1 -0
- package/dist/standalone/chunk-DZGOHOOE.js +1 -0
- package/dist/standalone/chunk-E6P2ERQV.js +1 -0
- package/dist/standalone/chunk-EDHW2EEG.js +1 -0
- package/dist/standalone/chunk-EYGF6TQS.js +1 -0
- package/dist/standalone/chunk-F7JOSNAT.js +1 -0
- package/dist/standalone/chunk-FJ6G6FNE.js +1 -0
- package/dist/standalone/chunk-G3NGXYJY.js +1 -0
- package/dist/standalone/chunk-GK2UBSBQ.js +1 -0
- package/dist/standalone/chunk-GTEXP4P3.js +1 -0
- package/dist/standalone/chunk-INQICZYC.js +1 -0
- package/dist/standalone/chunk-IYWVSMAY.js +1 -0
- package/dist/standalone/chunk-J2GQE4PW.js +1 -0
- package/dist/standalone/chunk-JIPVSPSG.js +1 -0
- package/dist/standalone/chunk-JUWOEHDD.js +1 -0
- package/dist/standalone/chunk-JV7KTJPY.js +1 -0
- package/dist/standalone/chunk-KPQROFH5.js +1 -0
- package/dist/standalone/chunk-KVSQKUWD.js +1 -0
- package/dist/standalone/chunk-KWGHNORP.js +1 -0
- package/dist/standalone/chunk-L4EZAHCD.js +1 -0
- package/dist/standalone/chunk-L6ATKZKO.js +1 -0
- package/dist/standalone/chunk-M3NNNOD5.js +1 -0
- package/dist/standalone/chunk-MCLM2QJI.js +1 -0
- package/dist/standalone/chunk-METRMDIQ.js +1 -0
- package/dist/standalone/chunk-MG7VPUFA.js +1 -0
- package/dist/standalone/chunk-MLYZZD5C.js +4 -0
- package/dist/standalone/chunk-NIX2QSSN.js +1 -0
- package/dist/standalone/chunk-NXXGISFB.js +1 -0
- package/dist/standalone/chunk-P4QIDUCY.js +1 -0
- package/dist/standalone/chunk-P54YTPHL.js +1 -0
- package/dist/standalone/chunk-PRWFHSHC.js +1 -0
- package/dist/standalone/chunk-PS66CRK5.js +9 -0
- package/dist/standalone/chunk-PZ4QDWTI.js +1 -0
- package/dist/standalone/chunk-QDGAB4R2.js +1 -0
- package/dist/standalone/chunk-QKN5EHEF.js +1 -0
- package/dist/standalone/chunk-QLG2EJU3.js +1 -0
- package/dist/standalone/chunk-QXLU6YPU.js +1 -0
- package/dist/standalone/chunk-R3G55P4J.js +1 -0
- package/dist/standalone/chunk-R52YOHVU.js +1 -0
- package/dist/standalone/chunk-R5ZTCHCE.js +1 -0
- package/dist/standalone/chunk-RCZTUWG3.js +1 -0
- package/dist/standalone/chunk-RK5XWYUL.js +1 -0
- package/dist/standalone/chunk-RSG2DVHH.js +1 -0
- package/dist/standalone/chunk-SPDZUX4P.js +1 -0
- package/dist/standalone/chunk-T5SC5RAD.js +1 -0
- package/dist/standalone/chunk-T7DJP5HM.js +1 -0
- package/dist/standalone/chunk-TCKQ4E5Y.js +1 -0
- package/dist/standalone/chunk-TFMQSCGC.js +1 -0
- package/dist/standalone/chunk-TNKECJW4.js +1 -0
- package/dist/standalone/chunk-TPAZM36C.js +1 -0
- package/dist/standalone/chunk-UANVABQG.js +1 -0
- package/dist/standalone/chunk-UBT2FIU5.js +8 -0
- package/dist/standalone/chunk-VDSFYFDH.js +1 -0
- package/dist/standalone/chunk-VR3UJA7B.js +1 -0
- package/dist/standalone/chunk-VYW2PAWC.js +15 -0
- package/dist/standalone/chunk-VZCS5GXZ.js +1 -0
- package/dist/standalone/chunk-W2JBKQNU.js +1 -0
- package/dist/standalone/chunk-W3PCX3TU.js +1 -0
- package/dist/standalone/chunk-WFABZPAK.js +1 -0
- package/dist/standalone/chunk-WIFYD4A6.js +1 -0
- package/dist/standalone/chunk-WUW4ZHRL.js +1 -0
- package/dist/standalone/chunk-WYSR5F77.js +1 -0
- package/dist/standalone/chunk-XFU6YBYL.js +1 -0
- package/dist/standalone/chunk-XJSWM47N.js +1 -0
- package/dist/standalone/chunk-XL2OT5WB.js +59 -0
- package/dist/standalone/chunk-XOA5TTRA.js +1 -0
- package/dist/standalone/chunk-XQS7KSHL.js +1 -0
- package/dist/standalone/chunk-XRC7KEEN.js +3 -0
- package/dist/standalone/chunk-XTNSQYXW.js +13 -0
- package/dist/standalone/chunk-XUX7B54Z.js +1 -0
- package/dist/standalone/chunk-YMVKAXBC.js +1 -0
- package/dist/standalone/chunk-YN2KHW3B.js +7 -0
- package/dist/standalone/chunk-YTYRZTG6.js +11 -0
- package/dist/standalone/chunk-ZHPDAJBM.js +1 -0
- package/dist/standalone/chunk-ZPGNTTQ3.js +1 -0
- package/dist/standalone/chunk-ZSOLGJFC.js +1 -0
- package/dist/standalone/studio.js +9 -378
- package/dist/styles.css +2 -2
- package/package.json +16 -15
- package/dist/packem_shared/ADMIN_FUNCTIONS-CZJCZ4c7.js +0 -47
- package/dist/packem_shared/ApiDocsPanel-yEz0fiof.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-DdubReQI.js +0 -251
- package/dist/packem_shared/AuditPanel-CE5ofjCc.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-DpL8U-Nf.js +0 -4475
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-ChsSUCYZ.js +0 -197
- package/dist/packem_shared/FileBrowser-DsRBnVhZ.js +0 -2932
- package/dist/packem_shared/FunctionRunner-D4cZ6fuA.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BVelWgNv.js +0 -375
- package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
- package/dist/packem_shared/HealthPanel-CxUVKfvo.js +0 -648
- package/dist/packem_shared/HomePanel-tfqpZxuu.js +0 -1334
- package/dist/packem_shared/InsightsPanel-DNg3K9XN.js +0 -461
- package/dist/packem_shared/LogsPanel-B4LoSRj0.js +0 -827
- package/dist/packem_shared/MailPanel-CcpdyWYs.js +0 -440
- package/dist/packem_shared/MetricsPanel-CxoyWbNb.js +0 -1611
- package/dist/packem_shared/MigrationsPanel-DGwJGWDA.js +0 -239
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CKUzyyHi.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
- package/dist/packem_shared/SchemaViewer-RclXFo9Q.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-Dqql1Z5O.js +0 -92
- package/dist/packem_shared/SettingsPanel-D5iTY0YE.js +0 -390
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-Dj-In-B3.js +0 -13
- package/dist/packem_shared/Studio-VWvKNOw4.js +0 -33
- package/dist/packem_shared/StudioApp-BhQ6T2pn.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-BY8bTpCl.js +0 -11
- 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-BVJFkXyj.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-CMdxstu5.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-D8ry3tJR.js +0 -11043
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-editor-CWx68ZCg.js +0 -407
- 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-BkbdNFNz.js +0 -105
- 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,9 @@
|
|
|
1
|
+
import{a as rt,b as ot}from"./chunk-WYSR5F77.js";import{a as nt}from"./chunk-7CVIN6KU.js";import{a as tt}from"./chunk-2RASQG3R.js";import"./chunk-FJ6G6FNE.js";import"./chunk-CP4ZFBVW.js";import"./chunk-CN2AINNY.js";import"./chunk-5JLIP2HH.js";import"./chunk-EDHW2EEG.js";import"./chunk-ZSOLGJFC.js";import"./chunk-DUDQV6XJ.js";import{a as et}from"./chunk-M3NNNOD5.js";import"./chunk-VZCS5GXZ.js";import"./chunk-DKSLOJDQ.js";import"./chunk-XL2OT5WB.js";import"./chunk-JV7KTJPY.js";import"./chunk-DPNEFSEC.js";import"./chunk-2EJQ7SPV.js";import{a as Je}from"./chunk-6UN4V2HB.js";import{b as Xe}from"./chunk-KVSQKUWD.js";import{c as Ve,d as qe,e as Le,f as _e,g as Pe}from"./chunk-ZHPDAJBM.js";import{P as Ge}from"./chunk-AOAJGSYZ.js";import"./chunk-INQICZYC.js";import"./chunk-TFMQSCGC.js";import"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import"./chunk-7PIHTTND.js";import{a as Ze}from"./chunk-PZ4QDWTI.js";import{a as Ne}from"./chunk-DZGOHOOE.js";import"./chunk-L6ATKZKO.js";import{f as Ee}from"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import"./chunk-L4EZAHCD.js";import{d as ce,f as we,g as ke,h as Ke,o as ue}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as l,d as We,e as vt,f as yt,g as St,i as me}from"./chunk-R5ZTCHCE.js";var G=We(yt(),1);var z=We(vt(),1);var c=We(St(),1);var wt=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],kt=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],Me=String.fromCodePoint(0),Nt=new RegExp(`${Me}${String.raw`(\d+)`}${Me}`,"gu"),qt=wt.map(s=>({pattern:new RegExp(String.raw`\b${s.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:s})),Ct=kt.map(s=>({pattern:new RegExp(String.raw`\s+${s.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
2
|
+
${s}`})),Tt=l(s=>{let e=[],n=s.replaceAll(/'(?:[^']|'')*'/gu,t=>(e.push(t),`${Me}${(e.length-1).toString()}${Me}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:t,replacement:o}of qt)n=n.replaceAll(t,o);for(let{pattern:t,replacement:o}of Ct)n=n.replaceAll(t,o);return n=n.replaceAll(Nt,(t,o)=>e[Number(o)]??""),n},"Lt"),je="x",It={'"':'"',"'":"'","[":"]","`":"`"},Rt=l((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
3
|
+
`;)n+=1;return n},"qt"),Et=l((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"At"),ct=l(s=>{let e=s.split(""),n=0;for(;n<s.length;){let t=s[n]??"",o=It[t];if(t==="-"&&s[n+1]==="-"){let r=Rt(s,n);e.fill(je,n,r),n=r}else if(t==="/"&&s[n+1]==="*"){let r=Et(s,n);if(r===-1)return;e.fill(je,n,r),n=r}else if(o!==void 0){let r=n+1;for(;r<s.length;)if(s[r]!==o)r+=1;else if(o!=="]"&&s[r+1]===o)r+=2;else break;if(r>=s.length)return;e.fill(je,n,r+1),n=r+1}else n+=1}for(let t=0;t<s.length;t+=1)s[t]===`
|
|
4
|
+
`&&(e[t]=`
|
|
5
|
+
`);return e.join("")},"tt"),Lt=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,_t=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|replace|truncate|update|vacuum)\b/iu,Ot=/^\w+/u,Dt=/;\s*$/u,Mt=/\s/u,At=l((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
6
|
+
`;)n+=1;return n},"Bt"),$t=l((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"Ht"),Bt=l(s=>{let e=0;for(;e<s.length;){let n=s[e];if(n!==void 0&&Mt.test(n))e+=1;else if(n==="-"&&s[e+1]==="-")e=At(s,e);else if(n==="/"&&s[e+1]==="*"){let t=$t(s,e);if(t===-1)break;e=t}else break}return e},"Pt"),Ht=l(s=>{let e=Bt(s),n=s.slice(e).trimEnd();if(n==="")return{code:"SQL_EMPTY",message:"the query is empty"};let t=n.replace(Dt,""),o=(ct(t)??t).indexOf(";");if(o!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+o};let r="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!Lt.test(t))return{code:"SQL_NOT_READONLY",length:Ot.exec(t)?.[0].length??1,message:r,offset:e};let a=_t.exec(t);if(a!==null)return{code:"SQL_NOT_READONLY",length:a[0].length,message:`${r} (\`${a[0].toUpperCase()}\` is not allowed)`,offset:e+a.index}},"Wt"),Fe=l((s,e)=>{let n=s.trim();if(n==="")return[];let t=e+s.indexOf(n),o=Ht(n);return[o===void 0?{offset:t,sql:n}:{offset:t,rejection:o,sql:n}]},"Qe"),dt=l(s=>{let e=ct(s);if(e===void 0)return Fe(s,0);let n=[],t=0;for(let o=0;o<=e.length;o+=1)o!==e.length&&e[o]!==";"||(n.push(...Fe(s.slice(t,o),t)),t=o+1);return n},"nt"),Wt=/\b(?:from|join)\s+([a-z_][\w$]*)(?:\s+(?:as\s+)?([a-z_][\w$]*))?/giu,Pt=/(?:\bwith\s+(?:recursive\s+)?|,\s*)([a-z_][\w$]*)\s+as\s*\(/giu,jt=new Set(["cross","full","group","having","inner","join","left","limit","offset","on","order","right","union","using","where","window"]),Qt=/[^\n]/gu,Ft=l((s,e)=>{let n=s[e];if(n==="'"){let t=e+1;for(;t<s.length&&s[t]!=="'";)t+=1;return Math.min(t+1,s.length)}if(n==="-"&&s[e+1]==="-"){let t=s.indexOf(`
|
|
7
|
+
`,e);return t===-1?s.length:t}if(n==="/"&&s[e+1]==="*"){let t=s.indexOf("*/",e+2);return t===-1?s.length:t+2}return-1},"zt"),zt=l(s=>{let e="",n=0;for(;n<s.length;){let t=Ft(s,n);t===-1?(e+=s.slice(n,n+1),n+=1):(e+=s.slice(n,t).replaceAll(Qt," "),n=t)}return e},"Yt"),Ut=l(s=>{let e=new Set;for(let n of s.matchAll(Pt))e.add((n[1]??"").toLowerCase());return e},"Kt"),Yt=l((s,e)=>{let n=new Map;for(let t of s.matchAll(Wt)){let o=(t[1]??"").toLowerCase(),r=(t[2]??"").toLowerCase();e.has(o)&&(n.set(o,o),r!==""&&!jt.has(r)&&n.set(r,o))}return n},"Gt"),ut=l((s,e)=>{let n=zt(s),t=new Set(e.map(o=>o.toLowerCase()));return{ctes:Ut(n),masked:n,targets:Yt(n,t)}},"st"),Gt=/^(?:__lunora|sqlite_)/iu,Kt=/\b(?:from|join)\s+([a-z_][\w$]*)/giu,Vt=/\b([a-z_][\w$]*)\.([a-z_][\w$]*)/giu,Xt=new Set(["cross","full","group","having","inner","join","lateral","left","limit","offset","order","right","select","union","where","window"]),Jt=l((s,e,n)=>{let t=[];for(let o of s.matchAll(Kt)){let r=o[1]??"",a=r.toLowerCase();!e.has(a)&&!n.has(a)&&!Xt.has(a)&&!Gt.test(r)&&t.push({length:r.length,message:`unknown table \`${r}\``,offset:o.index+o[0].length-r.length,severity:"error",source:"schema"})}return t},"en"),Zt=l((s,e,n)=>{let t=[],o=new Map;for(let[r,a]of Object.entries(e.columns))o.set(r.toLowerCase(),new Set(a.map(d=>d.toLowerCase())));for(let r of s.matchAll(Vt)){let a=(r[1]??"").toLowerCase(),d=r[2]??"",i=n.get(a),u=i===void 0?void 0:o.get(i);u!==void 0&&!u.has(d.toLowerCase())&&t.push({length:d.length,message:`\`${i??""}\` has no column \`${d}\``,offset:r.index+r[0].length-d.length,severity:"error",source:"schema"})}return t},"tn"),en=l((s,e)=>{if(s.trim()==="")return[];let n=dt(s),t=new Set(e.tables.map(r=>r.toLowerCase())),o=[];for(let r of n){let{offset:a,rejection:d}=r;if(d!==void 0){d.code!=="SQL_EMPTY"&&o.push({length:d.length,message:d.message,offset:d.offset===void 0?a:a+d.offset,severity:"error",source:"gate"});continue}let{ctes:i,masked:u,targets:p}=ut(r.sql,e.tables);o.push(...[...Jt(u,t,i),...Zt(u,e,p)].map(h=>({...h,offset:h.offset===void 0?a:a+h.offset})))}return o},"nn"),tn=we(Ne.lintSql),nn=600,rn=l((s,e,n)=>{let t=Ee(),[o,r]=(0,z.useState)([]),a=(0,z.useMemo)(()=>en(s,e),[s,e]),d=et(s,nn),i=a.some(h=>h.source==="gate")||d.trim()==="",u=(0,z.useCallback)(async h=>{try{let g=await t.query(tn,{sql:d},ke(n));h.cancelled||r(g.diagnostics??[])}catch{h.cancelled||r([])}},[t,d,n]);(0,z.useEffect)(()=>{if(i){r([]);return}let h={cancelled:!1};return ue(u(h)),()=>{h.cancelled=!0}},[u,i]);let p=d===s;return(0,z.useMemo)(()=>p?[...a,...o]:a,[a,o,p])},"ln"),Oe=8,on=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],sn=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),ln=/[\w$]/,mt=l(s=>s!==void 0&&ln.test(s),"ot"),ft=l(s=>{let e=s.length;for(;e>0&&mt(s[e-1]);)e-=1;return s.slice(e)},"lt"),ht=l((s,e)=>{let n=e;for(;n>0&&mt(s[n-1]);)n-=1;return{end:e,start:n,text:s.slice(n,e)}},"rt"),st=l((s,e)=>{let n=s.slice(0,e).trimEnd();return n.endsWith(".")||sn.has(ft(n).toUpperCase())},"Je"),an=l((s,e,n)=>{let t=s.slice(0,e);if(!t.endsWith("."))return;let o=ft(t.slice(0,-1));if(o!=="")return ut(s,n).targets.get(o.toLowerCase())??o},"dn"),ze=l((s,e)=>s.toLowerCase().startsWith(e.toLowerCase()),"ze"),lt=l((s,e,n,t)=>{let o=[];for(let r of s)if(ze(r,e)&&(o.push(t(r)),o.length>=n))break;return o},"Ve"),cn=l((s,e,n)=>{let t=new Map;for(let[o,r]of Object.entries(s.columns))for(let a of r)if(ze(a,e)&&!t.has(a)&&(t.set(a,o),t.size>=n))return[...t].map(([d,i])=>({detail:i,kind:"column",label:d}));return[...t].map(([o,r])=>({detail:r,kind:"column",label:o}))},"un"),dn=l((s,e,n)=>{let t=ht(s,e),o=an(s,t.start,n.tables);if(o!==void 0){let i=n.columns[o]??n.columns[o.toLowerCase()]??[];return lt(i,t.text,Oe,u=>({detail:o,kind:"column",label:u}))}if(t.text===""&&!st(s,t.start))return[];let r=lt(n.tables,t.text,Oe,i=>({kind:"table",label:i})),a=cn(n,t.text,Oe),d=on.flatMap(i=>t.text!==""&&ze(i,t.text)&&i.toLowerCase()!==t.text.toLowerCase()?[{kind:"keyword",label:i}]:[]);return(st(s,t.start)?[...a,...r,...d]:[...r,...a,...d]).slice(0,Oe)},"fn"),un=l((s,e,n)=>{let t=ht(s,e),o=s.slice(0,t.start)+n.label+s.slice(t.end);return{caret:t.start+n.label.length,value:o}},"mn"),mn=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],fn=l((s,e)=>{let n=globalThis.getComputedStyle(s),t=globalThis.document.createElement("div"),{style:o}=t;o.position="absolute",o.visibility="hidden",o.whiteSpace="pre-wrap",o.overflowWrap="break-word";for(let i of mn)o[i]=n[i];t.textContent=s.value.slice(0,Math.max(0,e));let r=globalThis.document.createElement("span");r.textContent=s.value.slice(Math.max(0,e))||".",t.append(r),globalThis.document.body.append(t);let a=r.offsetLeft-s.scrollLeft,d=r.offsetTop-s.scrollTop;return t.remove(),{left:a,top:d}},"pn"),hn=l((s,e,n)=>{let t=(0,G.c)(16),[o,r]=(0,z.useState)(null),a;t[0]!==s||t[1]!==e?(a=l((v,b)=>{let k=dn(v,b,s);if(k.length===0){r(null);return}let S=e.current,{left:x,top:q}=S===null?{left:0,top:0}:fn(S,b);r(C=>C!==null&&C.active===0&&C.left===x&&C.top===q&&C.suggestions.length===k.length&&C.suggestions.every((R,T)=>{let _=k.at(T);return R.kind===_?.kind&&R.label===_.label&&R.detail===_.detail})?C:{active:0,left:x,suggestions:k,top:q})},"r"),t[0]=s,t[1]=e,t[2]=a):a=t[2];let d=a,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=l(()=>{r(null)},"c"),t[3]=i):i=t[3];let u=i,p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=l(v=>{r(b=>{if(b===null)return b;let k=b.suggestions.length,S=(b.active+v+k)%k;return{...b,active:S}})},"m"),t[4]=p):p=t[4];let h=p,g;t[5]!==n||t[6]!==o||t[7]!==e?(g=l(v=>{let b=e.current;if(o===null||b===null)return!1;let k=o.suggestions[v??o.active];if(k===void 0)return!1;let S=un(b.value,b.selectionStart,k);return n(S.value),r(null),requestAnimationFrame(()=>{let x=e.current;x!==null&&(x.focus(),x.setSelectionRange(S.caret,S.caret))}),!0},"f"),t[5]=n,t[6]=o,t[7]=e,t[8]=g):g=t[8];let y=g,m;t[9]!==y?(m=l(()=>y(),"d"),t[9]=y,t[10]=m):m=t[10];let w=m,f;return t[11]!==w||t[12]!==y||t[13]!==d||t[14]!==o?(f={close:u,commit:w,commitAt:y,move:h,refresh:d,state:o},t[11]=w,t[12]=y,t[13]=d,t[14]=o,t[15]=f):f=t[15],f},"bn"),pn={column:"column",keyword:"keyword",table:"table"},bn=20,gn=l(s=>{let e=(0,G.c)(17),{listboxId:n,onPick:t,state:o}=s,r=ce(),a;e[0]!==o?(a=o===null?void 0:{left:o.left,top:o.top+bn},e[0]=o,e[1]=a):a=e[1];let d=a;if(o===null)return null;let i;if(e[2]!==n||e[3]!==t||e[4]!==o.active||e[5]!==o.suggestions||e[6]!==r){let p;e[8]!==n||e[9]!==t||e[10]!==o.active||e[11]!==r?(p=l((h,g)=>(0,c.jsxs)("li",{"aria-selected":g===o.active,className:me("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",g===o.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${n}-opt-${g.toString()}`,onMouseDown:l(y=>{y.preventDefault(),t(g)},"onMouseDown"),role:"option",children:[(0,c.jsx)("span",{className:"truncate font-mono",children:h.label}),h.detail!==void 0&&(0,c.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:h.detail}),(0,c.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:r(pn[h.kind])})]},`${h.kind}:${h.label}`),"m"),e[8]=n,e[9]=t,e[10]=o.active,e[11]=r,e[12]=p):p=e[12],i=o.suggestions.map(p),e[2]=n,e[3]=t,e[4]=o.active,e[5]=o.suggestions,e[6]=r,e[7]=i}else i=e[7];let u;return e[13]!==n||e[14]!==d||e[15]!==i?(u=(0,c.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:n,role:"listbox",style:d,children:i}),e[13]=n,e[14]=d,e[15]=i,e[16]=u):u=e[16],u},"yn"),xn=we(Ne.listTables),vn=we(Ne.readTablePage),yn=l(s=>{let e=(0,G.c)(16),n=Ee(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];let[o,r]=(0,z.useState)(t),a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={},e[1]=a):a=e[1];let[d,i]=(0,z.useState)(a),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,e[2]=u):u=e[2];let p=(0,z.useRef)(u),h,g;e[3]!==n||e[4]!==s?(h=l(()=>{let b={cancelled:!1};return ue((async()=>{try{let k=await n.query(xn,{},ke(s));b.cancelled||(r(k.map(wn)),i({}),p.current=new Set)}catch{b.cancelled||(r([]),i({}),p.current=new Set)}})()),()=>{b.cancelled=!0}},"g"),g=[n,s],e[3]=n,e[4]=s,e[5]=h,e[6]=g):(h=e[5],g=e[6]),(0,z.useEffect)(h,g);let y;e[7]!==n||e[8]!==s?(y=l(b=>{p.current.has(b)||(p.current.add(b),ue((async()=>{try{let k=await n.query(vn,{limit:1,offset:0,table:b},ke(s));i(S=>({...S,[b]:k.columns}))}catch{p.current.delete(b)}})()))},"y"),e[7]=n,e[8]=s,e[9]=y):y=e[9];let m=y,w;e[10]!==d||e[11]!==o?(w={columns:d,tables:o},e[10]=d,e[11]=o,e[12]=w):w=e[12];let f=w,v;return e[13]!==m||e[14]!==f?(v={probe:m,schema:f},e[13]=m,e[14]=f,e[15]=v):v=e[15],v},"wn"),Qe=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,Sn=l(s=>{let e=new Set;Qe.lastIndex=0;let n=Qe.exec(s);for(;n!==null;)e.add(n[1]??n[2]),n=Qe.exec(s);return[...e]},"Cn");function wn(s){return s.name}l(wn,"Nn");var kn=l(s=>{let e=(0,G.c)(34),{onSubmit:n,probe:t,schema:o,setDraft:r}=s,a=(0,z.useId)(),d=(0,z.useRef)(null),i=(0,z.useRef)(null),u=(0,z.useRef)(null),p=hn(o,u,r),{close:h,commit:g,commitAt:y,move:m,refresh:w,state:f}=p,v;e[0]!==y?(v=l(N=>{y(N)},"x"),e[0]=y,e[1]=v):v=e[1];let b=v,k;e[2]!==w?(k=l(()=>{let N=u.current;N!==null&&N===document.activeElement&&w(N.value,N.selectionStart)},"C"),e[2]=w,e[3]=k):k=e[3];let S;e[4]!==w||e[5]!==o?(S=[w,o],e[4]=w,e[5]=o,e[6]=S):S=e[6],(0,z.useEffect)(k,S);let x;e[7]!==t||e[8]!==w||e[9]!==r?(x=l(N=>{let{selectionStart:j,value:I}=N.target;r(I);for(let $ of Sn(I))t($);w(I,j)},"p"),e[7]=t,e[8]=w,e[9]=r,e[10]=x):x=e[10];let q=x,C;e[11]!==w?(C=l(N=>{let j=N.currentTarget;w(j.value,j.selectionStart)},"N"),e[11]=w,e[12]=C):C=e[12];let R=C,T;e[13]!==f||e[14]!==h||e[15]!==g||e[16]!==m||e[17]!==n?(T=l(N=>{if(f!==null){if(N.key==="ArrowDown"){N.preventDefault(),m(1);return}if(N.key==="ArrowUp"){N.preventDefault(),m(-1);return}if(N.key==="Escape"){N.preventDefault(),h();return}if((N.key==="Enter"||N.key==="Tab")&&!N.metaKey&&!N.ctrlKey&&g()){N.preventDefault();return}}(N.metaKey||N.ctrlKey)&&N.key==="Enter"&&(N.preventDefault(),n())},"E"),e[13]=f,e[14]=h,e[15]=g,e[16]=m,e[17]=n,e[18]=T):T=e[18];let _=T,E;e[19]!==h?(E=l(()=>{requestAnimationFrame(()=>{h()})},"T"),e[19]=h,e[20]=E):E=e[20];let O=E,D;e[21]===Symbol.for("react.memo_cache_sentinel")?(D=l(N=>{let{scrollLeft:j,scrollTop:I}=N.currentTarget;d.current!==null&&(d.current.scrollTop=I),i.current!==null&&(i.current.scrollTop=I,i.current.scrollLeft=j)},"_"),e[21]=D):D=e[21];let L=D,B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=l(N=>{let j=u.current;j===null||N.offset===void 0||(j.focus(),j.setSelectionRange(N.offset,N.offset+(N.length??0)))},"B"),e[22]=B):B=e[22];let A=B,P;e[23]!==q||e[24]!==O||e[25]!==_||e[26]!==R?(P={onBlur:O,onChange:q,onKeyDown:_,onScroll:L,onSelect:R},e[23]=q,e[24]=O,e[25]=_,e[26]=R,e[27]=P):P=e[27];let M;return e[28]!==f||e[29]!==h||e[30]!==a||e[31]!==b||e[32]!==P?(M={autocompleteState:f,closeAutocomplete:h,handlers:P,listboxId:a,onPickSuggestion:b,editorRef:u,gutterRef:d,overlayRef:i,revealDiagnostic:A},e[28]=f,e[29]=h,e[30]=a,e[31]=b,e[32]=P,e[33]=M):M=e[33],M},"kn"),Nn="lunora-studio-sql-tabs",qn="lunora-studio-sql-active-tab",Ue=12,Ce=l((s="",e="")=>({activeId:null,id:Pe("tab"),name:e,sql:s}),"we"),Cn=l(()=>_e(qn,""),"Rn"),Tn=l(s=>{let e=(0,G.c)(16),[n,t]=Le(Nn),[o,r]=Cn(),[a]=(0,z.useState)(s),d,i;e[0]!==a||e[1]!==t||e[2]!==n.length?(d=l(()=>{n.length===0&&t([a])},"i"),i=[a,t,n.length],e[0]=a,e[1]=t,e[2]=n.length,e[3]=d,e[4]=i):(d=e[3],i=e[4]),(0,z.useEffect)(d,i);let u;e[5]!==a||e[6]!==n?(u=n.length===0?[a]:n,e[5]=a,e[6]=n,e[7]=u):u=e[7];let p=u,h;e[8]!==o||e[9]!==p?(h=p.some(m=>m.id===o)?o:p[0]?.id??"",e[8]=o,e[9]=p,e[10]=h):h=e[10];let g=h,y;return e[11]!==g||e[12]!==r||e[13]!==t||e[14]!==p?(y={activeId:g,setActiveId:r,setTabs:t,tabs:p},e[11]=g,e[12]=r,e[13]=t,e[14]=p,e[15]=y):y=e[15],y},"Ln"),pt=l(s=>s.activeId===null&&s.sql.trim()!=="","it"),In=l((s,e)=>[...s,e].slice(-Ue),"In"),Rn=l((s,e,n)=>{let t=s.findIndex(r=>r.id===e);if(t===-1)return{activeId:s[0]?.id??"",tabs:[...s]};let o=s.filter(r=>r.id!==e);if(o.length===0){let r=n();return{activeId:r.id,tabs:[r]}}return{activeId:o[Math.min(t,o.length-1)].id,tabs:o}},"qn"),En=l((s,e)=>{let n=s.filter(t=>t.id===e);return n.length===0?{activeId:s[0]?.id??"",tabs:[...s]}:{activeId:e,tabs:n}},"An"),Ln=l((s,e,n)=>{let t=s.findIndex(r=>r.id===e);if(t===-1)return{activeId:n,tabs:[...s]};let o=s.slice(0,t+1);return{activeId:o.some(r=>r.id===n)?n:e,tabs:o}},"_n"),_n=l(s=>{let e=s();return{activeId:e.id,tabs:[e]}},"On"),On=l((s,e,n)=>{if(s==="others")return e.filter(t=>t.id!==n);if(s==="right"){let t=e.findIndex(o=>o.id===n);return t===-1?[]:e.slice(t+1)}return[...e]},"Dn"),at={error:null,pane:"results",result:null,running:!1},Dn=l(s=>{let e=(0,G.c)(66),{activeId:n,setActiveId:t,setTabs:o,tabs:r}=Tn(s),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let[d,i]=(0,z.useState)(a),[u,p]=(0,z.useState)(null),[h,g]=(0,z.useState)(null),y;e[1]!==n||e[2]!==r?(y=r.find(W=>W.id===n)??r[0]??Ce(),e[1]=n,e[2]=r,e[3]=y):y=e[3];let m=y,w=d[m.id]??at,f;e[4]!==m.id||e[5]!==o?(f=l(W=>{o(U=>U.map(Y=>Y.id===m.id?{...Y,...W}:Y))},"u"),e[4]=m.id,e[5]=o,e[6]=f):f=e[6];let v=f,b;e[7]!==m.id?(b=l(W=>{i(U=>{let Y=U[m.id]??at;return{...U,[m.id]:{...Y,...W}}})},"h"),e[7]=m.id,e[8]=b):b=e[8];let k=b,S;e[9]!==t||e[10]!==o||e[11]!==r.length?(S=l(()=>{if(r.length>=Ue)return;let W=Ce();o(U=>In(U,W)),t(W.id)},"v"),e[9]=t,e[10]=o,e[11]=r.length,e[12]=S):S=e[12];let x=S,q;e[13]!==t||e[14]!==o?(q=l(W=>{p(null),g(null),o(W.tabs),t(W.activeId);let U=new Set(W.tabs.map(Mn));i(Y=>Object.fromEntries(Object.entries(Y).filter(X=>{let[fe]=X;return U.has(fe)})))},"k"),e[13]=t,e[14]=o,e[15]=q):q=e[15];let C=q,R;e[16]!==C||e[17]!==r?(R=l(W=>{C(Rn(r,W,Ce))},"L"),e[16]=C,e[17]=r,e[18]=R):R=e[18];let T=R,_;e[19]!==n||e[20]!==C||e[21]!==r?(_=l((W,U)=>{C(W==="others"?En(r,U):W==="right"?Ln(r,U,n):_n(Ce))},"q"),e[19]=n,e[20]=C,e[21]=r,e[22]=_):_=e[22];let E=_,O;e[23]!==E||e[24]!==u||e[25]!==r?(O=l(W=>{u!==null&&(On(W,r,u.id).some(An)?g(W):E(W,u.id))},"A"),e[23]=E,e[24]=u,e[25]=r,e[26]=O):O=e[26];let D=O,L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=l((W,U)=>{U.preventDefault(),g(null),p({id:W,x:U.clientX,y:U.clientY})},"I"),e[27]=L):L=e[27];let B=L,A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=l(()=>{p(null),g(null)},"D"),e[28]=A):A=e[28];let P=A,M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=l(W=>{W.preventDefault(),p(null),g(null)},"O"),e[29]=M):M=e[29];let N=M,j;e[30]!==D?(j=l(()=>{D("others")},"W"),e[30]=D,e[31]=j):j=e[31];let I=j,$;e[32]!==D?($=l(()=>{D("right")},"M"),e[32]=D,e[33]=$):$=e[33];let F=$,H;e[34]!==D?(H=l(()=>{D("all")},"$"),e[34]=D,e[35]=H):H=e[35];let J=H,Z;e[36]!==E||e[37]!==h||e[38]!==u?(Z=l(()=>{u!==null&&h!==null&&E(h,u.id),g(null)},"Z"),e[36]=E,e[37]=h,e[38]=u,e[39]=Z):Z=e[39];let ee=Z,te;e[40]===Symbol.for("react.memo_cache_sentinel")?(te=l(()=>{g(null)},"te"),e[40]=te):te=e[40];let ie=te,V;e[41]!==u?(V=u===null?void 0:{left:u.x,top:u.y},e[41]=u,e[42]=V):V=e[42];let Q=V,ne;e[43]!==o?(ne=l(W=>{o(U=>U.map(Y=>Y.activeId===W?{...Y,activeId:null}:Y))},"ne"),e[43]=o,e[44]=ne):ne=e[44];let re=ne,oe;e[45]!==o?(oe=l((W,U)=>{o(Y=>Y.map(X=>X.id===W?{...X,name:U}:X))},"oe"),e[45]=o,e[46]=oe):oe=e[46];let se=oe,le;return e[47]!==m||e[48]!==n||e[49]!==x||e[50]!==T||e[51]!==ee||e[52]!==J||e[53]!==I||e[54]!==F||e[55]!==w||e[56]!==k||e[57]!==v||e[58]!==h||e[59]!==se||e[60]!==t||e[61]!==u||e[62]!==Q||e[63]!==r||e[64]!==re?(le={activeTab:m,activeTabId:n,addEditorTab:x,cancelBulk:ie,closeEditorTab:T,closeTabMenu:P,confirmBulk:ee,menuStyle:Q,onBackdropContextMenu:N,onCloseAll:J,onCloseOthers:I,onCloseToRight:F,openTabMenu:B,output:w,patchActiveOutput:k,patchActiveTab:v,pendingBulk:h,renameTab:se,setActiveTabId:t,tabMenu:u,tabs:r,unlinkQuery:re},e[47]=m,e[48]=n,e[49]=x,e[50]=T,e[51]=ee,e[52]=J,e[53]=I,e[54]=F,e[55]=w,e[56]=k,e[57]=v,e[58]=h,e[59]=se,e[60]=t,e[61]=u,e[62]=Q,e[63]=r,e[64]=re,e[65]=le):le=e[65],le},"Mn");function Mn(s){return s.id}l(Mn,"$n");function An(s){return pt(s)}l(An,"Bn");var $n="lunora-studio-sql-queries",Se="lunora-studio-sql-history",Bn="lunora-studio-sql-remember-history",Hn=25,Wn=l(s=>{let e=(0,G.c)(41),{loadIntoActiveTab:n,unlinkQuery:t}=s,o=ce(),[r,a]=Le($n),[d,i]=_e(Bn,!1),[u,p]=Le(Se,d?"local":"session"),h,g;e[0]!==d?(h=l(()=>{d||qe(Se,"local")},"g"),g=[d],e[0]=d,e[1]=h,e[2]=g):(h=e[1],g=e[2]),(0,z.useEffect)(h,g);let[y,m]=(0,z.useState)(""),w=(0,z.useRef)(null),f;e[3]!==p?(f=l(I=>{p($=>$[0]?.sql===I?$:[{at:Date.now(),sql:I},...$.filter(F=>F.sql!==I)].slice(0,Hn))},"u"),e[3]=p,e[4]=f):f=e[4];let v=f,b;e[5]!==n||e[6]!==a||e[7]!==o?(b=l(()=>{let I={id:Pe("q"),name:o("Untitled query"),sql:""};a($=>[I,...$]),n("",I.id)},"h"),e[5]=n,e[6]=a,e[7]=o,e[8]=b):b=e[8];let k=b,S;e[9]!==n||e[10]!==r?(S=l(I=>{let $=r.find(F=>F.id===I);$!==void 0&&(n($.sql,I),w.current?.querySelector(`[data-testid="sql-query-${I}"]`)?.scrollIntoView({block:"nearest"}))},"v"),e[9]=n,e[10]=r,e[11]=S):S=e[11];let x=S,q;e[12]!==a||e[13]!==t?(q=l(I=>{a($=>$.filter(F=>F.id!==I)),t(I)},"k"),e[12]=a,e[13]=t,e[14]=q):q=e[14];let C=q,R;e[15]!==n?(R=l(I=>{n(I.currentTarget.dataset.sql??"",null)},"L"),e[15]=n,e[16]=R):R=e[16];let T=R,_;e[17]!==n?(_=l(I=>{n(I.currentTarget.dataset.sql??"",null)},"q"),e[17]=n,e[18]=_):_=e[18];let E=_,O;e[19]!==p?(O=l(()=>{p([]),qe(Se,"local"),qe(Se,"session")},"A"),e[19]=p,e[20]=O):O=e[20];let D=O,L;e[21]!==u||e[22]!==i?(L=l(I=>{Ve(Se,u,I?"local":"session"),I||qe(Se,"local"),i(I)},"I"),e[21]=u,e[22]=i,e[23]=L):L=e[23];let B=L,A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=l(I=>{m(I.target.value)},"D"),e[24]=A):A=e[24];let P=A,M;e[25]!==a?(M=l((I,$)=>{a(F=>F.map(H=>H.id===I?{...H,sql:$}:H))},"O"),e[25]=a,e[26]=M):M=e[26];let N=M,j;return e[27]!==D||e[28]!==C||e[29]!==u||e[30]!==E||e[31]!==T||e[32]!==k||e[33]!==r||e[34]!==v||e[35]!==d||e[36]!==y||e[37]!==x||e[38]!==B||e[39]!==N?(j={clearHistory:D,deleteQuery:C,history:u,listRef:w,loadFromHistory:E,loadTemplate:T,newQuery:k,onSearchChange:P,queries:r,recordHistory:v,rememberHistory:d,search:y,selectQuery:x,setRememberHistory:B,updateQuerySql:N},e[27]=D,e[28]=C,e[29]=u,e[30]=E,e[31]=T,e[32]=k,e[33]=r,e[34]=v,e[35]=d,e[36]=y,e[37]=x,e[38]=B,e[39]=N,e[40]=j):j=e[40],j},"Fn"),bt="p-3 font-mono text-xs leading-5 whitespace-pre-wrap break-words",Pn=l((s,e)=>{let n=[];for(let o of s){if(o.offset===void 0||o.length===void 0||o.length<=0)continue;let r=Math.max(0,Math.min(o.offset,e)),a=Math.max(r,Math.min(o.offset+o.length,e));r!==a&&n.push({end:a,severity:o.severity,start:r})}n.sort((o,r)=>o.start-r.start);let t=[];for(let o of n)o.start>=(t.at(-1)?.end??0)&&t.push(o);return t},"Qn"),jn=l(s=>s==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":s==="empty-response"?"The model returned nothing usable.":"The model could not be reached.","Un"),Qn=l(s=>{let e=(0,G.c)(51),{assistant:n,failed:t,onGenerated:o}=s,r=ce(),[a,d]=(0,z.useState)("");if(n.unavailable)return null;let i;e[0]!==n?(i=n.pending("sql"),e[0]=n,e[1]=i):i=e[1];let u=i,p;if(e[2]!==n||e[3]!==t||e[4]!==o||e[5]!==u||e[6]!==a||e[7]!==r){let h=n.reason("sql"),g;e[9]!==n||e[10]!==t||e[11]!==o||e[12]!==a?(g=l(E=>{let O=a.trim();O===""&&!E||ue((async()=>{let D=await n.generate(O===""?"fix the failing statement":O,E?t:void 0);D!==void 0&&o(D)})())},"f"),e[9]=n,e[10]=t,e[11]=o,e[12]=a,e[13]=g):g=e[13];let y=g,m;e[14]!==r?(m=r("Describe the query you want"),e[14]=r,e[15]=m):m=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=l(E=>{d(E.target.value)},"S"),e[16]=w):w=e[16];let f;e[17]!==y?(f=l(E=>{E.key==="Enter"&&(E.preventDefault(),y(!1))},"u"),e[17]=y,e[18]=f):f=e[18];let v;e[19]!==r?(v=r("Describe the query you want"),e[19]=r,e[20]=v):v=e[20];let b;e[21]!==u||e[22]!==a||e[23]!==m||e[24]!==f||e[25]!==v?(b=(0,c.jsx)(Ge,{"aria-label":m,className:"h-7 flex-1 text-xs","data-testid":"sql-assistant-prompt",disabled:u,onChange:w,onKeyDown:f,placeholder:v,value:a}),e[21]=u,e[22]=a,e[23]=m,e[24]=f,e[25]=v,e[26]=b):b=e[26];let k=u&&"opacity-60",S;e[27]!==k?(S=me("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",k),e[27]=k,e[28]=S):S=e[28];let x;e[29]!==u||e[30]!==a?(x=u||a.trim()==="",e[29]=u,e[30]=a,e[31]=x):x=e[31];let q;e[32]!==y?(q=l(()=>{y(!1)},"k"),e[32]=y,e[33]=q):q=e[33];let C;e[34]!==u||e[35]!==r?(C=r(u?"Thinking\u2026":"Draft SQL"),e[34]=u,e[35]=r,e[36]=C):C=e[36];let R;e[37]!==S||e[38]!==x||e[39]!==q||e[40]!==C?(R=(0,c.jsx)("button",{className:S,"data-testid":"sql-assistant-generate",disabled:x,onClick:q,type:"button",children:C}),e[37]=S,e[38]=x,e[39]=q,e[40]=C,e[41]=R):R=e[41];let T;e[42]!==t||e[43]!==u||e[44]!==y||e[45]!==r?(T=t!==void 0&&(0,c.jsx)("button",{className:"rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-assistant-fix",disabled:u,onClick:l(()=>{y(!0)},"onClick"),type:"button",children:r("Fix this")}),e[42]=t,e[43]=u,e[44]=y,e[45]=r,e[46]=T):T=e[46];let _;e[47]!==R||e[48]!==T||e[49]!==b?(_=(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[b,R,T]}),e[47]=R,e[48]=T,e[49]=b,e[50]=_):_=e[50],p=(0,c.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border px-3 py-2","data-testid":"sql-assistant",children:[_,h!==void 0&&(0,c.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-assistant-reason",role:"status",children:jn(h)})]}),e[2]=n,e[3]=t,e[4]=o,e[5]=u,e[6]=a,e[7]=r,e[8]=p}else p=e[8];return p},"jn"),Fn=l(s=>{let e=(0,G.c)(8),{diagnostics:n,draft:t,scrollRef:o}=s,r,a;if(e[0]!==n||e[1]!==t){a=Symbol.for("react.early_return_sentinel");e:{let u=Pn(n,t.length);if(u.length===0){a=null;break e}r=[];let p=0;for(let[h,g]of u.entries())g.start>p&&r.push(t.slice(p,g.start)),r.push((0,c.jsx)("span",{className:me("decoration-wavy underline underline-offset-4",g.severity==="error"?"decoration-destructive":"decoration-amber-500"),children:t.slice(g.start,g.end)},`${g.start.toString()}-${h.toString()}`)),p=g.end;r.push(t.slice(p))}e[0]=n,e[1]=t,e[2]=r,e[3]=a}else r=e[2],a=e[3];if(a!==Symbol.for("react.early_return_sentinel"))return a;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=me("pointer-events-none absolute inset-0 overflow-hidden text-transparent",bt),e[4]=d):d=e[4];let i;return e[5]!==r||e[6]!==o?(i=(0,c.jsx)("div",{"aria-hidden":"true",className:d,"data-testid":"sql-diagnostics-overlay",ref:o,children:r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},"zn"),zn={gate:"read-only",plan:"plan",schema:"schema",syntax:"syntax"},Un=l(s=>{let e=(0,G.c)(10),{diagnostics:n,onSelect:t}=s,o=ce();if(n.length===0)return null;let r;e[0]!==o?(r=o("SQL problems"),e[0]=o,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==t){let i;e[5]!==t?(i=l((u,p)=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{className:"flex w-full items-start gap-2 px-3 py-1 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-problem",onClick:l(()=>{t(u)},"onClick"),type:"button",children:[(0,c.jsx)("span",{className:me("mt-px shrink-0 rounded px-1 font-mono text-[10px] uppercase",u.severity==="error"?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"),children:zn[u.source]}),(0,c.jsx)("span",{className:"min-w-0 text-muted-foreground",children:u.message})]})},`${u.source}-${(u.offset??p).toString()}-${p.toString()}`),"c"),e[5]=t,e[6]=i):i=e[6],a=n.map(i),e[2]=n,e[3]=t,e[4]=a}else a=e[4];let d;return e[7]!==r||e[8]!==a?(d=(0,c.jsx)("ul",{"aria-label":r,className:"max-h-24 shrink-0 overflow-y-auto border-t border-border bg-muted/30","data-testid":"sql-problems",children:a}),e[7]=r,e[8]=a,e[9]=d):d=e[9],d},"Kn"),Yn={minWidth:"2.75rem",paddingInline:"0.5rem"},Gn=l(s=>{let e=(0,G.c)(64),{assistant:n,autocomplete:t,diagnostics:o,draft:r,failed:a,handlers:d,editorRef:i,gutterRef:u,listboxId:p,onGenerated:h,onPickSuggestion:g,onRevealDiagnostic:y,overlayRef:m}=s,w=ce(),f,v,b,k,S,x,q,C;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==h){let j=r.split(`
|
|
8
|
+
`).length;q="flex min-h-0 min-w-0 flex-1 flex-col",e[13]!==n||e[14]!==a||e[15]!==h?(C=(0,c.jsx)(Qn,{assistant:n,failed:a,onGenerated:h}),e[13]=n,e[14]=a,e[15]=h,e[16]=C):C=e[16],x="flex min-h-0 min-w-0 flex-1",f="true",v="shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",b=u,k=Yn,S=Array.from({length:j},Kn),e[0]=n,e[1]=r,e[2]=a,e[3]=u,e[4]=h,e[5]=f,e[6]=v,e[7]=b,e[8]=k,e[9]=S,e[10]=x,e[11]=q,e[12]=C}else f=e[5],v=e[6],b=e[7],k=e[8],S=e[9],x=e[10],q=e[11],C=e[12];let R;e[17]!==f||e[18]!==v||e[19]!==b||e[20]!==k||e[21]!==S?(R=(0,c.jsx)("div",{"aria-hidden":f,className:v,ref:b,style:k,children:S}),e[17]=f,e[18]=v,e[19]=b,e[20]=k,e[21]=S,e[22]=R):R=e[22];let T;e[23]!==o||e[24]!==r||e[25]!==m?(T=(0,c.jsx)(Fn,{diagnostics:o,draft:r,scrollRef:m}),e[23]=o,e[24]=r,e[25]=m,e[26]=T):T=e[26];let _;e[27]!==t||e[28]!==p?(_=t===null?void 0:`${p}-opt-${t.active.toString()}`,e[27]=t,e[28]=p,e[29]=_):_=e[29];let E=t===null?void 0:p,O=t!==null,D;e[30]!==w?(D=w("SQL query"),e[30]=w,e[31]=D):D=e[31];let L;e[32]!==r||e[33]!==i||e[34]!==d.onBlur||e[35]!==d.onChange||e[36]!==d.onKeyDown||e[37]!==d.onScroll||e[38]!==d.onSelect||e[39]!==_||e[40]!==E||e[41]!==O||e[42]!==D?(L=(0,c.jsx)("textarea",{"aria-activedescendant":_,"aria-autocomplete":"list","aria-controls":E,"aria-expanded":O,"aria-label":D,className:`relative size-full resize-none bg-transparent outline-none ${bt}`,"data-testid":"sql-input",onBlur:d.onBlur,onChange:d.onChange,onKeyDown:d.onKeyDown,onScroll:d.onScroll,onSelect:d.onSelect,placeholder:"SELECT * FROM \u2026",ref:i,role:"combobox",spellCheck:!1,value:r}),e[32]=r,e[33]=i,e[34]=d.onBlur,e[35]=d.onChange,e[36]=d.onKeyDown,e[37]=d.onScroll,e[38]=d.onSelect,e[39]=_,e[40]=E,e[41]=O,e[42]=D,e[43]=L):L=e[43];let B;e[44]!==t||e[45]!==p||e[46]!==g?(B=(0,c.jsx)(gn,{listboxId:p,onPick:g,state:t}),e[44]=t,e[45]=p,e[46]=g,e[47]=B):B=e[47];let A;e[48]!==T||e[49]!==L||e[50]!==B?(A=(0,c.jsxs)("div",{className:"relative min-w-0 flex-1 bg-background",children:[T,L,B]}),e[48]=T,e[49]=L,e[50]=B,e[51]=A):A=e[51];let P;e[52]!==A||e[53]!==x||e[54]!==R?(P=(0,c.jsxs)("div",{className:x,children:[R,A]}),e[52]=A,e[53]=x,e[54]=R,e[55]=P):P=e[55];let M;e[56]!==o||e[57]!==y?(M=(0,c.jsx)(Un,{diagnostics:o,onSelect:y}),e[56]=o,e[57]=y,e[58]=M):M=e[58];let N;return e[59]!==P||e[60]!==M||e[61]!==q||e[62]!==C?(N=(0,c.jsxs)("div",{className:q,children:[C,P,M]}),e[59]=P,e[60]=M,e[61]=q,e[62]=C,e[63]=N):N=e[63],N},"Jn");function Kn(s,e){return(0,c.jsx)("div",{children:e+1},e)}l(Kn,"Vn");var gt=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],Vn=l(s=>{let e=(0,G.c)(29),{active:n,onDelete:t,onSelect:o,query:r}=s,a=ce(),d;e[0]!==o||e[1]!==r.id?(d=l(()=>{o(r.id)},"i"),e[0]=o,e[1]=r.id,e[2]=d):d=e[2];let i=d,u;e[3]!==t||e[4]!==r.id?(u=l(q=>{q.stopPropagation(),t(r.id)},"a"),e[3]=t,e[4]=r.id,e[5]=u):u=e[5];let p=u,h=n?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",g;e[6]!==h?(g=me("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",h),e[6]=h,e[7]=g):g=e[7];let y=`sql-query-${r.id}`,m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M4 6h16M4 12h10M4 18h7"})}),e[8]=m):m=e[8];let w;e[9]!==r.name?(w=(0,c.jsx)("span",{className:"truncate",children:r.name}),e[9]=r.name,e[10]=w):w=e[10];let f;e[11]!==n||e[12]!==i||e[13]!==g||e[14]!==y||e[15]!==w?(f=(0,c.jsxs)("button",{"aria-pressed":n,className:g,"data-testid":y,onClick:i,type:"button",children:[m,w]}),e[11]=n,e[12]=i,e[13]=g,e[14]=y,e[15]=w,e[16]=f):f=e[16];let v;e[17]!==a?(v=a("Delete query"),e[17]=a,e[18]=v):v=e[18];let b;e[19]!==a?(b=a("Delete query"),e[19]=a,e[20]=b):b=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[21]=k):k=e[21];let S;e[22]!==p||e[23]!==b||e[24]!==v?(S=(0,c.jsx)("button",{"aria-label":v,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:p,title:b,type:"button",children:k}),e[22]=p,e[23]=b,e[24]=v,e[25]=S):S=e[25];let x;return e[26]!==S||e[27]!==f?(x=(0,c.jsxs)("li",{className:"group/q flex items-center",children:[f,S]}),e[26]=S,e[27]=f,e[28]=x):x=e[28],x},"Xn"),it="sql-history-remember",Xn=l((s,e)=>{let n=e.trim().toLowerCase();return n===""?[...s]:s.filter(t=>t.name.toLowerCase().includes(n))},"Zn"),Jn=l(s=>{let e=(0,G.c)(66),{activeId:n,history:t,listRef:o,onClearHistory:r,onDelete:a,onLoadHistory:d,onLoadTemplate:i,onNew:u,onSearchChange:p,onSelect:h,onToggleRememberHistory:g,queries:y,rememberHistory:m,search:w}=s,f=ce(),v,b,k,S,x;if(e[0]!==n||e[1]!==o||e[2]!==a||e[3]!==u||e[4]!==p||e[5]!==h||e[6]!==g||e[7]!==y||e[8]!==w||e[9]!==f){let L=Xn(y,w),B;e[15]!==g?(B=l(H=>{g(H.target.checked)},"B"),e[15]=g,e[16]=B):B=e[16],v=B,k="flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar";let A;e[17]!==f?(A=f("Search queries\u2026"),e[17]=f,e[18]=A):A=e[18];let P;e[19]!==p||e[20]!==w||e[21]!==A?(P=(0,c.jsx)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:p,placeholder:A,type:"text",value:w}),e[19]=p,e[20]=w,e[21]=A,e[22]=P):P=e[22];let M;e[23]!==f?(M=f("New query"),e[23]=f,e[24]=M):M=e[24];let N;e[25]!==f?(N=f("New query"),e[25]=f,e[26]=N):N=e[26];let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[27]=j):j=e[27];let I;e[28]!==u||e[29]!==M||e[30]!==N?(I=(0,c.jsx)("button",{"aria-label":M,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:u,title:N,type:"button",children:j}),e[28]=u,e[29]=M,e[30]=N,e[31]=I):I=e[31],e[32]!==I||e[33]!==P?(S=(0,c.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[P,I]}),e[32]=I,e[33]=P,e[34]=S):S=e[34],b="flex flex-1 flex-col gap-4 overflow-y-auto p-2";let $;e[35]!==f?($=f("Private"),e[35]=f,e[36]=$):$=e[36];let F;e[37]!==$?(F=(0,c.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:$}),e[37]=$,e[38]=F):F=e[38],x=(0,c.jsxs)("div",{children:[F,L.length===0?(0,c.jsx)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:f("No saved queries yet \u2014 they save to this browser as you type.")}):(0,c.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:o,children:L.map(H=>(0,c.jsx)(Vn,{active:n===H.id,onDelete:a,onSelect:h,query:H},H.id))})]}),e[0]=n,e[1]=o,e[2]=a,e[3]=u,e[4]=p,e[5]=h,e[6]=g,e[7]=y,e[8]=w,e[9]=f,e[10]=v,e[11]=b,e[12]=k,e[13]=S,e[14]=x}else v=e[10],b=e[11],k=e[12],S=e[13],x=e[14];let q;e[39]!==f?(q=f("Reference"),e[39]=f,e[40]=q):q=e[40];let C;e[41]!==q?(C=(0,c.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:q}),e[41]=q,e[42]=C):C=e[42];let R;e[43]!==i?(R=gt.map(L=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":L.sql,onClick:i,type:"button",children:[(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"})}),L.label]})},L.label)),e[43]=i,e[44]=R):R=e[44];let T;e[45]!==R?(T=(0,c.jsx)("ul",{className:"flex flex-col gap-px",children:R}),e[45]=R,e[46]=T):T=e[46];let _;e[47]!==C||e[48]!==T?(_=(0,c.jsxs)("div",{children:[C,T]}),e[47]=C,e[48]=T,e[49]=_):_=e[49];let E;e[50]!==t||e[51]!==r||e[52]!==d||e[53]!==v||e[54]!==m||e[55]!==f?(E=t.length>0&&(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,c.jsx)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:f("History")}),(0,c.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:r,type:"button",children:f("Clear history")})]}),(0,c.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 pb-1.5 text-[11px] text-muted-foreground",htmlFor:it,children:[(0,c.jsx)("input",{checked:m,"data-testid":"sql-history-remember",id:it,onChange:v,type:"checkbox"}),f("Keep history on this browser")]}),(0,c.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:t.map(L=>(0,c.jsx)("li",{children:(0,c.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":L.sql,"data-testid":"sql-history-item",onClick:d,title:L.sql,type:"button",children:[(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"})}),(0,c.jsx)("span",{className:"truncate font-mono",children:L.sql})]})},`${L.at.toString()}:${L.sql}`))})]}),e[50]=t,e[51]=r,e[52]=d,e[53]=v,e[54]=m,e[55]=f,e[56]=E):E=e[56];let O;e[57]!==b||e[58]!==E||e[59]!==x||e[60]!==_?(O=(0,c.jsxs)("div",{className:b,children:[x,_,E]}),e[57]=b,e[58]=E,e[59]=x,e[60]=_,e[61]=O):O=e[61];let D;return e[62]!==O||e[63]!==k||e[64]!==S?(D=(0,c.jsxs)("aside",{className:k,children:[S,O]}),e[62]=O,e[63]=k,e[64]=S,e[65]=D):D=e[65],D},"es"),De=l(s=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${s?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"Ie"),Zn=l(s=>{let e=(0,G.c)(96),{assistant:n,chart:t,className:o,error:r,onFormat:a,onInferChart:d,onRun:i,onSelectStatement:u,onShardKeyChange:p,onShowChart:h,onShowExplain:g,onShowResults:y,onToggleSplit:m,pane:w,result:f,running:v,script:b,shardKey:k,splitView:S}=s,x=ce(),q=w==="results",C;e[0]!==q?(C=De(q),e[0]=q,e[1]=C):C=e[1];let R;e[2]!==x?(R=x("Results"),e[2]=x,e[3]=R):R=e[3];let T;e[4]!==y||e[5]!==C||e[6]!==R?(T=(0,c.jsx)("button",{className:C,"data-testid":"sql-tab-results",onClick:y,type:"button",children:R}),e[4]=y,e[5]=C,e[6]=R,e[7]=T):T=e[7];let _=w==="chart",E;e[8]!==_?(E=De(_),e[8]=_,e[9]=E):E=e[9];let O;e[10]!==x?(O=x("Chart"),e[10]=x,e[11]=O):O=e[11];let D;e[12]!==h||e[13]!==E||e[14]!==O?(D=(0,c.jsx)("button",{className:E,"data-testid":"sql-tab-chart",onClick:h,type:"button",children:O}),e[12]=h,e[13]=E,e[14]=O,e[15]=D):D=e[15];let L;e[16]!==n||e[17]!==d||e[18]!==w||e[19]!==f||e[20]!==x?(L=!n.unavailable&&w==="chart"&&f!==null&&(0,c.jsx)("button",{className:De(!1),"data-testid":"sql-infer-chart",disabled:n.pending("chart"),onClick:d,type:"button",children:n.pending("chart")?x("Thinking\u2026"):x("Suggest chart")}),e[16]=n,e[17]=d,e[18]=w,e[19]=f,e[20]=x,e[21]=L):L=e[21];let B=w==="explain",A;e[22]!==B?(A=De(B),e[22]=B,e[23]=A):A=e[23];let P;e[24]!==x?(P=x("Explain"),e[24]=x,e[25]=P):P=e[25];let M;e[26]!==g||e[27]!==A||e[28]!==P?(M=(0,c.jsx)("button",{className:A,"data-testid":"sql-tab-explain",onClick:g,type:"button",children:P}),e[26]=g,e[27]=A,e[28]=P,e[29]=M):M=e[29];let N;e[30]!==x?(N=x("Split editor and results"),e[30]=x,e[31]=N):N=e[31];let j=`inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${S?"bg-accent text-foreground":"text-muted-foreground"}`,I;e[32]!==x?(I=x("Split editor and results"),e[32]=x,e[33]=I):I=e[33];let $;e[34]===Symbol.for("react.memo_cache_sentinel")?($=(0,c.jsxs)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:[(0,c.jsx)("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),(0,c.jsx)("path",{d:"M12 4v16"})]}),e[34]=$):$=e[34];let F;e[35]!==m||e[36]!==S||e[37]!==N||e[38]!==j||e[39]!==I?(F=(0,c.jsx)("button",{"aria-label":N,"aria-pressed":S,className:j,"data-testid":"sql-split-toggle",onClick:m,title:I,type:"button",children:$}),e[35]=m,e[36]=S,e[37]=N,e[38]=j,e[39]=I,e[40]=F):F=e[40];let H;e[41]!==f?(H=f!==null&&f.columns.length>0&&(0,c.jsx)(nt,{columns:f.columns,name:"query-result",rows:f.rows}),e[41]=f,e[42]=H):H=e[42];let J;e[43]!==x?(J=x("Format"),e[43]=x,e[44]=J):J=e[44];let Z;e[45]!==a||e[46]!==v||e[47]!==J?(Z=(0,c.jsx)("button",{className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-format",disabled:v,onClick:a,type:"button",children:J}),e[45]=a,e[46]=v,e[47]=J,e[48]=Z):Z=e[48];let ee;e[49]!==p||e[50]!==k?(ee=(0,c.jsx)(Je,{onChange:p,testId:"sql-shard-input",value:k}),e[49]=p,e[50]=k,e[51]=ee):ee=e[51];let te;e[52]!==v||e[53]!==x?(te=x(v?"Running\u2026":"Run"),e[52]=v,e[53]=x,e[54]=te):te=e[54];let ie;e[55]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,c.jsx)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"}),e[55]=ie):ie=e[55];let V;e[56]!==i||e[57]!==v||e[58]!==te?(V=(0,c.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-run",disabled:v,onClick:i,type:"button",children:[te,ie]}),e[56]=i,e[57]=v,e[58]=te,e[59]=V):V=e[59];let Q;e[60]!==F||e[61]!==H||e[62]!==Z||e[63]!==ee||e[64]!==V?(Q=(0,c.jsxs)("div",{className:"ms-auto flex items-center gap-2",children:[F,H,Z,ee,V]}),e[60]=F,e[61]=H,e[62]=Z,e[63]=ee,e[64]=V,e[65]=Q):Q=e[65];let ne;e[66]!==M||e[67]!==Q||e[68]!==T||e[69]!==D||e[70]!==L?(ne=(0,c.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[T,D,L,M,Q]}),e[66]=M,e[67]=Q,e[68]=T,e[69]=D,e[70]=L,e[71]=ne):ne=e[71];let re;e[72]!==u||e[73]!==b?(re=b!==void 0&&(0,c.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-3 py-1.5","data-testid":"sql-statements",children:b.runs.map((Y,X)=>(0,c.jsx)("button",{"aria-pressed":X===b.selected,className:`rounded-md border px-2 py-0.5 font-mono text-[11px] outline-none transition-colors ${X===b.selected?"border-foreground text-foreground":"border-border text-muted-foreground hover:text-foreground"} ${Y.error===null?"":"border-destructive/50 text-destructive"}`,"data-testid":`sql-statement-${X.toString()}`,onClick:l(()=>{u(X)},"onClick"),title:Y.sql,type:"button",children:X+1},`${X.toString()}:${Y.sql}`))}),e[72]=u,e[73]=b,e[74]=re):re=e[74];let oe;e[75]!==r?(oe=r!==null&&(0,c.jsx)(Ze,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:r}),e[75]=r,e[76]=oe):oe=e[76];let se;e[77]!==r||e[78]!==f||e[79]!==x?(se=r===null&&f===null&&(0,c.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:x("Click Run to execute your query.")}),e[77]=r,e[78]=f,e[79]=x,e[80]=se):se=e[80];let le;e[81]!==t||e[82]!==r||e[83]!==w||e[84]!==f||e[85]!==x?(le=r===null&&f!==null&&(0,c.jsxs)("div",{"data-testid":"sql-result",children:[w==="chart"?(0,c.jsx)(rt,{axes:t,result:f}):(0,c.jsx)(ot,{result:f}),(0,c.jsx)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:f.truncated?x("Showing the first {max} of {count} rows.",{count:f.rowCount,max:f.rows.length}):x("{count} rows",{count:f.rowCount})})]}),e[81]=t,e[82]=r,e[83]=w,e[84]=f,e[85]=x,e[86]=le):le=e[86];let W;e[87]!==oe||e[88]!==se||e[89]!==le?(W=(0,c.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto",children:[oe,se,le]}),e[87]=oe,e[88]=se,e[89]=le,e[90]=W):W=e[90];let U;return e[91]!==o||e[92]!==ne||e[93]!==re||e[94]!==W?(U=(0,c.jsxs)("div",{className:o,children:[ne,re,W]}),e[91]=o,e[92]=ne,e[93]=re,e[94]=W,e[95]=U):U=e[95],U},"ts"),er=l((s,e)=>s.trim()===""?e:(s.split(`
|
|
9
|
+
`)[0]??s).slice(0,24),"ns"),tr=l(s=>{s?.focus(),s?.select()},"ss"),nr=l(s=>{let e=(0,G.c)(14),{initial:n,onCancel:t,onCommit:o,placeholder:r,testId:a}=s,d=ce(),i;e[0]!==o?(i=l(m=>{o(m.currentTarget.value.trim())},"c"),e[0]=o,e[1]=i):i=e[1];let u=i,p;e[2]!==t||e[3]!==o?(p=l(m=>{m.key==="Enter"?o(m.currentTarget.value.trim()):m.key==="Escape"&&t()},"m"),e[2]=t,e[3]=o,e[4]=p):p=e[4];let h=p,g;e[5]!==d?(g=d("Tab title"),e[5]=d,e[6]=g):g=e[6];let y;return e[7]!==n||e[8]!==u||e[9]!==h||e[10]!==r||e[11]!==g||e[12]!==a?(y=(0,c.jsx)("input",{"aria-label":g,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":a,defaultValue:n,onBlur:u,onKeyDown:h,placeholder:r,ref:tr,type:"text"}),e[7]=n,e[8]=u,e[9]=h,e[10]=r,e[11]=g,e[12]=a,e[13]=y):y=e[13],y},"os"),rr=l(s=>{let e=(0,G.c)(29),{idBase:n,onDiscard:t,onKeep:o}=s,r=ce(),a=`sql-tab-close-prompt-${n}`,d;e[0]!==r?(d=r("Discard?"),e[0]=r,e[1]=d):d=e[1];let i;e[2]!==d?(i=(0,c.jsx)("span",{className:"text-[11px] text-muted-foreground",children:d}),e[2]=d,e[3]=i):i=e[3];let u;e[4]!==r?(u=r("Discard changes"),e[4]=r,e[5]=u):u=e[5];let p=`sql-tab-close-confirm-${n}`,h;e[6]!==r?(h=r("Discard changes"),e[6]=r,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M5 13l4 4L19 7"})}),e[8]=g):g=e[8];let y;e[9]!==t||e[10]!==u||e[11]!==p||e[12]!==h?(y=(0,c.jsx)("button",{"aria-label":u,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":p,onClick:t,title:h,type:"button",children:g}),e[9]=t,e[10]=u,e[11]=p,e[12]=h,e[13]=y):y=e[13];let m;e[14]!==r?(m=r("Keep editing"),e[14]=r,e[15]=m):m=e[15];let w=`sql-tab-close-cancel-${n}`,f;e[16]!==r?(f=r("Keep editing"),e[16]=r,e[17]=f):f=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})}),e[18]=v):v=e[18];let b;e[19]!==o||e[20]!==w||e[21]!==f||e[22]!==m?(b=(0,c.jsx)("button",{"aria-label":m,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":w,onClick:o,title:f,type:"button",children:v}),e[19]=o,e[20]=w,e[21]=f,e[22]=m,e[23]=b):b=e[23];let k;return e[24]!==a||e[25]!==b||e[26]!==i||e[27]!==y?(k=(0,c.jsxs)("span",{className:"flex shrink-0 items-center gap-1","data-testid":a,role:"group",children:[i,y,b]}),e[24]=a,e[25]=b,e[26]=i,e[27]=y,e[28]=k):k=e[28],k},"ls"),or=l(s=>{let e=(0,G.c)(47),{active:n,canClose:t,onClose:o,onMenu:r,onRename:a,onSelect:d,tab:i}=s,u=ce(),[p,h]=(0,z.useState)(!1),[g,y]=(0,z.useState)(!1),m;e[0]!==r||e[1]!==i.id?(m=l(H=>{r(i.id,H)},"d"),e[0]=r,e[1]=i.id,e[2]=m):m=e[2];let w=m,f;e[3]!==d||e[4]!==i.id?(f=l(()=>{d(i.id)},"u"),e[3]=d,e[4]=i.id,e[5]=f):f=e[5];let v=f,b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=l(()=>{h(!0)},"h"),e[6]=b):b=e[6];let k=b,S;e[7]!==o||e[8]!==i?(S=l(H=>{H.stopPropagation(),pt(i)?y(!0):o(i.id)},"v"),e[7]=o,e[8]=i,e[9]=S):S=e[9];let x=S,q;e[10]!==o||e[11]!==i.id?(q=l(H=>{H.stopPropagation(),y(!1),o(i.id)},"k"),e[10]=o,e[11]=i.id,e[12]=q):q=e[12];let C=q,R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=l(H=>{H.stopPropagation(),y(!1)},"L"),e[13]=R):R=e[13];let T=R,_;e[14]!==a||e[15]!==i.id?(_=l(H=>{a(i.id,H),h(!1)},"q"),e[14]=a,e[15]=i.id,e[16]=_):_=e[16];let E=_,O;e[17]===Symbol.for("react.memo_cache_sentinel")?(O=l(()=>{h(!1)},"A"),e[17]=O):O=e[17];let D=O,L;e[18]!==i.name?(L=i.name.trim(),e[18]=i.name,e[19]=L):L=e[19];let B=L,A;e[20]!==u||e[21]!==i.sql?(A=er(i.sql,u("Untitled")),e[20]=u,e[21]=i.sql,e[22]=A):A=e[22];let P=A,M=n?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",N;e[23]!==M?(N=me("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",M),e[23]=M,e[24]=N):N=e[24];let j=`sql-tab-${i.id}`,I;e[25]!==n||e[26]!==E||e[27]!==B||e[28]!==P||e[29]!==p||e[30]!==v||e[31]!==u||e[32]!==i.id?(I=p?(0,c.jsx)(nr,{initial:B,onCancel:D,onCommit:E,placeholder:P,testId:`sql-tab-rename-${i.id}`}):(0,c.jsx)("button",{"aria-pressed":n,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${i.id}`,onClick:v,onDoubleClick:k,title:u("Double-click to rename"),type:"button",children:B===""?P:B}),e[25]=n,e[26]=E,e[27]=B,e[28]=P,e[29]=p,e[30]=v,e[31]=u,e[32]=i.id,e[33]=I):I=e[33];let $;e[34]!==t||e[35]!==C||e[36]!==g||e[37]!==x||e[38]!==u||e[39]!==i.id?($=t&&(g?(0,c.jsx)(rr,{idBase:i.id,onDiscard:C,onKeep:T}):(0,c.jsx)("button",{"aria-label":u("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${i.id}`,onClick:x,title:u("Close tab"),type:"button",children:(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})),e[34]=t,e[35]=C,e[36]=g,e[37]=x,e[38]=u,e[39]=i.id,e[40]=$):$=e[40];let F;return e[41]!==w||e[42]!==N||e[43]!==j||e[44]!==I||e[45]!==$?(F=(0,c.jsxs)("div",{className:N,"data-testid":j,onContextMenu:w,children:[I,$]}),e[41]=w,e[42]=N,e[43]=j,e[44]=I,e[45]=$,e[46]=F):F=e[46],F},"rs"),sr=l(s=>{let e=(0,G.c)(43),{model:n,onSelect:t}=s,o=ce(),{activeTab:r,addEditorTab:a,cancelBulk:d,closeEditorTab:i,closeTabMenu:u,confirmBulk:p,menuStyle:h,onBackdropContextMenu:g,onCloseAll:y,onCloseOthers:m,onCloseToRight:w,openTabMenu:f,pendingBulk:v,renameTab:b,tabMenu:k,tabs:S}=n,x;if(e[0]!==r||e[1]!==i||e[2]!==t||e[3]!==f||e[4]!==b||e[5]!==S){let L;e[7]!==r||e[8]!==i||e[9]!==t||e[10]!==f||e[11]!==b||e[12]!==S.length?(L=l(B=>(0,c.jsx)(or,{active:B.id===r.id,canClose:S.length>1,onClose:i,onMenu:f,onRename:b,onSelect:t,tab:B},B.id),"I"),e[7]=r,e[8]=i,e[9]=t,e[10]=f,e[11]=b,e[12]=S.length,e[13]=L):L=e[13],x=S.map(L),e[0]=r,e[1]=i,e[2]=t,e[3]=f,e[4]=b,e[5]=S,e[6]=x}else x=e[6];let q;e[14]!==o?(q=o("New tab"),e[14]=o,e[15]=q):q=e[15];let C=S.length>=Ue,R;e[16]!==o?(R=o("New tab"),e[16]=o,e[17]=R):R=e[17];let T;e[18]===Symbol.for("react.memo_cache_sentinel")?(T=(0,c.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,c.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[18]=T):T=e[18];let _;e[19]!==a||e[20]!==q||e[21]!==C||e[22]!==R?(_=(0,c.jsx)("button",{"aria-label":q,className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:C,onClick:a,title:R,type:"button",children:T}),e[19]=a,e[20]=q,e[21]=C,e[22]=R,e[23]=_):_=e[23];let E;e[24]!==x||e[25]!==_?(E=(0,c.jsxs)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[x,_]}),e[24]=x,e[25]=_,e[26]=E):E=e[26];let O;e[27]!==d||e[28]!==u||e[29]!==p||e[30]!==h||e[31]!==g||e[32]!==y||e[33]!==m||e[34]!==w||e[35]!==v||e[36]!==o||e[37]!==k||e[38]!==S?(O=k!==null&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:u,onContextMenu:g,role:"presentation"}),(0,c.jsx)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:h,children:v===null?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:S.length<=1,onClick:m,role:"menuitem",type:"button",children:o("Close other tabs")}),(0,c.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:S.findIndex(L=>L.id===k.id)>=S.length-1,onClick:w,role:"menuitem",type:"button",children:o("Close tabs to the right")}),(0,c.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:y,role:"menuitem",type:"button",children:o("Close all tabs")})]}):(0,c.jsxs)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,c.jsx)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:o("Discard unsaved tabs?")}),(0,c.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,c.jsx)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:p,type:"button",children:o("Discard")}),(0,c.jsx)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:d,type:"button",children:o("Cancel")})]})]})})]}),e[27]=d,e[28]=u,e[29]=p,e[30]=h,e[31]=g,e[32]=y,e[33]=m,e[34]=w,e[35]=v,e[36]=o,e[37]=k,e[38]=S,e[39]=O):O=e[39];let D;return e[40]!==E||e[41]!==O?(D=(0,c.jsxs)(c.Fragment,{children:[E,O]}),e[40]=E,e[41]=O,e[42]=D):D=e[42],D},"is"),lr=we(Ne.runSql),ar="lunora-studio-sql-split-view",ir=l(()=>Ce(gt[0]?.sql??""),"ds"),kr=l(s=>{let e=(0,G.c)(112),{initialShardKey:n}=s,t=Ee(),o=Dn(ir),{activeTab:r,output:a,patchActiveOutput:d,patchActiveTab:i,setActiveTabId:u,unlinkQuery:p}=o,h;e[0]!==d||e[1]!==i?(h=l((K,ae)=>{i({activeId:ae,sql:K}),d({chart:void 0,error:null,failed:void 0,result:null,script:void 0})},"g"),e[0]=d,e[1]=i,e[2]=h):h=e[2];let g=h,y;e[3]!==g||e[4]!==p?(y={loadIntoActiveTab:g,unlinkQuery:p},e[3]=g,e[4]=p,e[5]=y):y=e[5];let m=Wn(y),{recordHistory:w,updateQuerySql:f}=m,v=r.sql,{activeId:b}=r,{chart:k,error:S,failed:x,result:q,running:C}=a,R=a.pane,[T,_]=(0,z.useState)(n??""),[E,O]=_e(ar,!1),{probe:D,schema:L}=yn(T),B;e[6]!==b||e[7]!==i||e[8]!==f?(B=l(K=>{i({sql:K}),b!==null&&f(b,K)},"B"),e[6]=b,e[7]=i,e[8]=f,e[9]=B):B=e[9];let A=B,P=rn(v,L,T),M=tt(T),N;e[10]!==M||e[11]!==d||e[12]!==q?(N=l(()=>{q!==null&&ue((async()=>{let K=await M.inferChart({columns:q.columns,rowCount:q.rowCount,types:Object.fromEntries(q.columns.map(ae=>[ae,typeof(q.rows[0]?.[ae]??"")]))});d({chart:K})})())},"w"),e[10]=M,e[11]=d,e[12]=q,e[13]=N):N=e[13];let j=N,I;e[14]!==t||e[15]!==w||e[16]!==T?(I=l(async K=>{try{let ae=await t.query(lr,{sql:K},ke(T));return w(K),{error:null,result:ae,sql:K}}catch(ae){return{error:Ke(ae),result:null,sql:K}}},"R"),e[14]=t,e[15]=w,e[16]=T,e[17]=I):I=e[17];let $=I,F;e[18]!==v||e[19]!==d||e[20]!==$||e[21]!==T?(F=l(async K=>{if(v.trim()==="")return;d({running:!0});let ae=K==="explain"?Fe(`EXPLAIN QUERY PLAN ${v}`,0):dt(v),de=[];for(let Re of ae){let xt={error:Re.rejection?.message??"",result:null,sql:Re.sql};de.push(Re.rejection===void 0?await $(Re.sql):xt)}Xe(T);let Ye=Math.max(de.length-1,0),ye=de[Ye];d({chart:void 0,error:ye?.error??null,failed:ye?.error===null||ye===void 0?void 0:{error:ye.error,sql:ye.sql},pane:K,result:ye?.result??null,running:!1,script:de.length>1?{runs:de,selected:Ye}:void 0})},"U"),e[18]=v,e[19]=d,e[20]=$,e[21]=T,e[22]=F):F=e[22];let H=F,J;e[23]!==a.script?.runs||e[24]!==d?(J=l(K=>{let ae=a.script?.runs,de=ae?.[K];ae===void 0||de===void 0||d({chart:void 0,error:de.error,failed:de.error===null?void 0:{error:de.error,sql:de.sql},result:de.result,script:{runs:ae,selected:K}})},"X"),e[23]=a.script?.runs,e[24]=d,e[25]=J):J=e[25];let Z=J,ee;e[26]!==H?(ee=l(()=>{ue(H("results"))},"ee"),e[26]=H,e[27]=ee):ee=e[27];let te=ee,ie;e[28]!==a.pane||e[29]!==H?(ie=l(()=>{ue(H(a.pane))},"ie"),e[28]=a.pane,e[29]=H,e[30]=ie):ie=e[30];let V;e[31]!==D||e[32]!==L||e[33]!==A||e[34]!==ie?(V={onSubmit:ie,probe:D,schema:L,setDraft:A},e[31]=D,e[32]=L,e[33]=A,e[34]=ie,e[35]=V):V=e[35];let Q=kn(V),{closeAutocomplete:ne}=Q,re;e[36]!==v||e[37]!==A?(re=l(()=>{A(Tt(v))},"se"),e[36]=v,e[37]=A,e[38]=re):re=e[38];let oe=re,se;e[39]!==ne||e[40]!==u?(se=l(K=>{ne(),u(K)},"le"),e[39]=ne,e[40]=u,e[41]=se):se=e[41];let le=se,W;e[42]!==d?(W=l(()=>{d({pane:"results"})},"H"),e[42]=d,e[43]=W):W=e[43];let U=W,Y;e[44]!==H?(Y=l(()=>{ue(H("explain"))},"z"),e[44]=H,e[45]=Y):Y=e[45];let X=Y,fe;e[46]!==d?(fe=l(()=>{d({pane:"chart"})},"me"),e[46]=d,e[47]=fe):fe=e[47];let Ae=fe,Te;e[48]!==O||e[49]!==E?(Te=l(()=>{O(!E)},"ke"),e[48]=O,e[49]=E,e[50]=Te):Te=e[50];let $e=Te,Be=E?"flex min-h-0 flex-1 flex-row":"flex min-h-0 flex-1 flex-col",He=E?"flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border":"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border",he;e[51]!==b||e[52]!==m.clearHistory||e[53]!==m.deleteQuery||e[54]!==m.history||e[55]!==m.listRef||e[56]!==m.loadFromHistory||e[57]!==m.loadTemplate||e[58]!==m.newQuery||e[59]!==m.onSearchChange||e[60]!==m.queries||e[61]!==m.rememberHistory||e[62]!==m.search||e[63]!==m.selectQuery||e[64]!==m.setRememberHistory?(he=(0,c.jsx)(Jn,{activeId:b,history:m.history,listRef:m.listRef,onClearHistory:m.clearHistory,onDelete:m.deleteQuery,onLoadHistory:m.loadFromHistory,onLoadTemplate:m.loadTemplate,onNew:m.newQuery,onSearchChange:m.onSearchChange,onSelect:m.selectQuery,onToggleRememberHistory:m.setRememberHistory,queries:m.queries,rememberHistory:m.rememberHistory,search:m.search}),e[51]=b,e[52]=m.clearHistory,e[53]=m.deleteQuery,e[54]=m.history,e[55]=m.listRef,e[56]=m.loadFromHistory,e[57]=m.loadTemplate,e[58]=m.newQuery,e[59]=m.onSearchChange,e[60]=m.queries,e[61]=m.rememberHistory,e[62]=m.search,e[63]=m.selectQuery,e[64]=m.setRememberHistory,e[65]=he):he=e[65];let pe;e[66]!==o||e[67]!==le?(pe=(0,c.jsx)(sr,{model:o,onSelect:le}),e[66]=o,e[67]=le,e[68]=pe):pe=e[68];let be;e[69]!==M||e[70]!==P||e[71]!==v||e[72]!==x||e[73]!==A||e[74]!==Q.autocompleteState||e[75]!==Q.editorRef||e[76]!==Q.gutterRef||e[77]!==Q.handlers||e[78]!==Q.listboxId||e[79]!==Q.onPickSuggestion||e[80]!==Q.overlayRef||e[81]!==Q.revealDiagnostic?(be=(0,c.jsx)(Gn,{assistant:M,autocomplete:Q.autocompleteState,diagnostics:P,draft:v,editorRef:Q.editorRef,failed:x,gutterRef:Q.gutterRef,handlers:Q.handlers,listboxId:Q.listboxId,onGenerated:A,onPickSuggestion:Q.onPickSuggestion,onRevealDiagnostic:Q.revealDiagnostic,overlayRef:Q.overlayRef}),e[69]=M,e[70]=P,e[71]=v,e[72]=x,e[73]=A,e[74]=Q.autocompleteState,e[75]=Q.editorRef,e[76]=Q.gutterRef,e[77]=Q.handlers,e[78]=Q.listboxId,e[79]=Q.onPickSuggestion,e[80]=Q.overlayRef,e[81]=Q.revealDiagnostic,e[82]=be):be=e[82];let ge;e[83]!==M||e[84]!==S||e[85]!==oe||e[86]!==j||e[87]!==k||e[88]!==te||e[89]!==Z||e[90]!==a.script||e[91]!==q||e[92]!==He||e[93]!==C||e[94]!==T||e[95]!==Ae||e[96]!==X||e[97]!==U||e[98]!==E||e[99]!==R||e[100]!==$e?(ge=(0,c.jsx)(Zn,{assistant:M,chart:k,className:He,error:S,onFormat:oe,onInferChart:j,onRun:te,onSelectStatement:Z,onShardKeyChange:_,onShowChart:Ae,onShowExplain:X,onShowResults:U,onToggleSplit:$e,pane:R,result:q,running:C,script:a.script,shardKey:T,splitView:E}),e[83]=M,e[84]=S,e[85]=oe,e[86]=j,e[87]=k,e[88]=te,e[89]=Z,e[90]=a.script,e[91]=q,e[92]=He,e[93]=C,e[94]=T,e[95]=Ae,e[96]=X,e[97]=U,e[98]=E,e[99]=R,e[100]=$e,e[101]=ge):ge=e[101];let xe;e[102]!==be||e[103]!==ge||e[104]!==Be?(xe=(0,c.jsxs)("div",{className:Be,children:[be,ge]}),e[102]=be,e[103]=ge,e[104]=Be,e[105]=xe):xe=e[105];let ve;e[106]!==pe||e[107]!==xe?(ve=(0,c.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[pe,xe]}),e[106]=pe,e[107]=xe,e[108]=ve):ve=e[108];let Ie;return e[109]!==he||e[110]!==ve?(Ie=(0,c.jsxs)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[he,ve]}),e[109]=he,e[110]=ve,e[111]=Ie):Ie=e[111],Ie},"Rs");export{kr as SqlEditorPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"./chunk-RCZTUWG3.js";import{a as c,d as l,f as x,g,i as v}from"./chunk-R5ZTCHCE.js";var u=l(x(),1);var s=l(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=c(f=>{let t=(0,u.c)(10),{children:d,className:i,icon:m,testId:o,variant:n}=f,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]!==m||t[6]!==e||t[7]!==r||t[8]!==o?(a=(0,s.jsxs)("div",{className:e,"data-testid":o,role:"alert",children:[m,r]}),t[5]=m,t[6]=e,t[7]=r,t[8]=o,t[9]=a):a=t[9],a},"N");export{j as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ke}from"./chunk-NIX2QSSN.js";import{a as Qe,b as Me}from"./chunk-PRWFHSHC.js";import{a as Ye}from"./chunk-MG7VPUFA.js";import{a as Ve}from"./chunk-5JLIP2HH.js";import{a as D}from"./chunk-NXXGISFB.js";import{a as Je}from"./chunk-WUW4ZHRL.js";import{a as Ge}from"./chunk-M3NNNOD5.js";import"./chunk-VZCS5GXZ.js";import"./chunk-DKSLOJDQ.js";import{P as L}from"./chunk-AOAJGSYZ.js";import"./chunk-TFMQSCGC.js";import{a as z}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as P}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{b as Ze}from"./chunk-L6ATKZKO.js";import{f as O}from"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{a as We}from"./chunk-UANVABQG.js";import{a as Ue,b as $e,c as _e,d as q,e as U,f as $}from"./chunk-L4EZAHCD.js";import{a as we,e as Ce}from"./chunk-IYWVSMAY.js";import{d as H,h as je,m as Ae,o as ze,s as Ie}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as r,d as qe,e as et,f as tt,g as at}from"./chunk-R5ZTCHCE.js";var k=qe(et(),1);var W=qe(tt(),1);var t=qe(at(),1);Qe.capabilities;var st=r(()=>{let u=(0,W.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},"tt"),lt={boolean:"checkbox",date:"datetime-local",number:"number",string:"text"},rt=r((u,e)=>u.type==="boolean"?!0:typeof e!="string"||e.trim()===""?!1:u.type!=="number"||!Number.isNaN(Number(e.trim())),"lt"),it=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}}},"at"),nt=r(u=>{let e=(0,W.c)(105),{onClose:l,onCreated:s}=u,c=O(),a=H(),{config:o}=Me(),{busy:i,error:n,run:m}=Ye(),[w,S]=(0,k.useState)(""),[x,C]=(0,k.useState)(""),[y,I]=(0,k.useState)(""),[h,g]=(0,k.useState)(""),b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={},e[0]=b):b=e[0];let[f,d]=(0,k.useState)(b),A;e[1]===Symbol.for("react.memo_cache_sentinel")?(A=r(p=>{S(p.target.value)},"C"),e[1]=A):A=e[1];let v=A,F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r(p=>{C(p.target.value)},"I"),e[2]=F):F=e[2];let T=F,R;e[3]===Symbol.for("react.memo_cache_sentinel")?(R=r(p=>{I(p.target.value)},"T"),e[3]=R):R=e[3];let Le=R,Z;e[4]===Symbol.for("react.memo_cache_sentinel")?(Z=r(p=>{g(p.target.value)},"q"),e[4]=Z):Z=e[4];let Pe=Z,J;e[5]===Symbol.for("react.memo_cache_sentinel")?(J=r((p,_)=>{d(V=>({...V,[p]:_}))},"Y"),e[5]=J):J=e[5];let Re=J,Q;e[6]!==f?(Q=r(p=>f[p.name]??(p.type==="boolean"?!1:""),"G"),e[6]=f,e[7]=Q):Q=e[7];let B=Q,Y;if(e[8]!==o.userFields||e[9]!==B){let p;e[11]!==B?(p=r(_=>!_.required||rt(_,B(_)),"f"),e[11]=B,e[12]=p):p=e[12],Y=o.userFields.every(p),e[8]=o.userFields,e[9]=B,e[10]=Y}else Y=e[10];let Fe=Y,G;e[13]!==i||e[14]!==w||e[15]!==x||e[16]!==Fe?(G=!i&&w.trim()!==""&&x.trim()!==""&&Fe,e[13]=i,e[14]=w,e[15]=x,e[16]=Fe,e[17]=G):G=e[17];let De=G,K;e[18]!==o.userFields||e[19]!==B?(K=r(()=>{let p={};for(let _ of o.userFields){let V=it(_,B(_));V!==void 0&&(p[_.name]=V.value)}return Object.keys(p).length===0?void 0:p},"W"),e[18]=o.userFields,e[19]=B,e[20]=K):K=e[20];let Se=K,X;e[21]!==Se||e[22]!==c||e[23]!==w||e[24]!==x||e[25]!==l||e[26]!==s||e[27]!==y||e[28]!==h||e[29]!==m?(X=r(()=>{m(async()=>{await c.createAuthUser({data:Se(),email:w.trim(),name:x.trim(),password:y===""?void 0:y,role:h.trim()===""?void 0:h.trim()}),s(),l()})},"J"),e[21]=Se,e[22]=c,e[23]=w,e[24]=x,e[25]=l,e[26]=s,e[27]=y,e[28]=h,e[29]=m,e[30]=X):X=e[30];let N=X,j;e[31]!==a?(j=a("Create user"),e[31]=a,e[32]=j):j=e[32];let E;e[33]!==a?(E=a("Create user"),e[33]=a,e[34]=E):E=e[34];let M;e[35]!==E?(M=(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:E}),e[35]=E,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)(L,{"data-testid":"uc-email",id:"uc-email",onChange:v,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]!==x?(ie=(0,t.jsx)(L,{"data-testid":"uc-name",id:"uc-name",onChange:T,value:x}),e[50]=x,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)(L,{"data-testid":"uc-password",id:"uc-password",onChange:Le,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)(L,{"data-testid":"uc-role",id:"uc-role",onChange:Pe,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 be;e[73]!==o.userFields||e[74]!==B||e[75]!==a?(be=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 Ee=B(p)===!0;return(0,t.jsxs)("label",{className:"flex items-center gap-2",htmlFor:_,children:[(0,t.jsx)(Ke,{checked:Ee,"data-testid":_,id:_,onCheckedChange:r(Xe=>{Re(p.name,Xe)},"onCheckedChange")}),(0,t.jsxs)("span",{className:"text-sm",children:[p.name,V]})]},p.name)}let He=B(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)(L,{"data-testid":_,id:_,onChange:r(Ee=>{Re(p.name,Ee.target.value)},"onChange"),type:lt[p.type],value:typeof He=="string"?He:""})]},p.name)})]}),e[73]=o.userFields,e[74]=B,e[75]=a,e[76]=be):be=e[76];let ve;e[77]!==n?(ve=n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"uc-error",role:"alert",children:n}),e[77]=n,e[78]=ve):ve=e[78];let xe;e[79]!==a?(xe=a("Cancel"),e[79]=a,e[80]=xe):xe=e[80];let ye;e[81]!==l||e[82]!==xe?(ye=(0,t.jsx)(z,{"data-testid":"uc-cancel",onClick:l,size:"sm",type:"button",variant:"outline",children:xe}),e[81]=l,e[82]=xe,e[83]=ye):ye=e[83];let Te=!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]!==Te||e[89]!==ge?(Ne=(0,t.jsx)(z,{"data-testid":"uc-submit",disabled:Te,onClick:N,size:"sm",type:"button",children:ge}),e[87]=N,e[88]=Te,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 Be;return e[94]!==l||e[95]!==j||e[96]!==M||e[97]!==se||e[98]!==ne||e[99]!==ue||e[100]!==fe||e[101]!==be||e[102]!==ve||e[103]!==ke?(Be=(0,t.jsxs)(Ve,{label:j,onClose:l,panelTestId:"uc-dialog",testId:"uc-overlay",variant:"dialog",children:[M,se,ne,ue,fe,be,ve,ke]}),e[94]=l,e[95]=j,e[96]=M,e[97]=se,e[98]=ne,e[99]=ue,e[100]=fe,e[101]=be,e[102]=ve,e[103]=ke,e[104]=Be):Be=e[104],Be},"nt"),Oe=r(u=>{let e=(0,W.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},"Oe"),dt=r(u=>{let e=(0,W.c)(29),{busy:l,runAction:s,userId:c,version:a}=u,o=O(),i=H(),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(null),x;e[0]!==o||e[1]!==c?(x=r(()=>{ze((async()=>{S(null);try{let v=await o.listAuthSessions({limit:50,userId:c});m(v.rows)}catch(v){let F=v;m(null),S(je(F))}})())},"x"),e[0]=o,e[1]=c,e[2]=x):x=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)(x,C);let y;e[7]!==o||e[8]!==s?(y=r(v=>{s(()=>o.revokeAuthSession({sessionId:v}))},"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)(Oe,{children:h}),e[12]=h,e[13]=g):g=e[13];let b;e[14]!==w?(b=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]=b):b=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)(q,{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(v=>(0,t.jsxs)(q,{"data-testid":`ud-session-${v.id}`,children:[(0,t.jsx)($,{className:"text-muted-foreground tabular-nums",children:Ie(v.expiresAt)}),(0,t.jsx)($,{children:v.ipAddress??""}),(0,t.jsx)($,{className:"max-w-40 truncate",children:v.userAgent??""}),(0,t.jsx)($,{children:(0,t.jsx)(z,{"data-testid":`ud-revoke-${v.id}`,disabled:l,onClick:r(()=>{I(v.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Revoke")})})]},v.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]!==b||e[26]!==f||e[27]!==d?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-sessions",children:[g,b,f,d]}),e[24]=g,e[25]=b,e[26]=f,e[27]=d,e[28]=A):A=e[28],A},"rt"),ot=r(u=>{let e=(0,W.c)(30),{busy:l,runAction:s,userId:c,version:a}=u,o=O(),i=H(),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(null),x;e[0]!==o||e[1]!==c?(x=r(()=>{ze((async()=>{S(null);try{m(await o.listAuthAccounts({userId:c}))}catch(v){let F=v;m(null),S(je(F))}})())},"x"),e[0]=o,e[1]=c,e[2]=x):x=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)(x,C);let y;e[7]!==o||e[8]!==s||e[9]!==c?(y=r(v=>{s(()=>o.unlinkAuthAccount({accountId:v,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)(Oe,{children:h}),e[13]=h,e[14]=g):g=e[14];let b;e[15]!==w?(b=w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:w}),e[15]=w,e[16]=b):b=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)(q,{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(v=>{let F=Ae(v.id);return(0,t.jsxs)(q,{"data-testid":`ud-account-${F}`,children:[(0,t.jsx)($,{children:Ae(v.providerId)}),(0,t.jsx)($,{className:"text-muted-foreground tabular-nums",children:Ie(v.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]!==b||e[27]!==f||e[28]!==d?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-accounts",children:[g,b,f,d]}),e[25]=g,e[26]=b,e[27]=f,e[28]=d,e[29]=A):A=e[29],A},"it"),ct=r(u=>{let e=(0,W.c)(40),{busy:l,capabilities:s,runAction:c,userId:a,version:o}=u,i=O(),n=H(),[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)}})())},"S"),e[0]=s.passkey,e[1]=i,e[2]=a,e[3]=S):S=e[3];let x;e[4]!==s.passkey||e[5]!==i||e[6]!==a||e[7]!==o?(x=[s.passkey,i,a,o],e[4]=s.passkey,e[5]=i,e[6]=a,e[7]=o,e[8]=x):x=e[8],(0,k.useEffect)(S,x);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 b;e[18]!==g?(b=(0,t.jsx)(Oe,{children:g}),e[18]=g,e[19]=b):b=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)(q,{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 T=Ae(F.id);return(0,t.jsxs)(q,{"data-testid":`ud-passkey-${T}`,children:[(0,t.jsx)($,{children:Ae(F.name)||T}),(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-${T}`,disabled:l,onClick:r(()=>{h(T)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Delete")})})]},T)})})]})})}),e[29]=l,e[30]=s.passkey,e[31]=h,e[32]=m,e[33]=n,e[34]=A):A=e[34];let v;return e[35]!==b||e[36]!==f||e[37]!==d||e[38]!==A?(v=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-security",children:[b,f,d,A]}),e[35]=b,e[36]=f,e[37]=d,e[38]=A,e[39]=v):v=e[39],v},"ot"),ut=/(?:at|expires)$/iu,mt=new Set(["banExpires","banned","banReason","email","emailVerified","id","name","role"]),ht=r((u,e)=>typeof e=="number"&&ut.test(u)?Ie(e):Ae(e),"ut"),pt=r(({capabilities:u,onChanged:e,onClose:l,user:s})=>{let c=O(),a=H(),o=s.banned===!0,[i,n]=(0,k.useState)(null),[m,w]=(0,k.useState)(!1),[S,x]=(0,k.useState)(0),[C,y]=(0,k.useState)(typeof s.role=="string"?s.role:""),[I,h]=(0,k.useState)(""),[g,b]=(0,k.useState)(""),[f,d]=(0,k.useState)(""),[A,v]=(0,k.useState)(null),[F,T]=(0,k.useState)(!1),R=r((N,j)=>{ze((async()=>{w(!0),n(null);try{let E=await N();j?.refresh!==!1&&(x(M=>M+1),e()),j?.onResult?.(E)}catch(E){n(je(E))}w(!1)})())},"T"),Le=r(N=>{y(N.target.value)},"ze"),Z=r(N=>{h(N.target.value)},"q"),Pe=r(N=>{b(N.target.value)},"Be"),J=r(N=>{d(N.target.value)},"Y"),Re=r(()=>{let N=C.trim();N!==""&&R(async()=>{await c.setAuthUserRole({role:N,userId:s.id})})},"Ue"),Q=r(()=>{let N=Number.parseInt(g,10),j=Number.isFinite(N)&&N>0?N*86400:void 0;R(async()=>{await c.banAuthUser({expiresInSeconds:j,reason:I.trim()===""?void 0:I.trim(),userId:s.id})})},"G"),B=r(()=>{R(async()=>{await c.unbanAuthUser({userId:s.id})})},"E"),Y=r(()=>{R(async()=>{await c.setAuthUserPassword({newPassword:f,userId:s.id}),d("")})},"Q"),Fe=r(()=>{R(()=>c.impersonateAuthUser({userId:s.id}),{onResult:r(N=>{v(N.token)},"onResult"),refresh:!1})},"we"),G=r(()=>{R(async()=>{await c.revokeAuthUserSessions({userId:s.id})})},"Z"),De=r(()=>{R(async()=>{await c.removeAuthUser({userId:s.id}),l()})},"$e"),K=r(()=>{T(!0)},"W"),Se=r(()=>{T(!1)},"Ce"),X=Object.entries(s).filter(([N])=>!mt.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)(P,{variant:"secondary",children:s.role}),o?(0,t.jsx)(P,{variant:"destructive",children:a("Banned")}):(0,t.jsx)(P,{variant:"outline",children:a("Active")}),s.emailVerified===!0?(0,t.jsx)(P,{variant:"secondary",children:a("verified")}):(0,t.jsx)(P,{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)(L,{"data-testid":"ud-role-input",id:"ud-role",onChange:Le,value:C})]}),(0,t.jsx)(z,{"data-testid":"ud-set-role",disabled:m||C.trim()==="",onClick:Re,size:"sm",type:"button",variant:"outline",children:a("Set role")})]}),o?(0,t.jsx)(z,{"data-testid":"ud-unban",disabled:m,onClick:B,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)(L,{"data-testid":"ud-ban-reason",id:"ud-ban-reason",onChange:Z,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)(L,{"data-testid":"ud-ban-days",id:"ud-ban-days",onChange:Pe,type:"number",value:g})]}),(0,t.jsx)(z,{"data-testid":"ud-ban",disabled:m,onClick:Q,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)(L,{"data-testid":"ud-password",id:"ud-password",onChange:J,type:"password",value:f})]}),(0,t.jsx)(z,{"data-testid":"ud-set-password",disabled:m||f==="",onClick:Y,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:G,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:K,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)(L,{"data-testid":"ud-token",id:"ud-token",readOnly:!0,value:A})]})]})]}),(0,t.jsx)(dt,{busy:m,runAction:R,userId:s.id,version:S}),u.accounts&&(0,t.jsx)(ot,{busy:m,runAction:R,userId:s.id,version:S}),(u.twoFactor||u.passkey)&&(0,t.jsx)(ct,{busy:m,capabilities:u,runAction:R,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:X.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:ht(N,j)})]},N))})]})]})},"mt"),ft=50,Rt=r(({pageSize:u=ft}={})=>{let e=O(),l=H(),[s,c]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),i=Ge(s),[n,m]=(0,k.useState)(null),[w,S]=(0,k.useState)(!1),{capabilities:x}=st(),C=i.trim(),y=a.trim(),I=Ze(["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,b=r(()=>{I.refetch()},"b");Je(()=>{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)(L,{"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)(L,{"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)(We,{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)(q,{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)(q,{"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)(P,{variant:"secondary",children:d.role}):""}),(0,t.jsx)($,{children:d.banned===!0?(0,t.jsx)(P,{variant:"destructive",children:l("Banned")}):(0,t.jsx)(P,{variant:"success",children:l("Active")})}),(0,t.jsx)($,{children:d.emailVerified===!0?(0,t.jsx)(P,{variant:"success",children:l("yes")}):(0,t.jsx)(P,{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)(pt,{capabilities:x,onChanged:b,onClose:r(()=>{m(null)},"onClose"),user:f}),w&&(0,t.jsx)(nt,{onClose:r(()=>{S(!1)},"onClose"),onCreated:b})]})},"Et");export{Rt as UsersPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as R}from"./chunk-27IF4PXG.js";import"./chunk-B3BKR5ZW.js";import"./chunk-PZ4QDWTI.js";import"./chunk-P4QIDUCY.js";import"./chunk-F7JOSNAT.js";import{a as p}from"./chunk-DZGOHOOE.js";import{c as h}from"./chunk-L6ATKZKO.js";import"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import"./chunk-L4EZAHCD.js";import"./chunk-IYWVSMAY.js";import{d as g}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as i,d as m,f as S,g as _}from"./chunk-R5ZTCHCE.js";var f=m(S(),1);var k=m(_(),1);var A=i((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("Live admin subscriptions are ungated")})[s.kind],"f"),w=i(e=>Array.isArray(e.findings)?e.findings:[],"k"),E=i(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),T=i((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: live admin subscriptions need no credential. Set it to gate them like the HTTP admin RPCs.")})[s.kind],"A"),L=i(()=>{let e=(0,f.c)(8),s=g(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={},e[0]=t):t=e[0];let{data:a,error:d,errorSource:c}=h(p.getSecurityAudit,t),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(r=>({description:T(s,r),entity:E(r),issueType:A(s,r),key:r.kind,level:r.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(R,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"y");export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as h}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{b as A}from"./chunk-L6ATKZKO.js";import{f as k}from"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{a as y,e as S}from"./chunk-IYWVSMAY.js";import{d as I}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as u,d as w,f as z,g as P}from"./chunk-R5ZTCHCE.js";var N=w(z(),1);var a=w(P(),1);var j=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),p=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:n}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let s;i[2]!==t?(s=(0,a.jsx)(S,{className:"p-3",children:t}),i[2]=t,i[3]=s):s=i[3];let c;return i[4]!==l||i[5]!==s||i[6]!==n?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":n,children:[l,s]}),i[4]=l,i[5]=s,i[6]=n,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,n;i[0]!==t?(n=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=n):n=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let s;return i[4]!==n||i[5]!==l?(s=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[n,l]}),i[4]=n,i[5]=l,i[6]=s):s=i[6],s},"c"),M=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let n;e[1]!==i?(n=u(()=>i.getAuthConfig(),"r"),e[1]=i,e[2]=n):n=e[2];let{data:l,error:s}=A(d,n),c;e[3]!==t?(c=u(r=>(0,a.jsx)(h,{variant:r?"success":"outline",children:t(r?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,g;e[5]!==s?(g=s!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s}),e[5]=s,e[6]=g):g=e[6];let f;e[7]!==l||e[8]!==s||e[9]!==t?(f=s===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=s,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==s||e[13]!==m||e[14]!==t?(x=s===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:j.map(r=>{let $=l.capabilities[r.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${r.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(r.label)}),m($)]},r.key)})})}),(0,a.jsx)(p,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(C)})}),(0,a.jsx)(p,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(L)})})]})}),l.organization.enabled&&(0,a.jsx)(p,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(p,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(p,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(p,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(r=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${r.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:r.name}),r.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:r.type}),r.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),r.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},r.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=s,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==g||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,f,x]}),e[16]=g,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"O");function C(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(C,"P");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(L,"z");export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as we}from"./chunk-5XMZP64Z.js";import{a as Ne}from"./chunk-CAOUXOL7.js";import{b as ve,c as ye}from"./chunk-2SFSTQS4.js";import{a as ge}from"./chunk-NIX2QSSN.js";import{a as xe}from"./chunk-E6P2ERQV.js";import"./chunk-VZCS5GXZ.js";import"./chunk-DKSLOJDQ.js";import{a as fe}from"./chunk-CKTKI4IY.js";import{a as he}from"./chunk-6UN4V2HB.js";import{b as pe}from"./chunk-KVSQKUWD.js";import"./chunk-ZHPDAJBM.js";import{P as me}from"./chunk-AOAJGSYZ.js";import"./chunk-TFMQSCGC.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as oe}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as be}from"./chunk-B3BKR5ZW.js";import"./chunk-PZ4QDWTI.js";import"./chunk-P4QIDUCY.js";import"./chunk-F7JOSNAT.js";import{a as ce}from"./chunk-DZGOHOOE.js";import{c as ie}from"./chunk-L6ATKZKO.js";import"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{a as ue}from"./chunk-UANVABQG.js";import{d as U,s as de}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as m,d as le,e as $e,f as Ce,g as Le,i as te}from"./chunk-R5ZTCHCE.js";var B=le(Ce(),1),O=le($e(),1);var s=le(Le(),1);var Te=.5,Me=4,Ie=m(n=>Math.min(100,Math.max(0,n)),"ce"),Pe=m((n,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=Ie(n.offsetMs/e*100),a=n.durationMs/e*100,l=Math.max(Te,Math.min(Ie(a),100-t));return{leftPercent:t,widthPercent:l}},"Le"),Ke=m((n,e,t=!1)=>{let a=e.trim().toLowerCase(),l=t?n.filter(r=>!r.ok):n;return a===""?[...l]:l.filter(r=>r.rootName.toLowerCase().includes(a)||r.functionPath.toLowerCase().includes(a)||r.traceId.toLowerCase().includes(a)||r.spans.some(o=>o.name.toLowerCase().includes(a)||o.spanId.toLowerCase().includes(a)))},"Ce"),G=m(n=>Number.isFinite(n)?n>0&&n<1?`${n.toFixed(2)}ms`:`${String(Math.round(n))}ms`:"\u2014","q"),De=m(n=>!Number.isFinite(n)||n<=0?[]:Array.from({length:Me},(e,t)=>{let a=(t+1)/Me;return{label:G(n*a),percent:a*100}}),"Ee"),Se=m(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}},"ue"),ee=m(n=>{let e=(0,B.c)(7),{label:t,value:a}=n,l;e[0]!==t?(l=(0,s.jsx)("dt",{className:"w-40 shrink-0 text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1];let r;e[2]!==a?(r=(0,s.jsx)("dd",{className:"min-w-0 break-all",children:a}),e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==r?(o=(0,s.jsxs)("div",{className:"flex gap-2",children:[l,r]}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o},"Y"),Fe=m(n=>{let e=(0,B.c)(68),{span:t}=n,a=U(),l,r,o,d,i,u;if(e[0]!==t.attributes||e[1]!==t.durationMs||e[2]!==t.error||e[3]!==t.events||e[4]!==t.kind||e[5]!==t.offsetMs||e[6]!==t.parentSpanId||e[7]!==t.spanId||e[8]!==a){let $=Object.entries(t.attributes??{}),_;e[15]!==t.events?(_=t.events??[],e[15]=t.events,e[16]=_):_=e[16],l=_,r="border-t border-border bg-background/60 px-3 py-2 font-mono text-xs",o="tr-span-detail";let y;e[17]!==a?(y=a("Span ID"),e[17]=a,e[18]=y):y=e[18];let w;e[19]!==t.spanId||e[20]!==y?(w=(0,s.jsx)(ee,{label:y,value:t.spanId}),e[19]=t.spanId,e[20]=y,e[21]=w):w=e[21];let M;e[22]!==a?(M=a("Parent span ID"),e[22]=a,e[23]=M):M=e[23];let p;e[24]!==t.parentSpanId||e[25]!==a?(p=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=p):p=e[26];let h;e[27]!==p||e[28]!==M?(h=(0,s.jsx)(ee,{label:M,value:p}),e[27]=p,e[28]=M,e[29]=h):h=e[29];let b;e[30]!==a?(b=a("Kind"),e[30]=a,e[31]=b):b=e[31];let C=t.kind??"internal",S;e[32]!==b||e[33]!==C?(S=(0,s.jsx)(ee,{label:b,value:C}),e[32]=b,e[33]=C,e[34]=S):S=e[34];let I;e[35]!==a?(I=a("Started at"),e[35]=a,e[36]=I):I=e[36];let g;e[37]!==t.offsetMs||e[38]!==a?(g=a("+{offset}",{offset:G(t.offsetMs)}),e[37]=t.offsetMs,e[38]=a,e[39]=g):g=e[39];let x;e[40]!==I||e[41]!==g?(x=(0,s.jsx)(ee,{label:I,value:g}),e[40]=I,e[41]=g,e[42]=x):x=e[42];let k;e[43]!==a?(k=a("Duration"),e[43]=a,e[44]=k):k=e[44];let f;e[45]!==t.durationMs?(f=G(t.durationMs),e[45]=t.durationMs,e[46]=f):f=e[46];let N;e[47]!==k||e[48]!==f?(N=(0,s.jsx)(ee,{label:k,value:f}),e[47]=k,e[48]=f,e[49]=N):N=e[49],e[50]!==h||e[51]!==S||e[52]!==x||e[53]!==N||e[54]!==w?(d=(0,s.jsxs)("dl",{className:"flex flex-col gap-1",children:[w,h,S,x,N]}),e[50]=h,e[51]=S,e[52]=x,e[53]=N,e[54]=w,e[55]=d):d=e[55],e[56]!==t.error?(i=t.error!==void 0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1.5","data-testid":"tr-detail-error",children:[(0,s.jsx)("span",{className:"font-semibold text-destructive",children:t.error.type}),(0,s.jsx)("p",{className:"whitespace-pre-wrap break-all text-destructive",children:t.error.message})]}),e[56]=t.error,e[57]=i):i=e[57],u=$.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-attributes",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Attributes")}),(0,s.jsx)("dl",{className:"flex flex-col gap-1",children:$.map(je)})]}),e[0]=t.attributes,e[1]=t.durationMs,e[2]=t.error,e[3]=t.events,e[4]=t.kind,e[5]=t.offsetMs,e[6]=t.parentSpanId,e[7]=t.spanId,e[8]=a,e[9]=l,e[10]=r,e[11]=o,e[12]=d,e[13]=i,e[14]=u}else l=e[9],r=e[10],o=e[11],d=e[12],i=e[13],u=e[14];let c;e[58]!==l||e[59]!==a?(c=l.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-events",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Events")}),(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:l.map(Oe)})]}),e[58]=l,e[59]=a,e[60]=c):c=e[60];let v;return e[61]!==r||e[62]!==o||e[63]!==d||e[64]!==i||e[65]!==u||e[66]!==c?(v=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,i,u,c]}),e[61]=r,e[62]=o,e[63]=d,e[64]=i,e[65]=u,e[66]=c,e[67]=v):v=e[67],v},"Pe");function je(n){let[e,t]=n;return(0,s.jsx)(ee,{label:e,value:Se(t)},e)}m(je,"Fe");function Ee(n){let[e,t]=n;return`${e}=${Se(t)}`}m(Ee,"Ke");function Oe(n){return(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:de(n.ts)}),(0,s.jsx)(oe,{variant:"secondary",children:n.name}),(0,s.jsx)("span",{className:"min-w-0 break-all text-muted-foreground",children:Object.entries(n.attributes??{}).map(Ee).join(" ")})]},`${n.name}:${String(n.ts)}`)}m(Oe,"Ae");var Be=14,ke="grid grid-cols-[14rem_1fr_4rem_16rem_16rem] items-center gap-2 px-3",Re=m(n=>{let e=(0,B.c)(17),{traceDurationMs:t}=n,a,l,r,o,d,i;if(e[0]!==t){i=Symbol.for("react.early_return_sentinel");e:{let v=De(t);if(v.length===0){i=null;break e}e[7]===Symbol.for("react.memo_cache_sentinel")?(r=te(ke,"border-b border-border py-1 font-mono text-[10px] text-muted-foreground"),e[7]=r):r=e[7],o="tr-ruler",e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("span",{}),e[8]=d):d=e[8],a="relative h-3",l=v.map(ze)}e[0]=t,e[1]=a,e[2]=l,e[3]=r,e[4]=o,e[5]=d,e[6]=i}else a=e[1],l=e[2],r=e[3],o=e[4],d=e[5],i=e[6];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;e[9]!==a||e[10]!==l?(u=(0,s.jsx)("span",{className:a,children:l}),e[9]=a,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==o||e[14]!==d||e[15]!==u?(c=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,u]}),e[12]=r,e[13]=o,e[14]=d,e[15]=u,e[16]=c):c=e[16],c},"Re"),We=m(n=>{let e=(0,B.c)(60),{span:t,traceDurationMs:a}=n,l=U(),[r,o]=(0,O.useState)(!1),d;e[0]!==t||e[1]!==a?(d=Pe(t,a),e[0]=t,e[1]=a,e[2]=d):d=e[2];let{leftPercent:i,widthPercent:u}=d,c;e[3]!==t.attributes?(c=Ne(t.attributes),e[3]=t.attributes,e[4]=c):c=e[4];let v=c,$=t.depth*Be,_;e[5]!==$?(_={paddingLeft:$},e[5]=$,e[6]=_):_=e[6];let y=_,w=`${String(i)}%`,M=`${String(u)}%`,p;e[7]!==w||e[8]!==M?(p={left:w,width:M},e[7]=w,e[8]=M,e[9]=p):p=e[9];let h=p,b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m(()=>{o(Je)},"h"),e[10]=b):b=e[10];let C=b,S=t.depth,I=`tr-span-detail-${t.spanId}`,g;e[11]!==t.durationMs||e[12]!==t.error||e[13]!==t.name||e[14]!==t.offsetMs||e[15]!==l?(g=l("{name}, {duration}, starts {offset} in{failure}",{duration:G(t.durationMs),failure:t.error===void 0?"":l(", failed: {message}",{message:t.error.message}),name:t.name,offset:G(t.offsetMs)}),e[11]=t.durationMs,e[12]=t.error,e[13]=t.name,e[14]=t.offsetMs,e[15]=l,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=te(ke,"w-full border-b border-border py-1.5 text-left font-mono text-xs hover:bg-muted/50"),e[17]=x):x=e[17];let k=`tr-span-toggle-${t.spanId}`,f;e[18]!==t.ok?(f=t.ok?null:(0,s.jsx)("span",{"aria-hidden":"true",className:"mr-1 text-destructive","data-testid":"tr-span-error",children:"\u25CF"}),e[18]=t.ok,e[19]=f):f=e[19];let N;e[20]!==y||e[21]!==t.name||e[22]!==f?(N=(0,s.jsxs)("span",{className:"truncate",style:y,title:t.name,children:[f,t.name]}),e[20]=y,e[21]=t.name,e[22]=f,e[23]=N):N=e[23];let R=t.ok?"bg-primary/70":"bg-destructive",L;e[24]!==R?(L=te("absolute inset-y-0 rounded-sm",R),e[24]=R,e[25]=L):L=e[25];let E;e[26]!==h||e[27]!==i||e[28]!==L||e[29]!==u?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:"relative h-3 overflow-hidden rounded-sm bg-muted",children:(0,s.jsx)("span",{className:L,"data-left":i,"data-testid":"tr-span-bar","data-width":u,style:h})}),e[26]=h,e[27]=i,e[28]=L,e[29]=u,e[30]=E):E=e[30];let W;e[31]!==t.durationMs?(W=G(t.durationMs),e[31]=t.durationMs,e[32]=W):W=e[32];let D;e[33]!==W?(D=(0,s.jsx)("span",{className:"text-right tabular-nums text-muted-foreground",children:W}),e[33]=W,e[34]=D):D=e[34];let q;e[35]!==t.error?(q=t.error===void 0?null:(0,s.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=q):q=e[36];let T;e[37]!==q?(T=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:q}),e[37]=q,e[38]=T):T=e[38];let z;e[39]!==v?(z=v===""?null:(0,s.jsx)("span",{"data-testid":"tr-span-attributes",title:v,children:v}),e[39]=v,e[40]=z):z=e[40];let P;e[41]!==z?(P=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:z}),e[41]=z,e[42]=P):P=e[42];let J;e[43]!==r||e[44]!==I||e[45]!==g||e[46]!==k||e[47]!==N||e[48]!==E||e[49]!==D||e[50]!==T||e[51]!==P?(J=(0,s.jsxs)("button",{"aria-controls":I,"aria-expanded":r,"aria-label":g,className:x,"data-testid":k,onClick:C,type:"button",children:[N,E,D,T,P]}),e[43]=r,e[44]=I,e[45]=g,e[46]=k,e[47]=N,e[48]=E,e[49]=D,e[50]=T,e[51]=P,e[52]=J):J=e[52];let F;e[53]!==r||e[54]!==t?(F=r&&(0,s.jsx)("div",{id:`tr-span-detail-${t.spanId}`,children:(0,s.jsx)(Fe,{span:t})}),e[53]=r,e[54]=t,e[55]=F):F=e[55];let K;return e[56]!==t.depth||e[57]!==J||e[58]!==F?(K=(0,s.jsxs)("li",{"data-depth":S,"data-testid":"tr-span-row",children:[J,F]}),e[56]=t.depth,e[57]=J,e[58]=F,e[59]=K):K=e[59],K},"Be"),qe=m(n=>{let e=(0,B.c)(15),{durationMs:t,spans:a}=n,l=U(),r;e[0]!==t?(r=(0,s.jsx)(Re,{traceDurationMs:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==l?(o=l("Trace waterfall"),e[2]=l,e[3]=o):o=e[3];let d;if(e[4]!==t||e[5]!==a){let c;e[7]!==t?(c=m(v=>(0,s.jsx)(We,{span:v,traceDurationMs:t},v.spanId),"c"),e[7]=t,e[8]=c):c=e[8],d=a.map(c),e[4]=t,e[5]=a,e[6]=d}else d=e[6];let i;e[9]!==o||e[10]!==d?(i=(0,s.jsx)("ul",{"aria-label":o,children:d}),e[9]=o,e[10]=d,e[11]=i):i=e[11];let u;return e[12]!==r||e[13]!==i?(u=(0,s.jsxs)(s.Fragment,{children:[r,i]}),e[12]=r,e[13]=i,e[14]=u):u=e[14],u},"Oe");function ze(n){return(0,s.jsx)("span",{className:te("absolute inset-y-0 border-l border-border/70",n.percent===100?"-translate-x-full pr-1":"pl-1"),style:{left:`${String(n.percent)}%`},children:n.label},n.percent)}m(ze,"je");function Je(n){return!n}m(Je,"We");var Ue=m(n=>Array.isArray(n?.traces)?n.traces:[],"Ue"),Ge=m(n=>{let e=(0,B.c)(12),{entries:t}=n,a=U(),l;e[0]!==t.length||e[1]!==a?(l=a("Logs ({count})",{count:t.length}),e[0]=t.length,e[1]=a,e[2]=l):l=e[2];let r;e[3]!==l?(r=(0,s.jsx)("p",{className:"mb-1 font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==t?(o=t.map(Qe),e[5]=t,e[6]=o):o=e[6];let d;e[7]!==o?(d=(0,s.jsx)("div",{role:"grid",children:o}),e[7]=o,e[8]=d):d=e[8];let i;return e[9]!==r||e[10]!==d?(i=(0,s.jsxs)("div",{className:"border-t border-border px-3 py-2","data-testid":"tr-logs",children:[r,d]}),e[9]=r,e[10]=d,e[11]=i):i=e[11],i},"qe"),He=m(n=>{let e=(0,B.c)(50),{expanded:t,logs:a,onToggle:l,trace:r}=n,o=U(),d;e[0]!==l||e[1]!==r.traceId?(d=m(()=>{l(r.traceId)},"i"),e[0]=l,e[1]=r.traceId,e[2]=d):d=e[2];let i=d,u=`tr-row-${r.traceId}`,c=`tr-waterfall-${r.traceId}`,v=`tr-toggle-${r.traceId}`,$=t?"\u25BE":"\u25B8",_;e[3]!==$?(_=(0,s.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:$}),e[3]=$,e[4]=_):_=e[4];let y;e[5]!==r.rootName?(y=(0,s.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=y):y=e[6];let w;e[7]!==r.functionPath?(w=(0,s.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let M;e[9]!==r.durationMs?(M=G(r.durationMs),e[9]=r.durationMs,e[10]=M):M=e[10];let p;e[11]!==M?(p=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:M}),e[11]=M,e[12]=p):p=e[12];let h;e[13]!==o||e[14]!==r.spans.length?(h=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=h):h=e[15];let b;e[16]!==h?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:h}),e[16]=h,e[17]=b):b=e[17];let C=r.ok?"secondary":"destructive",S;e[18]!==o||e[19]!==r.ok?(S=r.ok?o("ok"):o("error"),e[18]=o,e[19]=r.ok,e[20]=S):S=e[20];let I;e[21]!==C||e[22]!==S?(I=(0,s.jsx)("span",{className:"shrink-0",children:(0,s.jsx)(oe,{variant:C,children:S})}),e[21]=C,e[22]=S,e[23]=I):I=e[23];let g;e[24]!==r.startTs?(g=de(r.startTs),e[24]=r.startTs,e[25]=g):g=e[25];let x;e[26]!==g?(x=(0,s.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let k;e[28]!==t||e[29]!==i||e[30]!==p||e[31]!==b||e[32]!==I||e[33]!==x||e[34]!==c||e[35]!==v||e[36]!==_||e[37]!==y||e[38]!==w?(k=(0,s.jsxs)("button",{"aria-controls":c,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":v,onClick:i,type:"button",children:[_,y,w,p,b,I,x]}),e[28]=t,e[29]=i,e[30]=p,e[31]=b,e[32]=I,e[33]=x,e[34]=c,e[35]=v,e[36]=_,e[37]=y,e[38]=w,e[39]=k):k=e[39];let f;e[40]!==t||e[41]!==a||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(f=t&&(0,s.jsxs)("div",{className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,children:[(0,s.jsx)(qe,{durationMs:r.durationMs,spans:r.spans}),a.length>0&&(0,s.jsx)(Ge,{entries:a})]}),e[40]=t,e[41]=a,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=f):f=e[45];let N;return e[46]!==k||e[47]!==f||e[48]!==u?(N=(0,s.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":u,children:[k,f]}),e[46]=k,e[47]=f,e[48]=u,e[49]=N):N=e[49],N},"ze"),ft=m(n=>{let e=(0,B.c)(58),{initialShardKey:t}=n,a=U(),[l]=(0,O.useState)(ve),{queryShardKey:r,setShardKey:o,shardKey:d}=fe(l?.shardKey!==void 0&&l.shardKey!==""?l.shardKey:t??""),[i,u]=(0,O.useState)(l?.traceId??""),[c,v]=(0,O.useState)(!1),[$,_]=(0,O.useState)(Ae),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,O.useEffect)(Ve,y);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={},e[1]=w):w=e[1];let M;e[2]!==r?(M={live:!0,shardKey:r},e[2]=r,e[3]=M):M=e[3];let{data:p,error:h,errorSource:b,isLoading:C,liveError:S}=ie(ce.getTraces,w,M),I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={},e[4]=I):I=e[4];let g=$.size>0,x;e[5]!==r||e[6]!==g?(x={enabled:g,live:!0,shardKey:r},e[5]=r,e[6]=g,e[7]=x):x=e[7];let{data:k}=ie(ce.getLogs,I,x),f,N;e[8]!==p||e[9]!==r?(f=m(()=>{p!==void 0&&pe(r)},"p"),N=[p,r],e[8]=p,e[9]=r,e[10]=f,e[11]=N):(f=e[10],N=e[11]),(0,O.useEffect)(f,N);let R;if(e[12]!==p||e[13]!==h||e[14]!==b||e[15]!==$||e[16]!==C||e[17]!==S||e[18]!==k?.entries||e[19]!==c||e[20]!==i||e[21]!==o||e[22]!==d||e[23]!==a){let L=Ue(p),E=p?.total??L.length,W=E>L.length,D=Ke(L,i,c),q=Map.groupBy((k?.entries??[]).toReversed(),Xe),T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=m(j=>{u(j.target.value)},"C"),e[25]=T):T=e[25];let z=T,P;e[26]===Symbol.for("react.memo_cache_sentinel")?(P=m(j=>{_(_e=>{let ne=new Set(_e);return ne.has(j)?ne.delete(j):ne.add(j),ne})},"E"),e[26]=P):P=e[26];let J=P,F=h===null&&D.length===0&&!C,K;e[27]!==o||e[28]!==d?(K=(0,s.jsx)(he,{onChange:o,testId:"tr-shard-input",value:d}),e[27]=o,e[28]=d,e[29]=K):K=e[29];let H;e[30]!==a?(H=a("Search traces"),e[30]=a,e[31]=H):H=e[31];let Q;e[32]!==a?(Q=a("search trace, span, or function"),e[32]=a,e[33]=Q):Q=e[33];let A;e[34]!==i||e[35]!==H||e[36]!==Q?(A=(0,s.jsx)(me,{"aria-label":H,className:"h-8 w-56","data-testid":"tr-search",onChange:z,placeholder:Q,value:i}),e[34]=i,e[35]=H,e[36]=Q,e[37]=A):A=e[37];let V;e[38]!==c?(V=(0,s.jsx)(ge,{checked:c,"data-testid":"tr-only-errors",id:"tr-only-errors",onCheckedChange:v}),e[38]=c,e[39]=V):V=e[39];let X;e[40]!==a?(X=a("Errors only"),e[40]=a,e[41]=X):X=e[41];let Y;e[42]!==V||e[43]!==X?(Y=(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",htmlFor:"tr-only-errors",children:[V,X]}),e[42]=V,e[43]=X,e[44]=Y):Y=e[44];let Z;e[45]!==S?(Z=(0,s.jsx)(xe,{message:S,prefix:"tr"}),e[45]=S,e[46]=Z):Z=e[46];let re;e[47]!==K||e[48]!==A||e[49]!==Y||e[50]!==Z?(re=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K,A,Y,Z]}),e[47]=K,e[48]=A,e[49]=Y,e[50]=Z,e[51]=re):re=e[51];let ae;e[52]!==h||e[53]!==b?(ae=h!==null&&(0,s.jsx)(be,{error:b,testId:"tr-error"}),e[52]=h,e[53]=b,e[54]=ae):ae=e[54];let se;e[55]!==F||e[56]!==a?(se=F&&(0,s.jsx)(ue,{description:a("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:a("No traces")}),e[55]=F,e[56]=a,e[57]=se):se=e[57],R=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[re,ae,se,h===null&&W&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:a("Showing the {shown} most recent of {total} traces in the buffer.",{shown:L.length,total:E})}),h===null&&D.length>0&&(0,s.jsx)("div",{"aria-label":a("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:D.map(j=>(0,s.jsx)(He,{expanded:$.has(j.traceId),logs:q.get(j.traceId)??[],onToggle:J,trace:j},j.traceId))})]}),e[12]=p,e[13]=h,e[14]=b,e[15]=$,e[16]=C,e[17]=S,e[18]=k?.entries,e[19]=c,e[20]=i,e[21]=o,e[22]=d,e[23]=a,e[24]=R}else R=e[24];return R},"gt");function Qe(n,e){return(0,s.jsx)("div",{className:"flex items-center border-b border-border py-1 font-mono text-xs last:border-b-0","data-testid":"tr-log-row",role:"row",children:(0,s.jsx)(we,{entry:n})},`${String(e)}:${String(n.timestamp)}`)}m(Qe,"Ge");function Ae(){return new Set}m(Ae,"He");function Ve(){ye()}m(Ve,"Je");function Xe(n){return n.traceId}m(Xe,"Qe");export{ft as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as C}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as J}from"./chunk-B3BKR5ZW.js";import"./chunk-PZ4QDWTI.js";import"./chunk-P4QIDUCY.js";import"./chunk-F7JOSNAT.js";import{a as H}from"./chunk-DZGOHOOE.js";import{c as z}from"./chunk-L6ATKZKO.js";import"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{a as E}from"./chunk-UANVABQG.js";import{a as G,b as M,c as U,d as P,e as d,f as c}from"./chunk-L4EZAHCD.js";import{a as D,e as _}from"./chunk-IYWVSMAY.js";import{d as q}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as S,d as O,f as Q,g as V}from"./chunk-R5ZTCHCE.js";var L=O(Q(),1);var r=O(V(),1);var K=["read","insert","update","delete"],B=S((e,s)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[s],"z"),W=S(e=>{let s=new Map;for(let a of e){let t=s.get(a.table)??{operations:new Set,procedures:new Set,table:a.table};t.operations.add(a.on),t.procedures.add(a.procedure),s.set(a.table,t)}return[...s.values()].toSorted((a,t)=>a.table.localeCompare(t.table))},"J"),ie=S(()=>{let e=(0,L.c)(49),s=q(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:t,error:R,errorSource:k}=z(H.rlsPolicies,a),p=t!==void 0,m,n,h,l,f,u,x,b,o;if(e[1]!==t||e[2]!==R||e[3]!==k||e[4]!==p||e[5]!==s){let $=W(Array.isArray(t?.policies)?t.policies:[]),j;e[15]!==t?(j=Array.isArray(t?.roles)?t.roles:[],e[15]=t,e[16]=j):j=e[16],n=j,x="flex flex-col gap-6",b="lunora-rls-panel",e[17]!==R||e[18]!==k?(o=R!==null&&(0,r.jsx)(J,{error:k,testId:"rls-error"}),e[17]=R,e[18]=k,e[19]=o):o=e[19],u="flex flex-col gap-2",m=D,h="overflow-hidden py-0";let I;e[20]!==s?(I=s("Policies"),e[20]=s,e[21]=I):I=e[21],e[22]!==I?(l=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:I})}),e[22]=I,e[23]=l):l=e[23],f=p&&$.length===0?(0,r.jsx)(E,{description:s("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:s("No policies defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(G,{"data-testid":"rls-policies-table",children:[(0,r.jsx)(M,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:s("Table")}),K.map(i=>(0,r.jsx)(d,{children:B(s,i)},i)),(0,r.jsx)(d,{children:s("Guarded by")})]})}),(0,r.jsx)(U,{children:$.map(i=>(0,r.jsxs)(P,{"data-testid":`rls-table-${i.table}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:i.table}),K.map(F=>(0,r.jsx)(c,{children:i.operations.has(F)?(0,r.jsx)(C,{variant:"secondary",children:s("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},F)),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:[...i.procedures].join(", ")})]},i.table))})]})}),e[1]=t,e[2]=R,e[3]=k,e[4]=p,e[5]=s,e[6]=m,e[7]=n,e[8]=h,e[9]=l,e[10]=f,e[11]=u,e[12]=x,e[13]=b,e[14]=o}else m=e[6],n=e[7],h=e[8],l=e[9],f=e[10],u=e[11],x=e[12],b=e[13],o=e[14];let N;e[24]!==m||e[25]!==h||e[26]!==l||e[27]!==f?(N=(0,r.jsxs)(m,{className:h,children:[l,f]}),e[24]=m,e[25]=h,e[26]=l,e[27]=f,e[28]=N):N=e[28];let g;e[29]!==u||e[30]!==N?(g=(0,r.jsx)("section",{className:u,children:N}),e[29]=u,e[30]=N,e[31]=g):g=e[31];let y;e[32]!==s?(y=s("Roles"),e[32]=s,e[33]=y):y=e[33];let w;e[34]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[34]=y,e[35]=w):w=e[35];let v;e[36]!==p||e[37]!==n||e[38]!==s?(v=p&&n.length===0?(0,r.jsx)(E,{description:s("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:s("No roles defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(G,{"data-testid":"rls-roles-table",children:[(0,r.jsx)(M,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:s("Role")}),(0,r.jsx)(d,{children:s("Description")}),(0,r.jsx)(d,{children:s("Permissions")})]})}),(0,r.jsx)(U,{children:n.map(Y)})]})}),e[36]=p,e[37]=n,e[38]=s,e[39]=v):v=e[39];let A;e[40]!==w||e[41]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[w,v]})}),e[40]=w,e[41]=v,e[42]=A):A=e[42];let T;return e[43]!==A||e[44]!==x||e[45]!==b||e[46]!==o||e[47]!==g?(T=(0,r.jsxs)("div",{className:x,"data-testid":b,children:[o,g,A]}),e[43]=A,e[44]=x,e[45]=b,e[46]=o,e[47]=g,e[48]=T):T=e[48],T},"oe");function X(e){return(0,r.jsx)(C,{variant:"outline",children:e},e)}S(X,"K");function Y(e){return(0,r.jsxs)(P,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(c,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(c,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(X)})})]},e.name)}S(Y,"V");export{ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as de}from"./chunk-W2JBKQNU.js";import{a as te,b as re,c as ne}from"./chunk-TPAZM36C.js";import"./chunk-ZHPDAJBM.js";import{b as Y}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as ae}from"./chunk-B3BKR5ZW.js";import"./chunk-PZ4QDWTI.js";import"./chunk-P4QIDUCY.js";import"./chunk-F7JOSNAT.js";import{a as ee}from"./chunk-DZGOHOOE.js";import{c as Z}from"./chunk-L6ATKZKO.js";import"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{a as le,b as oe,c as se,d as H,e as z,f as G}from"./chunk-L4EZAHCD.js";import{a as P,e as q}from"./chunk-IYWVSMAY.js";import{d as X}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as g,d as W,f as ce,g as me}from"./chunk-R5ZTCHCE.js";var J=W(ce(),1);var t=W(me(),1);var ue={binding:"outline",secret:"destructive",var:"secondary"},pe=g((n,e)=>{if(n===void 0)return[];let u=[];return n.workerUrl!==void 0&&u.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&u.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&u.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&u.push({label:e("Version"),value:n.versionTag}),u},"ce"),ie=g(n=>{let e=(0,J.c)(18),{modifier:u,name:r,label:p}=n,A=te(),x;e[0]!==r?(x=g(o=>{if(!["Escape","Tab"].includes(o.key)){if(o.shiftKey){o.preventDefault();return}o.preventDefault(),re(r,o.key)}},"b"),e[0]=r,e[1]=x):x=e[1];let i=x,c=`set-shortcut-${r}`,m;e[2]!==p?(m=(0,t.jsx)("dt",{className:"text-muted-foreground",children:p}),e[2]=p,e[3]=m):m=e[3];let h;e[4]!==u?(h=(0,t.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:u}),e[4]=u,e[5]=h):h=e[5];let l=`set-shortcut-input-${r}`,f=A[r],s;e[6]!==p||e[7]!==i||e[8]!==l||e[9]!==f?(s=(0,t.jsx)("input",{"aria-label":p,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":l,onKeyDown:i,readOnly:!0,value:f}),e[6]=p,e[7]=i,e[8]=l,e[9]=f,e[10]=s):s=e[10];let a;e[11]!==h||e[12]!==s?(a=(0,t.jsxs)("dd",{className:"flex items-center gap-1.5",children:[h,s]}),e[11]=h,e[12]=s,e[13]=a):a=e[13];let d;return e[14]!==c||e[15]!==m||e[16]!==a?(d=(0,t.jsxs)("div",{className:"contents","data-testid":c,children:[m,a]}),e[14]=c,e[15]=m,e[16]=a,e[17]=d):d=e[17],d},"z"),Se=g(n=>{let e=(0,J.c)(85),{initialShardKey:u}=n,r=X(),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let A=u??"",x;e[1]!==A?(x={shardKey:A},e[1]=A,e[2]=x):x=e[2];let{data:i,error:c,errorSource:m,isLoading:h}=Z(ee.getSettings,p,x),l,f,s,a,d,o,b;if(e[3]!==c||e[4]!==m||e[5]!==i?.deploy||e[6]!==i?.settings||e[7]!==r){let Q=pe(i?.deploy,r),M;e[15]!==i?.settings?(M=i?.settings??[],e[15]=i?.settings,e[16]=M):M=e[16],l=M,f="flex flex-col gap-4",s="lunora-settings";let V;e[17]!==r?(V=r("Open in Cloudflare"),e[17]=r,e[18]=V):V=e[18],e[19]!==V?(a=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:de,rel:"noreferrer",target:"_blank",children:V})}),e[19]=V,e[20]=a):a=e[20];let $;e[21]!==r?($=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=$):$=e[22],e[23]!==$?(d=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:$}),e[23]=$,e[24]=d):d=e[24],e[25]!==c||e[26]!==m?(o=c!==null&&(0,t.jsx)(ae,{error:m,testId:"set-error"}),e[25]=c,e[26]=m,e[27]=o):o=e[27],b=Q.length>0&&(0,t.jsxs)(P,{className:"py-0","data-testid":"set-deploy",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:r("Deployment")})}),(0,t.jsx)(q,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:Q.map(he)})})]}),e[3]=c,e[4]=m,e[5]=i?.deploy,e[6]=i?.settings,e[7]=r,e[8]=l,e[9]=f,e[10]=s,e[11]=a,e[12]=d,e[13]=o,e[14]=b}else l=e[8],f=e[9],s=e[10],a=e[11],d=e[12],o=e[13],b=e[14];let y;e[28]!==r?(y=r("Keyboard shortcuts"),e[28]=r,e[29]=y):y=e[29];let v;e[30]!==y?(v=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y}),e[30]=y,e[31]=v):v=e[31];let N;e[32]!==r?(N=r("Reset"),e[32]=r,e[33]=N):N=e[33];let k;e[34]!==N?(k=(0,t.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:ne,type:"button",children:N}),e[34]=N,e[35]=k):k=e[35];let w;e[36]!==v||e[37]!==k?(w=(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[v,k]}),e[36]=v,e[37]=k,e[38]=w):w=e[38];let C;e[39]!==r?(C=r("Command palette"),e[39]=r,e[40]=C):C=e[40];let S;e[41]!==C?(S=(0,t.jsx)(ie,{label:C,modifier:"\u2318/Ctrl",name:"palette"}),e[41]=C,e[42]=S):S=e[42];let T;e[43]!==r?(T=r("Operation console"),e[43]=r,e[44]=T):T=e[44];let D;e[45]!==T?(D=(0,t.jsx)(ie,{label:T,modifier:"Ctrl",name:"console"}),e[45]=T,e[46]=D):D=e[46];let _;e[47]!==S||e[48]!==D?(_=(0,t.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[S,D]}),e[47]=S,e[48]=D,e[49]=_):_=e[49];let E;e[50]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[50]=r,e[51]=E):E=e[51];let I;e[52]!==E?(I=(0,t.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[52]=E,e[53]=I):I=e[53];let K;e[54]!==_||e[55]!==I?(K=(0,t.jsxs)(q,{className:"py-3",children:[_,I]}),e[54]=_,e[55]=I,e[56]=K):K=e[56];let O;e[57]!==w||e[58]!==K?(O=(0,t.jsxs)(P,{className:"py-0","data-testid":"set-preferences",children:[w,K]}),e[57]=w,e[58]=K,e[59]=O):O=e[59];let U;e[60]!==r?(U=r("Environment & bindings"),e[60]=r,e[61]=U):U=e[61];let j;e[62]!==U?(j=(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:U})}),e[62]=U,e[63]=j):j=e[63];let F;e[64]!==c||e[65]!==h||e[66]!==l.length||e[67]!==r?(F=c===null&&!h&&l.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[64]=c,e[65]=h,e[66]=l.length,e[67]=r,e[68]=F):F=e[68];let L;e[69]!==l||e[70]!==r?(L=l.length>0&&(0,t.jsx)(q,{className:"px-0 py-0",children:(0,t.jsxs)(le,{"data-testid":"set-table",children:[(0,t.jsx)(oe,{children:(0,t.jsxs)(H,{children:[(0,t.jsx)(z,{children:r("name")}),(0,t.jsx)(z,{children:r("kind")}),(0,t.jsx)(z,{children:r("value")})]})}),(0,t.jsx)(se,{children:l.map(fe)})]})}),e[69]=l,e[70]=r,e[71]=L):L=e[71];let R;e[72]!==j||e[73]!==F||e[74]!==L?(R=(0,t.jsxs)(P,{className:"py-0",children:[j,F,L]}),e[72]=j,e[73]=F,e[74]=L,e[75]=R):R=e[75];let B;return e[76]!==O||e[77]!==R||e[78]!==f||e[79]!==s||e[80]!==a||e[81]!==d||e[82]!==o||e[83]!==b?(B=(0,t.jsxs)("div",{className:f,"data-testid":s,children:[a,d,o,b,O,R]}),e[76]=O,e[77]=R,e[78]=f,e[79]=s,e[80]=a,e[81]=d,e[82]=o,e[83]=b,e[84]=B):B=e[84],B},"Ce");function he(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}g(he,"me");function fe(n){return(0,t.jsxs)(H,{"data-testid":"set-row",children:[(0,t.jsx)(G,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(G,{children:(0,t.jsx)(Y,{variant:ue[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(G,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}g(fe,"fe");export{Se as SettingsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var wt=Object.create;var te=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var n=(e,t)=>te(e,"name",{value:t,configurable:!0});var D=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}},Oo=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},Et=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of kt(t))!_t.call(e,s)&&s!==o&&te(e,s,{get:()=>t[s],enumerable:!(r=xt(t,s))||r.enumerable});return e};var Lo=(e,t,o)=>(o=e!=null?wt(vt(e)):{},Et(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e));var Ye=D(m=>{"use strict";var me=Symbol.for("react.transitional.element"),Ct=Symbol.for("react.portal"),Rt=Symbol.for("react.fragment"),Tt=Symbol.for("react.strict_mode"),At=Symbol.for("react.profiler"),St=Symbol.for("react.consumer"),zt=Symbol.for("react.context"),Pt=Symbol.for("react.forward_ref"),Mt=Symbol.for("react.suspense"),It=Symbol.for("react.memo"),Ne=Symbol.for("react.lazy"),Gt=Symbol.for("react.activity"),Pe=Symbol.iterator;function Nt(e){return e===null||typeof e!="object"?null:(e=Pe&&e[Pe]||e["@@iterator"],typeof e=="function"?e:null)}n(Nt,"getIteratorFn");var je={isMounted:n(function(){return!1},"isMounted"),enqueueForceUpdate:n(function(){},"enqueueForceUpdate"),enqueueReplaceState:n(function(){},"enqueueReplaceState"),enqueueSetState:n(function(){},"enqueueSetState")},Oe=Object.assign,Le={};function q(e,t,o){this.props=e,this.context=t,this.refs=Le,this.updater=o||je}n(q,"Component");q.prototype.isReactComponent={};q.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};q.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $e(){}n($e,"ComponentDummy");$e.prototype=q.prototype;function be(e,t,o){this.props=e,this.context=t,this.refs=Le,this.updater=o||je}n(be,"PureComponent");var ge=be.prototype=new $e;ge.constructor=be;Oe(ge,q.prototype);ge.isPureReactComponent=!0;var Me=Array.isArray;function fe(){}n(fe,"noop");var h={H:null,A:null,T:null,S:null},He=Object.prototype.hasOwnProperty;function he(e,t,o){var r=o.ref;return{$$typeof:me,type:e,key:t,ref:r!==void 0?r:null,props:o}}n(he,"ReactElement");function jt(e,t){return he(e.type,t,e.props)}n(jt,"cloneAndReplaceKey");function ye(e){return typeof e=="object"&&e!==null&&e.$$typeof===me}n(ye,"isValidElement");function Ot(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return t[o]})}n(Ot,"escape");var Ie=/\/+/g;function pe(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ot(""+e.key):t.toString(36)}n(pe,"getElementKey");function Lt(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fe,fe):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}n(Lt,"resolveThenable");function V(e,t,o,r,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case me:case Ct:i=!0;break;case Ne:return i=e._init,V(i(e._payload),t,o,r,s)}}if(i)return s=s(e),i=r===""?"."+pe(e,0):r,Me(s)?(o="",i!=null&&(o=i.replace(Ie,"$&/")+"/"),V(s,t,o,"",function(b){return b})):s!=null&&(ye(s)&&(s=jt(s,o+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(Ie,"$&/")+"/")+i)),t.push(s)),1;i=0;var f=r===""?".":r+":";if(Me(e))for(var p=0;p<e.length;p++)r=e[p],a=f+pe(r,p),i+=V(r,t,o,a,s);else if(p=Nt(e),typeof p=="function")for(e=p.call(e),p=0;!(r=e.next()).done;)r=r.value,a=f+pe(r,p++),i+=V(r,t,o,a,s);else if(a==="object"){if(typeof e.then=="function")return V(Lt(e),t,o,r,s);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}n(V,"mapIntoArray");function oe(e,t,o){if(e==null)return e;var r=[],s=0;return V(e,r,"","",function(a){return t.call(o,a,s++)}),r}n(oe,"mapChildren");function $t(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(o){(e._status===0||e._status===-1)&&(e._status=1,e._result=o)},function(o){(e._status===0||e._status===-1)&&(e._status=2,e._result=o)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}n($t,"lazyInitializer");var Ge=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ht={map:oe,forEach:n(function(e,t,o){oe(e,function(){t.apply(this,arguments)},o)},"forEach"),count:n(function(e){var t=0;return oe(e,function(){t++}),t},"count"),toArray:n(function(e){return oe(e,function(t){return t})||[]},"toArray"),only:n(function(e){if(!ye(e))throw Error("React.Children.only expected to receive a single React element child.");return e},"only")};m.Activity=Gt;m.Children=Ht;m.Component=q;m.Fragment=Rt;m.Profiler=At;m.PureComponent=be;m.StrictMode=Tt;m.Suspense=Mt;m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=h;m.__COMPILER_RUNTIME={__proto__:null,c:n(function(e){return h.H.useMemoCache(e)},"c")};m.cache=function(e){return function(){return e.apply(null,arguments)}};m.cacheSignal=function(){return null};m.cloneElement=function(e,t,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Oe({},e.props),s=e.key;if(t!=null)for(a in t.key!==void 0&&(s=""+t.key),t)!He.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=o;else if(1<a){for(var i=Array(a),f=0;f<a;f++)i[f]=arguments[f+2];r.children=i}return he(e.type,s,r)};m.createContext=function(e){return e={$$typeof:zt,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:St,_context:e},e};m.createElement=function(e,t,o){var r,s={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=""+t.key),t)He.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(s[r]=t[r]);var i=arguments.length-2;if(i===1)s.children=o;else if(1<i){for(var f=Array(i),p=0;p<i;p++)f[p]=arguments[p+2];s.children=f}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)s[r]===void 0&&(s[r]=i[r]);return he(e,a,s)};m.createRef=function(){return{current:null}};m.forwardRef=function(e){return{$$typeof:Pt,render:e}};m.isValidElement=ye;m.lazy=function(e){return{$$typeof:Ne,_payload:{_status:-1,_result:e},_init:$t}};m.memo=function(e,t){return{$$typeof:It,type:e,compare:t===void 0?null:t}};m.startTransition=function(e){var t=h.T,o={};h.T=o;try{var r=e(),s=h.S;s!==null&&s(o,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(fe,Ge)}catch(a){Ge(a)}finally{t!==null&&o.types!==null&&(t.types=o.types),h.T=t}};m.unstable_useCacheRefresh=function(){return h.H.useCacheRefresh()};m.use=function(e){return h.H.use(e)};m.useActionState=function(e,t,o){return h.H.useActionState(e,t,o)};m.useCallback=function(e,t){return h.H.useCallback(e,t)};m.useContext=function(e){return h.H.useContext(e)};m.useDebugValue=function(){};m.useDeferredValue=function(e,t){return h.H.useDeferredValue(e,t)};m.useEffect=function(e,t){return h.H.useEffect(e,t)};m.useEffectEvent=function(e){return h.H.useEffectEvent(e)};m.useId=function(){return h.H.useId()};m.useImperativeHandle=function(e,t,o){return h.H.useImperativeHandle(e,t,o)};m.useInsertionEffect=function(e,t){return h.H.useInsertionEffect(e,t)};m.useLayoutEffect=function(e,t){return h.H.useLayoutEffect(e,t)};m.useMemo=function(e,t){return h.H.useMemo(e,t)};m.useOptimistic=function(e,t){return h.H.useOptimistic(e,t)};m.useReducer=function(e,t,o){return h.H.useReducer(e,t,o)};m.useRef=function(e){return h.H.useRef(e)};m.useState=function(e){return h.H.useState(e)};m.useSyncExternalStore=function(e,t,o){return h.H.useSyncExternalStore(e,t,o)};m.useTransition=function(){return h.H.useTransition()};m.version="19.2.8"});var Ue=D((Wo,We)=>{"use strict";We.exports=Ye()});var Ve=D(De=>{"use strict";var Yt=Ue().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;De.c=function(e){return Yt.H.useMemoCache(e)}});var Wt=D((Do,qe)=>{"use strict";qe.exports=Ve()});var Fe=D(re=>{"use strict";var Ut=Symbol.for("react.transitional.element"),Dt=Symbol.for("react.fragment");function Be(e,t,o){var r=null;if(o!==void 0&&(r=""+o),t.key!==void 0&&(r=""+t.key),"key"in t){o={};for(var s in t)s!=="key"&&(o[s]=t[s])}else o=t;return t=o.ref,{$$typeof:Ut,type:e,key:r,ref:t!==void 0?t:null,props:o}}n(Be,"jsxProd");re.Fragment=Dt;re.jsx=Be;re.jsxs=Be});var Vt=D((Bo,Xe)=>{"use strict";Xe.exports=Fe()});function Qe(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(o=Qe(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}n(Qe,"r");function Je(){for(var e,t,o=0,r="",s=arguments.length;o<s;o++)(e=arguments[o])&&(t=Qe(e))&&(r&&(r+=" "),r+=t);return r}n(Je,"clsx");var qt=n((e,t)=>{let o=new Array(e.length+t.length);for(let r=0;r<e.length;r++)o[r]=e[r];for(let r=0;r<t.length;r++)o[e.length+r]=t[r];return o},"concatArrays"),Bt=n((e,t)=>({classGroupId:e,validator:t}),"createClassValidatorObject"),nt=n((e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),"createClassPartObject"),ie="-",Ze=[],Ft="arbitrary..",Xt=n(e=>{let t=Jt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n(i=>{if(i.startsWith("[")&&i.endsWith("]"))return Qt(i);let f=i.split(ie),p=f[0]===""&&f.length>1?1:0;return st(f,p,t)},"getClassGroupId"),getConflictingClassGroupIds:n((i,f)=>{if(f){let p=r[i],b=o[i];return p?b?qt(b,p):p:b||Ze}return o[i]||Ze},"getConflictingClassGroupIds")}},"createClassGroupUtils"),st=n((e,t,o)=>{if(e.length-t===0)return o.classGroupId;let s=e[t],a=o.nextPart.get(s);if(a){let b=st(e,t+1,a);if(b)return b}let i=o.validators;if(i===null)return;let f=t===0?e.join(ie):e.slice(t).join(ie),p=i.length;for(let b=0;b<p;b++){let x=i[b];if(x.validator(f))return x.classGroupId}},"getGroupRecursive"),Qt=n(e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),o=t.indexOf(":"),r=t.slice(0,o);return r?Ft+r:void 0})(),"getGroupIdForArbitraryProperty"),Jt=n(e=>{let{theme:t,classGroups:o}=e;return Zt(o,t)},"createClassMap"),Zt=n((e,t)=>{let o=nt();for(let r in e){let s=e[r];ke(s,o,r,t)}return o},"processClassGroups"),ke=n((e,t,o,r)=>{let s=e.length;for(let a=0;a<s;a++){let i=e[a];Kt(i,t,o,r)}},"processClassesRecursively"),Kt=n((e,t,o,r)=>{if(typeof e=="string"){eo(e,t,o);return}if(typeof e=="function"){to(e,t,o,r);return}oo(e,t,o,r)},"processClassDefinition"),eo=n((e,t,o)=>{let r=e===""?t:it(t,e);r.classGroupId=o},"processStringDefinition"),to=n((e,t,o,r)=>{if(ro(e)){ke(e(r),t,o,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Bt(o,e))},"processFunctionDefinition"),oo=n((e,t,o,r)=>{let s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){let[f,p]=s[i];ke(p,it(t,f),o,r)}},"processObjectDefinition"),it=n((e,t)=>{let o=e,r=t.split(ie),s=r.length;for(let a=0;a<s;a++){let i=r[a],f=o.nextPart.get(i);f||(f=nt(),o.nextPart.set(i,f)),o=f}return o},"getPart"),ro=n(e=>"isThemeGetter"in e&&e.isThemeGetter===!0,"isThemeGetter"),no=n(e=>{if(e<1)return{get:n(()=>{},"get"),set:n(()=>{},"set")};let t=0,o=Object.create(null),r=Object.create(null),s=n((a,i)=>{o[a]=i,t++,t>e&&(t=0,r=o,o=Object.create(null))},"update");return{get(a){let i=o[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in o?o[a]=i:s(a,i)}}},"createLruCache"),xe="!",Ke=":",so=[],et=n((e,t,o,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:r,isExternal:s}),"createResultObject"),io=n(e=>{let{prefix:t,experimentalParseClassName:o}=e,r=n(s=>{let a=[],i=0,f=0,p=0,b,x=s.length;for(let E=0;E<x;E++){let T=s[E];if(i===0&&f===0){if(T===Ke){a.push(s.slice(p,E)),p=E+1;continue}if(T==="/"){b=E;continue}}T==="["?i++:T==="]"?i--:T==="("?f++:T===")"&&f--}let k=a.length===0?s:s.slice(p),N=k,S=!1;k.endsWith(xe)?(N=k.slice(0,-1),S=!0):k.startsWith(xe)&&(N=k.slice(1),S=!0);let B=b&&b>p?b-p:void 0;return et(a,S,N,B)},"parseClassName");if(t){let s=t+Ke,a=r;r=n(i=>i.startsWith(s)?a(i.slice(s.length)):et(so,!1,i,void 0,!0),"parseClassName")}if(o){let s=r;r=n(a=>o({className:a,parseClassName:s}),"parseClassName")}return r},"createParseClassName"),ao=n(e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((o,r)=>{t.set(o,1e6+r)}),o=>{let r=[],s=[];for(let a=0;a<o.length;a++){let i=o[a],f=i[0]==="[",p=t.has(i);f||p?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},"createSortModifiers"),lo=n(e=>({cache:no(e.cacheSize),parseClassName:io(e),sortModifiers:ao(e),postfixLookupClassGroupIds:co(e),...Xt(e)}),"createConfigUtils"),co=n(e=>{let t=Object.create(null),o=e.postfixLookupClassGroups;if(o)for(let r=0;r<o.length;r++)t[o[r]]=!0;return t},"createPostfixLookupClassGroupIds"),uo=/\s+/,po=n((e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a,postfixLookupClassGroupIds:i}=t,f=[],p=e.trim().split(uo),b="";for(let x=p.length-1;x>=0;x-=1){let k=p[x],{isExternal:N,modifiers:S,hasImportantModifier:B,baseClassName:E,maybePostfixModifierPosition:T}=o(k);if(N){b=k+(b.length>0?" "+b:b);continue}let j=!!T,C;if(j){let P=E.substring(0,T);C=r(P);let u=C&&i[C]?r(E):void 0;u&&u!==C&&(C=u,j=!1)}else C=r(E);if(!C){if(!j){b=k+(b.length>0?" "+b:b);continue}if(C=r(E),!C){b=k+(b.length>0?" "+b:b);continue}j=!1}let F=S.length===0?"":S.length===1?S[0]:a(S).join(":"),H=B?F+xe:F,Y=H+C;if(f.indexOf(Y)>-1)continue;f.push(Y);let W=s(C,j);for(let P=0;P<W.length;++P){let u=W[P];f.push(H+u)}b=k+(b.length>0?" "+b:b)}return b},"mergeClassList"),fo=n((...e)=>{let t=0,o,r,s="";for(;t<e.length;)(o=e[t++])&&(r=at(o))&&(s&&(s+=" "),s+=r);return s},"twJoin"),at=n(e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=at(e[r]))&&(o&&(o+=" "),o+=t);return o},"toValue"),mo=n((e,...t)=>{let o,r,s,a,i=n(p=>{let b=t.reduce((x,k)=>k(x),e());return o=lo(b),r=o.cache.get,s=o.cache.set,a=f,f(p)},"initTailwindMerge"),f=n(p=>{let b=r(p);if(b)return b;let x=po(p,o);return s(p,x),x},"tailwindMerge");return a=i,(...p)=>a(fo(...p))},"createTailwindMerge"),bo=[],y=n(e=>{let t=n(o=>o[e]||bo,"themeGetter");return t.isThemeGetter=!0,t},"fromTheme"),lt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ct=/^\((?:(\w[\w-]*):)?(.+)\)$/i,go=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ho=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ko=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=n(e=>go.test(e),"isFraction"),g=n(e=>!!e&&!Number.isNaN(Number(e)),"isNumber"),z=n(e=>!!e&&Number.isInteger(Number(e)),"isInteger"),we=n(e=>e.endsWith("%")&&g(e.slice(0,-1)),"isPercent"),M=n(e=>ho.test(e),"isTshirtSize"),ut=n(()=>!0,"isAny"),vo=n(e=>yo.test(e)&&!wo.test(e),"isLengthOnly"),ve=n(()=>!1,"isNever"),_o=n(e=>xo.test(e),"isShadow"),Eo=n(e=>ko.test(e),"isImage"),Co=n(e=>!l(e)&&!c(e),"isAnyNonArbitrary"),Ro=n(e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),"isNamedContainerQuery"),To=n(e=>G(e,ft,ve),"isArbitrarySize"),l=n(e=>lt.test(e),"isArbitraryValue"),L=n(e=>G(e,mt,vo),"isArbitraryLength"),tt=n(e=>G(e,No,g),"isArbitraryNumber"),Ao=n(e=>G(e,gt,ut),"isArbitraryWeight"),So=n(e=>G(e,bt,ve),"isArbitraryFamilyName"),ot=n(e=>G(e,dt,ve),"isArbitraryPosition"),zo=n(e=>G(e,pt,Eo),"isArbitraryImage"),ne=n(e=>G(e,ht,_o),"isArbitraryShadow"),c=n(e=>ct.test(e),"isArbitraryVariable"),X=n(e=>$(e,mt),"isArbitraryVariableLength"),Po=n(e=>$(e,bt),"isArbitraryVariableFamilyName"),rt=n(e=>$(e,dt),"isArbitraryVariablePosition"),Mo=n(e=>$(e,ft),"isArbitraryVariableSize"),Io=n(e=>$(e,pt),"isArbitraryVariableImage"),se=n(e=>$(e,ht,!0),"isArbitraryVariableShadow"),Go=n(e=>$(e,gt,!0),"isArbitraryVariableWeight"),G=n((e,t,o)=>{let r=lt.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},"getIsArbitraryValue"),$=n((e,t,o=!1)=>{let r=ct.exec(e);return r?r[1]?t(r[1]):o:!1},"getIsArbitraryVariable"),dt=n(e=>e==="position"||e==="percentage","isLabelPosition"),pt=n(e=>e==="image"||e==="url","isLabelImage"),ft=n(e=>e==="length"||e==="size"||e==="bg-size","isLabelSize"),mt=n(e=>e==="length","isLabelLength"),No=n(e=>e==="number","isLabelNumber"),bt=n(e=>e==="family-name","isLabelFamilyName"),gt=n(e=>e==="number"||e==="weight","isLabelWeight"),ht=n(e=>e==="shadow","isLabelShadow");var jo=n(()=>{let e=y("color"),t=y("font"),o=y("text"),r=y("font-weight"),s=y("tracking"),a=y("leading"),i=y("breakpoint"),f=y("container"),p=y("spacing"),b=y("radius"),x=y("shadow"),k=y("inset-shadow"),N=y("text-shadow"),S=y("drop-shadow"),B=y("blur"),E=y("perspective"),T=y("aspect"),j=y("ease"),C=y("animate"),F=n(()=>["auto","avoid","all","avoid-page","page","left","right","column"],"scaleBreak"),H=n(()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],"scalePosition"),Y=n(()=>[...H(),c,l],"scalePositionWithArbitrary"),W=n(()=>["auto","hidden","clip","visible","scroll"],"scaleOverflow"),P=n(()=>["auto","contain","none"],"scaleOverscroll"),u=n(()=>[c,l,p],"scaleUnambiguousSpacing"),R=n(()=>[I,"full","auto",...u()],"scaleInset"),_e=n(()=>[z,"none","subgrid",c,l],"scaleGridTemplateColsRows"),Ee=n(()=>["auto",{span:["full",z,c,l]},z,c,l],"scaleGridColRowStartAndEnd"),Q=n(()=>[z,"auto",c,l],"scaleGridColRowStartOrEnd"),Ce=n(()=>["auto","min","max","fr",c,l],"scaleGridAutoColsRows"),ae=n(()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],"scaleAlignPrimaryAxis"),U=n(()=>["start","end","center","stretch","center-safe","end-safe"],"scaleAlignSecondaryAxis"),A=n(()=>["auto",...u()],"scaleMargin"),O=n(()=>[I,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],"scaleSizing"),le=n(()=>[I,"screen","full","dvw","lvw","svw","min","max","fit",...u()],"scaleSizingInline"),ce=n(()=>[I,"screen","full","lh","dvh","lvh","svh","min","max","fit",...u()],"scaleSizingBlock"),d=n(()=>[e,c,l],"scaleColor"),Re=n(()=>[...H(),rt,ot,{position:[c,l]}],"scaleBgPosition"),Te=n(()=>["no-repeat",{repeat:["","x","y","space","round"]}],"scaleBgRepeat"),Ae=n(()=>["auto","cover","contain",Mo,To,{size:[c,l]}],"scaleBgSize"),ue=n(()=>[we,X,L],"scaleGradientStopPosition"),v=n(()=>["","none","full",b,c,l],"scaleRadius"),_=n(()=>["",g,X,L],"scaleBorderWidth"),J=n(()=>["solid","dashed","dotted","double"],"scaleLineStyle"),Se=n(()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"scaleBlendMode"),w=n(()=>[g,we,rt,ot],"scaleMaskImagePosition"),ze=n(()=>["","none",B,c,l],"scaleBlur"),Z=n(()=>["none",g,c,l],"scaleRotate"),K=n(()=>["none",g,c,l],"scaleScale"),de=n(()=>[g,c,l],"scaleSkew"),ee=n(()=>[I,"full",...u()],"scaleTranslate");return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[M],breakpoint:[M],color:[ut],container:[M],"drop-shadow":[M],ease:["in","out","in-out"],font:[Co],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[M],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[M],shadow:[M],spacing:["px",g],text:[M],"text-shadow":[M],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",I,l,c,T]}],container:["container"],"container-type":[{"@container":["","normal","size",c,l]}],"container-named":[Ro],columns:[{columns:[g,l,c,f]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[z,"auto",c,l]}],basis:[{basis:[I,"full","auto",f,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[g,I,"auto","initial","none",l]}],grow:[{grow:["",g,c,l]}],shrink:[{shrink:["",g,c,l]}],order:[{order:[z,"first","last","none",c,l]}],"grid-cols":[{"grid-cols":_e()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":_e()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ce()}],"auto-rows":[{"auto-rows":Ce()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pbs:[{pbs:u()}],pbe:[{pbe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...le()]}],"min-inline-size":[{"min-inline":["auto",...le()]}],"max-inline-size":[{"max-inline":["none",...le()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[f,"screen",...O()]}],"min-w":[{"min-w":[f,"screen","none",...O()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[i]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",o,X,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Go,Ao]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",we,l]}],"font-family":[{font:[Po,So,t]}],"font-features":[{"font-features":[l]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,c,l]}],"line-clamp":[{"line-clamp":[g,"none",c,tt]}],leading:[{leading:[a,...u()]}],"list-image":[{"list-image":["none",c,l]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",c,l]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:d()}],"text-color":[{text:d()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[g,"from-font","auto",c,L]}],"text-decoration-color":[{decoration:d()}],"underline-offset":[{"underline-offset":[g,"auto",c,l]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"tab-size":[{tab:[z,c,l]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c,l]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",c,l]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Re()}],"bg-repeat":[{bg:Te()}],"bg-size":[{bg:Ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},z,c,l],radial:["",c,l],conic:[z,c,l]},Io,zo]}],"bg-color":[{bg:d()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:d()}],"gradient-via":[{via:d()}],"gradient-to":[{to:d()}],rounded:[{rounded:v()}],"rounded-s":[{"rounded-s":v()}],"rounded-e":[{"rounded-e":v()}],"rounded-t":[{"rounded-t":v()}],"rounded-r":[{"rounded-r":v()}],"rounded-b":[{"rounded-b":v()}],"rounded-l":[{"rounded-l":v()}],"rounded-ss":[{"rounded-ss":v()}],"rounded-se":[{"rounded-se":v()}],"rounded-ee":[{"rounded-ee":v()}],"rounded-es":[{"rounded-es":v()}],"rounded-tl":[{"rounded-tl":v()}],"rounded-tr":[{"rounded-tr":v()}],"rounded-br":[{"rounded-br":v()}],"rounded-bl":[{"rounded-bl":v()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-bs":[{"border-bs":_()}],"border-w-be":[{"border-be":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:d()}],"border-color-x":[{"border-x":d()}],"border-color-y":[{"border-y":d()}],"border-color-s":[{"border-s":d()}],"border-color-e":[{"border-e":d()}],"border-color-bs":[{"border-bs":d()}],"border-color-be":[{"border-be":d()}],"border-color-t":[{"border-t":d()}],"border-color-r":[{"border-r":d()}],"border-color-b":[{"border-b":d()}],"border-color-l":[{"border-l":d()}],"divide-color":[{divide:d()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[g,c,l]}],"outline-w":[{outline:["",g,X,L]}],"outline-color":[{outline:d()}],shadow:[{shadow:["","none",x,se,ne]}],"shadow-color":[{shadow:d()}],"inset-shadow":[{"inset-shadow":["none",k,se,ne]}],"inset-shadow-color":[{"inset-shadow":d()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:d()}],"ring-offset-w":[{"ring-offset":[g,L]}],"ring-offset-color":[{"ring-offset":d()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":d()}],"text-shadow":[{"text-shadow":["none",N,se,ne]}],"text-shadow-color":[{"text-shadow":d()}],opacity:[{opacity:[g,c,l]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[g]}],"mask-image-linear-from-pos":[{"mask-linear-from":w()}],"mask-image-linear-to-pos":[{"mask-linear-to":w()}],"mask-image-linear-from-color":[{"mask-linear-from":d()}],"mask-image-linear-to-color":[{"mask-linear-to":d()}],"mask-image-t-from-pos":[{"mask-t-from":w()}],"mask-image-t-to-pos":[{"mask-t-to":w()}],"mask-image-t-from-color":[{"mask-t-from":d()}],"mask-image-t-to-color":[{"mask-t-to":d()}],"mask-image-r-from-pos":[{"mask-r-from":w()}],"mask-image-r-to-pos":[{"mask-r-to":w()}],"mask-image-r-from-color":[{"mask-r-from":d()}],"mask-image-r-to-color":[{"mask-r-to":d()}],"mask-image-b-from-pos":[{"mask-b-from":w()}],"mask-image-b-to-pos":[{"mask-b-to":w()}],"mask-image-b-from-color":[{"mask-b-from":d()}],"mask-image-b-to-color":[{"mask-b-to":d()}],"mask-image-l-from-pos":[{"mask-l-from":w()}],"mask-image-l-to-pos":[{"mask-l-to":w()}],"mask-image-l-from-color":[{"mask-l-from":d()}],"mask-image-l-to-color":[{"mask-l-to":d()}],"mask-image-x-from-pos":[{"mask-x-from":w()}],"mask-image-x-to-pos":[{"mask-x-to":w()}],"mask-image-x-from-color":[{"mask-x-from":d()}],"mask-image-x-to-color":[{"mask-x-to":d()}],"mask-image-y-from-pos":[{"mask-y-from":w()}],"mask-image-y-to-pos":[{"mask-y-to":w()}],"mask-image-y-from-color":[{"mask-y-from":d()}],"mask-image-y-to-color":[{"mask-y-to":d()}],"mask-image-radial":[{"mask-radial":[c,l]}],"mask-image-radial-from-pos":[{"mask-radial-from":w()}],"mask-image-radial-to-pos":[{"mask-radial-to":w()}],"mask-image-radial-from-color":[{"mask-radial-from":d()}],"mask-image-radial-to-color":[{"mask-radial-to":d()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[g]}],"mask-image-conic-from-pos":[{"mask-conic-from":w()}],"mask-image-conic-to-pos":[{"mask-conic-to":w()}],"mask-image-conic-from-color":[{"mask-conic-from":d()}],"mask-image-conic-to-color":[{"mask-conic-to":d()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Re()}],"mask-repeat":[{mask:Te()}],"mask-size":[{mask:Ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",c,l]}],filter:[{filter:["","none",c,l]}],blur:[{blur:ze()}],brightness:[{brightness:[g,c,l]}],contrast:[{contrast:[g,c,l]}],"drop-shadow":[{"drop-shadow":["","none",S,se,ne]}],"drop-shadow-color":[{"drop-shadow":d()}],grayscale:[{grayscale:["",g,c,l]}],"hue-rotate":[{"hue-rotate":[g,c,l]}],invert:[{invert:["",g,c,l]}],saturate:[{saturate:[g,c,l]}],sepia:[{sepia:["",g,c,l]}],"backdrop-filter":[{"backdrop-filter":["","none",c,l]}],"backdrop-blur":[{"backdrop-blur":ze()}],"backdrop-brightness":[{"backdrop-brightness":[g,c,l]}],"backdrop-contrast":[{"backdrop-contrast":[g,c,l]}],"backdrop-grayscale":[{"backdrop-grayscale":["",g,c,l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g,c,l]}],"backdrop-invert":[{"backdrop-invert":["",g,c,l]}],"backdrop-opacity":[{"backdrop-opacity":[g,c,l]}],"backdrop-saturate":[{"backdrop-saturate":[g,c,l]}],"backdrop-sepia":[{"backdrop-sepia":["",g,c,l]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",c,l]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[g,"initial",c,l]}],ease:[{ease:["linear","initial",j,c,l]}],delay:[{delay:[g,c,l]}],animate:[{animate:["none",C,c,l]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,c,l]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[c,l,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],zoom:[{zoom:[z,c,l]}],accent:[{accent:d()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:d()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c,l]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":d()}],"scrollbar-track-color":[{"scrollbar-track":d()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mbs":[{"scroll-mbs":u()}],"scroll-mbe":[{"scroll-mbe":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pbs":[{"scroll-pbs":u()}],"scroll-pbe":[{"scroll-pbe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c,l]}],fill:[{fill:["none",...d()]}],"stroke-w":[{stroke:[g,X,L,tt]}],stroke:[{stroke:["none",...d()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},"getDefaultConfig");var yt=mo(jo);function er(...e){return yt(Je(e))}n(er,"m");export{n as a,D as b,Oo as c,Lo as d,Ue as e,Wt as f,Vt as g,Je as h,er as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,h as y}from"./chunk-R5ZTCHCE.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
|
+
import{a as G}from"./chunk-METRMDIQ.js";import{a as x}from"./chunk-NXXGISFB.js";import{a as U}from"./chunk-6UN4V2HB.js";import{b as M}from"./chunk-KVSQKUWD.js";import"./chunk-ZHPDAJBM.js";import{P as O}from"./chunk-AOAJGSYZ.js";import"./chunk-TFMQSCGC.js";import{a as h}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as w}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as E}from"./chunk-DZGOHOOE.js";import{f as D}from"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{d as K,e as _,f as z,h as B,o as P,s as q}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as s,d as J,e as ie,g as oe}from"./chunk-R5ZTCHCE.js";var i=J(ie(),1);var e=J(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,"oe"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"ie"),ce=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"),ue=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ce(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(E.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(),u=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),g=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[c,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 u.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(B(d))}),()=>{t=!0}},[u,r]);let A=I===""?g[0]?.path??"":I,n=g.find(t=>t.path===A),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},R=c.trim()===""?{}:{shardKey:c.trim()},j=o?f.trim():"",L=s(l=>{Y(T=>[{argsText:m,at:Date.now(),id:(T[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:c,status:l},...T].slice(0,fe))},"$");p("running"),N(null);try{let l=j===""?await _(u,n.kind,d,t,R):await u.query(me,{args:t,functionPath:n.path,userId:j},R);M(c),y(l),p("success"),L("success")}catch(l){y(void 0),N(l.message),p("error"),L("error")}},"J"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"M"),te=s(t=>{S(t.target.value)},"P"),re=s(t=>{b(t.target.value)},"z"),ae=s(t=>{W(t.target.value)},"q"),se=s(()=>{P(Z())},"H"),ne=s(()=>{b(ue(n?.args))},"V");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)(x,{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:A,children:g.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)(x,{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)(U,{onChange:F,testId:"shard-input",value:c}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(x,{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:q(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))})]})},"Ae");export{Fe as FunctionRunner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as w}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import{b as y}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as C}from"./chunk-B3BKR5ZW.js";import"./chunk-PZ4QDWTI.js";import"./chunk-P4QIDUCY.js";import"./chunk-F7JOSNAT.js";import{a as h}from"./chunk-DZGOHOOE.js";import{c as u}from"./chunk-L6ATKZKO.js";import"./chunk-YTYRZTG6.js";import"./chunk-RCZTUWG3.js";import{a as T}from"./chunk-UANVABQG.js";import{a as S,b as K,c as $,d as g,e as i,f as o}from"./chunk-L4EZAHCD.js";import{a as A,e as k}from"./chunk-IYWVSMAY.js";import{d as M,s as D}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as d,d as z,e as ae,g as re}from"./chunk-R5ZTCHCE.js";var O=z(ae(),1);var e=z(re(),1);var Q="agent_threads",se="agent_messages",F="agent_run_queue",R=100,ne=250,ie={},oe={filters:[],limit:R,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:Q},l=d((s,t)=>{let r=s[t];return typeof r=="string"?r:void 0},"i"),j=d((s,t)=>{let r=s[t];return typeof r=="number"?r:void 0},"A"),L=d(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:r}=t;return typeof r=="number"?r:void 0},"U"),de=d(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(r=>r!==null&&typeof r=="object"?r.name:void 0).filter(r=>typeof r=="string"):[]},"ne"),le=d(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"oe"),ce=d(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"de"),Ne=d(({initialShardKey:s=""})=>{let t=M(),[r,I]=(0,O.useState)(void 0),{data:c}=u(h.listTables,ie,{live:!0,shardKey:s}),G=c!==void 0,p=Array.isArray(c)&&c.some(a=>a.name===Q),H=Array.isArray(c)&&c.some(a=>a.name===F),{data:_,error:J,errorSource:V,liveError:W}=u(h.readTablePage,oe,{enabled:p,live:!0,shardKey:s}),X={filters:[{column:"threadKey",operator:"eq",value:r??""}],limit:ne,offset:0,orderBy:{column:"seq",direction:"asc"},skipCount:!0,table:se},{data:q}=u(h.readTablePage,{limit:R,offset:0,orderBy:{column:"position",direction:"asc"},skipCount:!0,table:F},{enabled:H,live:!0,shardKey:s}),{data:B,error:Y,errorSource:Z}=u(h.readTablePage,X,{enabled:p&&r!==void 0,live:!0,shardKey:s}),v=Array.isArray(_?.rows)?_.rows:[],ee=Array.isArray(q?.rows)?q.rows:[],E=d(a=>ee.filter(n=>l(n,"threadKey")===a).length,"w"),P=Array.isArray(B?.rows)?B.rows:[],U=v.find(a=>l(a,"key")===r),f;return G&&!p?f=(0,e.jsx)(T,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):p&&v.length===0?f=(0,e.jsx)(T,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):f=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(A,{className:"overflow-hidden py-0",children:(0,e.jsx)(k,{className:"px-0",children:(0,e.jsxs)(S,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(g,{children:[(0,e.jsx)(i,{children:t("Agent")}),(0,e.jsx)(i,{children:t("Key")}),(0,e.jsx)(i,{children:t("Status")}),(0,e.jsx)(i,{children:t("Queued")}),(0,e.jsx)(i,{children:t("Messages")}),(0,e.jsx)(i,{children:t("Tokens")}),(0,e.jsx)(i,{children:t("Updated")}),(0,e.jsx)(i,{"aria-label":t("Actions")})]})}),(0,e.jsx)($,{children:v.map(a=>{let n=l(a,"key")??"",m=l(a,"status"),x=L(a);return(0,e.jsxs)(g,{"data-active":n===r?"":void 0,"data-testid":`agents-thread-${n}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:l(a,"agent")??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:n}),(0,e.jsx)(o,{children:(0,e.jsx)(y,{"data-testid":`agents-thread-status-${n}`,variant:le(m),children:m??"\u2014"})}),(0,e.jsx)(o,{className:"tabular-nums",children:E(n)===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(y,{"data-testid":`agents-thread-queued-${n}`,variant:"warning",children:E(n)})}),(0,e.jsx)(o,{className:"tabular-nums",children:j(a,"messageCount")??"\u2014"}),(0,e.jsx)(o,{className:"tabular-nums text-muted-foreground",children:x??"\u2014"}),(0,e.jsx)(o,{className:"text-muted-foreground tabular-nums",children:D(j(a,"updatedAt"),"\u2014")}),(0,e.jsx)(o,{className:"text-right",children:(0,e.jsx)(w,{"data-testid":`agents-thread-open-${n}`,onClick:d(()=>{I(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},n)})})]})})}),Y!==null&&(0,e.jsx)(C,{error:Z,testId:"agents-messages-error"}),r!==void 0&&(0,e.jsx)(A,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(k,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",r,U!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",L(U)??0," ",t("Tokens")]})]}),(0,e.jsx)(w,{"data-testid":"agents-thread-detail-close",onClick:d(()=>{I(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),P.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(S,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(g,{children:[(0,e.jsx)(i,{children:t("Role")}),(0,e.jsx)(i,{children:t("Content")}),(0,e.jsx)(i,{children:t("Tool")}),(0,e.jsx)(i,{children:t("Approval")})]})}),(0,e.jsx)($,{children:P.map((a,n)=>{let m=l(a,"role")??"\u2014",x=de(a),te=l(a,"toolName"),b=l(a,"status"),N=j(a,"seq")??n;return(0,e.jsxs)(g,{"data-testid":`agents-message-${String(N)}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs align-top text-muted-foreground",children:m}),(0,e.jsx)(o,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:l(a,"content")??"\u2014"}),(0,e.jsx)(o,{className:"font-mono text-xs align-top text-muted-foreground",children:te??(x.length>0?x.join(", "):"\u2014")}),(0,e.jsx)(o,{className:"align-top",children:b===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(y,{"data-testid":`agents-message-approval-${String(N)}`,variant:ce(b),children:b})})]},l(a,"messageKey")??`${m}:${String(N)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[J!==null&&(0,e.jsx)(C,{error:V,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),W!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),f]})},"be");export{Ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,j as a}from"./chunk-7PIHTTND.js";import{a as o}from"./chunk-RCZTUWG3.js";import{a as r,i as n}from"./chunk-R5ZTCHCE.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};
|