@lunora/studio 1.0.0-alpha.36 → 1.0.0-alpha.360
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/README.md +4 -4
- package/dist/index.d.mts +1621 -0
- package/dist/index.d.ts +1013 -809
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +23 -0
- package/dist/mount.d.ts +13 -11
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +8 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-panel.mjs +1 -0
- package/dist/packem_chunks/architecture-panel.mjs +1 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
- package/dist/packem_chunks/auth-config-panel.mjs +1 -0
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
- package/dist/packem_chunks/containers-panel.mjs +1 -0
- package/dist/packem_chunks/dashboards-panel.mjs +1 -0
- package/dist/packem_chunks/evals-panel.mjs +1 -0
- package/dist/packem_chunks/fanout-panel.mjs +1 -0
- package/dist/packem_chunks/flags-panel.mjs +1 -0
- package/dist/packem_chunks/issues-panel.mjs +1 -0
- package/dist/packem_chunks/kv-browser.mjs +1 -0
- package/dist/packem_chunks/log-drains-panel.mjs +4 -0
- package/dist/packem_chunks/migrations-route.mjs +1 -0
- package/dist/packem_chunks/organizations-panel.mjs +1 -0
- package/dist/packem_chunks/payments-panel.mjs +1 -0
- package/dist/packem_chunks/permissions-panel.mjs +1 -0
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
- package/dist/packem_chunks/queues-panel.mjs +1 -0
- package/dist/packem_chunks/reactors-panel.mjs +1 -0
- package/dist/packem_chunks/rls-panel.mjs +1 -0
- package/dist/packem_chunks/schedule-panel.mjs +1 -0
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
- package/dist/packem_chunks/sync-client-panel.mjs +1 -0
- package/dist/packem_chunks/theme-indicator.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -0
- package/dist/packem_chunks/users-panel.mjs +1 -0
- package/dist/packem_chunks/vector-browser.mjs +1 -0
- package/dist/packem_chunks/workflows-panel.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-DD2Uns6b.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-CQxU1Ocx.mjs +1 -0
- package/dist/packem_shared/CommandPalette-BZCHLpst.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-CIXYF6Mg.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-BfcoN-VE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Py5Yx7rP.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
- package/dist/packem_shared/DataBrowser-CVRWnNWu.mjs +4 -0
- package/dist/packem_shared/DataFilters--ocFTVT2.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DC47T6Zl.mjs +1 -0
- package/dist/packem_shared/HomePanel-D12HxHQo.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-DMkxSXNl.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-BFDG91tn.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-QCTRdugp.mjs +1 -0
- package/dist/packem_shared/ShardInput-CoySruKZ.mjs +1 -0
- package/dist/packem_shared/Studio-MA8kKZLu.mjs +1 -0
- package/dist/packem_shared/StudioApp-isdWpF9P.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-CGXCPnQn.mjs +1 -0
- package/dist/packem_shared/advisor-view-tBumWci_.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-D425h1XO.d.mts +352 -0
- package/dist/packem_shared/app.d-D425h1XO.d.ts +352 -0
- package/dist/packem_shared/auth-pager-DW77WeZw.mjs +1 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
- package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
- package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
- package/dist/packem_shared/data-grid-B5m1OosL.mjs +1 -0
- package/dist/packem_shared/data-view-params-C-_G-biH.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-Vdt-DZnO.mjs +2 -0
- package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
- package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
- package/dist/packem_shared/error-alert-C0R39DO1.mjs +1 -0
- package/dist/packem_shared/grid-features-Drvfswwy.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DY2erU65.mjs +1 -0
- package/dist/packem_shared/home-panel-CDVTuTF8.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-hIuTpSbx.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-D1GasNsH.mjs +1 -0
- package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
- package/dist/packem_shared/log-line-BH0iWiBv.mjs +1 -0
- package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-DAipTA_n.mjs +1 -0
- package/dist/packem_shared/reference-view-DENugPcj.mjs +13 -0
- package/dist/packem_shared/schema-diagram-CtVPhOGj.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-DCwooMGW.mjs +1 -0
- package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-UhUrPz5J.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-CNadcIgG.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-CaOm4JS3.mjs +1 -0
- package/dist/packem_shared/use-admin-spec-CK7mk3Ui.mjs +1 -0
- package/dist/packem_shared/use-async-submit-D0r7-m2J.mjs +1 -0
- package/dist/packem_shared/use-auth-config-CG7VvAvQ.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-BJKMJjeS.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-rZPs3LC3.mjs +1 -0
- package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/standalone/chunk-2AH4ABE5.js +1 -0
- package/dist/standalone/chunk-2G57ENH5.js +1 -0
- package/dist/standalone/chunk-3FS22LNI.js +4 -0
- package/dist/standalone/chunk-3GXPALXG.js +1 -0
- package/dist/standalone/chunk-3GYLOE4V.js +1 -0
- package/dist/standalone/chunk-3PAYDWHN.js +8 -0
- package/dist/standalone/chunk-473JK2PQ.js +1 -0
- package/dist/standalone/chunk-4C4THJUD.js +1 -0
- package/dist/standalone/chunk-4DAKKAK7.js +1 -0
- package/dist/standalone/chunk-4M57OYFX.js +1 -0
- package/dist/standalone/chunk-4SQBAPY6.js +1 -0
- package/dist/standalone/chunk-5DNGK3NT.js +1 -0
- package/dist/standalone/chunk-5GIQ6C5N.js +1 -0
- package/dist/standalone/chunk-5R2YO7HF.js +4 -0
- package/dist/standalone/chunk-5WJG7FMH.js +1 -0
- package/dist/standalone/chunk-63KDHS3H.js +1 -0
- package/dist/standalone/chunk-6B6ARRMI.js +1 -0
- package/dist/standalone/chunk-6LMO2D54.js +1 -0
- package/dist/standalone/chunk-6M7FLLMT.js +1 -0
- package/dist/standalone/chunk-6QEXGYWH.js +1 -0
- package/dist/standalone/chunk-6UTZXEW3.js +1 -0
- package/dist/standalone/chunk-6VAY6L4J.js +1 -0
- package/dist/standalone/chunk-7PADVGQX.js +1 -0
- package/dist/standalone/chunk-7RGYCU6F.js +1 -0
- package/dist/standalone/chunk-7UM5ROG6.js +1 -0
- package/dist/standalone/chunk-7ZIYHKLX.js +5 -0
- package/dist/standalone/chunk-A566HCBX.js +1 -0
- package/dist/standalone/chunk-A5JISKHE.js +1 -0
- package/dist/standalone/chunk-ADNRFCMZ.js +1 -0
- package/dist/standalone/chunk-AP4PC2M4.js +1 -0
- package/dist/standalone/chunk-BFE2DRP6.js +33 -0
- package/dist/standalone/chunk-BPEB4KFE.js +1 -0
- package/dist/standalone/chunk-BVX45MU5.js +7 -0
- package/dist/standalone/chunk-BYOGQ2IV.js +3 -0
- package/dist/standalone/chunk-C6GN7ZXJ.js +1 -0
- package/dist/standalone/chunk-CL2VZNDI.js +1 -0
- package/dist/standalone/chunk-CNA3TVUK.js +1 -0
- package/dist/standalone/chunk-CZ6HBDIL.js +1 -0
- package/dist/standalone/chunk-D6S7MXW4.js +1 -0
- package/dist/standalone/chunk-DBVJ5VLI.js +1 -0
- package/dist/standalone/chunk-DX55P3KZ.js +1 -0
- package/dist/standalone/chunk-E26OT26O.js +1 -0
- package/dist/standalone/chunk-FCAXVYAX.js +1 -0
- package/dist/standalone/chunk-FXPAJDES.js +1 -0
- package/dist/standalone/chunk-H7HZ42JY.js +1 -0
- package/dist/standalone/chunk-HHRYM6UW.js +1 -0
- package/dist/standalone/chunk-HPRF5LMA.js +1 -0
- package/dist/standalone/chunk-IB22LETR.js +1 -0
- package/dist/standalone/chunk-IBJVVHV5.js +1 -0
- package/dist/standalone/chunk-IENQRRQT.js +1 -0
- package/dist/standalone/chunk-IH2CJZF2.js +1 -0
- package/dist/standalone/chunk-IQ4TTHQT.js +1 -0
- package/dist/standalone/chunk-ITH5LRWM.js +1 -0
- package/dist/standalone/chunk-J6VFG6M5.js +1 -0
- package/dist/standalone/chunk-JSDKOE4U.js +1 -0
- package/dist/standalone/chunk-JTGGWF7R.js +1 -0
- package/dist/standalone/chunk-JZD7ZN3F.js +1 -0
- package/dist/standalone/chunk-K3CWB3AM.js +1 -0
- package/dist/standalone/chunk-KNFB3FGW.js +1 -0
- package/dist/standalone/chunk-KNXWDE4N.js +1 -0
- package/dist/standalone/chunk-KRPXOSBL.js +1 -0
- package/dist/standalone/chunk-KRY7BYHT.js +1 -0
- package/dist/standalone/chunk-KYAG2YMF.js +1 -0
- package/dist/standalone/chunk-KZCEJFZF.js +1 -0
- package/dist/standalone/chunk-KZILJQX3.js +8 -0
- package/dist/standalone/chunk-LEYUH5TS.js +1 -0
- package/dist/standalone/chunk-LFM672WN.js +1 -0
- package/dist/standalone/chunk-LIGOLZND.js +1 -0
- package/dist/standalone/chunk-LPU6YTSU.js +1 -0
- package/dist/standalone/chunk-LUHXNZI4.js +2 -0
- package/dist/standalone/chunk-MWJC3S62.js +1 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NP2AQOLE.js +1 -0
- package/dist/standalone/chunk-NVKLYDOH.js +1 -0
- package/dist/standalone/chunk-O2NMPIV2.js +59 -0
- package/dist/standalone/chunk-O2X2XYCM.js +1 -0
- package/dist/standalone/chunk-O3MDWYXF.js +1 -0
- package/dist/standalone/chunk-ONG4JEZD.js +1 -0
- package/dist/standalone/chunk-ONWGX5Y4.js +6 -0
- package/dist/standalone/chunk-OS26JXYA.js +1 -0
- package/dist/standalone/chunk-OXFKZ4BM.js +1 -0
- package/dist/standalone/chunk-PGTEGUAB.js +1 -0
- package/dist/standalone/chunk-PQH2LSJX.js +1 -0
- package/dist/standalone/chunk-PTBUWRBY.js +1 -0
- package/dist/standalone/chunk-Q6HA3L2H.js +1 -0
- package/dist/standalone/chunk-QGV5ARD2.js +1 -0
- package/dist/standalone/chunk-QWRK4ESB.js +1 -0
- package/dist/standalone/chunk-R36QXQZX.js +1 -0
- package/dist/standalone/chunk-RL2ITK2N.js +1 -0
- package/dist/standalone/chunk-RTJO3AR4.js +1 -0
- package/dist/standalone/chunk-SFY646MC.js +1 -0
- package/dist/standalone/chunk-SLIDAWNX.js +1 -0
- package/dist/standalone/chunk-SU5DTRGK.js +3 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SYGCASPT.js} +1 -1
- package/dist/standalone/chunk-T5UMHPAB.js +1 -0
- package/dist/standalone/chunk-T6HV2FQP.js +2 -0
- package/dist/standalone/chunk-T7ZKNNGX.js +1 -0
- package/dist/standalone/chunk-TCYPNSTV.js +1 -0
- package/dist/standalone/chunk-TDVDZ7XQ.js +1 -0
- package/dist/standalone/chunk-TQM6XHBA.js +1 -0
- package/dist/standalone/chunk-TRMWBRRU.js +1 -0
- package/dist/standalone/chunk-TW7KJSMR.js +15 -0
- package/dist/standalone/chunk-TYD3V4NB.js +1 -0
- package/dist/standalone/chunk-TZKLK52W.js +1 -0
- package/dist/standalone/chunk-U4RXQSQ7.js +1 -0
- package/dist/standalone/chunk-UNZ2UBVL.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-VEWQWS3J.js +1 -0
- package/dist/standalone/chunk-VJRNOSRY.js +1 -0
- package/dist/standalone/chunk-W2BCSK5S.js +1 -0
- package/dist/standalone/chunk-W7MRISE3.js +1 -0
- package/dist/standalone/chunk-WM72PRE3.js +1 -0
- package/dist/standalone/chunk-WS36BO4R.js +1 -0
- package/dist/standalone/chunk-X4WHMCOZ.js +1 -0
- package/dist/standalone/chunk-X74GEPSG.js +1 -0
- package/dist/standalone/chunk-XIRKBJPD.js +14 -0
- package/dist/standalone/chunk-XKPD4SFN.js +1 -0
- package/dist/standalone/chunk-XMSNLMWU.js +1 -0
- package/dist/standalone/chunk-XOPFDWXX.js +1 -0
- package/dist/standalone/chunk-XQLOVFPP.js +1 -0
- package/dist/standalone/chunk-XSHYZPGF.js +1 -0
- package/dist/standalone/chunk-XST3UEHU.js +1 -0
- package/dist/standalone/chunk-XYR5NST4.js +1 -0
- package/dist/standalone/chunk-Y74LIFSL.js +1 -0
- package/dist/standalone/chunk-YHTHRYP5.js +1 -0
- package/dist/standalone/chunk-YMEKCV27.js +1 -0
- package/dist/standalone/chunk-Z5EV64KS.js +1 -0
- package/dist/standalone/chunk-ZBON5T5A.js +1 -0
- package/dist/standalone/chunk-ZGSL4DPP.js +1 -0
- package/dist/standalone/chunk-ZOQTXWPK.js +1 -0
- package/dist/standalone/chunk-ZTOREMGH.js +1 -0
- package/dist/standalone/chunk-ZZ5GICTF.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/dist/styles.css +2 -2
- package/package.json +26 -22
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -27
- package/dist/packem_chunks/ApiTab.js +0 -251
- package/dist/packem_chunks/AuditPanel.js +0 -200
- package/dist/packem_chunks/ExportImportPanel.js +0 -198
- package/dist/packem_chunks/FileBrowser.js +0 -2932
- package/dist/packem_chunks/FunctionRunner.js +0 -343
- package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
- package/dist/packem_chunks/HealthPanel.js +0 -648
- package/dist/packem_chunks/InsightsPanel.js +0 -462
- package/dist/packem_chunks/LogsPanel.js +0 -827
- package/dist/packem_chunks/MailPanel.js +0 -353
- package/dist/packem_chunks/MetricsPanel.js +0 -1344
- package/dist/packem_chunks/MigrationsPanel.js +0 -239
- package/dist/packem_chunks/PitrPanel.js +0 -252
- package/dist/packem_chunks/SchemaViewer.js +0 -2513
- package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
- package/dist/packem_chunks/SettingsPanel.js +0 -391
- package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
- package/dist/packem_chunks/TableEditor.js +0 -313
- package/dist/packem_chunks/analytics-panel.js +0 -261
- package/dist/packem_chunks/auth-config-panel.js +0 -179
- package/dist/packem_chunks/auth-sessions-panel.js +0 -175
- package/dist/packem_chunks/containers-panel.js +0 -247
- package/dist/packem_chunks/dashboards-panel.js +0 -780
- package/dist/packem_chunks/fanout-panel.js +0 -482
- package/dist/packem_chunks/flags-panel.js +0 -176
- package/dist/packem_chunks/kv-browser.js +0 -1896
- package/dist/packem_chunks/log-drains-panel.js +0 -273
- package/dist/packem_chunks/organizations-panel.js +0 -670
- package/dist/packem_chunks/payments-panel.js +0 -186
- package/dist/packem_chunks/permissions-panel.js +0 -805
- package/dist/packem_chunks/queues-panel.js +0 -1052
- package/dist/packem_chunks/rls-panel.js +0 -315
- package/dist/packem_chunks/schedule-panel.js +0 -831
- package/dist/packem_chunks/sparkline.js +0 -79
- package/dist/packem_chunks/storage-rules-panel.js +0 -140
- package/dist/packem_chunks/subscriptions-panel.js +0 -238
- package/dist/packem_chunks/users-panel.js +0 -1265
- package/dist/packem_chunks/vector-browser.js +0 -281
- package/dist/packem_chunks/workflows-panel.js +0 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js +0 -52
- package/dist/packem_shared/ApiDocsPanel-D4CJf2ad.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
- package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-BeVNxSVm.js +0 -4493
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
- package/dist/packem_shared/HomePanel-D9MQk8I7.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/Studio-C48P1K5W.js +0 -16
- package/dist/packem_shared/StudioApp-Cqh-SYm2.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
- package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
- package/dist/packem_shared/home-panel-CoGxi-oj.js +0 -1639
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
- package/dist/packem_shared/select-UkNYCT3s.js +0 -273
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-CPHA_-3I.js +0 -4015
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
- package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
- package/dist/standalone/chunk-22W5VKZ6.js +0 -1
- package/dist/standalone/chunk-2GGMGPEP.js +0 -1
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-2THHW7BC.js +0 -1
- package/dist/standalone/chunk-3CJW6NWG.js +0 -4
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-46K3NKPA.js +0 -1
- package/dist/standalone/chunk-4QHKBC77.js +0 -1
- package/dist/standalone/chunk-5OH3VPZF.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-6GFEVKJP.js +0 -1
- package/dist/standalone/chunk-6WRZP62V.js +0 -1
- package/dist/standalone/chunk-764T6X6X.js +0 -1
- package/dist/standalone/chunk-7SLSB2TS.js +0 -4
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-7VF3IAAW.js +0 -2
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AJIUI7DD.js +0 -1
- package/dist/standalone/chunk-ATYUMPDM.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-BI35RXKQ.js +0 -1
- package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
- package/dist/standalone/chunk-BQUQS7QN.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-DC72CQY4.js +0 -76
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-DVC6YWVP.js +0 -1
- package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
- package/dist/standalone/chunk-DWDILV2E.js +0 -1
- package/dist/standalone/chunk-DWTBY343.js +0 -1
- package/dist/standalone/chunk-EUIHTPKI.js +0 -1
- package/dist/standalone/chunk-FCSPAJW4.js +0 -1
- package/dist/standalone/chunk-GMSGZDDH.js +0 -13
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-ILCTSAOB.js +0 -1
- package/dist/standalone/chunk-IOFMK4D7.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-JE2YOAB7.js +0 -4
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-K3GNLVYK.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-LAK5VSPI.js +0 -1
- package/dist/standalone/chunk-LD2R263D.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-M55U7NHO.js +0 -1
- package/dist/standalone/chunk-MPTM7ZU3.js +0 -3
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-NKJDGOM3.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-OCHNCAXJ.js +0 -1
- package/dist/standalone/chunk-OIZ4CHPN.js +0 -8
- package/dist/standalone/chunk-OY3GVYS7.js +0 -4
- package/dist/standalone/chunk-PACH5AHG.js +0 -1
- package/dist/standalone/chunk-PN5NCZDX.js +0 -1
- package/dist/standalone/chunk-PVZI3CXP.js +0 -19
- package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
- package/dist/standalone/chunk-Q52CHOSY.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QBAT52GB.js +0 -1
- package/dist/standalone/chunk-QLM6FYZW.js +0 -2
- package/dist/standalone/chunk-RRAFQ5G2.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-RSEEHNFI.js +0 -1
- package/dist/standalone/chunk-SEU5V7I6.js +0 -1
- package/dist/standalone/chunk-SG3ALJJU.js +0 -1
- package/dist/standalone/chunk-SLKF2L74.js +0 -1
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TBMYIZIO.js +0 -1
- package/dist/standalone/chunk-TDL7NEWA.js +0 -1
- package/dist/standalone/chunk-TO4JQX7W.js +0 -1
- package/dist/standalone/chunk-TOJ3TC35.js +0 -1
- package/dist/standalone/chunk-TQ36RWOP.js +0 -1
- package/dist/standalone/chunk-U4OAQPBT.js +0 -1
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-VLXV72QE.js +0 -1
- package/dist/standalone/chunk-VTGBPW24.js +0 -1
- package/dist/standalone/chunk-WI7GWFEG.js +0 -1
- package/dist/standalone/chunk-WXPWVBIY.js +0 -1
- package/dist/standalone/chunk-X5P2WRYI.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XLQ4BHBD.js +0 -1
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
- package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
- package/dist/standalone/chunk-YAECF5LW.js +0 -1
- package/dist/standalone/chunk-YEVCU7TB.js +0 -13
- package/dist/standalone/chunk-ZHVTQ37P.js +0 -1
- package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
- package/dist/standalone/chunk-ZU4DZ6NK.js +0 -1
- package/dist/standalone/chunk-ZYRGPDZB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-RRCPZMC2.js";function S(e,r,t){e.prototype=r.prototype=t,t.constructor=e}f(S,"default");function W(e,r){var t=Object.create(e.prototype);for(var n in r)t[n]=r[n];return t}f(W,"extend");function B(){}f(B,"Color");var C=.7,Y=1/C,R="\\s*([+-]?\\d+)\\s*",E="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xe=/^#([0-9a-f]{3,8})$/,Se=new RegExp(`^rgb\\(${R},${R},${R}\\)$`),Ce=new RegExp(`^rgb\\(${y},${y},${y}\\)$`),Ee=new RegExp(`^rgba\\(${R},${R},${R},${E}\\)$`),Be=new RegExp(`^rgba\\(${y},${y},${y},${E}\\)$`),Ie=new RegExp(`^hsl\\(${E},${y},${y}\\)$`),_e=new RegExp(`^hsla\\(${E},${y},${y},${E}\\)$`),se={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};S(B,v,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:le,formatHex:le,formatHex8:je,formatHsl:Ye,formatRgb:ue,toString:ue});function le(){return this.rgb().formatHex()}f(le,"color_formatHex");function je(){return this.rgb().formatHex8()}f(je,"color_formatHex8");function Ye(){return ge(this).formatHsl()}f(Ye,"color_formatHsl");function ue(){return this.rgb().formatRgb()}f(ue,"color_formatRgb");function v(e){var r,t;return e=(e+"").trim().toLowerCase(),(r=Xe.exec(e))?(t=r[1].length,r=parseInt(r[1],16),t===6?xe(r):t===3?new d(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?_(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?_(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Se.exec(e))?new d(r[1],r[2],r[3],1):(r=Ce.exec(e))?new d(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Ee.exec(e))?_(r[1],r[2],r[3],r[4]):(r=Be.exec(e))?_(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Ie.exec(e))?he(r[1],r[2]/100,r[3]/100,1):(r=_e.exec(e))?he(r[1],r[2]/100,r[3]/100,r[4]):se.hasOwnProperty(e)?xe(se[e]):e==="transparent"?new d(NaN,NaN,NaN,0):null}f(v,"color");function xe(e){return new d(e>>16&255,e>>8&255,e&255,1)}f(xe,"rgbn");function _(e,r,t,n){return n<=0&&(e=r=t=NaN),new d(e,r,t,n)}f(_,"rgba");function Le(e){return e instanceof B||(e=v(e)),e?(e=e.rgb(),new d(e.r,e.g,e.b,e.opacity)):new d}f(Le,"rgbConvert");function H(e,r,t,n){return arguments.length===1?Le(e):new d(e,r,t,n??1)}f(H,"rgb");function d(e,r,t,n){this.r=+e,this.g=+r,this.b=+t,this.opacity=+n}f(d,"Rgb");S(d,H,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new d(k(this.r),k(this.g),k(this.b),L(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ce,formatHex:ce,formatHex8:Te,formatRgb:pe,toString:pe}));function ce(){return`#${N(this.r)}${N(this.g)}${N(this.b)}`}f(ce,"rgb_formatHex");function Te(){return`#${N(this.r)}${N(this.g)}${N(this.b)}${N((isNaN(this.opacity)?1:this.opacity)*255)}`}f(Te,"rgb_formatHex8");function pe(){let e=L(this.opacity);return`${e===1?"rgb(":"rgba("}${k(this.r)}, ${k(this.g)}, ${k(this.b)}${e===1?")":`, ${e})`}`}f(pe,"rgb_formatRgb");function L(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}f(L,"clampa");function k(e){return Math.max(0,Math.min(255,Math.round(e)||0))}f(k,"clampi");function N(e){return e=k(e),(e<16?"0":"")+e.toString(16)}f(N,"hex");function he(e,r,t,n){return n<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new w(e,r,t,n)}f(he,"hsla");function ge(e){if(e instanceof w)return new w(e.h,e.s,e.l,e.opacity);if(e instanceof B||(e=v(e)),!e)return new w;if(e instanceof w)return e;e=e.rgb();var r=e.r/255,t=e.g/255,n=e.b/255,i=Math.min(r,t,n),o=Math.max(r,t,n),a=NaN,s=o-i,x=(o+i)/2;return s?(r===o?a=(t-n)/s+(t<n)*6:t===o?a=(n-r)/s+2:a=(r-t)/s+4,s/=x<.5?o+i:2-o-i,a*=60):s=x>0&&x<1?0:a,new w(a,s,x,e.opacity)}f(ge,"hslConvert");function me(e,r,t,n){return arguments.length===1?ge(e):new w(e,r,t,n??1)}f(me,"hsl");function w(e,r,t,n){this.h=+e,this.s=+r,this.l=+t,this.opacity=+n}f(w,"Hsl");S(w,me,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new w(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new w(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*r,i=2*t-n;return new d(Z(e>=240?e-240:e+120,i,n),Z(e,i,n),Z(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new w(de(this.h),j(this.s),j(this.l),L(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=L(this.opacity);return`${e===1?"hsl(":"hsla("}${de(this.h)}, ${j(this.s)*100}%, ${j(this.l)*100}%${e===1?")":`, ${e})`}`}}));function de(e){return e=(e||0)%360,e<0?e+360:e}f(de,"clamph");function j(e){return Math.max(0,Math.min(1,e||0))}f(j,"clampt");function Z(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}f(Z,"hsl2rgb");function F(e,r,t,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*r+(4-6*o+3*a)*t+(1+3*e+3*o-3*a)*n+a*i)/6}f(F,"basis");function J(e){var r=e.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<r-1?e[n+2]:2*o-i;return F((t-n/r)*r,a,i,o,s)}}f(J,"default");function U(e){var r=e.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*r),i=e[(n+r-1)%r],o=e[n%r],a=e[(n+1)%r],s=e[(n+2)%r];return F((t-n/r)*r,i,o,a,s)}}f(U,"default");var I=f(e=>()=>e,"default");function De(e,r){return function(t){return e+t*r}}f(De,"linear");function Oe(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}f(Oe,"exponential");function be(e){return(e=+e)==1?T:function(r,t){return t-r?Oe(r,t,e):I(isNaN(r)?t:r)}}f(be,"gamma");function T(e,r){var t=r-e;return t?De(e,t):I(isNaN(e)?r:e)}f(T,"nogamma");var D=f((function e(r){var t=be(r);function n(i,o){var a=t((i=H(i)).r,(o=H(o)).r),s=t(i.g,o.g),x=t(i.b,o.b),l=T(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=x(u),i.opacity=l(u),i+""}}return f(n,"rgb"),n.gamma=e,n}),"rgbGamma")(1);function we(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),o=new Array(t),a,s;for(a=0;a<t;++a)s=H(r[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(x){return s.r=n(x),s.g=i(x),s.b=o(x),s+""}}}f(we,"rgbSpline");var ze=we(J),Pe=we(U);function ee(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(o){for(i=0;i<t;++i)n[i]=e[i]*(1-o)+r[i]*o;return n}}f(ee,"default");function ye(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}f(ye,"isNumberArray");function ve(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),o=new Array(t),a;for(a=0;a<n;++a)i[a]=M(e[a],r[a]);for(;a<t;++a)o[a]=r[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}f(ve,"genericArray");function re(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}f(re,"default");function g(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}f(g,"default");function te(e,r){var t={},n={},i;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(i in r)i in e?t[i]=M(e[i],r[i]):n[i]=r[i];return function(o){for(i in t)n[i]=t[i](o);return n}}f(te,"default");var fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ne=new RegExp(fe.source,"g");function Ve(e){return function(){return e}}f(Ve,"zero");function Qe(e){return function(r){return e(r)+""}}f(Qe,"one");function O(e,r){var t=fe.lastIndex=ne.lastIndex=0,n,i,o,a=-1,s=[],x=[];for(e=e+"",r=r+"";(n=fe.exec(e))&&(i=ne.exec(r));)(o=i.index)>t&&(o=r.slice(t,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,x.push({i:a,x:g(n,i)})),t=ne.lastIndex;return t<r.length&&(o=r.slice(t),s[a]?s[a]+=o:s[++a]=o),s.length<2?x[0]?Qe(x[0].x):Ve(r):(r=x.length,function(l){for(var u=0,c;u<r;++u)s[(c=x[u]).i]=c.x(l);return s.join("")})}f(O,"default");function M(e,r){var t=typeof r,n;return r==null||t==="boolean"?I(r):(t==="number"?g:t==="string"?(n=v(r))?(r=n,D):O:r instanceof v?D:r instanceof Date?re:ye(r)?ee:Array.isArray(r)?ve:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?te:g)(e,r)}f(M,"default");var Ge=1e-12;function Me(e){return((e=Math.exp(e))+1/e)/2}f(Me,"cosh");function Ke(e){return((e=Math.exp(e))-1/e)/2}f(Ke,"sinh");function We(e){return((e=Math.exp(2*e))-1)/(e+1)}f(We,"tanh");var Ze=f((function e(r,t,n){function i(o,a){var s=o[0],x=o[1],l=o[2],u=a[0],c=a[1],p=a[2],h=u-s,b=c-x,m=h*h+b*b,$,A;if(m<Ge)A=Math.log(p/l)/r,$=f(function(X){return[s+X*h,x+X*b,l*Math.exp(r*X*A)]},"i");else{var Q=Math.sqrt(m),G=(p*p-l*l+n*m)/(2*l*t*Q),K=(p*p-l*l-n*m)/(2*p*t*Q),q=Math.log(Math.sqrt(G*G+1)-G),qe=Math.log(Math.sqrt(K*K+1)-K);A=(qe-q)/r,$=f(function(X){var ie=X*A,ae=Me(q),oe=l/(t*Q)*(ae*We(r*ie+q)-Ke(q));return[s+oe*h,x+oe*b,l*ae/Me(r*ie+q)]},"i")}return $.duration=A*1e3*r/Math.SQRT2,$}return f(i,"zoom"),i.rho=function(o){var a=Math.max(.001,+o),s=a*a,x=s*s;return e(a,s,x)},i}),"zoomRho")(Math.SQRT2,2,4);function $e(e,r){return e=+e,r=+r,function(t){return Math.round(e*(1-t)+r*t)}}f($e,"default");var Ne=180/Math.PI,z={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function P(e,r,t,n,i,o){var a,s,x;return(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a),(x=e*t+r*n)&&(t-=e*x,n-=r*x),(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s,x/=s),e*n<r*t&&(e=-e,r=-r,x=-x,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(r,e)*Ne,skewX:Math.atan(x)*Ne,scaleX:a,scaleY:s}}f(P,"default");var V;function ke(e){let r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?z:P(r.a,r.b,r.c,r.d,r.e,r.f)}f(ke,"parseCss");function Re(e){return e==null?z:(V||(V=document.createElementNS("http://www.w3.org/2000/svg","g")),V.setAttribute("transform",e),(e=V.transform.baseVal.consolidate())?(e=e.matrix,P(e.a,e.b,e.c,e.d,e.e,e.f)):z)}f(Re,"parseSvg");function He(e,r,t,n){function i(l){return l.length?l.pop()+" ":""}f(i,"pop");function o(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push("translate(",null,r,null,t);b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c||p)&&h.push("translate("+c+r+p+t)}f(o,"translate");function a(l,u,c,p){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),p.push({i:c.push(i(c)+"rotate(",null,n)-2,x:g(l,u)})):u&&c.push(i(c)+"rotate("+u+n)}f(a,"rotate");function s(l,u,c,p){l!==u?p.push({i:c.push(i(c)+"skewX(",null,n)-2,x:g(l,u)}):u&&c.push(i(c)+"skewX("+u+n)}f(s,"skewX");function x(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push(i(h)+"scale(",null,",",null,")");b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c!==1||p!==1)&&h.push(i(h)+"scale("+c+","+p+")")}return f(x,"scale"),function(l,u){var c=[],p=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,c,p),a(l.rotate,u.rotate,c,p),s(l.skewX,u.skewX,c,p),x(l.scaleX,l.scaleY,u.scaleX,u.scaleY,c,p),l=u=null,function(h){for(var b=-1,m=p.length,$;++b<m;)c[($=p[b]).i]=$.x(h);return c.join("")}}}f(He,"interpolateTransform");var Fe=He(ke,"px, ","px)","deg)"),Je=He(Re,", ",")",")");function Ae(e,r){r===void 0&&(r=e,e=M);for(var t=0,n=r.length-1,i=r[0],o=new Array(n<0?0:n);t<n;)o[t]=e(i,i=r[++t]);return function(a){var s=Math.max(0,Math.min(n-1,Math.floor(a*=n)));return o[s](a-s)}}f(Ae,"piecewise");export{v as a,D as b,g as c,O as d,M as e,$e as f,Fe as g,Je as h,Ze as i,Ae as j};
|
|
1
|
+
import{a as f}from"./chunk-OXFKZ4BM.js";function S(e,r,t){e.prototype=r.prototype=t,t.constructor=e}f(S,"default");function W(e,r){var t=Object.create(e.prototype);for(var n in r)t[n]=r[n];return t}f(W,"extend");function B(){}f(B,"Color");var C=.7,Y=1/C,R="\\s*([+-]?\\d+)\\s*",E="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xe=/^#([0-9a-f]{3,8})$/,Se=new RegExp(`^rgb\\(${R},${R},${R}\\)$`),Ce=new RegExp(`^rgb\\(${y},${y},${y}\\)$`),Ee=new RegExp(`^rgba\\(${R},${R},${R},${E}\\)$`),Be=new RegExp(`^rgba\\(${y},${y},${y},${E}\\)$`),Ie=new RegExp(`^hsl\\(${E},${y},${y}\\)$`),_e=new RegExp(`^hsla\\(${E},${y},${y},${E}\\)$`),se={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};S(B,v,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:le,formatHex:le,formatHex8:je,formatHsl:Ye,formatRgb:ue,toString:ue});function le(){return this.rgb().formatHex()}f(le,"color_formatHex");function je(){return this.rgb().formatHex8()}f(je,"color_formatHex8");function Ye(){return ge(this).formatHsl()}f(Ye,"color_formatHsl");function ue(){return this.rgb().formatRgb()}f(ue,"color_formatRgb");function v(e){var r,t;return e=(e+"").trim().toLowerCase(),(r=Xe.exec(e))?(t=r[1].length,r=parseInt(r[1],16),t===6?xe(r):t===3?new d(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?_(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?_(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Se.exec(e))?new d(r[1],r[2],r[3],1):(r=Ce.exec(e))?new d(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Ee.exec(e))?_(r[1],r[2],r[3],r[4]):(r=Be.exec(e))?_(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Ie.exec(e))?he(r[1],r[2]/100,r[3]/100,1):(r=_e.exec(e))?he(r[1],r[2]/100,r[3]/100,r[4]):se.hasOwnProperty(e)?xe(se[e]):e==="transparent"?new d(NaN,NaN,NaN,0):null}f(v,"color");function xe(e){return new d(e>>16&255,e>>8&255,e&255,1)}f(xe,"rgbn");function _(e,r,t,n){return n<=0&&(e=r=t=NaN),new d(e,r,t,n)}f(_,"rgba");function Le(e){return e instanceof B||(e=v(e)),e?(e=e.rgb(),new d(e.r,e.g,e.b,e.opacity)):new d}f(Le,"rgbConvert");function H(e,r,t,n){return arguments.length===1?Le(e):new d(e,r,t,n??1)}f(H,"rgb");function d(e,r,t,n){this.r=+e,this.g=+r,this.b=+t,this.opacity=+n}f(d,"Rgb");S(d,H,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new d(k(this.r),k(this.g),k(this.b),L(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ce,formatHex:ce,formatHex8:Te,formatRgb:pe,toString:pe}));function ce(){return`#${N(this.r)}${N(this.g)}${N(this.b)}`}f(ce,"rgb_formatHex");function Te(){return`#${N(this.r)}${N(this.g)}${N(this.b)}${N((isNaN(this.opacity)?1:this.opacity)*255)}`}f(Te,"rgb_formatHex8");function pe(){let e=L(this.opacity);return`${e===1?"rgb(":"rgba("}${k(this.r)}, ${k(this.g)}, ${k(this.b)}${e===1?")":`, ${e})`}`}f(pe,"rgb_formatRgb");function L(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}f(L,"clampa");function k(e){return Math.max(0,Math.min(255,Math.round(e)||0))}f(k,"clampi");function N(e){return e=k(e),(e<16?"0":"")+e.toString(16)}f(N,"hex");function he(e,r,t,n){return n<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new w(e,r,t,n)}f(he,"hsla");function ge(e){if(e instanceof w)return new w(e.h,e.s,e.l,e.opacity);if(e instanceof B||(e=v(e)),!e)return new w;if(e instanceof w)return e;e=e.rgb();var r=e.r/255,t=e.g/255,n=e.b/255,i=Math.min(r,t,n),o=Math.max(r,t,n),a=NaN,s=o-i,x=(o+i)/2;return s?(r===o?a=(t-n)/s+(t<n)*6:t===o?a=(n-r)/s+2:a=(r-t)/s+4,s/=x<.5?o+i:2-o-i,a*=60):s=x>0&&x<1?0:a,new w(a,s,x,e.opacity)}f(ge,"hslConvert");function me(e,r,t,n){return arguments.length===1?ge(e):new w(e,r,t,n??1)}f(me,"hsl");function w(e,r,t,n){this.h=+e,this.s=+r,this.l=+t,this.opacity=+n}f(w,"Hsl");S(w,me,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new w(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new w(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*r,i=2*t-n;return new d(Z(e>=240?e-240:e+120,i,n),Z(e,i,n),Z(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new w(de(this.h),j(this.s),j(this.l),L(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=L(this.opacity);return`${e===1?"hsl(":"hsla("}${de(this.h)}, ${j(this.s)*100}%, ${j(this.l)*100}%${e===1?")":`, ${e})`}`}}));function de(e){return e=(e||0)%360,e<0?e+360:e}f(de,"clamph");function j(e){return Math.max(0,Math.min(1,e||0))}f(j,"clampt");function Z(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}f(Z,"hsl2rgb");function F(e,r,t,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*r+(4-6*o+3*a)*t+(1+3*e+3*o-3*a)*n+a*i)/6}f(F,"basis");function J(e){var r=e.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<r-1?e[n+2]:2*o-i;return F((t-n/r)*r,a,i,o,s)}}f(J,"default");function U(e){var r=e.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*r),i=e[(n+r-1)%r],o=e[n%r],a=e[(n+1)%r],s=e[(n+2)%r];return F((t-n/r)*r,i,o,a,s)}}f(U,"default");var I=f(e=>()=>e,"default");function De(e,r){return function(t){return e+t*r}}f(De,"linear");function Oe(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}f(Oe,"exponential");function be(e){return(e=+e)==1?T:function(r,t){return t-r?Oe(r,t,e):I(isNaN(r)?t:r)}}f(be,"gamma");function T(e,r){var t=r-e;return t?De(e,t):I(isNaN(e)?r:e)}f(T,"nogamma");var D=f((function e(r){var t=be(r);function n(i,o){var a=t((i=H(i)).r,(o=H(o)).r),s=t(i.g,o.g),x=t(i.b,o.b),l=T(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=x(u),i.opacity=l(u),i+""}}return f(n,"rgb"),n.gamma=e,n}),"rgbGamma")(1);function we(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),o=new Array(t),a,s;for(a=0;a<t;++a)s=H(r[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(x){return s.r=n(x),s.g=i(x),s.b=o(x),s+""}}}f(we,"rgbSpline");var ze=we(J),Pe=we(U);function ee(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(o){for(i=0;i<t;++i)n[i]=e[i]*(1-o)+r[i]*o;return n}}f(ee,"default");function ye(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}f(ye,"isNumberArray");function ve(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),o=new Array(t),a;for(a=0;a<n;++a)i[a]=M(e[a],r[a]);for(;a<t;++a)o[a]=r[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}f(ve,"genericArray");function re(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}f(re,"default");function g(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}f(g,"default");function te(e,r){var t={},n={},i;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(i in r)i in e?t[i]=M(e[i],r[i]):n[i]=r[i];return function(o){for(i in t)n[i]=t[i](o);return n}}f(te,"default");var fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ne=new RegExp(fe.source,"g");function Ve(e){return function(){return e}}f(Ve,"zero");function Qe(e){return function(r){return e(r)+""}}f(Qe,"one");function O(e,r){var t=fe.lastIndex=ne.lastIndex=0,n,i,o,a=-1,s=[],x=[];for(e=e+"",r=r+"";(n=fe.exec(e))&&(i=ne.exec(r));)(o=i.index)>t&&(o=r.slice(t,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,x.push({i:a,x:g(n,i)})),t=ne.lastIndex;return t<r.length&&(o=r.slice(t),s[a]?s[a]+=o:s[++a]=o),s.length<2?x[0]?Qe(x[0].x):Ve(r):(r=x.length,function(l){for(var u=0,c;u<r;++u)s[(c=x[u]).i]=c.x(l);return s.join("")})}f(O,"default");function M(e,r){var t=typeof r,n;return r==null||t==="boolean"?I(r):(t==="number"?g:t==="string"?(n=v(r))?(r=n,D):O:r instanceof v?D:r instanceof Date?re:ye(r)?ee:Array.isArray(r)?ve:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?te:g)(e,r)}f(M,"default");var Ge=1e-12;function Me(e){return((e=Math.exp(e))+1/e)/2}f(Me,"cosh");function Ke(e){return((e=Math.exp(e))-1/e)/2}f(Ke,"sinh");function We(e){return((e=Math.exp(2*e))-1)/(e+1)}f(We,"tanh");var Ze=f((function e(r,t,n){function i(o,a){var s=o[0],x=o[1],l=o[2],u=a[0],c=a[1],p=a[2],h=u-s,b=c-x,m=h*h+b*b,$,A;if(m<Ge)A=Math.log(p/l)/r,$=f(function(X){return[s+X*h,x+X*b,l*Math.exp(r*X*A)]},"i");else{var Q=Math.sqrt(m),G=(p*p-l*l+n*m)/(2*l*t*Q),K=(p*p-l*l-n*m)/(2*p*t*Q),q=Math.log(Math.sqrt(G*G+1)-G),qe=Math.log(Math.sqrt(K*K+1)-K);A=(qe-q)/r,$=f(function(X){var ie=X*A,ae=Me(q),oe=l/(t*Q)*(ae*We(r*ie+q)-Ke(q));return[s+oe*h,x+oe*b,l*ae/Me(r*ie+q)]},"i")}return $.duration=A*1e3*r/Math.SQRT2,$}return f(i,"zoom"),i.rho=function(o){var a=Math.max(.001,+o),s=a*a,x=s*s;return e(a,s,x)},i}),"zoomRho")(Math.SQRT2,2,4);function $e(e,r){return e=+e,r=+r,function(t){return Math.round(e*(1-t)+r*t)}}f($e,"default");var Ne=180/Math.PI,z={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function P(e,r,t,n,i,o){var a,s,x;return(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a),(x=e*t+r*n)&&(t-=e*x,n-=r*x),(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s,x/=s),e*n<r*t&&(e=-e,r=-r,x=-x,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(r,e)*Ne,skewX:Math.atan(x)*Ne,scaleX:a,scaleY:s}}f(P,"default");var V;function ke(e){let r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?z:P(r.a,r.b,r.c,r.d,r.e,r.f)}f(ke,"parseCss");function Re(e){return e==null?z:(V||(V=document.createElementNS("http://www.w3.org/2000/svg","g")),V.setAttribute("transform",e),(e=V.transform.baseVal.consolidate())?(e=e.matrix,P(e.a,e.b,e.c,e.d,e.e,e.f)):z)}f(Re,"parseSvg");function He(e,r,t,n){function i(l){return l.length?l.pop()+" ":""}f(i,"pop");function o(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push("translate(",null,r,null,t);b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c||p)&&h.push("translate("+c+r+p+t)}f(o,"translate");function a(l,u,c,p){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),p.push({i:c.push(i(c)+"rotate(",null,n)-2,x:g(l,u)})):u&&c.push(i(c)+"rotate("+u+n)}f(a,"rotate");function s(l,u,c,p){l!==u?p.push({i:c.push(i(c)+"skewX(",null,n)-2,x:g(l,u)}):u&&c.push(i(c)+"skewX("+u+n)}f(s,"skewX");function x(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push(i(h)+"scale(",null,",",null,")");b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c!==1||p!==1)&&h.push(i(h)+"scale("+c+","+p+")")}return f(x,"scale"),function(l,u){var c=[],p=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,c,p),a(l.rotate,u.rotate,c,p),s(l.skewX,u.skewX,c,p),x(l.scaleX,l.scaleY,u.scaleX,u.scaleY,c,p),l=u=null,function(h){for(var b=-1,m=p.length,$;++b<m;)c[($=p[b]).i]=$.x(h);return c.join("")}}}f(He,"interpolateTransform");var Fe=He(ke,"px, ","px)","deg)"),Je=He(Re,", ",")",")");function Ae(e,r){r===void 0&&(r=e,e=M);for(var t=0,n=r.length-1,i=r[0],o=new Array(n<0?0:n);t<n;)o[t]=e(i,i=r[++t]);return function(a){var s=Math.max(0,Math.min(n-1,Math.floor(a*=n)));return o[s](a-s)}}f(Ae,"piecewise");export{v as a,D as b,g as c,O as d,M as e,$e as f,Fe as g,Je as h,Ze as i,Ae as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"./chunk-H7HZ42JY.js";import{h as v}from"./chunk-BFE2DRP6.js";import{a as c,d as l,f as x,g}from"./chunk-OXFKZ4BM.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,2 @@
|
|
|
1
|
+
import{a as fe}from"./chunk-OS26JXYA.js";import"./chunk-A566HCBX.js";import{a as ie}from"./chunk-3GXPALXG.js";import{a as pe}from"./chunk-473JK2PQ.js";import"./chunk-W2BCSK5S.js";import{i as ne}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as b}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as oe}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as ue}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as H}from"./chunk-6UTZXEW3.js";import{c as he}from"./chunk-4DAKKAK7.js";import{m as me}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as de}from"./chunk-XMSNLMWU.js";import{B as ce,C as re,h as le,l as se,n as Z,o as ee,p as te,y as ae}from"./chunk-BFE2DRP6.js";import{a as l,d as Y,e as ge,f as ve,g as Ne}from"./chunk-OXFKZ4BM.js";var t=Y(Ne(),1);var be=Y(ve(),1),v=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:le("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}l(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,xe=l(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),N=l(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"v"),Ce=/<a\s(?:[^>]*?\s)?href\s*=\s*["'](https?:\/\/[^"'\s]+)["']/iu,ke=/&(?:amp|#0*38|#x0*26);/giu,Se=l(a=>a===void 0?void 0:((a.html===void 0?void 0:Ce.exec(a.html)?.[1])??xe(a.text)??xe(a.html))?.replaceAll(ke,"&"),"ye"),Te=l((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${N(o.to)} ${N(o.cc)}`.toLowerCase().includes(s))},"Ce"),je=l((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"Se"),Le=Z(H.clearCapturedMail),_e=Z(H.sendTestMail),Me=l(a=>{let e=(0,be.c)(36),{limit:s}=a,o=me(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:I,error:y,errorSource:w,isLoading:g,poll:P,refetch:c}=he(H.getCapturedMail,p),[C,f]=(0,v.useState)(null),[q,k]=(0,v.useState)(null),[i,h]=(0,v.useState)("html"),[x,B]=(0,v.useState)(""),r=I?.entries??[],m=y??C,D=y===null?C:w,S;e[2]!==o||e[3]!==c?(S=l(async()=>{f(null);try{await o.query(Le,{},ee("")),k(null),c()}catch(d){f(te(d))}},"S"),e[2]=o,e[3]=c,e[4]=S):S=e[4];let R=S,T;e[5]!==o||e[6]!==c?(T=l(async()=>{f(null);try{await o.query(_e,{},ee("")),c()}catch(d){f(te(d))}},"T"),e[5]=o,e[6]=c,e[7]=T):T=e[7];let Q=T;pe(P,!0);let j;e[8]!==R?(j=l(()=>{ae(R())},"k"),e[8]=R,e[9]=j):j=e[9];let U=j,L;e[10]!==Q?(L=l(()=>{ae(Q())},"A"),e[10]=Q,e[11]=L):L=e[11];let W=L,_;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=l(d=>{B(d.currentTarget.value)},"E"),e[12]=_):_=e[12];let G=_,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=l(d=>{let{id:u}=d.currentTarget.dataset;u!==void 0&&k(u)},"_"),e[13]=M):M=e[13];let J=M,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=l(d=>{let u=d.currentTarget.dataset.tab;(u==="headers"||u==="html"||u==="text")&&h(u)},"L"),e[14]=z):z=e[14];let K=z,$=Te(r,x),A=je($,q),n=Se(A),O;e[15]!==n?(O=l(()=>{n!==void 0&&ce(n)},"j"),e[15]=n,e[16]=O):O=e[16];let V=O,F;e[17]!==n?(F=l(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"$"),e[17]=n,e[18]=F):F=e[18];let X=F,E;return e[19]!==r||e[20]!==m||e[21]!==D||e[22]!==x||e[23]!==g||e[24]!==n||e[25]!==U||e[26]!==V||e[27]!==G||e[28]!==X||e[29]!==J||e[30]!==K||e[31]!==W||e[32]!==A||e[33]!==i||e[34]!==$?(E={entries:r,error:m,errorSource:D,filter:x,isLoading:g,link:n,onClear:U,onCopyLink:V,onFilterChange:G,onOpenLink:X,onSelectMessage:J,onSelectTab:K,onSendTest:W,selected:A,tab:i,visible:$},e[19]=r,e[20]=m,e[21]=D,e[22]=x,e[23]=g,e[24]=n,e[25]=U,e[26]=V,e[27]=G,e[28]=X,e[29]=J,e[30]=K,e[31]=W,e[32]=A,e[33]=i,e[34]=$,e[35]=E):E=e[35],E},"Ae"),ze=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,$e=l(a=>`${ze}${a}`,"_e"),Ke=l(({limit:a=100})=>{let e=se(),{entries:s,error:o,errorSource:p,filter:I,isLoading:y,link:w,onClear:g,onCopyLink:P,onFilterChange:c,onOpenLink:C,onSelectMessage:f,onSelectTab:q,onSendTest:k,selected:i,tab:h,visible:x}=Me({limit:a}),B=l(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"H");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b,{"data-testid":"mail-send-test",onClick:k,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(b,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(oe,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(ue,{error:p,testId:"mail-error"}),o===null&&!y&&s.length===0&&(0,t.jsx)(de,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(ne,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:c,placeholder:e("Filter messages"),type:"search",value:I}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:x.map(r=>{let m=r.id===i?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${m?"bg-muted":""}`,"data-active":m,"data-id":r.id,"data-testid":"mail-list-item",onClick:f,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:N(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),i!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:i.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:i.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.to)}),i.cc!==void 0&&i.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(i.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(b,{"data-testid":"mail-copy-link",disabled:w===void 0,onClick:P,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(b,{"data-testid":"mail-open-link",disabled:w===void 0,onClick:C,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(b,{"aria-selected":h===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:q,role:"tab",size:"sm",type:"button",variant:h===r?"secondary":"ghost",children:B(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[h==="html"&&(i.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:$e(i.html),title:e("Email preview")})),h==="text"&&(i.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:i.text})),h==="headers"&&(i.headers===void 0||Object.keys(i.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(i.headers).map(([r,m])=>`${r}: ${m}`).join(`
|
|
2
|
+
`)}))]})]})]})]})},"Qe");export{Ke as MailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as h}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{b as A}from"./chunk-4DAKKAK7.js";import{m as S}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as y,e as I}from"./chunk-JSDKOE4U.js";import{l as k}from"./chunk-BFE2DRP6.js";import{a as u,d as w,f as z,g as P}from"./chunk-OXFKZ4BM.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)(I,{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=S(),t=k(),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(q)})})]})}),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 q(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(q,"z");export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ut,b as he,c as Xe,d as Ke,e as pt,f as cr}from"./chunk-A566HCBX.js";import{a as sr,b as ir,c as lr,d as ar}from"./chunk-LIGOLZND.js";import{B as Do,C as _o,E as Uo,F as ko,G as Fo,J as Ho,X as Bo,a as Eo,aa as jo,ba as zo,e as wo,ea as Wo,fa as Go,la as Yo,ma as $o,na as Xo,o as Tt,oa as Ko,qa as Jo,r as Oo,ra as Zo,sa as Qo,ta as er,u as Lo}from"./chunk-KRPXOSBL.js";import{a as Po,b as qo}from"./chunk-W2BCSK5S.js";import{a as Mo,b as Vo}from"./chunk-NGVP66OH.js";import{a as tr,b as or,i as rr,j as nr,k as ct}from"./chunk-XYR5NST4.js";import{a as Et,b as qe,c as So,d as ho,e as wt,f as Co,h as No}from"./chunk-SU5DTRGK.js";import{A as Io,D as Ye,F as Ao,I as Ve,J as $e,K as $t,L as To,M as oe,N as ce,b as xo,c as Ro,e as At,l as Me,n as Yt,o as bo,p as yo,q as Nt,r as vo}from"./chunk-W7MRISE3.js";import{c as Pt}from"./chunk-JTGGWF7R.js";import{a as te,c as Ie,e as Ct,w as at}from"./chunk-ZBON5T5A.js";import{a as it,c as ve,d as mo,e as go,g as lt,h as qt,i as It,j as w}from"./chunk-4C4THJUD.js";import{h as He}from"./chunk-BFE2DRP6.js";import{a as o,c as hn,d as b,e as O,f as Rn,g as xe}from"./chunk-OXFKZ4BM.js";var St=b(Rn(),1);var re={};hn(re,{Arrow:()=>Jr,Backdrop:()=>Ur,Group:()=>an,GroupLabel:()=>un,Icon:()=>Vr,Item:()=>qr,ItemIndicator:()=>$r,ItemText:()=>Xr,Label:()=>Cr,List:()=>Wr,Popup:()=>jr,Portal:()=>Dr,Positioner:()=>kr,Root:()=>vr,ScrollDownArrow:()=>tn,ScrollUpArrow:()=>nn,Separator:()=>dn,Trigger:()=>Nr,Value:()=>Pr});var U=b(O(),1);var ur=b(O(),1);function pr(e){let t=ur.useRef(!0);t.current&&(t.current=!1,e())}o(pr,"useOnFirstRender");var Oe=b(O(),1);var Xt=Oe.createContext(void 0),Kt=Oe.createContext(void 0),Jt=Oe.createContext(void 0);function L(){let e=Oe.useContext(Xt);if(e===void 0)throw new Error(ve(60));return e}o(L,"useSelectRootContext");function Le(){let e=Oe.useContext(Kt);if(e===void 0)throw new Error(ve(101));return e}o(Le,"useSelectRootPropsContext");function Mt(){let e=Oe.useContext(Jt);if(e===void 0)throw new Error(ve(61));return e}o(Mt,"useSelectFloatingContext");function fr(e,t,r=Object.is){let{length:n}=e;if(n!==t.length)return!1;for(let s=0;s<n;s+=1)if(!r(e[s],t[s]))return!1;return!0}o(fr,"areArraysEqual");var Qt=o((e,t)=>Object.is(e,t),"defaultItemEquality");function Ce(e,t,r){return e==null||t==null?Object.is(e,t):r(e,t)}o(Ce,"compareItemEquality");function dr(e,t,r){return Array.isArray(e)&&Array.isArray(t)?!fr(e,t,(n,s)=>Ce(n,s,r)):e!==t}o(dr,"isSelectedValueDirty");function Zt(e,t,r){return e?e.some(n=>n===void 0?!1:Ce(t,n,r)):!1}o(Zt,"selectedValueIncludes");function ft(e,t,r){return e?e.findIndex(n=>n===void 0?!1:Ce(n,t,r)):-1}o(ft,"findItemIndex");function bn(e,t){if(t!==Qt)return n=>Zt(e,n,t);let r=new Set(e);return r.delete(void 0),n=>r.has(n)&&(n!==0||e.some(s=>Object.is(n,s)))}o(bn,"createSelectionMatcher");function eo(e,t,r,n){let s=n&&Array.isArray(t)?e.findIndex(bn(t,r)):ft(e,t,r);return s===-1?null:s}o(eo,"findSelectionIndex");function mr(e,t,r,n,s,a){return Zt(n,t,s)?a!=null&&e>a&&Zt(n,r[a],s)?a:e:e===a?eo(r,n,s,!0):a}o(mr,"resolveSelectedIndex");function gr(e,t,r){return e.filter(n=>!Ce(t,n,r))}o(gr,"removeItem");var Sr=b(O(),1);function Vt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}o(Vt,"serializeValue");var xr=b(xe(),1);function yn(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}o(yn,"isGroup");function hr(e){return yn(e?.[0])}o(hr,"isGroupedItems");function vn(e){return hr(e)?e.flatMap(t=>t.items):e}o(vn,"flattenLeafItems");function Rr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(hr(t)){for(let r of t)for(let n of r.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let r of t)if(r&&r.value==null&&r.label!=null)return!0;return!1}o(Rr,"hasNullItemLabel");function to(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Vt(e)}o(to,"stringifyAsLabel");function De(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Vt(e.value):Vt(e)}o(De,"stringifyAsValue");function oo(e,t,r){function n(){return to(e,r)}if(o(n,"fallback"),r&&e!=null)return r(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??n();if(Array.isArray(t)){let a=vn(t);if(e==null||typeof e!="object"){let i=a.find(u=>u.value===e);return i&&i.label!=null?i.label:n()}if("value"in e){let i=a.find(u=>u&&u.value===e.value);if(i&&i.label!=null)return i.label}}return n()}o(oo,"resolveSelectedLabel");function br(e,t,r){return e.reduce((n,s,a)=>(a>0&&n.push(", "),n.push((0,xr.jsx)(Sr.Fragment,{children:oo(s,t,r)},a)),n),[])}o(br,"resolveMultipleLabels");var yr={id:o(e=>e.id,"id"),labelId:o(e=>e.labelId,"labelId"),modal:o(e=>e.modal,"modal"),items:o(e=>e.items,"items"),itemToStringLabel:o(e=>e.itemToStringLabel,"itemToStringLabel"),isItemEqualToValue:o(e=>e.isItemEqualToValue,"isItemEqualToValue"),value:o(e=>e.value,"value"),hasSelectedValue:o(e=>{let{value:t,multiple:r,itemToStringValue:n}=e;return t==null?!1:r&&Array.isArray(t)?t.length>0:De(t,n)!==""},"hasSelectedValue"),hasNullItemLabel:o((e,t)=>t?Rr(e.items):!1,"hasNullItemLabel"),open:o(e=>e.open,"open"),mounted:o(e=>e.mounted,"mounted"),forceMount:o(e=>e.forceMount,"forceMount"),transitionStatus:o(e=>e.transitionStatus,"transitionStatus"),openMethod:o(e=>e.openMethod,"openMethod"),activeIndex:o(e=>e.activeIndex,"activeIndex"),selectedIndex:o(e=>e.selectedIndex,"selectedIndex"),isActive:o((e,t)=>e.activeIndex===t,"isActive"),isSelected:o((e,t)=>{let r=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(s=>Ce(t,s,r)):Ce(t,n,r)},"isSelected"),isSelectedByFocus:o((e,t)=>e.selectedIndex===t,"isSelectedByFocus"),popupProps:o(e=>e.popupProps,"popupProps"),triggerProps:o(e=>e.triggerProps,"triggerProps"),triggerElement:o(e=>e.triggerElement,"triggerElement"),positionerElement:o(e=>e.positionerElement,"positionerElement"),listElement:o(e=>e.listElement,"listElement"),popupSide:o(e=>e.popupSide,"popupSide"),scrollUpArrowVisible:o(e=>e.scrollUpArrowVisible,"scrollUpArrowVisible"),scrollDownArrowVisible:o(e=>e.scrollDownArrowVisible,"scrollDownArrowVisible"),hasScrollArrows:o(e=>e.hasScrollArrows,"hasScrollArrows")};var Be=b(xe(),1);function vr(e){let{id:t,value:r,defaultValue:n=null,onValueChange:s,open:a,defaultOpen:i=!1,onOpenChange:u,name:l,form:m,autoComplete:p,disabled:h=!1,readOnly:y=!1,required:d=!1,modal:N=!0,actionsRef:v,inputRef:H,onOpenChangeComplete:S,items:j,multiple:I=!1,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M=Qt,highlightItemOnHover:T=!0,children:k}=e,{clearErrors:Q}=So(),{setDirty:$,setTouched:W,setFocused:X,validityData:c,setFilled:z,name:q,disabled:ie,validation:G,validationMode:le}=qe(),F=wt({id:t}),f=ie||h,E=q??l,[R,x]=$t({controlled:r,default:I?n??qt:n,name:"Select",state:"value"}),[P,K]=$t({controlled:a,default:i,name:"Select",state:"open"}),ne=U.useRef([]),J=U.useRef([]),ue=U.useRef(null),Se=U.useRef(null),ee=U.useRef(0),pe=U.useRef(null),V=U.useRef([]),D=U.useRef(!1),ae=U.useRef(null),Z=U.useRef(null),Ue=U.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ae=U.useRef(!1),Ne=U.useRef(R),{mounted:fe,setMounted:ke,transitionStatus:Te}=$e(P),{openMethod:se,triggerProps:xt}=Wo(P),_=mo(()=>new Fo({id:F,labelId:void 0,modal:N,multiple:I,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,value:R,open:P,mounted:fe,transitionStatus:Te,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:It,triggerProps:It,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:lt,setOpen:lt,handleScrollArrowVisibility:lt,onOpenChangeComplete:lt,listRef:ne,popupRef:ue,scrollHandlerRef:Se,scrollArrowsMountedCountRef:ee,valueRef:pe,valuesRef:V,labelsRef:J,typingRef:D,selectionRef:Ue,firstItemTextRef:ae,selectedItemTextRef:Z,alignItemWithTriggerActiveRef:Ae,initialValueRef:Ne},yr)).current,be=_.useState("activeIndex"),ht=_.useState("selectedIndex"),Rt=_.useState("triggerElement"),ye=_.useState("positionerElement"),bt=er(se),yt=se??bt,ze=U.useMemo(()=>I?"":De(R,C),[I,R,C]),Ee=U.useMemo(()=>I&&Array.isArray(R)?R.map(A=>De(A,C)):De(R,C),[I,R,C]),Bt=Tt(Rt),tt=Ie(()=>Ee);No(Bt,F,R,tt,!f,l);let ot=I?Array.isArray(R)&&R.length>0:R!=null&&ze!=="";te(()=>{z(ot)},[ot,z]),te(o(function(){let Y=eo(V.current,R,M,I);Y===null&&(Z.current=null),!P&&_.set("selectedIndex",Y)},"syncSelectedIndex"),[I,P,R,M,_]),To(R,()=>{Q(E),$(dr(R,c.initialValue,M)),G.change(R)});let rt=Ie((A,Y)=>{u?.(A,Y),!Y.isCanceled&&(K(A),!A&&(Y.reason===oe.focusOut||Y.reason===oe.outsidePress)&&(W(!0),X(!1),le==="onBlur"&&G.commit(R)))}),We=Ie(()=>{ke(!1),_.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),S?.(!1)});Ve({enabled:!v,open:P,ref:ue,onComplete(){P||We()}}),U.useImperativeHandle(v,()=>({unmount:We}),[We]);let nt=Ie((A,Y)=>{s?.(A,Y),!Y.isCanceled&&x(A)}),jt=Ie(A=>{let Y=Xe(A.scrollHeight,A.clientHeight),vt=Ke(A.scrollTop,Y),zt=vt>0,st=vt<Y;_.set("scrollUpArrowVisible",zt),_.set("scrollDownArrowVisible",st)}),Fe=Bo({open:P,onOpenChange:rt,elements:{reference:Rt,floating:ye}}),de=_o(Fe,{enabled:!f,event:"mousedown"}),we=Uo(Fe),Pe=jo(Fe,{enabled:!f,listRef:ne,activeIndex:be,selectedIndex:ht,disabledIndices:qt,onNavigate(A){A===null&&!P||_.set("activeIndex",A)},focusItemOnHover:T}),Ge=zo(Fe,{enabled:!f&&(P||!y&&!I),listRef:J,activeIndex:be,selectedIndex:ht,disabledIndices:o(A=>ar(ne.current[A]),"disabledIndices"),onMatch(A){P?_.set("activeIndex",A):nt(V.current[A],ce(oe.none))},onTyping(A){D.current=A}}),lo=U.useMemo(()=>it(Ge.reference,Pe.reference,we.reference,de.reference,xt),[de.reference,Ge.reference,Pe.reference,we.reference,xt]),ao=U.useMemo(()=>it(Ho,Ge.floating,Pe.floating,we.floating),[Ge.floating,Pe.floating,we.floating]),co=Pe.item??It;_.useContextCallback("setValue",nt),_.useContextCallback("setOpen",rt),_.useContextCallback("handleScrollArrowVisibility",jt),_.useContextCallback("onOpenChangeComplete",S),pr(()=>{_.update({popupProps:ao,triggerProps:lo})}),_.useSyncedValues({id:F,modal:N,multiple:I,value:R,open:P,mounted:fe,transitionStatus:Te,popupProps:ao,triggerProps:lo,items:j,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,openMethod:yt});let mn=U.useMemo(()=>({disabled:f,readOnly:y,required:d,multiple:I,highlightItemOnHover:T,itemProps:co}),[f,y,d,I,T,co]),gn=go(H,G.inputRef),uo=I?void 0:E,Sn=U.useMemo(()=>!I||!Array.isArray(R)||!E?null:R.map(A=>{let Y=De(A,C);return(0,Be.jsx)("input",{type:"hidden",form:m,name:E,value:Y,disabled:f},Y)}),[I,R,m,E,C,f]);return(0,Be.jsxs)(Xt.Provider,{value:_,children:[(0,Be.jsx)(Kt.Provider,{value:mn,children:(0,Be.jsx)(Jt.Provider,{value:Fe,children:k})}),(0,Be.jsx)("input",{...G.getValidationProps(f,{onFocus(){_.state.triggerElement?.focus({focusVisible:!0})},onChange(A){if(A.nativeEvent.defaultPrevented||f||y)return;let Y=A.currentTarget.value,vt=ce(oe.none,A.nativeEvent);function zt(){if(I)return;let st=Y.toLowerCase(),Wt=V.current.findIndex(Gt=>De(Gt,C).toLowerCase()===st||to(Gt,g).toLowerCase()===st);Wt===-1&&(Wt=V.current.findIndex((Gt,xn)=>{let fo=J.current[xn];return fo!=null&&fo.toLowerCase()===st}));let po=V.current[Wt];po!=null&&nt(po,vt)}o(zt,"handleChange"),_.set("forceMount",!0),queueMicrotask(zt)}}),id:F&&uo==null?`${F}-hidden-input`:void 0,form:m,name:uo,autoComplete:p,value:ze,disabled:f,required:d&&!(I&&ot),readOnly:y,ref:gn,style:E?Vo:Mo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]})}o(vr,"SelectRoot");var wr=b(O(),1);function Ir(e){return e==null?void 0:`${e}-label`}o(Ir,"getDefaultLabelId");function Er(e,t){return e??t}o(Er,"resolveAriaLabelledBy");var Cr=wr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=i;delete u.id;let l=qe(),m=L(),p=m.useState("triggerElement"),h=m.useState("id"),y=Ir(h),d=Co({id:y,fallbackControlId:p?.id??h,setLabelId(N){let v=typeof N=="function"?N(m.state.labelId):N;m.set("labelId",v)}});return w("div",t,{ref:r,state:l.state,props:[d,i],stateAttributesMapping:Et})},"SelectLabel"));var Je=b(O(),1);var Gs=Yt.popupOpen,qs=Yt.pressed;var Ar="data-popup-side";var En=400,wn={...yo,...Et,popupSide:o(e=>e?{[Ar]:e}:null,"popupSide"),value:o(()=>null,"value")},Nr=Je.forwardRef(o(function(t,r){let{render:n,className:s,id:a,disabled:i=!1,nativeButton:u=!0,style:l,...m}=t,{setTouched:p,setFocused:h,validationMode:y,validation:d,state:N,disabled:v}=qe(),{labelId:H}=ho(),S=L(),{readOnly:j,required:I,disabled:g}=Le(),C=v||g||i,M=S.useState("open"),T=S.useState("mounted"),k=S.useState("value"),Q=S.useState("triggerProps"),$=S.useState("positionerElement"),W=S.useState("listElement"),X=S.useState("popupSide"),c=S.useState("id"),z=S.useState("labelId"),q=S.useState("hasSelectedValue"),ie=T&&$?X:null,G=a??c,le=Er(H,z);wt({id:a});let F=Tt($),f=Je.useRef(null),{getButtonProps:E,buttonRef:R}=Pt({disabled:C,native:u}),x=S.useStateSetter("triggerElement"),P=Ye(),K=Ye(),ne=Ye();Je.useEffect(()=>{if(M)return ne.start(En,()=>{S.context.selectionRef.current.allowUnselectedMouseUp=!0,S.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ne.clear()};S.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[M,S,K,ne]);let J=it(Q,{id:G,role:"combobox","aria-expanded":M,"aria-haspopup":"listbox","aria-controls":M?W?.id??Io($)?.id:void 0,"aria-labelledby":le,"aria-readonly":j||void 0,"aria-required":I||void 0,tabIndex:C?-1:0,onFocus(ee){h(!0),M&&S.context.alignItemWithTriggerActiveRef.current&&S.context.setOpen(!1,ce(oe.none,ee.nativeEvent)),P.start(0,()=>{S.set("forceMount",!0)})},onBlur(ee){At($,ee.relatedTarget)||(p(!0),h(!1),y==="onBlur"&&d.commit(k))},onMouseDown(ee){if(M)return;let pe=at(ee.currentTarget);function V(D){if(!f.current)return;let ae=D.target;At(f.current,ae)||At(F.current,ae)||lr(D,f.current)||S.context.setOpen(!1,ce(oe.cancelOpen,D))}o(V,"handleMouseUp"),K.start(0,()=>{pe.addEventListener("mouseup",V,{once:!0})})}},m,E),ue=d.getValidationProps(C,J);ue.role="combobox";let Se={...N,open:M,disabled:C,value:k,readOnly:j,popupSide:ie,placeholder:!q};return w("button",t,{ref:[r,f,R,x],state:Se,stateAttributesMapping:wn,props:ue})},"SelectTrigger"));var Tr=b(O(),1);var Cn={value:o(()=>null,"value")},Pr=Tr.forwardRef(o(function(t,r){let{className:n,render:s,children:a,placeholder:i,style:u,...l}=t,m=L(),p=m.useState("value"),h=m.useState("items"),y=m.useState("itemToStringLabel"),d=m.useState("hasSelectedValue"),N=!d&&i!=null&&a==null,v=m.useState("hasNullItemLabel",N),H={value:p,placeholder:!d},S=null;return typeof a=="function"?S=a(p):a!=null?S=a:N&&!v?S=i:Array.isArray(p)?S=br(p,h,y):S=oo(p,h,y),w("span",t,{state:H,ref:[r,m.context.valueRef],props:[{children:S},l],stateAttributesMapping:Cn})},"SelectValue"));var Mr=b(O(),1);var Vr=Mr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,m={open:L().useState("open")};return w("span",t,{state:m,ref:r,props:[{"aria-hidden":!0,children:"\u25BC"},i],stateAttributesMapping:bo})},"SelectIcon"));var Or=b(O(),1);var Lr=b(xe(),1);var Dr=Or.forwardRef(o(function(t,r){let n=L(),s=n.useState("mounted"),a=n.useState("forceMount");return s||a?(0,Lr.jsx)(Lo,{ref:r,...t}):null},"SelectPortal"));var _r=b(O(),1);var An={...Nt,...Me},Ur=_r.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),l=u.useState("open"),m=u.useState("mounted"),p=u.useState("transitionStatus");return w("div",t,{state:{open:l,transitionStatus:p},ref:r,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:An})},"SelectBackdrop"));var me=b(O(),1);var Ot=b(O(),1);var ro=Ot.createContext(void 0);function _e(){let e=Ot.useContext(ro);if(!e)throw new Error(ve(59));return e}o(_e,"useSelectPositionerContext");function Ze(e,t){e&&Object.assign(e.style,t)}o(Ze,"clearStyles");var Lt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var dt=b(xe(),1);var Nn={position:"fixed"},kr=me.forwardRef(o(function(t,r){let{anchor:n,className:s,render:a,positionMethod:i,side:u,align:l,sideOffset:m,alignOffset:p,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:d,sticky:N,disableAnchorTracking:v,alignItemWithTrigger:H=!0,collisionAvoidance:S=Oo,style:j,...I}=t,g=L(),C=Mt(),M=g.useState("open"),T=g.useState("mounted"),k=g.useState("modal"),Q=g.useState("value"),$=g.useState("openMethod"),W=g.useState("positionerElement"),X=g.useState("triggerElement"),c=g.useState("isItemEqualToValue"),z=g.useState("transitionStatus"),q=me.useRef(null),ie=me.useRef(null),[G,le]=me.useState(H),F=T&&G&&$!=="touch";!T&&G!==H&&le(H),me.useImperativeHandle(g.context.alignItemWithTriggerActiveRef,()=>F),Jo((F||k)&&M,$==="touch",W,X);let f=Yo({anchor:n,floatingRootContext:C,positionMethod:i,mounted:T,side:u,sideOffset:m,align:l,alignOffset:p,arrowPadding:d,collisionBoundary:h,collisionPadding:y,sticky:N,disableAnchorTracking:v??F,collisionAvoidance:S,keepMounted:!0}),E=F?"none":f.side,R=F?Nn:f.positionerStyles,x={open:M,side:E,align:f.align,anchorHidden:f.anchorHidden};te(()=>{g.set("popupSide",f.side)},[g,f.side]);let P=g.useStateSetter("positionerElement"),K=Ko(t,x,{styles:R,transitionStatus:z,props:I,refs:[r,P],hidden:!T,inert:!M}),ne=me.useRef(0),J=Ie(Se=>{if(g.context.valuesRef.current.length===0)return;let ee=ne.current;ne.current=Se.size;let pe=ce(oe.none);if(ee!==0&&!g.state.multiple&&Q!==null&&ft(g.context.valuesRef.current,Q,c)===-1){let D=g.context.initialValueRef.current,Z=D!=null&&ft(g.context.valuesRef.current,D,c)!==-1?D:null;g.context.setValue(Z,pe),Z===null&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null)}if(ee!==0&&g.state.multiple&&Array.isArray(Q)){let V=Q.filter(D=>ft(g.context.valuesRef.current,D,c)!==-1);V.length!==Q.length&&(g.context.setValue(V,pe),V.length===0&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null))}if(M&&F){g.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let V={height:""};Ze(W,V),Ze(g.context.popupRef.current,V)}}),ue=me.useMemo(()=>({...f,side:E,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:q,scrollDownArrowRef:ie}),[f,E,F,le]);return(0,dt.jsx)(ir,{elementsRef:g.context.listRef,labelsRef:g.context.labelsRef,onMapChange:J,children:(0,dt.jsxs)(ro.Provider,{value:ue,children:[T&&k&&(0,dt.jsx)($o,{inert:Go(!M),cutout:X}),K]})})},"SelectPositioner"));var ge=b(O(),1);var no="--transform-origin";var Ut=b(xe(),1);var Pn={...Nt,...Me},jr=ge.forwardRef(o(function(t,r){let{render:n,className:s,style:a,finalFocus:i,...u}=t,l=L(),{multiple:m,readOnly:p,highlightItemOnHover:h}=Le(),y=Mt(),{side:d,align:N,alignItemWithTriggerActive:v,isPositioned:H,setControlledAlignItemWithTrigger:S}=_e(),j=Qo(!0)!=null,I=qo(),{nonce:g,disableStyleElements:C}=cr(),M=l.useState("id"),T=l.useState("open"),k=l.useState("openMethod"),Q=l.useState("mounted"),$=l.useState("popupProps"),W=l.useState("transitionStatus"),X=l.useState("triggerElement"),c=l.useState("positionerElement"),z=l.useState("listElement"),q=ge.useRef(!1),ie=ge.useRef(!1),G=ge.useRef({}),le=Ao(),F=Ie(x=>{if(!c||!l.context.popupRef.current||!ie.current)return;let P=c.style.top==="0px",K=c.style.bottom==="0px";if(q.current||!v||!P&&!K){l.context.handleScrollArrowVisibility(x);return}let ne=Hr(c),J=mt(c.getBoundingClientRect().height,"y",ne),ue=at(c),Se=Ct(c),ee=Se.getComputedStyle(c),pe=parseFloat(ee.marginTop),V=parseFloat(ee.marginBottom),D=Fr(Se.getComputedStyle(l.context.popupRef.current)),ae=Math.min(ue.documentElement.clientHeight-pe-V,D),Z=x.scrollTop,Ue=Dt(x),Ae=null,Ne=o(se=>{c.style.height=`${se}px`},"setHeight"),fe=P?Ue-Z:Z,ke=Math.min(J+fe,ae);if(fe<=he){let se=ut(fe,0,ae-J);se>0&&Ne(J+se),x.scrollTop=P?Ue:0,ae-(J+se)<=he&&(q.current=!0),l.context.handleScrollArrowVisibility(x);return}if(ae-ke>he)Ae=P?1/0:0;else if(K&&Z<Ue){let se=J+fe-ae;Ae=Z-(fe-se)}let Te=Math.ceil(ke);if(Te!==0&&Ne(Te),Ae!=null){let se=ut(Ae,0,Dt(x));Math.abs(x.scrollTop-se)>he&&(x.scrollTop=se)}Te>=ae-he&&(q.current=!0),l.context.handleScrollArrowVisibility(x)});ge.useImperativeHandle(l.context.scrollHandlerRef,()=>F,[F]),Ve({open:T,ref:l.context.popupRef,onComplete(){T&&l.context.onOpenChangeComplete(!0)}});let f={open:T,transitionStatus:W,side:d,align:N};te(()=>{!c||!l.context.popupRef.current||Object.keys(G.current).length||(G.current={top:c.style.top||"0",left:c.style.left||"0",right:c.style.right,height:c.style.height,bottom:c.style.bottom,minHeight:c.style.minHeight,maxHeight:c.style.maxHeight,marginTop:c.style.marginTop,marginBottom:c.style.marginBottom})},[l,c]),te(()=>{T||v||(ie.current=!1,q.current=!1,Ze(c,G.current))},[T,v,c]),te(()=>{let x=l.context.popupRef.current;if(!T||!X||!c||!x||v&&!H||l.state.transitionStatus==="ending")return;if(ie.current=!0,x.style.removeProperty(no),!v){le.request(()=>l.context.handleScrollArrowVisibility(z||x));return}let P=Mn(x);try{let K=l.context.selectedItemTextRef.current;K?.isConnected||(K=!l.select("hasSelectedValue")&&l.context.firstItemTextRef.current?.isConnected?l.context.firstItemTextRef.current:null);let ne=l.context.valueRef.current,J=Ct(c),ue=J.getComputedStyle(c),Se=J.getComputedStyle(x),ee=at(X),pe=Hr(X),V=_t(X.getBoundingClientRect(),pe),D=_t(c.getBoundingClientRect(),pe),ae=V.height,Z=z||x,Ue=Z.scrollHeight,Ae=parseFloat(Se.borderBottomWidth),Ne=parseFloat(ue.marginTop)||10,fe=parseFloat(ue.marginBottom)||10,ke=parseFloat(ue.minHeight)||100,Te=Fr(Se),se=5,xt=5,_=20,be=ee.documentElement.clientHeight-Ne-fe,ht=ee.documentElement.clientWidth,Rt=be-V.bottom+ae,ye,bt=I==="rtl"?V.right-D.width:V.left,yt=0;if(K&&ne){let de=_t(ne.getBoundingClientRect(),pe);ye=_t(K.getBoundingClientRect(),pe),bt=D.left+(I==="rtl"?de.right-ye.right:de.left-ye.left);let we=de.top-V.top+de.height/2;yt=ye.top-D.top+ye.height/2-we}let ze=Rt+yt+fe+Ae,Ee=Math.min(be,ze),Bt=be-Ne-fe,tt=ze-Ee,ot=ht-xt;c.style.left=`${ut(bt,se,ot-D.width)}px`,c.style.height=`${Ee}px`,c.style.maxHeight="none",c.style.marginTop=`${Ne}px`,c.style.marginBottom=`${fe}px`,x.style.height="100%";let rt=Dt(Z),We=tt>=rt-he;We&&(Ee=Math.min(be,D.height)-(tt-rt));let nt=V.top<_||V.bottom>be-_||Math.ceil(Ee)+he<Math.min(Ue,ke),jt=(J.visualViewport?.scale??1)!==1&&Ro.engine.webkit;if(nt||jt){Ze(c,G.current),S(!1);return}let Fe=Math.max(ke,Ee);if(We){let de=Math.max(0,be-ze);c.style.top=D.height>=Bt?"0":`${de}px`,c.style.height=`${Ee}px`,Z.scrollTop=Dt(Z)}else c.style.bottom="0",Z.scrollTop=tt;if(ye){let de=D.top,we=D.height,Pe=ye.top+ye.height/2,Ge=ut(we>0?(Pe-de)/we*100:50,0,100);x.style.setProperty(no,`50% ${Ge}%`)}(Fe===be||Ee>=Te)&&(q.current=!0),l.context.handleScrollArrowVisibility(Z),h&&l.state.selectedIndex===null&&l.state.activeIndex===null&&l.context.listRef.current[0]!=null&&l.set("activeIndex",0)}finally{P()}},[l,T,c,X,v,S,le,z,h,I,H]),ge.useEffect(()=>{if(!v||!c||!T)return;let x=Ct(c);function P(K){l.context.setOpen(!1,ce(oe.windowResize,K))}return o(P,"handleResize"),Po(x,"resize",P)},[l,v,c,T]);let E={...z?{role:"presentation"}:{role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":p||void 0,id:`${M}-list`},onKeyDown(x){j&&Zo.has(x.key)&&x.stopPropagation()},onScroll(x){z||F(x.currentTarget)},...v&&{style:z?{height:"100%"}:Lt},className:!z&&v?pt.className:void 0},R=w("div",t,{ref:[r,l.context.popupRef],state:f,stateAttributesMapping:Pn,props:[$,E,Xo(W),u]});return(0,Ut.jsxs)(ge.Fragment,{children:[!C&&pt.getElement(g),(0,Ut.jsx)(Do,{context:y,modal:!1,disabled:!Q,openInteractionType:k,returnFocus:i,restoreFocus:!0,children:R})]})},"SelectPopup"));function Fr(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}o(Fr,"getMaxPopupHeight");function Dt(e){return Xe(e.scrollHeight,e.clientHeight)}o(Dt,"getMaxScrollTop");function Hr(e){return ko.getScale(e)}o(Hr,"getScale");function mt(e,t,r){return e/r[t]}o(mt,"normalizeSize");function _t(e,t){return wo({x:mt(e.x,"x",t),y:mt(e.y,"y",t),width:mt(e.width,"x",t),height:mt(e.height,"y",t)})}o(_t,"normalizeRect");var Br=[["transform","none"],["scale","1"],["translate","0 0"]];function Mn(e){let{style:t}=e,r={};for(let[n,s]of Br)r[n]=t.getPropertyValue(n),t.setProperty(n,s,"important");return()=>{for(let[n]of Br){let s=r[n];s?t.setProperty(n,s):t.removeProperty(n)}}}o(Mn,"unsetTransformStyles");var zr=b(O(),1);var Wr=zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{multiple:l,readOnly:m}=Le(),{alignItemWithTriggerActive:p}=_e(),h=u.useState("hasScrollArrows"),y=u.useState("openMethod"),N={id:`${u.useState("id")}-list`,role:"listbox","aria-multiselectable":l||void 0,"aria-readonly":m||void 0,onScroll(H){u.context.scrollHandlerRef.current?.(H.currentTarget)},...p&&{style:Lt},className:h&&y!=="touch"?pt.className:void 0},v=u.useStateSetter("listElement");return w("div",t,{ref:[r,v],props:[N,i]})},"SelectList"));var Re=b(O(),1);var kt=b(O(),1);var so=kt.createContext(void 0);function gt(){let e=kt.useContext(so);if(!e)throw new Error(ve(57));return e}o(gt,"useSelectItemContext");var Gr=b(xe(),1);var qr=Re.memo(Re.forwardRef(o(function(t,r){let{render:n,className:s,style:a,value:i=null,label:u,disabled:l=!1,nativeButton:m=!1,...p}=t,h=Re.useRef(null),y=sr({guess:!0,label:u,textRef:h}),d=L(),{itemProps:N,multiple:v,disabled:H,readOnly:S}=Le(),j=H||l,I=d.useState("isActive",y.index),g=d.useState("open"),C=d.useState("isSelected",i),M=d.useState("isSelectedByFocus",y.index),T=d.useState("isItemEqualToValue"),k=y.index,Q=Re.useRef(null);te(()=>{let f=d.context.valuesRef.current;return f[k]=i,()=>{delete f[k]}},[k,i,d]),te(()=>{let f=d.state.value,E=d.state.selectedIndex,R=E,x;v&&Array.isArray(f)?(R=mr(k,i,d.context.valuesRef.current,f,T,E),x=R===k,k===E&&!x&&(d.context.selectedItemTextRef.current=null)):(x=f!==void 0&&Ce(i,f,T),x&&(R=k)),d.set("selectedIndex",R),x&&h.current&&(d.context.selectedItemTextRef.current=h.current)},[k,v,T,d,i]);let $=Re.useRef("mouse"),W=Re.useRef(!1),{getButtonProps:X,buttonRef:c}=Pt({disabled:j,focusableWhenDisabled:!0,native:m,composite:!0}),z={disabled:j,selected:C,highlighted:I};function q(f){if(H||S)return;let E=d.state.value;if(v){let R=Array.isArray(E)?E:[],x=C?gr(R,i,T):[...R,i];d.context.setValue(x,ce(oe.itemPress,f))}else d.context.setValue(i,ce(oe.itemPress,f)),d.context.setOpen(!1,ce(oe.itemPress,f))}o(q,"commitSelection");function ie(){d.context.selectionRef.current.dragY=0}o(ie,"resetDragMovement");let G={role:"option","aria-selected":C,tabIndex:g&&I?0:-1,onKeyDown(f){d.set("activeIndex",k),f.key===" "&&d.context.typingRef.current&&f.preventDefault()},onClick(f){let E=$.current!=="touch",R=f.nativeEvent.pointerType,x=E&&Eo(f.nativeEvent)&&(R!==void 0||I),P=E&&!x&&!W.current;W.current=!1,!(j||P)&&q(f.nativeEvent)},onPointerEnter(f){$.current=f.pointerType},onPointerMove(f){if(f.pointerType==="mouse"&&f.buttons===1){let E=d.context.selectionRef.current;E.dragY+=f.movementY,E.dragY**2>=64&&(E.allowUnselectedMouseUp=!0)}},onPointerDown(f){$.current=f.pointerType,W.current=!0,ie()},onMouseUp(){if(ie(),j||$.current==="touch"||W.current)return;let f=!d.context.selectionRef.current.allowSelectedMouseUp&&C,E=!d.context.selectionRef.current.allowUnselectedMouseUp&&!C;f||E||(W.current=!0,Q.current?.click(),W.current=!1)}},le=w("div",t,{ref:[c,r,y.ref,Q],state:z,props:[N,G,p,X]}),F=Re.useMemo(()=>({selected:C,index:k,textRef:h,selectedByFocus:M}),[C,k,h,M]);return(0,Gr.jsx)(so.Provider,{value:F,children:le})},"SelectItem")));var je=b(O(),1);var Yr=b(xe(),1);var $r=je.forwardRef(o(function(t,r){let{selected:n}=gt();return t.keepMounted||n?(0,Yr.jsx)(Vn,{...t,ref:r}):null},"SelectItemIndicator")),Vn=je.memo(je.forwardRef((e,t)=>{let{render:r,className:n,style:s,keepMounted:a,...i}=e,{selected:u}=gt(),l=je.useRef(null),{transitionStatus:m,setMounted:p}=$e(u),y=w("span",e,{ref:[t,l],state:{selected:u,transitionStatus:m},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},i],stateAttributesMapping:Me});return Ve({batch:!0,enabled:!u,open:u,ref:l,onComplete(){u||p(!1)}}),y}));var Qe=b(O(),1);var Xr=Qe.memo(Qe.forwardRef(o(function(t,r){let{index:n,textRef:s,selectedByFocus:a}=gt(),i=L(),{render:u,className:l,style:m,...p}=t,h=Qe.useCallback(d=>{d&&(n===0&&(i.context.firstItemTextRef.current=d),a&&(i.context.selectedItemTextRef.current=d))},[i,n,a]);return w("div",t,{ref:[h,r,s],props:p})},"SelectItemText")));var Kr=b(O(),1);var Jr=Kr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{side:l,align:m,arrowRef:p,arrowStyles:h,arrowUncentered:y,alignItemWithTriggerActive:d}=_e(),v={open:u.useState("open"),side:l,align:m,uncentered:y},H=w("div",t,{state:v,ref:[p,r],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:vo});return d?null:H},"SelectArrow"));var Qr=b(O(),1);var Zr=b(O(),1);var Ft=Zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,direction:i,keepMounted:u,...l}=t,m=i==="up",p=L(),{side:h,scrollDownArrowRef:y,scrollUpArrowRef:d}=_e(),N=m?"scrollUpArrowVisible":"scrollDownArrowVisible",v=p.useState(N),H=p.useState("openMethod"),S=v&&H!=="touch",j=Ye(),I=m?d:y,{mounted:g,transitionStatus:C,setMounted:M}=$e(S);te(()=>(p.context.scrollArrowsMountedCountRef.current+=1,p.set("hasScrollArrows",!0),()=>{p.context.scrollArrowsMountedCountRef.current=Math.max(0,p.context.scrollArrowsMountedCountRef.current-1),p.context.scrollArrowsMountedCountRef.current===0&&p.set("hasScrollArrows",!1)}),[p]),Ve({open:S,ref:I,onComplete(){S||M(!1)}});let Q=w("div",t,{ref:[r,I],state:{direction:i,visible:S,side:h,transitionStatus:C},props:[{"aria-hidden":!0,children:m?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(W){if(W.movementX===0&&W.movementY===0||j.isStarted())return;p.set("activeIndex",null);function X(){let c=p.state.listElement??p.context.popupRef.current;if(!c)return;p.set("activeIndex",null),p.context.handleScrollArrowVisibility(c);let z=Xe(c.scrollHeight,c.clientHeight),q=Ke(c.scrollTop,z),ie=q===(m?0:z),G=p.context.listRef.current;if(q!==c.scrollTop&&(c.scrollTop=q),ie){j.clear();return}if(G.length>0){let le=I.current?.offsetHeight||0;c.scrollTop=On(G,m,q,c.clientHeight,le,z)}j.start(40,X)}o(X,"scrollNextItem"),j.start(40,X)},onMouseLeave(){j.clear()}},l],stateAttributesMapping:Me});return g||u?Q:null},"SelectScrollArrow"));function On(e,t,r,n,s,a){if(t){let p=0,h=r+s-he;for(let N=0;N<e.length;N+=1){let v=e[N];if(v&&v.offsetTop>=h){p=N;break}}let y=Math.max(0,p-1),d=e[y];return y<p&&d?Ke(d.offsetTop-s,a):0}let i=e.length-1,u=r+n-s+he;for(let p=0;p<e.length;p+=1){let h=e[p];if(h&&h.offsetTop+h.offsetHeight>u){i=Math.max(0,p-1);break}}let l=Math.min(e.length-1,i+1),m=e[l];return l>i&&m?Ke(m.offsetTop+m.offsetHeight-n+s,a):a}o(On,"getTargetScrollTop");var en=b(xe(),1);var tn=Qr.forwardRef(o(function(t,r){return(0,en.jsx)(Ft,{...t,ref:r,direction:"down"})},"SelectScrollDownArrow"));var on=b(O(),1);var rn=b(xe(),1);var nn=on.forwardRef(o(function(t,r){return(0,rn.jsx)(Ft,{...t,ref:r,direction:"up"})},"SelectScrollUpArrow"));var et=b(O(),1);var Ht=b(O(),1);var io=Ht.createContext(void 0);function sn(){let e=Ht.useContext(io);if(e===void 0)throw new Error(ve(56));return e}o(sn,"useSelectGroupContext");var ln=b(xe(),1);var an=et.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,[u,l]=et.useState(),m=et.useMemo(()=>({labelId:u,setLabelId:l}),[u,l]),p=w("div",t,{ref:r,props:[{role:"group","aria-labelledby":u},i]});return(0,ln.jsx)(io.Provider,{value:m,children:p})},"SelectGroup"));var cn=b(O(),1);var un=cn.forwardRef(o(function(t,r){let{render:n,className:s,style:a,id:i,...u}=t,{setLabelId:l}=sn(),m=xo(i);return te(()=>(l(m),()=>{l(h=>h===m?void 0:h)}),[m,l]),w("div",t,{ref:r,props:[{id:m,"aria-hidden":!0},u]})},"SelectGroupLabel"));var pn=b(O(),1);var fn=pn.forwardRef(o(function(t,r){let{className:n,render:s,orientation:a="horizontal",style:i,...u}=t;return w("div",t,{state:{orientation:a},ref:r,props:[{role:"presentation"},u]})},"ListboxSeparator"));var dn=fn;var B=b(xe(),1);var hc=re.Root;function Rc(e){let t=(0,St.c)(8),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("flex flex-1 text-start",r),t[3]=r,t[4]=s):s=t[4];let a;return t[5]!==n||t[6]!==s?(a=(0,B.jsx)(re.Value,{"data-slot":"select-value",className:s,...n}),t[5]=n,t[6]=s,t[7]=a):a=t[7],a}o(Rc,"$");function bc({className:e,size:t="default",children:r,...n}){return(0,B.jsxs)(re.Trigger,{"data-slot":"select-trigger","data-size":t,className:He("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,(0,B.jsx)(re.Icon,{render:(0,B.jsx)(ct,{icon:nr,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}o(bc,"j");function yc({className:e,children:t,side:r="bottom",sideOffset:n=4,align:s="center",alignOffset:a=0,alignItemWithTrigger:i=!0,...u}){return(0,B.jsx)(re.Portal,{children:(0,B.jsx)(re.Positioner,{side:r,sideOffset:n,align:s,alignOffset:a,alignItemWithTrigger:i,className:"isolate z-50",children:(0,B.jsxs)(re.Popup,{"data-slot":"select-content","data-align-trigger":i,className:He("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...u,children:[(0,B.jsx)(Ln,{}),(0,B.jsx)(re.List,{children:t}),(0,B.jsx)(Dn,{})]})})})}o(yc,"A");function vc(e){let t=(0,St.c)(13),r,n,s;t[0]!==e?({className:n,children:r,...s}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=s):(r=t[1],n=t[2],s=t[3]);let a;t[4]!==n?(a=He("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=a):a=t[5];let i;t[6]!==r?(i=(0,B.jsx)(re.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:r}),t[6]=r,t[7]=i):i=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,B.jsx)(re.ItemIndicator,{render:(0,B.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,B.jsx)(ct,{icon:rr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=u):u=t[8];let l;return t[9]!==s||t[10]!==a||t[11]!==i?(l=(0,B.jsxs)(re.Item,{"data-slot":"select-item",className:a,...s,children:[i,u]}),t[9]=s,t[10]=a,t[11]=i,t[12]=l):l=t[12],l}o(vc,"U");function Ln(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:or,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Ln,"x");function Dn(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:tr,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Dn,"w");export{hc as a,Rc as b,bc as c,yc as d,vc as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-OXFKZ4BM.js";var u=i(r=>{let a=0,e=0,o=0,c=0,t=0,n=0,l=0;for(let{metrics:s}of r){if(s===null){t+=1;continue}c+=1,a+=s.requests,e+=s.errors,o+=s.databaseSize??0,s.cache&&(n+=s.cache.hits,l+=s.cache.hits+s.cache.misses)}return{failed:t,hitRate:l===0?null:n/l,reachable:c,totalDatabaseSize:o,totalErrors:e,totalRequests:a}},"i"),h=i((r,a)=>{let e=new Set,o=[];for(let c of["",r.trim(),...a])e.has(c)||(e.add(c),o.push(c));return o},"u"),f=i(r=>{let a=r,e=[],o=0;for(let t of a.functions??[])t.calls>0&&(e.push({avg:t.totalDurationMs/t.calls,calls:t.calls}),o+=t.calls);e.sort((t,n)=>t.avg-n.avg);let c=i(t=>{let n=Math.ceil(t/100*o),l=0;for(let s of e)if(l+=s.calls,l>=n)return s.avg;return e.at(-1)?.avg??0},"c");return{p90:c(90),p95:c(95)}},"h"),g=i(r=>r.map(a=>({...a,avgDurationMs:a.execCount>0?a.totalDurationMs/a.execCount:0})),"f");export{u as a,h as b,f as c,g as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y,b as D}from"./chunk-7RGYCU6F.js";import{a as _,b as z,c as j,d as E,e as B,f as H,g as L,h as V,i as O,j as T,k as Z,l as q}from"./chunk-KZILJQX3.js";import{i as P}from"./chunk-SU5DTRGK.js";import{a as k}from"./chunk-6VAY6L4J.js";import{b as w}from"./chunk-PQH2LSJX.js";import{h as N,l as $,y as I}from"./chunk-BFE2DRP6.js";import{a as u,d as S,e as le,f as se,g as de}from"./chunk-OXFKZ4BM.js";var v=S(se(),1);var b=S(le(),1);var s=S(de(),1);function ie(a){let e=(0,v.c)(10),t,n,r;e[0]!==a?({className:t,selected:r,...n}=a,e[0]=a,e[1]=t,e[2]=n,e[3]=r):(t=e[1],n=e[2],r=e[3]);let l=r===!0?"":void 0,o;e[4]!==t?(o=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==l||e[8]!==o?(d=(0,s.jsx)("div",{"data-slot":"base-node","data-selected":l,className:o,...n}),e[6]=n,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}u(ie,"ie");function ce(a){let e=(0,v.c)(8),t,n;e[0]!==a?({className:t,...n}=a,e[0]=a,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let r;e[3]!==t?(r=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=(0,s.jsx)("div",{"data-slot":"base-node-header",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}u(ce,"ce");function me(a){let e=(0,v.c)(8),t,n;e[0]!==a?({className:t,...n}=a,e[0]=a,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let r;e[3]!==t?(r=N("flex flex-col",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=(0,s.jsx)("div",{"data-slot":"base-node-content",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}u(me,"de");var ue=3,fe=u((a,e,t)=>{let n=e?a:a.slice(0,ue),r=n.map(o=>JSON.stringify(o)).join(" | "),l=a.length-n.length;return l>0?`${r} ${t("+{count} more",{count:l})}`:r},"fe"),J=u((a,e,t)=>{let n=a.enumValues??[],r=n.length===0?a.type:fe(n,e,t),l=a.ref===void 0?r:`${r} \u2192 ${a.ref}`;return a.optional===!0?`${l}?`:l},"H"),pe=u(a=>{let e=(0,v.c)(23),{data:t,selected:n}=a,r=$(),l;e[0]!==t.label||e[1]!==t.loadError||e[2]!==r?(l=t.loadError===!0?(0,s.jsx)("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:r("Columns unavailable")}):(0,s.jsx)("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"\u2014"}),e[0]=t.label,e[1]=t.loadError,e[2]=r,e[3]=l):l=e[3];let o=l,d=`sd-node-${t.label}`,c;e[4]!==t.label?(c=(0,s.jsx)("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=c):c=e[5];let m;e[6]!==t.tier?(m=(0,s.jsx)("span",{className:"ms-auto",children:(0,s.jsx)(D,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==c||e[9]!==m?(i=(0,s.jsxs)(ce,{children:[c,m]}),e[8]=c,e[9]=m,e[10]=i):i=e[10];let f;e[11]!==t.columns||e[12]!==t.label||e[13]!==o||e[14]!==r?(f=t.columns.length===0?o:t.columns.map(h=>(0,s.jsxs)("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",h.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${h.name}`,children:[(0,s.jsx)(E,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:h.name,isConnectable:!1,position:_.Left,type:"target"}),(0,s.jsx)("span",{className:"truncate font-mono",title:h.name,children:h.name}),h.pk===!0&&(0,s.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),h.ref!==void 0&&(0,s.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),(0,s.jsx)("span",{className:"ms-auto truncate text-muted-foreground",title:J(h,!0,r),children:J(h,!1,r)}),(0,s.jsx)(E,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:h.name,isConnectable:!1,position:_.Right,type:"source"})]},h.name)),e[11]=t.columns,e[12]=t.label,e[13]=o,e[14]=r,e[15]=f):f=e[15];let p;e[16]!==f?(p=(0,s.jsx)(me,{children:f}),e[16]=f,e[17]=p):p=e[17];let x;return e[18]!==n||e[19]!==d||e[20]!==i||e[21]!==p?(x=(0,s.jsxs)(ie,{className:"w-64 overflow-hidden","data-testid":d,selected:n,children:[i,p]}),e[18]=n,e[19]=d,e[20]=i,e[21]=p,e[22]=x):x=e[22],x},"ue"),G=256,Q=112,W=36,M=24,he=480,be=1.4,ge=u(a=>{let e=Math.max(1,Math.round(Math.sqrt(be*a/(G+Q))));return Math.max(he,a/e)},"ge"),xe=38,Ne=28,A=u(a=>xe+Math.max(1,a)*Ne,"B"),ye=u((a,e)=>{let t=new Map;for(let o of a)t.set(o,[]);for(let o of e)o.to!==o.from&&t.has(o.from)&&t.has(o.to)&&t.get(o.from)?.push(o.to);let n=new Map,r=new Set,l=u(o=>{let d=n.get(o);if(d!==void 0)return d;if(r.has(o))return 0;r.add(o);let c=0;for(let m of t.get(o)??[])c=Math.max(c,l(m)+1);return r.delete(o),n.set(o,c),c},"r");for(let o of a)l(o);return n},"Ne"),ve=u((a,e,t)=>{let n=ye(a,e),r=new Map;for(let m of a){let i=n.get(m)??0,f=r.get(i);f===void 0?r.set(i,[m]):f.push(m)}let l=a.reduce((m,i)=>m+A(t.get(i)??0)+W,0),o=ge(l),d=[],c=0;for(let m of[...r.keys()].toSorted((i,f)=>i-f)){let i=0,f=M;for(let p of r.get(m)??[]){let x=A(t.get(p)??0);f>M&&f+x>o&&(i+=1,f=M),d.push({name:p,x:M+(c+i)*(G+Q),y:f}),f+=x+W}c+=i+1}return d},"ye"),we={databaseSchema:pe},U={backgroundColor:y.shard.color},X={backgroundColor:y.global.color},$e={global:!0,shard:!0},Me={},Ce=u(a=>{let e=a.find(t=>t.pk===!0)?.name;return e!==void 0?e:a.some(t=>t.name==="_id")?"_id":a.some(t=>t.name==="id")?"id":a[0]?.name??"_id"},"_e"),Y=u(a=>a.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),"K"),Se=u((a,e,t)=>{let n=a.map(d=>d.name),r=new Map(a.map(d=>[d.name,d.columns.length])),l=ve(n,Y(a),r),o=new Map(a.map(d=>[d.name,d]));return l.flatMap(({name:d,x:c,y:m})=>{let i=o.get(d);return i===void 0?[]:[{className:t[d],data:{columns:i.columns,label:d,loadError:e,tier:i.tier},id:d,position:{x:c,y:m},type:"databaseSchema"}]})},"we"),ke=u(a=>{let e=new Map(a.map(t=>[t.name,t.columns]));return Y(a).flatMap(t=>{let n=e.get(t.to)??[],r=e.get(t.from)??[],l=Ce(n);return!n.some(o=>o.name===l)||!r.some(o=>o.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:l,target:t.from,targetHandle:t.column}]})},"Me"),_e=u(()=>{let a=(0,v.c)(15),e=$(),t;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:U}),y.shard.label]}),a[0]=t):t=a[0];let n;a[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:X}),y.global.label]}),a[1]=n):n=a[1];let r;a[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,s.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),a[2]=r):r=a[2];let l;a[3]!==e?(l=e("Primary key"),a[3]=e,a[4]=l):l=a[4];let o;a[5]!==l?(o=(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[r,l]}),a[5]=l,a[6]=o):o=a[6];let d;a[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),a[7]=d):d=a[7];let c;a[8]!==e?(c=e("Foreign key"),a[8]=e,a[9]=c):c=a[9];let m;a[10]!==c?(m=(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[d,c]}),a[10]=c,a[11]=m):m=a[11];let i;return a[12]!==o||a[13]!==m?(i=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,n,o,m]}),a[12]=o,a[13]=m,a[14]=i):i=a[14],i},"Ce"),ze=12,Ee=u(a=>{let e=(0,v.c)(9),{containerRef:t,seedKey:n}=a,r=V(),{fitView:l}=j(),o;e[0]!==t||e[1]!==l||e[2]!==r?(o=u(()=>{if(!r)return;let c=u(()=>{I(l({duration:0,maxZoom:1.6,padding:.14}))},"d");c();let m=t.current;if(m===null)return;let i=new ResizeObserver(()=>{c()});return i.observe(m),()=>{i.disconnect()}},"a"),e[0]=t,e[1]=l,e[2]=r,e[3]=o):o=e[3];let d;return e[4]!==t||e[5]!==l||e[6]!==r||e[7]!==n?(d=[t,l,r,n],e[4]=t,e[5]=l,e[6]=r,e[7]=n,e[8]=d):d=e[8],(0,b.useEffect)(o,d),null},"Te"),Ve=u(({columnsError:a,fill:e=!1,nodeClasses:t,tables:n,testIdPrefix:r})=>{let l=$(),[o,d]=(0,b.useState)($e),[c,m]=(0,b.useState)(""),i=(0,b.useMemo)(()=>{let g=c.trim().toLowerCase();return n.filter(K=>o[K.tier]&&K.name.toLowerCase().includes(g))},[n,o,c]),f=(0,b.useMemo)(()=>Se(i,a??!1,t??Me),[i,a,t]),p=(0,b.useMemo)(()=>ke(i),[i]),x=i.map(g=>g.name).join(","),[h,R,ee]=H(f),[te,F,ae]=L(p),C=(0,b.useRef)(null);(0,b.useEffect)(()=>{R(f)},[f,R]),(0,b.useEffect)(()=>{F(p)},[p,F]);let re=u(g=>{m(g.target.value)},"V"),oe=u(()=>{d(g=>({...g,shard:!g.shard}))},"W"),ne=u(()=>{d(g=>({...g,global:!g.global}))},"Y");return n.length===0?(0,s.jsx)("section",{className:"flex flex-col gap-2","data-testid":`${r}-section`,children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":`${r}-empty`,children:l("No tables to graph.")})}):(0,s.jsx)("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${r}-section`,children:(0,s.jsx)("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${r}-canvas`,ref:C,children:(0,s.jsxs)(B,{edges:te,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:h,nodesConnectable:!1,nodeTypes:we,onEdgesChange:ae,onNodesChange:ee,children:[(0,s.jsx)(O,{}),(0,s.jsx)(z,{position:"top-left",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[(0,s.jsx)(P,{"aria-label":l("Find table\u2026"),className:"h-7 w-44 text-xs","data-testid":`${r}-find`,onChange:re,placeholder:l("Find table\u2026"),value:c}),(0,s.jsxs)("div",{"aria-label":l("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[(0,s.jsxs)(k,{"aria-pressed":o.shard,className:"gap-1.5","data-testid":`${r}-tier-shard`,onClick:oe,size:"xs",type:"button",variant:o.shard?"default":"outline",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:U}),y.shard.label]}),(0,s.jsxs)(k,{"aria-pressed":o.global,className:"gap-1.5","data-testid":`${r}-tier-global`,onClick:ne,size:"xs",type:"button",variant:o.global?"default":"outline",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:X}),y.global.label]})]})]})}),(0,s.jsx)(z,{position:"bottom-center",children:(0,s.jsx)(_e,{})}),(0,s.jsx)(T,{showInteractive:!1}),i.length>ze&&(0,s.jsx)(Z,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),(0,s.jsx)(q,{containerRef:C,filenameBase:`${r}-schema-diagram`,testIdPrefix:r}),(0,s.jsx)(Ee,{containerRef:C,seedKey:x})]})})})},"Ke");export{Ve as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as D}from"./chunk-473JK2PQ.js";import{a as k}from"./chunk-BYOGQ2IV.js";import"./chunk-DBVJ5VLI.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as N}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as B}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as u}from"./chunk-6UTZXEW3.js";import{c as p}from"./chunk-4DAKKAK7.js";import{e as R}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as S}from"./chunk-XMSNLMWU.js";import{a as A,b as C,c as P,d as b,e as l,f as n}from"./chunk-HHRYM6UW.js";import{a as v,e as w}from"./chunk-JSDKOE4U.js";import{C as I,l as j}from"./chunk-BFE2DRP6.js";import{a as m,d as H,g as Q}from"./chunk-OXFKZ4BM.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=j(),h=k(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});D(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(S,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(N,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(B,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(S,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(w,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(C,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(N,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:I(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(w,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:I(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as Fe,b as Ke}from"./chunk-O2X2XYCM.js";import"./chunk-O2NMPIV2.js";import{a as We}from"./chunk-JZD7ZN3F.js";import{d as He}from"./chunk-ONWGX5Y4.js";import"./chunk-SYGCASPT.js";import"./chunk-YMEKCV27.js";import"./chunk-LIGOLZND.js";import"./chunk-3GXPALXG.js";import"./chunk-TYD3V4NB.js";import"./chunk-AP4PC2M4.js";import"./chunk-KRPXOSBL.js";import"./chunk-W2BCSK5S.js";import{a as ze}from"./chunk-6QEXGYWH.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import"./chunk-ZGSL4DPP.js";import"./chunk-FXPAJDES.js";import{a as Pe}from"./chunk-XST3UEHU.js";import{b as Oe}from"./chunk-SLIDAWNX.js";import{c as $e,d as pe,e as ve,f as ye,g as Ee}from"./chunk-6M7FLLMT.js";import"./chunk-ZTOREMGH.js";import{i as qe}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import{a as je}from"./chunk-T5UMHPAB.js";import{a as he}from"./chunk-6UTZXEW3.js";import"./chunk-4DAKKAK7.js";import{m as xe}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import"./chunk-HHRYM6UW.js";import{h as ie,l as se,n as me,o as fe,p as Ae,y as ae}from"./chunk-BFE2DRP6.js";import{a as i,d as ke,e as ct,f as dt,g as ut}from"./chunk-OXFKZ4BM.js";var X=ke(dt(),1),j=ke(ct(),1);var u=ke(ut(),1);var be=class{static{i(this,"Diff")}diff(e,n,t={}){let o;typeof t=="function"?(o=t,t={}):"callback"in t&&(o=t.callback);let r=this.castInput(e,t),l=this.castInput(n,t),d=this.removeEmpty(this.tokenize(r,t)),a=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(d,a,t,o)}diffWithOptionsObj(e,n,t,o){var r;let l=i(h=>{if(h=this.postProcess(h,t),o){setTimeout(function(){o(h)},0);return}else return h},"done"),d=n.length,a=e.length,c=1,m=d+a;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let p=(r=t.timeout)!==null&&r!==void 0?r:1/0,f=Date.now()+p,v=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(v[0],n,e,0,t);if(v[0].oldPos+1>=a&&g+1>=d)return l(this.buildValues(v[0].lastComponent,n,e));let E=-1/0,x=1/0,y=i(()=>{for(let h=Math.max(E,-c);h<=Math.min(x,c);h+=2){let S,w=v[h-1],C=v[h+1];w&&(v[h-1]=void 0);let b=!1;if(C){let N=C.oldPos-h;b=C&&0<=N&&N<d}let k=w&&w.oldPos+1<a;if(!b&&!k){v[h]=void 0;continue}if(!k||b&&w.oldPos<C.oldPos?S=this.addToPath(C,!0,!1,0,t):S=this.addToPath(w,!1,!0,1,t),g=this.extractCommon(S,n,e,h,t),S.oldPos+1>=a&&g+1>=d)return l(this.buildValues(S.lastComponent,n,e))||!0;v[h]=S,S.oldPos+1>=a&&(x=Math.min(x,h-1)),g+1>=d&&(E=Math.max(E,h+1))}c++},"execEditLength");if(o)i(function h(){setTimeout(function(){if(c>m||Date.now()>f)return o(void 0);y()||h()},0)},"exec")();else for(;c<=m&&Date.now()<=f;){let h=y();if(h)return h}}addToPath(e,n,t,o,r){let l=e.lastComponent;return l&&!r.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,o,r){let l=n.length,d=t.length,a=e.oldPos,c=a-o,m=0;for(;c+1<l&&a+1<d&&this.equals(t[a+1],n[c+1],r);)c++,a++,m++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!r.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,c}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let o=[],r;for(;e;)o.push(e),r=e.previousComponent,delete e.previousComponent,e=r;o.reverse();let l=o.length,d=0,a=0,c=0;for(;d<l;d++){let m=o[d];if(m.removed)m.value=this.join(t.slice(c,c+m.count)),c+=m.count;else{if(!m.added&&this.useLongestToken){let p=n.slice(a,a+m.count);p=p.map(function(f,v){let g=t[c+v];return g.length>f.length?g:f}),m.value=this.join(p)}else m.value=this.join(n.slice(a,a+m.count));a+=m.count,m.added||(c+=m.count)}}return o}};var Te=class extends be{static{i(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=mt}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
2
|
+
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
3
|
+
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
5
|
+
`)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},Be=new Te;function Ie(s,e,n){return Be.diff(s,e,n)}i(Ie,"diffLines");function mt(s,e){e.stripTrailingCr&&(s=s.replace(/\r\n/g,`
|
|
6
|
+
`));let n=[],t=s.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let o=0;o<t.length;o++){let r=t[o];o%2&&!e.newlineIsToken?n[n.length-1]+=r:n.push(r)}return n}i(mt,"tokenize");var ft="x",Qe=" ",ht={'"':'"',"'":"'","[":"]","`":"`"},Ue=i((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
7
|
+
`;)n+=1;return n},"He"),Xe=i((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"Fe"),Ze=i(s=>{let e=s.split(""),n=0;for(;n<s.length;){let t=s[n]??"",o=ht[t];if(t==="-"&&s[n+1]==="-"){let r=Ue(s,n);e.fill(Qe,n,r),n=r}else if(t==="/"&&s[n+1]==="*"){let r=Xe(s,n);if(r===-1)return;e.fill(Qe,n,r),n=r}else if(o!==void 0){let r=n+1;for(;r<s.length;)if(s[r]!==o)r+=1;else if(o!=="]"&&s[r+1]===o)r+=2;else break;if(r>=s.length)return;e.fill(ft,n,r+1),n=r+1}else n+=1}for(let t=0;t<s.length;t+=1)s[t]===`
|
|
8
|
+
`&&(e[t]=`
|
|
9
|
+
`);return e.join("")},"We"),pt=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,bt=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|truncate|update|vacuum)\b|\breplace\b(?!\s*\()/iu,gt=/^\w+/u,xt=/;\s*$/u,vt=/\s/u,et=i(s=>{let e=0;for(;e<s.length;){let n=s[e];if(n!==void 0&&vt.test(n))e+=1;else if(n==="-"&&s[e+1]==="-")e=Ue(s,e);else if(n==="/"&&s[e+1]==="*"){let t=Xe(s,e);if(t===-1)break;e=t}else break}return e},"Ke"),yt=i(s=>{let e=et(s),n=s.slice(e).trimEnd();if(n==="")return{code:"SQL_EMPTY",message:"the query is empty"};let t=(Ze(n)??n).replace(xt,""),o=n.slice(0,t.length),r=t.indexOf(";");if(r!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+r};let l="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!pt.test(o))return{code:"SQL_NOT_READONLY",length:gt.exec(o)?.[0].length??1,message:l,offset:e};let d=bt.exec(o);if(d!==null)return{code:"SQL_NOT_READONLY",length:d[0].length,message:`${l} (\`${d[0].toUpperCase()}\` is not allowed)`,offset:e+d.index}},"xt"),wt=/^explain\b/iu,St=i(s=>wt.test(s.slice(et(s)))?s:`EXPLAIN QUERY PLAN ${s}`,"yt"),_e=i((s,e)=>{let n=s.trim();if(n==="")return[];let t=e+s.indexOf(n),o=yt(n);return o?.code==="SQL_EMPTY"?[]:[o===void 0?{offset:t,sql:n}:{offset:t,rejection:o,sql:n}]},"ke"),tt=i(s=>{let e=Ze(s);if(e===void 0)return _e(s,0);let n=[],t=0;for(let o=0;o<=e.length;o+=1)o!==e.length&&e[o]!==";"||(n.push(..._e(s.slice(t,o),t)),t=o+1);return n},"ze"),Ct=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Nt=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],Ne=String.fromCodePoint(0),kt=new RegExp(`${Ne}${String.raw`(\d+)`}${Ne}`,"gu"),qt=Ct.map(s=>({pattern:new RegExp(String.raw`\b${s.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:s})),Et=Nt.map(s=>({pattern:new RegExp(String.raw`\s+${s.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
10
|
+
${s}`})),Tt=i(s=>{let e=[],n=s.replaceAll(/'(?:[^']|'')*'/gu,t=>(e.push(t),`${Ne}${(e.length-1).toString()}${Ne}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:t,replacement:o}of qt)n=n.replaceAll(t,o);for(let{pattern:t,replacement:o}of Et)n=n.replaceAll(t,o);return n=n.replaceAll(kt,(t,o)=>e[Number(o)]??""),n},"kt"),It=/\b(?:from|join)\s+([a-z_][\w$]*)(?:\s+(?:as\s+)?([a-z_][\w$]*))?/giu,Lt=/(?:\bwith\s+(?:recursive\s+)?|,\s*)([a-z_][\w$]*)\s+as\s*\(/giu,_t=new Set(["cross","full","group","having","inner","join","left","limit","offset","on","order","right","union","using","where","window"]),Rt=/[^\n]/gu,Dt=i((s,e)=>{let n=s[e];if(n==="'"){let t=e+1;for(;t<s.length&&s[t]!=="'";)t+=1;return Math.min(t+1,s.length)}if(n==="-"&&s[e+1]==="-"){let t=s.indexOf(`
|
|
11
|
+
`,e);return t===-1?s.length:t}if(n==="/"&&s[e+1]==="*"){let t=s.indexOf("*/",e+2);return t===-1?s.length:t+2}return-1},"_t"),Mt=i(s=>{let e="",n=0;for(;n<s.length;){let t=Dt(s,n);t===-1?(e+=s.slice(n,n+1),n+=1):(e+=s.slice(n,t).replaceAll(Rt," "),n=t)}return e},"At"),At=i(s=>{let e=new Set;for(let n of s.matchAll(Lt))e.add((n[1]??"").toLowerCase());return e},"qt"),$t=i((s,e)=>{let n=new Map;for(let t of s.matchAll(It)){let o=(t[1]??"").toLowerCase(),r=(t[2]??"").toLowerCase();e.has(o)&&(n.set(o,o),r!==""&&!_t.has(r)&&n.set(r,o))}return n},"Dt"),nt=i((s,e)=>{let n=Mt(s),t=new Set(e.map(o=>o.toLowerCase()));return{ctes:At(n),masked:n,targets:$t(n,t)}},"Ue"),Ot=/^(?:__lunora|sqlite_)/iu,Pt=/\b(?:from|join)\s+([a-z_][\w$]*)/giu,jt=/\b([a-z_][\w$]*)\.([a-z_][\w$]*)/giu,zt=new Set(["cross","full","group","having","inner","join","lateral","left","limit","offset","order","right","select","union","where","window"]),Wt=i((s,e,n)=>{let t=[];for(let o of s.matchAll(Pt)){let r=o[1]??"",l=r.toLowerCase();!e.has(l)&&!n.has(l)&&!zt.has(l)&&!Ot.test(r)&&t.push({length:r.length,message:`unknown table \`${r}\``,offset:o.index+o[0].length-r.length,severity:"error",source:"schema"})}return t},"Pt"),Ht=i((s,e,n)=>{let t=[],o=new Map;for(let[r,l]of Object.entries(e.columns))o.set(r.toLowerCase(),new Set(l.map(d=>d.toLowerCase())));for(let r of s.matchAll(jt)){let l=(r[1]??"").toLowerCase(),d=r[2]??"",a=n.get(l),c=a===void 0?void 0:o.get(a);c!==void 0&&!c.has(d.toLowerCase())&&t.push({length:d.length,message:`\`${a??""}\` has no column \`${d}\``,offset:r.index+r[0].length-d.length,severity:"error",source:"schema"})}return t},"Ht"),Ft=/(?<![\w$."])(?:"([a-z_][\w$]*)"|([a-z_][\w$]*))(?![.(])/giu,Kt=/\bas\s+"?([a-z_][\w$]*)"?/giu,Bt=i((s,e,n,t)=>{let o=[...new Set(n.values())],r=new Map,l=new Set;for(let c of o){for(let m of e.columns[c]??[])l.add(m.toLowerCase());for(let m of e.docFields?.[c]??[])r.set(m.toLowerCase(),m)}if(r.size===0)return[];let d=new Set([...s.matchAll(Kt)].map(c=>(c[1]??"").toLowerCase())),a=[];for(let c of s.matchAll(Ft)){let m=c[1],p=m??c[2]??"",f=p.toLowerCase(),v=r.get(f);v===void 0||l.has(f)||d.has(f)||t.has(f)||n.has(f)||a.push({length:p.length,message:`\`${v}\` is a \`__doc__\` field, not a column \u2014 use \`json_extract(__doc__, '$.${v}')\``,offset:c.index+(m===void 0?0:1),severity:"error",source:"schema"})}return a},"Kt"),Qt=i((s,e)=>{if(s.trim()==="")return[];let n=tt(s),t=new Set(e.tables.map(r=>r.toLowerCase())),o=[];for(let r of n){let{offset:l,rejection:d}=r;if(d!==void 0){o.push({length:d.length,message:d.message,offset:d.offset===void 0?l:l+d.offset,severity:"error",source:"gate"});continue}let{ctes:a,masked:c,targets:m}=nt(r.sql,e.tables);o.push(...[...Wt(c,t,a),...Ht(c,e,m),...Bt(c,e,m,a)].map(p=>({...p,offset:p.offset===void 0?l:l+p.offset})))}return o},"zt"),Yt=me(he.lintSql),Jt=600,Vt=i((s,e,n)=>{let t=xe(),[o,r]=(0,j.useState)([]),l=(0,j.useMemo)(()=>Qt(s,e),[s,e]),d=ze(s,Jt),a=l.some(p=>p.source==="gate")||d.trim()==="",c=(0,j.useCallback)(async p=>{try{let f=await t.query(Yt,{sql:d},fe(n));p.cancelled||r(f.diagnostics??[])}catch{p.cancelled||r([])}},[t,d,n]);(0,j.useEffect)(()=>{if(a){r([]);return}let p={cancelled:!1};return ae(c(p)),()=>{p.cancelled=!0}},[c,a]);let m=d===s;return(0,j.useMemo)(()=>m?[...l,...o]:l,[l,o,m])},"Qt"),we=8,Gt=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],Ut=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),Xt=/[\w$]/,ot=i(s=>s!==void 0&&Xt.test(s),"je"),rt=i(s=>{let e=s.length;for(;e>0&&ot(s[e-1]);)e-=1;return s.slice(e)},"Qe"),st=i((s,e)=>{let n=e;for(;n>0&&ot(s[n-1]);)n-=1;return{end:e,start:n,text:s.slice(n,e)}},"Ye"),Ye=i((s,e)=>{let n=s.slice(0,e).trimEnd();return n.endsWith(".")||Ut.has(rt(n).toUpperCase())},"De"),Zt=i((s,e,n)=>{let t=s.slice(0,e);if(!t.endsWith("."))return;let o=rt(t.slice(0,-1));if(o!=="")return nt(s,n).targets.get(o.toLowerCase())??o},"Vt"),Re=i((s,e)=>s.toLowerCase().startsWith(e.toLowerCase()),"Ie"),Je=i((s,e,n,t)=>{let o=[];for(let r of s)if(Re(r,e)&&(o.push(t(r)),o.length>=n))break;return o},"Oe"),en=i((s,e,n)=>{let t=new Map;for(let[o,r]of Object.entries(s.columns))for(let l of r)if(Re(l,e)&&!t.has(l)&&(t.set(l,o),t.size>=n))return[...t].map(([d,a])=>({detail:a,kind:"column",label:d}));return[...t].map(([o,r])=>({detail:r,kind:"column",label:o}))},"Xt"),tn=i((s,e,n)=>{let t=st(s,e),o=Zt(s,t.start,n.tables);if(o!==void 0){let a=n.columns[o]??n.columns[o.toLowerCase()]??[];return Je(a,t.text,we,c=>({detail:o,kind:"column",label:c}))}if(t.text===""&&!Ye(s,t.start))return[];let r=Je(n.tables,t.text,we,a=>({kind:"table",label:a})),l=en(n,t.text,we),d=Gt.flatMap(a=>t.text!==""&&Re(a,t.text)&&a.toLowerCase()!==t.text.toLowerCase()?[{kind:"keyword",label:a}]:[]);return(Ye(s,t.start)?[...l,...r,...d]:[...r,...l,...d]).slice(0,we)},"Zt"),nn=i((s,e,n)=>{let t=st(s,e),o=s.slice(0,t.start)+n.label+s.slice(t.end);return{caret:t.start+n.label.length,value:o}},"en"),on=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],rn=i((s,e)=>{let n=globalThis.getComputedStyle(s),t=globalThis.document.createElement("div"),{style:o}=t;o.position="absolute",o.visibility="hidden",o.whiteSpace="pre-wrap",o.overflowWrap="break-word";for(let a of on)o[a]=n[a];t.textContent=s.value.slice(0,Math.max(0,e));let r=globalThis.document.createElement("span");r.textContent=s.value.slice(Math.max(0,e))||".",t.append(r),globalThis.document.body.append(t);let l=r.offsetLeft-s.scrollLeft,d=r.offsetTop-s.scrollTop;return t.remove(),{left:l,top:d}},"nn"),sn=i((s,e,n)=>{let t=(0,X.c)(16),[o,r]=(0,j.useState)(null),l;t[0]!==s||t[1]!==e?(l=i((y,h)=>{let S=tn(y,h,s);if(S.length===0){r(null);return}let w=e.current,{left:C,top:b}=w===null?{left:0,top:0}:rn(w,h);r(k=>k!==null&&k.active===0&&k.left===C&&k.top===b&&k.suggestions.length===S.length&&k.suggestions.every((N,R)=>{let q=S.at(R);return N.kind===q?.kind&&N.label===q.label&&N.detail===q.detail})?k:{active:0,left:C,suggestions:S,top:b})},"r"),t[0]=s,t[1]=e,t[2]=l):l=t[2];let d=l,a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=i(()=>{r(null)},"a"),t[3]=a):a=t[3];let c=a,m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i(y=>{r(h=>{if(h===null)return h;let S=h.suggestions.length,w=(h.active+y+S)%S;return{...h,active:w}})},"u"),t[4]=m):m=t[4];let p=m,f;t[5]!==n||t[6]!==o||t[7]!==e?(f=i(y=>{let h=e.current;if(o===null||h===null)return!1;let S=o.suggestions[y??o.active];if(S===void 0)return!1;let w=nn(h.value,h.selectionStart,S);return n(w.value),r(null),requestAnimationFrame(()=>{let C=e.current;C!==null&&(C.focus(),C.setSelectionRange(w.caret,w.caret))}),!0},"d"),t[5]=n,t[6]=o,t[7]=e,t[8]=f):f=t[8];let v=f,g;t[9]!==v?(g=i(()=>v(),"b"),t[9]=v,t[10]=g):g=t[10];let E=g,x;return t[11]!==E||t[12]!==v||t[13]!==d||t[14]!==o?(x={close:c,commit:E,commitAt:v,move:p,refresh:d,state:o},t[11]=E,t[12]=v,t[13]=d,t[14]=o,t[15]=x):x=t[15],x},"sn"),ln={column:"column",keyword:"keyword",table:"table"},an=20,cn=i(s=>{let e=(0,X.c)(17),{listboxId:n,onPick:t,state:o}=s,r=se(),l;e[0]!==o?(l=o===null?void 0:{left:o.left,top:o.top+an},e[0]=o,e[1]=l):l=e[1];let d=l;if(o===null)return null;let a;if(e[2]!==n||e[3]!==t||e[4]!==o.active||e[5]!==o.suggestions||e[6]!==r){let m;e[8]!==n||e[9]!==t||e[10]!==o.active||e[11]!==r?(m=i((p,f)=>(0,u.jsxs)("li",{"aria-selected":f===o.active,className:ie("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",f===o.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${n}-opt-${f.toString()}`,onMouseDown:i(v=>{v.preventDefault(),t(f)},"onMouseDown"),role:"option",children:[(0,u.jsx)("span",{className:"truncate font-mono",children:p.label}),p.detail!==void 0&&(0,u.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:p.detail}),(0,u.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:r(ln[p.kind])})]},`${p.kind}:${p.label}`),"u"),e[8]=n,e[9]=t,e[10]=o.active,e[11]=r,e[12]=m):m=e[12],a=o.suggestions.map(m),e[2]=n,e[3]=t,e[4]=o.active,e[5]=o.suggestions,e[6]=r,e[7]=a}else a=e[7];let c;return e[13]!==n||e[14]!==d||e[15]!==a?(c=(0,u.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:n,role:"listbox",style:d,children:a}),e[13]=n,e[14]=d,e[15]=a,e[16]=c):c=e[16],c},"rn"),dn=me(he.listTables),un=me(he.readTablePage),mn=i(s=>{let e=(0,X.c)(18),n=xe(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];let[o,r]=(0,j.useState)(t),l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={},e[1]=l):l=e[1];let[d,a]=(0,j.useState)(l),c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={},e[2]=c):c=e[2];let[m,p]=(0,j.useState)(c),f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=new Set,e[3]=f):f=e[3];let v=(0,j.useRef)(f),g,E;e[4]!==n||e[5]!==s?(g=i(()=>{let C={cancelled:!1};return ae((async()=>{try{let b=await n.query(dn,{},fe(s));C.cancelled||(r(b.map(hn)),a({}),p({}),v.current=new Set)}catch{C.cancelled||(r([]),a({}),p({}),v.current=new Set)}})()),()=>{C.cancelled=!0}},"b"),E=[n,s],e[4]=n,e[5]=s,e[6]=g,e[7]=E):(g=e[6],E=e[7]),(0,j.useEffect)(g,E);let x;e[8]!==n||e[9]!==s?(x=i(C=>{v.current.has(C)||(v.current.add(C),ae((async()=>{try{let b=await n.query(un,{limit:1,offset:0,table:C},fe(s)),{sqlColumns:k}=b;if(k===void 0){v.current.delete(C);return}let N=new Set(k),R=b.columns.filter(q=>!N.has(q));a(q=>({...q,[C]:k})),p(q=>({...q,[C]:R}))}catch{v.current.delete(C)}})()))},"m"),e[8]=n,e[9]=s,e[10]=x):x=e[10];let y=x,h;e[11]!==d||e[12]!==m||e[13]!==o?(h={columns:d,docFields:m,tables:o},e[11]=d,e[12]=m,e[13]=o,e[14]=h):h=e[14];let S=h,w;return e[15]!==y||e[16]!==S?(w={probe:y,schema:S},e[15]=y,e[16]=S,e[17]=w):w=e[17],w},"dn"),Le=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,fn=i(s=>{let e=new Set;Le.lastIndex=0;let n=Le.exec(s);for(;n!==null;)e.add(n[1]??n[2]),n=Le.exec(s);return[...e]},"un");function hn(s){return s.name}i(hn,"fn");var pn=i(s=>(s.metaKey||s.ctrlKey)&&!s.shiftKey&&!s.altKey&&s.key.toLowerCase()==="i","mn"),bn=i(s=>{let e=(0,X.c)(44),{inlineEditEnabled:n,onSubmit:t,probe:o,schema:r,setDraft:l}=s,d=(0,j.useId)(),[a,c]=(0,j.useState)(null),m=(0,j.useRef)(null),p=(0,j.useRef)(null),f=(0,j.useRef)(null),v=sn(r,f,l),{close:g,commit:E,commitAt:x,move:y,refresh:h,state:S}=v,w;e[0]!==x?(w=i(M=>{x(M)},"v"),e[0]=x,e[1]=w):w=e[1];let C=w,b;e[2]!==h?(b=i(()=>{let M=f.current;M!==null&&M===document.activeElement&&h(M.value,M.selectionStart)},"h"),e[2]=h,e[3]=b):b=e[3];let k;e[4]!==h||e[5]!==r?(k=[h,r],e[4]=h,e[5]=r,e[6]=k):k=e[6],(0,j.useEffect)(b,k);let N;e[7]!==o||e[8]!==h||e[9]!==l?(N=i(M=>{let{selectionStart:Y,value:U}=M.target;l(U),c(null);for(let W of fn(U))o(W);h(U,Y)},"T"),e[7]=o,e[8]=h,e[9]=l,e[10]=N):N=e[10];let R=N,q;e[11]!==h?(q=i(M=>{let Y=M.currentTarget;h(Y.value,Y.selectionStart)},"R"),e[11]=h,e[12]=q):q=e[12];let T=q,L;e[13]!==g||e[14]!==E||e[15]!==y?(L=i(M=>M.key==="ArrowDown"?(M.preventDefault(),y(1),!0):M.key==="ArrowUp"?(M.preventDefault(),y(-1),!0):M.key==="Escape"?(M.preventDefault(),g(),!0):(M.key==="Enter"||M.key==="Tab")&&!M.metaKey&&!M.ctrlKey&&E()?(M.preventDefault(),!0):!1,"_"),e[13]=g,e[14]=E,e[15]=y,e[16]=L):L=e[16];let _=L,I;e[17]!==S||e[18]!==g||e[19]!==n||e[20]!==_||e[21]!==t?(I=i(M=>{if(!(S!==null&&_(M))){if((M.metaKey||M.ctrlKey)&&M.key==="Enter"){M.preventDefault(),t();return}if(n&&pn(M)){M.preventDefault(),g();let{selectionEnd:Y,selectionStart:U,value:W}=M.currentTarget,[J,G]=U===Y?[0,W.length]:[U,Y];c({end:G,start:J,text:W.slice(J,G)})}}},"A"),e[17]=S,e[18]=g,e[19]=n,e[20]=_,e[21]=t,e[22]=I):I=e[22];let H=I,B;e[23]!==g?(B=i(()=>{requestAnimationFrame(()=>{g()})},"W"),e[23]=g,e[24]=B):B=e[24];let F=B,O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=i(M=>{let{scrollLeft:Y,scrollTop:U}=M.currentTarget;m.current!==null&&(m.current.scrollTop=U),p.current!==null&&(p.current.scrollTop=U,p.current.scrollLeft=Y)},"$"),e[25]=O):O=e[25];let K=O,$;e[26]===Symbol.for("react.memo_cache_sentinel")?($=i(M=>{let Y=f.current;Y===null||M.offset===void 0||(Y.focus(),Y.setSelectionRange(M.offset,M.offset+(M.length??0)))},"H"),e[26]=$):$=e[26];let D=$,A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=i(()=>{c(null),f.current?.focus()},"D"),e[27]=A):A=e[27];let Q=A,z;e[28]!==a||e[29]!==l?(z=i(M=>{let Y=f.current;if(a===null||Y===null)return;let{end:U,start:W,text:J}=a;if(Y.value.slice(W,U)!==J){Q();return}l(Y.value.slice(0,W)+M+Y.value.slice(U)),c(null),Y.focus(),requestAnimationFrame(()=>{Y.setSelectionRange(W,W+M.length)})},"P"),e[28]=a,e[29]=l,e[30]=z):z=e[30];let re=z,Z;e[31]!==R||e[32]!==F||e[33]!==H||e[34]!==T?(Z={onBlur:F,onChange:R,onKeyDown:H,onScroll:K,onSelect:T},e[31]=R,e[32]=F,e[33]=H,e[34]=T,e[35]=Z):Z=e[35];let oe;return e[36]!==re||e[37]!==S||e[38]!==g||e[39]!==a||e[40]!==d||e[41]!==C||e[42]!==Z?(oe={acceptInlineEdit:re,autocompleteState:S,closeAutocomplete:g,closeInlineEdit:Q,inlineEdit:a,handlers:Z,listboxId:d,onPickSuggestion:C,editorRef:f,gutterRef:m,overlayRef:p,revealDiagnostic:D},e[36]=re,e[37]=S,e[38]=g,e[39]=a,e[40]=d,e[41]=C,e[42]=Z,e[43]=oe):oe=e[43],oe},"pn"),gn="lunora-studio-sql-tabs",xn="lunora-studio-sql-active-tab",De=12,ge=i((s="",e="")=>({activeId:null,id:Ee("tab"),name:e,sql:s}),"pe"),vn=i(()=>ye(xn,""),"gn"),yn=i(s=>{let e=(0,X.c)(16),[n,t]=ve(gn),[o,r]=vn(),[l]=(0,j.useState)(s),d,a;e[0]!==l||e[1]!==t||e[2]!==n.length?(d=i(()=>{n.length===0&&t([l])},"c"),a=[l,t,n.length],e[0]=l,e[1]=t,e[2]=n.length,e[3]=d,e[4]=a):(d=e[3],a=e[4]),(0,j.useEffect)(d,a);let c;e[5]!==l||e[6]!==n?(c=n.length===0?[l]:n,e[5]=l,e[6]=n,e[7]=c):c=e[7];let m=c,p;e[8]!==o||e[9]!==m?(p=m.some(g=>g.id===o)?o:m[0]?.id??"",e[8]=o,e[9]=m,e[10]=p):p=e[10];let f=p,v;return e[11]!==f||e[12]!==r||e[13]!==t||e[14]!==m?(v={activeId:f,setActiveId:r,setTabs:t,tabs:m},e[11]=f,e[12]=r,e[13]=t,e[14]=m,e[15]=v):v=e[15],v},"xn"),lt=i(s=>s.activeId===null&&s.sql.trim()!=="","Ge"),wn=i((s,e)=>[...s,e].slice(-De),"vn"),Sn=i((s,e,n)=>{let t=s.findIndex(r=>r.id===e);if(t===-1)return{activeId:s[0]?.id??"",tabs:[...s]};let o=s.filter(r=>r.id!==e);if(o.length===0){let r=n();return{activeId:r.id,tabs:[r]}}return{activeId:o[Math.min(t,o.length-1)].id,tabs:o}},"yn"),Cn=i((s,e)=>{let n=s.filter(t=>t.id===e);return n.length===0?{activeId:s[0]?.id??"",tabs:[...s]}:{activeId:e,tabs:n}},"Sn"),Nn=i((s,e,n)=>{let t=s.findIndex(r=>r.id===e);if(t===-1)return{activeId:n,tabs:[...s]};let o=s.slice(0,t+1);return{activeId:o.some(r=>r.id===n)?n:e,tabs:o}},"wn"),kn=i(s=>{let e=s();return{activeId:e.id,tabs:[e]}},"Cn"),qn=i((s,e,n)=>{if(s==="others")return e.filter(t=>t.id!==n);if(s==="right"){let t=e.findIndex(o=>o.id===n);return t===-1?[]:e.slice(t+1)}return[...e]},"Nn"),Ve={error:null,pane:"results",result:null,running:!1},En=i(s=>{let e=(0,X.c)(66),{activeId:n,setActiveId:t,setTabs:o,tabs:r}=yn(s),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let[d,a]=(0,j.useState)(l),[c,m]=(0,j.useState)(null),[p,f]=(0,j.useState)(null),v;e[1]!==n||e[2]!==r?(v=r.find(P=>P.id===n)??r[0]??ge(),e[1]=n,e[2]=r,e[3]=v):v=e[3];let g=v,E=d[g.id]??Ve,x;e[4]!==g.id||e[5]!==o?(x=i(P=>{o(V=>V.map(ne=>ne.id===g.id?{...ne,...P}:ne))},"m"),e[4]=g.id,e[5]=o,e[6]=x):x=e[6];let y=x,h;e[7]!==g.id?(h=i(P=>{a(V=>{let ne=V[g.id]??Ve;return{...V,[g.id]:{...ne,...P}}})},"p"),e[7]=g.id,e[8]=h):h=e[8];let S=h,w;e[9]!==t||e[10]!==o||e[11]!==r.length?(w=i(()=>{if(r.length>=De)return;let P=ge();o(V=>wn(V,P)),t(P.id)},"v"),e[9]=t,e[10]=o,e[11]=r.length,e[12]=w):w=e[12];let C=w,b;e[13]!==t||e[14]!==o?(b=i(P=>{m(null),f(null),o(P.tabs),t(P.activeId);let V=new Set(P.tabs.map(Tn));a(ne=>Object.fromEntries(Object.entries(ne).filter(ce=>{let[de]=ce;return V.has(de)})))},"h"),e[13]=t,e[14]=o,e[15]=b):b=e[15];let k=b,N;e[16]!==k||e[17]!==r?(N=i(P=>{k(Sn(r,P,ge))},"T"),e[16]=k,e[17]=r,e[18]=N):N=e[18];let R=N,q;e[19]!==n||e[20]!==k||e[21]!==r?(q=i((P,V)=>{k(P==="others"?Cn(r,V):P==="right"?Nn(r,V,n):kn(ge))},"R"),e[19]=n,e[20]=k,e[21]=r,e[22]=q):q=e[22];let T=q,L;e[23]!==T||e[24]!==c||e[25]!==r?(L=i(P=>{c!==null&&(qn(P,r,c.id).some(In)?f(P):T(P,c.id))},"_"),e[23]=T,e[24]=c,e[25]=r,e[26]=L):L=e[26];let _=L,I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I=i((P,V)=>{V.preventDefault(),f(null),m({id:P,x:V.clientX,y:V.clientY})},"A"),e[27]=I):I=e[27];let H=I,B;e[28]===Symbol.for("react.memo_cache_sentinel")?(B=i(()=>{m(null),f(null)},"W"),e[28]=B):B=e[28];let F=B,O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=i(P=>{P.preventDefault(),m(null),f(null)},"$"),e[29]=O):O=e[29];let K=O,$;e[30]!==_?($=i(()=>{_("others")},"H"),e[30]=_,e[31]=$):$=e[31];let D=$,A;e[32]!==_?(A=i(()=>{_("right")},"D"),e[32]=_,e[33]=A):A=e[33];let Q=A,z;e[34]!==_?(z=i(()=>{_("all")},"P"),e[34]=_,e[35]=z):z=e[35];let re=z,Z;e[36]!==T||e[37]!==p||e[38]!==c?(Z=i(()=>{c!==null&&p!==null&&T(p,c.id),f(null)},"Z"),e[36]=T,e[37]=p,e[38]=c,e[39]=Z):Z=e[39];let oe=Z,M;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=i(()=>{f(null)},"q"),e[40]=M):M=e[40];let Y=M,U;e[41]!==c?(U=c===null?void 0:{left:c.x,top:c.y},e[41]=c,e[42]=U):U=e[42];let W=U,J;e[43]!==o?(J=i(P=>{o(V=>V.map(ne=>ne.activeId===P?{...ne,activeId:null}:ne))},"U"),e[43]=o,e[44]=J):J=e[44];let G=J,ee;e[45]!==o?(ee=i((P,V)=>{o(ne=>ne.map(ce=>ce.id===P?{...ce,name:V}:ce))},"Y"),e[45]=o,e[46]=ee):ee=e[46];let le=ee,te;return e[47]!==g||e[48]!==n||e[49]!==C||e[50]!==R||e[51]!==oe||e[52]!==re||e[53]!==D||e[54]!==Q||e[55]!==E||e[56]!==S||e[57]!==y||e[58]!==p||e[59]!==le||e[60]!==t||e[61]!==c||e[62]!==W||e[63]!==r||e[64]!==G?(te={activeTab:g,activeTabId:n,addEditorTab:C,cancelBulk:Y,closeEditorTab:R,closeTabMenu:F,confirmBulk:oe,menuStyle:W,onBackdropContextMenu:K,onCloseAll:re,onCloseOthers:D,onCloseToRight:Q,openTabMenu:H,output:E,patchActiveOutput:S,patchActiveTab:y,pendingBulk:p,renameTab:le,setActiveTabId:t,tabMenu:c,tabs:r,unlinkQuery:G},e[47]=g,e[48]=n,e[49]=C,e[50]=R,e[51]=oe,e[52]=re,e[53]=D,e[54]=Q,e[55]=E,e[56]=S,e[57]=y,e[58]=p,e[59]=le,e[60]=t,e[61]=c,e[62]=W,e[63]=r,e[64]=G,e[65]=te):te=e[65],te},"En");function Tn(s){return s.id}i(Tn,"kn");function In(s){return lt(s)}i(In,"Tn");var Ln="lunora-studio-sql-queries",ue="lunora-studio-sql-history",_n="lunora-studio-sql-remember-history",Rn=25,Dn=i(s=>{let e=(0,X.c)(41),{loadIntoActiveTab:n,unlinkQuery:t}=s,o=se(),[r,l]=ve(Ln),[d,a]=ye(_n,!1),[c,m]=ve(ue,d?"local":"session"),p,f;e[0]!==d?(p=i(()=>{d||pe(ue,"local")},"g"),f=[d],e[0]=d,e[1]=p,e[2]=f):(p=e[1],f=e[2]),(0,j.useEffect)(p,f);let[v,g]=(0,j.useState)(""),E=(0,j.useRef)(null),x;e[3]!==m?(x=i(D=>{m(A=>A[0]?.sql===D?A:[{at:Date.now(),sql:D},...A.filter(Q=>Q.sql!==D)].slice(0,Rn))},"m"),e[3]=m,e[4]=x):x=e[4];let y=x,h;e[5]!==n||e[6]!==l||e[7]!==o?(h=i(()=>{let D={id:Ee("q"),name:o("Untitled query"),sql:""};l(A=>[D,...A]),n("",D.id)},"p"),e[5]=n,e[6]=l,e[7]=o,e[8]=h):h=e[8];let S=h,w;e[9]!==n||e[10]!==r?(w=i(D=>{let A=r.find(Q=>Q.id===D);A!==void 0&&(n(A.sql,D),E.current?.querySelector(`[data-testid="sql-query-${D}"]`)?.scrollIntoView({block:"nearest"}))},"v"),e[9]=n,e[10]=r,e[11]=w):w=e[11];let C=w,b;e[12]!==l||e[13]!==t?(b=i(D=>{l(A=>A.filter(Q=>Q.id!==D)),t(D)},"h"),e[12]=l,e[13]=t,e[14]=b):b=e[14];let k=b,N;e[15]!==n?(N=i(D=>{n(D.currentTarget.dataset.sql??"",null)},"T"),e[15]=n,e[16]=N):N=e[16];let R=N,q;e[17]!==n?(q=i(D=>{n(D.currentTarget.dataset.sql??"",null)},"R"),e[17]=n,e[18]=q):q=e[18];let T=q,L;e[19]!==m?(L=i(()=>{m([]),pe(ue,"local"),pe(ue,"session")},"_"),e[19]=m,e[20]=L):L=e[20];let _=L,I;e[21]!==c||e[22]!==a?(I=i(D=>{$e(ue,c,D?"local":"session"),D||pe(ue,"local"),a(D)},"A"),e[21]=c,e[22]=a,e[23]=I):I=e[23];let H=I,B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=i(D=>{g(D.target.value)},"W"),e[24]=B):B=e[24];let F=B,O;e[25]!==l?(O=i((D,A)=>{l(Q=>Q.map(z=>z.id===D?{...z,sql:A}:z))},"$"),e[25]=l,e[26]=O):O=e[26];let K=O,$;return e[27]!==_||e[28]!==k||e[29]!==c||e[30]!==T||e[31]!==R||e[32]!==S||e[33]!==r||e[34]!==y||e[35]!==d||e[36]!==v||e[37]!==C||e[38]!==H||e[39]!==K?($={clearHistory:_,deleteQuery:k,history:c,listRef:E,loadFromHistory:T,loadTemplate:R,newQuery:S,onSearchChange:F,queries:r,recordHistory:y,rememberHistory:d,search:v,selectQuery:C,setRememberHistory:H,updateQuerySql:K},e[27]=_,e[28]=k,e[29]=c,e[30]=T,e[31]=R,e[32]=S,e[33]=r,e[34]=y,e[35]=d,e[36]=v,e[37]=C,e[38]=H,e[39]=K,e[40]=$):$=e[40],$},"_n"),Me="p-3 font-mono text-xs leading-5 whitespace-pre-wrap break-words",Mn=i((s,e)=>{let n=[];for(let o of s){if(o.offset===void 0||o.length===void 0||o.length<=0)continue;let r=Math.max(0,Math.min(o.offset,e)),l=Math.max(r,Math.min(o.offset+o.length,e));r!==l&&n.push({end:l,severity:o.severity,start:r})}n.sort((o,r)=>o.start-r.start);let t=[];for(let o of n)o.start>=(t.at(-1)?.end??0)&&t.push(o);return t},"An"),it=i((s,e)=>e(s==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":s==="too-long"?"The statement is too long to rewrite. Select a shorter part of it.":s==="empty-response"?"The model returned nothing usable.":"The model could not be reached."),"Je"),An=i(s=>{let e=(0,X.c)(51),{assistant:n,failed:t,onGenerated:o}=s,r=se(),[l,d]=(0,j.useState)("");if(n.unavailable)return null;let a;e[0]!==n?(a=n.pending("sql"),e[0]=n,e[1]=a):a=e[1];let c=a,m;if(e[2]!==n||e[3]!==t||e[4]!==o||e[5]!==c||e[6]!==l||e[7]!==r){let p=n.reason("sql"),f;e[9]!==n||e[10]!==t||e[11]!==o||e[12]!==l?(f=i(T=>{let L=l.trim();L===""&&!T||ae((async()=>{let _=await n.generate(L===""?"fix the failing statement":L,T?t:void 0);_!==void 0&&o(_)})())},"d"),e[9]=n,e[10]=t,e[11]=o,e[12]=l,e[13]=f):f=e[13];let v=f,g;e[14]!==r?(g=r("Describe the query you want"),e[14]=r,e[15]=g):g=e[15];let E;e[16]===Symbol.for("react.memo_cache_sentinel")?(E=i(T=>{d(T.target.value)},"N"),e[16]=E):E=e[16];let x;e[17]!==v?(x=i(T=>{T.key==="Enter"&&(T.preventDefault(),v(!1))},"m"),e[17]=v,e[18]=x):x=e[18];let y;e[19]!==r?(y=r("Describe the query you want"),e[19]=r,e[20]=y):y=e[20];let h;e[21]!==c||e[22]!==l||e[23]!==g||e[24]!==x||e[25]!==y?(h=(0,u.jsx)(qe,{"aria-label":g,className:"h-7 flex-1 text-xs","data-testid":"sql-assistant-prompt",disabled:c,onChange:E,onKeyDown:x,placeholder:y,value:l}),e[21]=c,e[22]=l,e[23]=g,e[24]=x,e[25]=y,e[26]=h):h=e[26];let S=c&&"opacity-60",w;e[27]!==S?(w=ie("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",S),e[27]=S,e[28]=w):w=e[28];let C;e[29]!==c||e[30]!==l?(C=c||l.trim()==="",e[29]=c,e[30]=l,e[31]=C):C=e[31];let b;e[32]!==v?(b=i(()=>{v(!1)},"h"),e[32]=v,e[33]=b):b=e[33];let k;e[34]!==c||e[35]!==r?(k=r(c?"Thinking\u2026":"Draft SQL"),e[34]=c,e[35]=r,e[36]=k):k=e[36];let N;e[37]!==w||e[38]!==C||e[39]!==b||e[40]!==k?(N=(0,u.jsx)("button",{className:w,"data-testid":"sql-assistant-generate",disabled:C,onClick:b,type:"button",children:k}),e[37]=w,e[38]=C,e[39]=b,e[40]=k,e[41]=N):N=e[41];let R;e[42]!==t||e[43]!==c||e[44]!==v||e[45]!==r?(R=t!==void 0&&(0,u.jsx)("button",{className:"rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-assistant-fix",disabled:c,onClick:i(()=>{v(!0)},"onClick"),type:"button",children:r("Fix this")}),e[42]=t,e[43]=c,e[44]=v,e[45]=r,e[46]=R):R=e[46];let q;e[47]!==N||e[48]!==R||e[49]!==h?(q=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[h,N,R]}),e[47]=N,e[48]=R,e[49]=h,e[50]=q):q=e[50],m=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border px-3 py-2","data-testid":"sql-assistant",children:[q,p!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-assistant-reason",role:"status",children:it(p,r)})]}),e[2]=n,e[3]=t,e[4]=o,e[5]=c,e[6]=l,e[7]=r,e[8]=m}else m=e[8];return m},"qn"),$n=i(s=>{let e=(0,X.c)(8),{diagnostics:n,draft:t,scrollRef:o}=s,r,l;if(e[0]!==n||e[1]!==t){l=Symbol.for("react.early_return_sentinel");e:{let c=Mn(n,t.length);if(c.length===0){l=null;break e}r=[];let m=0;for(let[p,f]of c.entries())f.start>m&&r.push(t.slice(m,f.start)),r.push((0,u.jsx)("span",{className:ie("decoration-wavy underline underline-offset-4",f.severity==="error"?"decoration-destructive":"decoration-amber-500"),children:t.slice(f.start,f.end)},`${f.start.toString()}-${p.toString()}`)),m=f.end;r.push(t.slice(m))}e[0]=n,e[1]=t,e[2]=r,e[3]=l}else r=e[2],l=e[3];if(l!==Symbol.for("react.early_return_sentinel"))return l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=ie("pointer-events-none absolute inset-0 overflow-hidden text-transparent",Me),e[4]=d):d=e[4];let a;return e[5]!==r||e[6]!==o?(a=(0,u.jsx)("div",{"aria-hidden":"true",className:d,"data-testid":"sql-diagnostics-overlay",ref:o,children:r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a},"Dn"),On={gate:"read-only",plan:"plan",schema:"schema",syntax:"syntax"},Pn=i(s=>{let e=(0,X.c)(10),{diagnostics:n,onSelect:t}=s,o=se();if(n.length===0)return null;let r;e[0]!==o?(r=o("SQL problems"),e[0]=o,e[1]=r):r=e[1];let l;if(e[2]!==n||e[3]!==t){let a;e[5]!==t?(a=i((c,m)=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-start gap-2 px-3 py-1 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-problem",onClick:i(()=>{t(c)},"onClick"),type:"button",children:[(0,u.jsx)("span",{className:ie("mt-px shrink-0 rounded px-1 font-mono text-[10px] uppercase",c.severity==="error"?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"),children:On[c.source]}),(0,u.jsx)("span",{className:"min-w-0 text-muted-foreground",children:c.message})]})},`${c.source}-${(c.offset??m).toString()}-${m.toString()}`),"a"),e[5]=t,e[6]=a):a=e[6],l=n.map(a),e[2]=n,e[3]=t,e[4]=l}else l=e[4];let d;return e[7]!==r||e[8]!==l?(d=(0,u.jsx)("ul",{"aria-label":r,className:"max-h-24 shrink-0 overflow-y-auto border-t border-border bg-muted/30","data-testid":"sql-problems",children:l}),e[7]=r,e[8]=l,e[9]=d):d=e[9],d},"Mn"),jn=i(s=>(s.endsWith(`
|
|
12
|
+
`)?s.slice(0,-1):s).split(`
|
|
13
|
+
`),"$n"),zn=i((s,e)=>{let n=[],t=1,o=1;for(let r of Ie(s,e,{ignoreNewlineAtEof:!0}))for(let l of jn(r.value))r.added?(n.push({after:o,kind:"added",text:l}),o+=1):r.removed?(n.push({before:t,kind:"removed",text:l}),t+=1):(n.push({after:o,before:t,kind:"context",text:l}),t+=1,o+=1);return n},"Bn"),Wn={added:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",context:"text-muted-foreground",removed:"bg-destructive/10 text-destructive"},Hn={added:"+",context:" ",removed:"-"},Fn=i(s=>{let e=(0,X.c)(11),{lines:n}=s,t=se(),o;e[0]!==t?(o=t("Proposed edit"),e[0]=t,e[1]=o):o=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=ie("max-h-48 overflow-auto rounded-md border border-border bg-background",Me),e[2]=r):r=e[2];let l;if(e[3]!==n||e[4]!==t){let a;e[6]!==t?(a=i(c=>(0,u.jsxs)("li",{className:ie("flex gap-2",Wn[c.kind]),"data-kind":c.kind,children:[(0,u.jsx)("span",{"aria-hidden":"true",className:"shrink-0 select-none opacity-60",children:Hn[c.kind]}),c.kind!=="context"&&(0,u.jsx)("span",{className:"sr-only",children:c.kind==="added"?t("Added"):t("Removed")}),(0,u.jsx)("span",{className:"min-w-0",children:c.text===""?"\xA0":c.text})]},`${String(c.before)}:${String(c.after)}`),"a"),e[6]=t,e[7]=a):a=e[7],l=n.map(a),e[3]=n,e[4]=t,e[5]=l}else l=e[5];let d;return e[8]!==o||e[9]!==l?(d=(0,u.jsx)("ul",{"aria-label":o,className:r,"data-testid":"sql-inline-diff",children:l}),e[8]=o,e[9]=l,e[10]=d):d=e[10],d},"Fn"),Se="rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",Kn=i(s=>{let e=(0,X.c)(41),{onAccept:n,onCancel:t,rpc:o,source:r,whole:l}=s,d=se(),a=(0,j.useRef)(null),c=(0,j.useRef)(null),[m,p]=(0,j.useState)(""),[f,v]=(0,j.useState)(null),g,E;if(e[0]!==f?(g=i(()=>{f===null?a.current?.focus():c.current?.focus()},"b"),E=[f],e[0]=f,e[1]=g,e[2]=E):(g=e[1],E=e[2]),(0,j.useEffect)(g,E),o.unavailable)return null;let x;e[3]!==o?(x=o.pending("sql"),e[3]=o,e[4]=x):x=e[4];let y=x,h;if(e[5]!==m||e[6]!==n||e[7]!==t||e[8]!==y||e[9]!==f||e[10]!==o||e[11]!==r||e[12]!==d||e[13]!==l){let S=o.reason("sql"),w;e[15]!==m||e[16]!==o||e[17]!==r?(w=i(()=>{let _=m.trim();_===""||r.trim()===""||ae((async()=>{let I=await o.rewrite(_,r);I!==void 0&&v(I)})())},"v"),e[15]=m,e[16]=o,e[17]=r,e[18]=w):w=e[18];let C=w,b;e[19]!==t?(b=i(_=>{_.key==="Escape"&&(_.preventDefault(),t())},"h"),e[19]=t,e[20]=b):b=e[20];let k=b,N;e[21]!==d||e[22]!==l?(N=d(l?"Whole query":"Selection"),e[21]=d,e[22]=l,e[23]=N):N=e[23];let R;e[24]!==N?(R=(0,u.jsx)("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] uppercase text-muted-foreground","data-testid":"sql-inline-edit-scope",children:N}),e[24]=N,e[25]=R):R=e[25];let q;e[26]!==m||e[27]!==n||e[28]!==t||e[29]!==k||e[30]!==y||e[31]!==f||e[32]!==C||e[33]!==d?(q=f===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(qe,{"aria-label":d("Tell the model what to change"),className:"h-7 flex-1 text-xs","data-testid":"sql-inline-edit-prompt",disabled:y,onChange:i(_=>{p(_.target.value)},"onChange"),onKeyDown:i(_=>{if(_.key==="Enter"){_.preventDefault(),C();return}k(_)},"onKeyDown"),placeholder:d("Tell the model what to change"),ref:a,value:m}),(0,u.jsx)("button",{className:ie(Se,y&&"opacity-60"),"data-testid":"sql-inline-edit-submit",disabled:y||m.trim()==="",onClick:C,onKeyDown:k,type:"button",children:d(y?"Thinking\u2026":"Rewrite")}),(0,u.jsx)("button",{className:Se,"data-testid":"sql-inline-edit-cancel",onClick:t,onKeyDown:k,type:"button",children:d("Cancel")})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"flex-1 text-xs text-muted-foreground",children:d("Proposed edit")}),(0,u.jsx)("button",{className:Se,"data-testid":"sql-inline-edit-accept",onClick:i(()=>{n(f)},"onClick"),onKeyDown:k,ref:c,type:"button",children:d("Accept")}),(0,u.jsx)("button",{className:Se,"data-testid":"sql-inline-edit-reject",onClick:i(()=>{v(null)},"onClick"),onKeyDown:k,type:"button",children:d("Reject")})]}),e[26]=m,e[27]=n,e[28]=t,e[29]=k,e[30]=y,e[31]=f,e[32]=C,e[33]=d,e[34]=q):q=e[34];let T;e[35]!==R||e[36]!==q?(T=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[R,q]}),e[35]=R,e[36]=q,e[37]=T):T=e[37];let L;e[38]!==f||e[39]!==r?(L=f!==null&&(0,u.jsx)(Fn,{lines:zn(r,f)}),e[38]=f,e[39]=r,e[40]=L):L=e[40],h=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border bg-muted/20 px-3 py-2","data-testid":"sql-inline-edit",children:[T,L,S!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-inline-edit-reason",role:"status",children:it(S,d)})]}),e[5]=m,e[6]=n,e[7]=t,e[8]=y,e[9]=f,e[10]=o,e[11]=r,e[12]=d,e[13]=l,e[14]=h}else h=e[14];return h},"Wn"),Bn={minWidth:"2.75rem",paddingInline:"0.5rem"},Qn=i(s=>{let e=(0,X.c)(75),{assistant:n,autocomplete:t,diagnostics:o,draft:r,failed:l,handlers:d,editorRef:a,gutterRef:c,inlineEdit:m,listboxId:p,onAcceptInlineEdit:f,onCancelInlineEdit:v,onGenerated:g,onPickSuggestion:E,onRevealDiagnostic:x,overlayRef:y}=s,h=se(),S,w,C,b,k,N,R,q,T;if(e[0]!==n||e[1]!==r||e[2]!==l||e[3]!==c||e[4]!==m||e[5]!==f||e[6]!==v||e[7]!==g){let z=r.split(`
|
|
14
|
+
`).length;R="flex min-h-0 min-w-0 flex-1 flex-col",e[17]!==n||e[18]!==l||e[19]!==g?(q=(0,u.jsx)(An,{assistant:n,failed:l,onGenerated:g}),e[17]=n,e[18]=l,e[19]=g,e[20]=q):q=e[20],e[21]!==n||e[22]!==r.length||e[23]!==m||e[24]!==f||e[25]!==v?(T=m!==null&&(0,u.jsx)(Kn,{onAccept:f,onCancel:v,rpc:n,source:m.text,whole:m.start===0&&m.end===r.length},`${m.start.toString()}-${m.end.toString()}`),e[21]=n,e[22]=r.length,e[23]=m,e[24]=f,e[25]=v,e[26]=T):T=e[26],N="flex min-h-0 min-w-0 flex-1",S="true",w="shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",C=c,b=Bn,k=Array.from({length:z},Yn),e[0]=n,e[1]=r,e[2]=l,e[3]=c,e[4]=m,e[5]=f,e[6]=v,e[7]=g,e[8]=S,e[9]=w,e[10]=C,e[11]=b,e[12]=k,e[13]=N,e[14]=R,e[15]=q,e[16]=T}else S=e[8],w=e[9],C=e[10],b=e[11],k=e[12],N=e[13],R=e[14],q=e[15],T=e[16];let L;e[27]!==S||e[28]!==w||e[29]!==C||e[30]!==b||e[31]!==k?(L=(0,u.jsx)("div",{"aria-hidden":S,className:w,ref:C,style:b,children:k}),e[27]=S,e[28]=w,e[29]=C,e[30]=b,e[31]=k,e[32]=L):L=e[32];let _;e[33]!==o||e[34]!==r||e[35]!==y?(_=(0,u.jsx)($n,{diagnostics:o,draft:r,scrollRef:y}),e[33]=o,e[34]=r,e[35]=y,e[36]=_):_=e[36];let I;e[37]!==t||e[38]!==p?(I=t===null?void 0:`${p}-opt-${t.active.toString()}`,e[37]=t,e[38]=p,e[39]=I):I=e[39];let H=t===null?void 0:p,B=t!==null,F;e[40]!==h?(F=h("SQL query"),e[40]=h,e[41]=F):F=e[41];let O;e[42]!==r||e[43]!==a||e[44]!==d.onBlur||e[45]!==d.onChange||e[46]!==d.onKeyDown||e[47]!==d.onScroll||e[48]!==d.onSelect||e[49]!==I||e[50]!==H||e[51]!==B||e[52]!==F?(O=(0,u.jsx)("textarea",{"aria-activedescendant":I,"aria-autocomplete":"list","aria-controls":H,"aria-expanded":B,"aria-label":F,className:`relative size-full resize-none bg-transparent outline-none ${Me}`,"data-testid":"sql-input",onBlur:d.onBlur,onChange:d.onChange,onKeyDown:d.onKeyDown,onScroll:d.onScroll,onSelect:d.onSelect,placeholder:"SELECT * FROM \u2026",ref:a,role:"combobox",spellCheck:!1,value:r}),e[42]=r,e[43]=a,e[44]=d.onBlur,e[45]=d.onChange,e[46]=d.onKeyDown,e[47]=d.onScroll,e[48]=d.onSelect,e[49]=I,e[50]=H,e[51]=B,e[52]=F,e[53]=O):O=e[53];let K;e[54]!==t||e[55]!==p||e[56]!==E?(K=(0,u.jsx)(cn,{listboxId:p,onPick:E,state:t}),e[54]=t,e[55]=p,e[56]=E,e[57]=K):K=e[57];let $;e[58]!==_||e[59]!==O||e[60]!==K?($=(0,u.jsxs)("div",{className:"relative min-w-0 flex-1 bg-background",children:[_,O,K]}),e[58]=_,e[59]=O,e[60]=K,e[61]=$):$=e[61];let D;e[62]!==L||e[63]!==$||e[64]!==N?(D=(0,u.jsxs)("div",{className:N,children:[L,$]}),e[62]=L,e[63]=$,e[64]=N,e[65]=D):D=e[65];let A;e[66]!==o||e[67]!==x?(A=(0,u.jsx)(Pn,{diagnostics:o,onSelect:x}),e[66]=o,e[67]=x,e[68]=A):A=e[68];let Q;return e[69]!==D||e[70]!==A||e[71]!==R||e[72]!==q||e[73]!==T?(Q=(0,u.jsxs)("div",{className:R,children:[q,T,D,A]}),e[69]=D,e[70]=A,e[71]=R,e[72]=q,e[73]=T,e[74]=Q):Q=e[74],Q},"zn");function Yn(s,e){return(0,u.jsx)("div",{children:e+1},e)}i(Yn,"Un");var at=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],Jn=i(s=>{let e=(0,X.c)(29),{active:n,onDelete:t,onSelect:o,query:r}=s,l=se(),d;e[0]!==o||e[1]!==r.id?(d=i(()=>{o(r.id)},"c"),e[0]=o,e[1]=r.id,e[2]=d):d=e[2];let a=d,c;e[3]!==t||e[4]!==r.id?(c=i(b=>{b.stopPropagation(),t(r.id)},"i"),e[3]=t,e[4]=r.id,e[5]=c):c=e[5];let m=c,p=n?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",f;e[6]!==p?(f=ie("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",p),e[6]=p,e[7]=f):f=e[7];let v=`sql-query-${r.id}`,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M4 6h16M4 12h10M4 18h7"})}),e[8]=g):g=e[8];let E;e[9]!==r.name?(E=(0,u.jsx)("span",{className:"truncate",children:r.name}),e[9]=r.name,e[10]=E):E=e[10];let x;e[11]!==n||e[12]!==a||e[13]!==f||e[14]!==v||e[15]!==E?(x=(0,u.jsxs)("button",{"aria-pressed":n,className:f,"data-testid":v,onClick:a,type:"button",children:[g,E]}),e[11]=n,e[12]=a,e[13]=f,e[14]=v,e[15]=E,e[16]=x):x=e[16];let y;e[17]!==l?(y=l("Delete query"),e[17]=l,e[18]=y):y=e[18];let h;e[19]!==l?(h=l("Delete query"),e[19]=l,e[20]=h):h=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[21]=S):S=e[21];let w;e[22]!==m||e[23]!==h||e[24]!==y?(w=(0,u.jsx)("button",{"aria-label":y,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:m,title:h,type:"button",children:S}),e[22]=m,e[23]=h,e[24]=y,e[25]=w):w=e[25];let C;return e[26]!==w||e[27]!==x?(C=(0,u.jsxs)("li",{className:"group/q flex items-center",children:[x,w]}),e[26]=w,e[27]=x,e[28]=C):C=e[28],C},"jn"),Ge="sql-history-remember",Vn=i((s,e)=>{let n=e.trim().toLowerCase();return n===""?[...s]:s.filter(t=>t.name.toLowerCase().includes(n))},"Qn"),Gn=i(s=>{let e=(0,X.c)(66),{activeId:n,history:t,listRef:o,onClearHistory:r,onDelete:l,onLoadHistory:d,onLoadTemplate:a,onNew:c,onSearchChange:m,onSelect:p,onToggleRememberHistory:f,queries:v,rememberHistory:g,search:E}=s,x=se(),y,h,S,w,C;if(e[0]!==n||e[1]!==o||e[2]!==l||e[3]!==c||e[4]!==m||e[5]!==p||e[6]!==f||e[7]!==v||e[8]!==E||e[9]!==x){let I=Vn(v,E),H;e[15]!==f?(H=i(z=>{f(z.target.checked)},"M"),e[15]=f,e[16]=H):H=e[16],y=H,S="flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar";let B;e[17]!==x?(B=x("Search queries\u2026"),e[17]=x,e[18]=B):B=e[18];let F;e[19]!==m||e[20]!==E||e[21]!==B?(F=(0,u.jsx)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:m,placeholder:B,type:"text",value:E}),e[19]=m,e[20]=E,e[21]=B,e[22]=F):F=e[22];let O;e[23]!==x?(O=x("New query"),e[23]=x,e[24]=O):O=e[24];let K;e[25]!==x?(K=x("New query"),e[25]=x,e[26]=K):K=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[27]=$):$=e[27];let D;e[28]!==c||e[29]!==O||e[30]!==K?(D=(0,u.jsx)("button",{"aria-label":O,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:c,title:K,type:"button",children:$}),e[28]=c,e[29]=O,e[30]=K,e[31]=D):D=e[31],e[32]!==D||e[33]!==F?(w=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[F,D]}),e[32]=D,e[33]=F,e[34]=w):w=e[34],h="flex flex-1 flex-col gap-4 overflow-y-auto p-2";let A;e[35]!==x?(A=x("Private"),e[35]=x,e[36]=A):A=e[36];let Q;e[37]!==A?(Q=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:A}),e[37]=A,e[38]=Q):Q=e[38],C=(0,u.jsxs)("div",{children:[Q,I.length===0?(0,u.jsx)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:x("No saved queries yet \u2014 they save to this browser as you type.")}):(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:o,children:I.map(z=>(0,u.jsx)(Jn,{active:n===z.id,onDelete:l,onSelect:p,query:z},z.id))})]}),e[0]=n,e[1]=o,e[2]=l,e[3]=c,e[4]=m,e[5]=p,e[6]=f,e[7]=v,e[8]=E,e[9]=x,e[10]=y,e[11]=h,e[12]=S,e[13]=w,e[14]=C}else y=e[10],h=e[11],S=e[12],w=e[13],C=e[14];let b;e[39]!==x?(b=x("Reference"),e[39]=x,e[40]=b):b=e[40];let k;e[41]!==b?(k=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b}),e[41]=b,e[42]=k):k=e[42];let N;e[43]!==a?(N=at.map(I=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":I.sql,onClick:a,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"})}),I.label]})},I.label)),e[43]=a,e[44]=N):N=e[44];let R;e[45]!==N?(R=(0,u.jsx)("ul",{className:"flex flex-col gap-px",children:N}),e[45]=N,e[46]=R):R=e[46];let q;e[47]!==k||e[48]!==R?(q=(0,u.jsxs)("div",{children:[k,R]}),e[47]=k,e[48]=R,e[49]=q):q=e[49];let T;e[50]!==t||e[51]!==r||e[52]!==d||e[53]!==y||e[54]!==g||e[55]!==x?(T=t.length>0&&(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,u.jsx)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:x("History")}),(0,u.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:r,type:"button",children:x("Clear history")})]}),(0,u.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 pb-1.5 text-[11px] text-muted-foreground",htmlFor:Ge,children:[(0,u.jsx)("input",{checked:g,"data-testid":"sql-history-remember",id:Ge,onChange:y,type:"checkbox"}),x("Keep history on this browser")]}),(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:t.map(I=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":I.sql,"data-testid":"sql-history-item",onClick:d,title:I.sql,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"})}),(0,u.jsx)("span",{className:"truncate font-mono",children:I.sql})]})},`${I.at.toString()}:${I.sql}`))})]}),e[50]=t,e[51]=r,e[52]=d,e[53]=y,e[54]=g,e[55]=x,e[56]=T):T=e[56];let L;e[57]!==h||e[58]!==T||e[59]!==C||e[60]!==q?(L=(0,u.jsxs)("div",{className:h,children:[C,q,T]}),e[57]=h,e[58]=T,e[59]=C,e[60]=q,e[61]=L):L=e[61];let _;return e[62]!==L||e[63]!==S||e[64]!==w?(_=(0,u.jsxs)("aside",{className:S,children:[w,L]}),e[62]=L,e[63]=S,e[64]=w,e[65]=_):_=e[65],_},"Yn"),Ce=i(s=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${s?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"ve"),Un=i(s=>{let e=(0,X.c)(97),{assistant:n,chart:t,className:o,durationMs:r,error:l,onFormat:d,onInferChart:a,onRun:c,onSelectStatement:m,onShardKeyChange:p,onShowChart:f,onShowExplain:v,onShowResults:g,onToggleSplit:E,pane:x,result:y,running:h,script:S,shardKey:w,splitView:C}=s,b=se(),k=x==="results",N;e[0]!==k?(N=Ce(k),e[0]=k,e[1]=N):N=e[1];let R;e[2]!==b?(R=b("Results"),e[2]=b,e[3]=R):R=e[3];let q;e[4]!==g||e[5]!==N||e[6]!==R?(q=(0,u.jsx)("button",{className:N,"data-testid":"sql-tab-results",onClick:g,type:"button",children:R}),e[4]=g,e[5]=N,e[6]=R,e[7]=q):q=e[7];let T=x==="chart",L;e[8]!==T?(L=Ce(T),e[8]=T,e[9]=L):L=e[9];let _;e[10]!==b?(_=b("Chart"),e[10]=b,e[11]=_):_=e[11];let I;e[12]!==f||e[13]!==L||e[14]!==_?(I=(0,u.jsx)("button",{className:L,"data-testid":"sql-tab-chart",onClick:f,type:"button",children:_}),e[12]=f,e[13]=L,e[14]=_,e[15]=I):I=e[15];let H;e[16]!==n||e[17]!==a||e[18]!==x||e[19]!==y||e[20]!==b?(H=!n.unavailable&&x==="chart"&&y!==null&&(0,u.jsx)("button",{className:Ce(!1),"data-testid":"sql-infer-chart",disabled:n.pending("chart"),onClick:a,type:"button",children:n.pending("chart")?b("Thinking\u2026"):b("Suggest chart")}),e[16]=n,e[17]=a,e[18]=x,e[19]=y,e[20]=b,e[21]=H):H=e[21];let B=x==="explain",F;e[22]!==B?(F=Ce(B),e[22]=B,e[23]=F):F=e[23];let O;e[24]!==b?(O=b("Explain"),e[24]=b,e[25]=O):O=e[25];let K;e[26]!==v||e[27]!==F||e[28]!==O?(K=(0,u.jsx)("button",{className:F,"data-testid":"sql-tab-explain",onClick:v,type:"button",children:O}),e[26]=v,e[27]=F,e[28]=O,e[29]=K):K=e[29];let $;e[30]!==b?($=b("Split editor and results"),e[30]=b,e[31]=$):$=e[31];let D=`inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${C?"bg-accent text-foreground":"text-muted-foreground"}`,A;e[32]!==b?(A=b("Split editor and results"),e[32]=b,e[33]=A):A=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,u.jsxs)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:[(0,u.jsx)("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),(0,u.jsx)("path",{d:"M12 4v16"})]}),e[34]=Q):Q=e[34];let z;e[35]!==E||e[36]!==C||e[37]!==$||e[38]!==D||e[39]!==A?(z=(0,u.jsx)("button",{"aria-label":$,"aria-pressed":C,className:D,"data-testid":"sql-split-toggle",onClick:E,title:A,type:"button",children:Q}),e[35]=E,e[36]=C,e[37]=$,e[38]=D,e[39]=A,e[40]=z):z=e[40];let re;e[41]!==y?(re=y!==null&&y.columns.length>0&&(0,u.jsx)(He,{columns:y.columns,name:"query-result",rows:y.rows}),e[41]=y,e[42]=re):re=e[42];let Z;e[43]!==b?(Z=b("Format"),e[43]=b,e[44]=Z):Z=e[44];let oe;e[45]!==d||e[46]!==h||e[47]!==Z?(oe=(0,u.jsx)("button",{className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-format",disabled:h,onClick:d,type:"button",children:Z}),e[45]=d,e[46]=h,e[47]=Z,e[48]=oe):oe=e[48];let M;e[49]!==p||e[50]!==w?(M=(0,u.jsx)(Pe,{onChange:p,testId:"sql-shard-input",value:w}),e[49]=p,e[50]=w,e[51]=M):M=e[51];let Y;e[52]!==h||e[53]!==b?(Y=b(h?"Running\u2026":"Run"),e[52]=h,e[53]=b,e[54]=Y):Y=e[54];let U;e[55]===Symbol.for("react.memo_cache_sentinel")?(U=(0,u.jsx)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"}),e[55]=U):U=e[55];let W;e[56]!==c||e[57]!==h||e[58]!==Y?(W=(0,u.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-run",disabled:h,onClick:c,type:"button",children:[Y,U]}),e[56]=c,e[57]=h,e[58]=Y,e[59]=W):W=e[59];let J;e[60]!==z||e[61]!==re||e[62]!==oe||e[63]!==M||e[64]!==W?(J=(0,u.jsxs)("div",{className:"ms-auto flex items-center gap-2",children:[z,re,oe,M,W]}),e[60]=z,e[61]=re,e[62]=oe,e[63]=M,e[64]=W,e[65]=J):J=e[65];let G;e[66]!==K||e[67]!==J||e[68]!==q||e[69]!==I||e[70]!==H?(G=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[q,I,H,K,J]}),e[66]=K,e[67]=J,e[68]=q,e[69]=I,e[70]=H,e[71]=G):G=e[71];let ee;e[72]!==m||e[73]!==S?(ee=S!==void 0&&(0,u.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-3 py-1.5","data-testid":"sql-statements",children:S.runs.map((ce,de)=>(0,u.jsx)("button",{"aria-pressed":de===S.selected,className:`rounded-md border px-2 py-0.5 font-mono text-[11px] outline-none transition-colors ${de===S.selected?"border-foreground text-foreground":"border-border text-muted-foreground hover:text-foreground"} ${ce.error===null?"":"border-destructive/50 text-destructive"}`,"data-testid":`sql-statement-${de.toString()}`,onClick:i(()=>{m(de)},"onClick"),title:ce.sql,type:"button",children:de+1},`${de.toString()}:${ce.sql}`))}),e[72]=m,e[73]=S,e[74]=ee):ee=e[74];let le;e[75]!==l?(le=l!==null&&(0,u.jsx)(je,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:l}),e[75]=l,e[76]=le):le=e[76];let te;e[77]!==l||e[78]!==y||e[79]!==b?(te=l===null&&y===null&&(0,u.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:b("Click Run to execute your query.")}),e[77]=l,e[78]=y,e[79]=b,e[80]=te):te=e[80];let P;e[81]!==t||e[82]!==r||e[83]!==l||e[84]!==x||e[85]!==y||e[86]!==b?(P=l===null&&y!==null&&(0,u.jsxs)("div",{"data-testid":"sql-result",children:[x==="chart"?(0,u.jsx)(Fe,{axes:t,result:y}):(0,u.jsx)(Ke,{result:y}),(0,u.jsxs)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:[y.truncated?b("Showing the first {max} rows.",{max:y.rows.length}):b("{count} rows",{count:y.rowCount}),r!==void 0&&` \xB7 ${b("{ms} ms",{ms:Math.round(r)})}`]})]}),e[81]=t,e[82]=r,e[83]=l,e[84]=x,e[85]=y,e[86]=b,e[87]=P):P=e[87];let V;e[88]!==le||e[89]!==te||e[90]!==P?(V=(0,u.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto",children:[le,te,P]}),e[88]=le,e[89]=te,e[90]=P,e[91]=V):V=e[91];let ne;return e[92]!==o||e[93]!==G||e[94]!==ee||e[95]!==V?(ne=(0,u.jsxs)("div",{className:o,children:[G,ee,V]}),e[92]=o,e[93]=G,e[94]=ee,e[95]=V,e[96]=ne):ne=e[96],ne},"Gn"),Xn=i((s,e)=>s.trim()===""?e:(s.split(`
|
|
15
|
+
`)[0]??s).slice(0,24),"Jn"),Zn=i(s=>{s?.focus(),s?.select()},"Vn"),eo=i(s=>{let e=(0,X.c)(14),{initial:n,onCancel:t,onCommit:o,placeholder:r,testId:l}=s,d=se(),a;e[0]!==o?(a=i(g=>{o(g.currentTarget.value.trim())},"a"),e[0]=o,e[1]=a):a=e[1];let c=a,m;e[2]!==t||e[3]!==o?(m=i(g=>{g.key==="Enter"?o(g.currentTarget.value.trim()):g.key==="Escape"&&t()},"u"),e[2]=t,e[3]=o,e[4]=m):m=e[4];let p=m,f;e[5]!==d?(f=d("Tab title"),e[5]=d,e[6]=f):f=e[6];let v;return e[7]!==n||e[8]!==c||e[9]!==p||e[10]!==r||e[11]!==f||e[12]!==l?(v=(0,u.jsx)("input",{"aria-label":f,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":l,defaultValue:n,onBlur:c,onKeyDown:p,placeholder:r,ref:Zn,type:"text"}),e[7]=n,e[8]=c,e[9]=p,e[10]=r,e[11]=f,e[12]=l,e[13]=v):v=e[13],v},"Xn"),to=i(s=>{let e=(0,X.c)(29),{idBase:n,onDiscard:t,onKeep:o}=s,r=se(),l=`sql-tab-close-prompt-${n}`,d;e[0]!==r?(d=r("Discard?"),e[0]=r,e[1]=d):d=e[1];let a;e[2]!==d?(a=(0,u.jsx)("span",{className:"text-[11px] text-muted-foreground",children:d}),e[2]=d,e[3]=a):a=e[3];let c;e[4]!==r?(c=r("Discard changes"),e[4]=r,e[5]=c):c=e[5];let m=`sql-tab-close-confirm-${n}`,p;e[6]!==r?(p=r("Discard changes"),e[6]=r,e[7]=p):p=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 13l4 4L19 7"})}),e[8]=f):f=e[8];let v;e[9]!==t||e[10]!==c||e[11]!==m||e[12]!==p?(v=(0,u.jsx)("button",{"aria-label":c,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":m,onClick:t,title:p,type:"button",children:f}),e[9]=t,e[10]=c,e[11]=m,e[12]=p,e[13]=v):v=e[13];let g;e[14]!==r?(g=r("Keep editing"),e[14]=r,e[15]=g):g=e[15];let E=`sql-tab-close-cancel-${n}`,x;e[16]!==r?(x=r("Keep editing"),e[16]=r,e[17]=x):x=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})}),e[18]=y):y=e[18];let h;e[19]!==o||e[20]!==E||e[21]!==x||e[22]!==g?(h=(0,u.jsx)("button",{"aria-label":g,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":E,onClick:o,title:x,type:"button",children:y}),e[19]=o,e[20]=E,e[21]=x,e[22]=g,e[23]=h):h=e[23];let S;return e[24]!==l||e[25]!==h||e[26]!==a||e[27]!==v?(S=(0,u.jsxs)("span",{className:"flex shrink-0 items-center gap-1","data-testid":l,role:"group",children:[a,v,h]}),e[24]=l,e[25]=h,e[26]=a,e[27]=v,e[28]=S):S=e[28],S},"Zn"),no=i(s=>{let e=(0,X.c)(47),{active:n,canClose:t,onClose:o,onMenu:r,onRename:l,onSelect:d,tab:a}=s,c=se(),[m,p]=(0,j.useState)(!1),[f,v]=(0,j.useState)(!1),g;e[0]!==r||e[1]!==a.id?(g=i(z=>{r(a.id,z)},"b"),e[0]=r,e[1]=a.id,e[2]=g):g=e[2];let E=g,x;e[3]!==d||e[4]!==a.id?(x=i(()=>{d(a.id)},"m"),e[3]=d,e[4]=a.id,e[5]=x):x=e[5];let y=x,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i(()=>{p(!0)},"p"),e[6]=h):h=e[6];let S=h,w;e[7]!==o||e[8]!==a?(w=i(z=>{z.stopPropagation(),lt(a)?v(!0):o(a.id)},"v"),e[7]=o,e[8]=a,e[9]=w):w=e[9];let C=w,b;e[10]!==o||e[11]!==a.id?(b=i(z=>{z.stopPropagation(),v(!1),o(a.id)},"h"),e[10]=o,e[11]=a.id,e[12]=b):b=e[12];let k=b,N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=i(z=>{z.stopPropagation(),v(!1)},"T"),e[13]=N):N=e[13];let R=N,q;e[14]!==l||e[15]!==a.id?(q=i(z=>{l(a.id,z),p(!1)},"R"),e[14]=l,e[15]=a.id,e[16]=q):q=e[16];let T=q,L;e[17]===Symbol.for("react.memo_cache_sentinel")?(L=i(()=>{p(!1)},"_"),e[17]=L):L=e[17];let _=L,I;e[18]!==a.name?(I=a.name.trim(),e[18]=a.name,e[19]=I):I=e[19];let H=I,B;e[20]!==c||e[21]!==a.sql?(B=Xn(a.sql,c("Untitled")),e[20]=c,e[21]=a.sql,e[22]=B):B=e[22];let F=B,O=n?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",K;e[23]!==O?(K=ie("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",O),e[23]=O,e[24]=K):K=e[24];let $=`sql-tab-${a.id}`,D;e[25]!==n||e[26]!==T||e[27]!==H||e[28]!==F||e[29]!==m||e[30]!==y||e[31]!==c||e[32]!==a.id?(D=m?(0,u.jsx)(eo,{initial:H,onCancel:_,onCommit:T,placeholder:F,testId:`sql-tab-rename-${a.id}`}):(0,u.jsx)("button",{"aria-pressed":n,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${a.id}`,onClick:y,onDoubleClick:S,title:c("Double-click to rename"),type:"button",children:H===""?F:H}),e[25]=n,e[26]=T,e[27]=H,e[28]=F,e[29]=m,e[30]=y,e[31]=c,e[32]=a.id,e[33]=D):D=e[33];let A;e[34]!==t||e[35]!==k||e[36]!==f||e[37]!==C||e[38]!==c||e[39]!==a.id?(A=t&&(f?(0,u.jsx)(to,{idBase:a.id,onDiscard:k,onKeep:R}):(0,u.jsx)("button",{"aria-label":c("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${a.id}`,onClick:C,title:c("Close tab"),type:"button",children:(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})),e[34]=t,e[35]=k,e[36]=f,e[37]=C,e[38]=c,e[39]=a.id,e[40]=A):A=e[40];let Q;return e[41]!==E||e[42]!==K||e[43]!==$||e[44]!==D||e[45]!==A?(Q=(0,u.jsxs)("div",{className:K,"data-testid":$,onContextMenu:E,children:[D,A]}),e[41]=E,e[42]=K,e[43]=$,e[44]=D,e[45]=A,e[46]=Q):Q=e[46],Q},"es"),oo=i(s=>{let e=(0,X.c)(43),{model:n,onSelect:t}=s,o=se(),{activeTab:r,addEditorTab:l,cancelBulk:d,closeEditorTab:a,closeTabMenu:c,confirmBulk:m,menuStyle:p,onBackdropContextMenu:f,onCloseAll:v,onCloseOthers:g,onCloseToRight:E,openTabMenu:x,pendingBulk:y,renameTab:h,tabMenu:S,tabs:w}=n,C;if(e[0]!==r||e[1]!==a||e[2]!==t||e[3]!==x||e[4]!==h||e[5]!==w){let I;e[7]!==r||e[8]!==a||e[9]!==t||e[10]!==x||e[11]!==h||e[12]!==w.length?(I=i(H=>(0,u.jsx)(no,{active:H.id===r.id,canClose:w.length>1,onClose:a,onMenu:x,onRename:h,onSelect:t,tab:H},H.id),"A"),e[7]=r,e[8]=a,e[9]=t,e[10]=x,e[11]=h,e[12]=w.length,e[13]=I):I=e[13],C=w.map(I),e[0]=r,e[1]=a,e[2]=t,e[3]=x,e[4]=h,e[5]=w,e[6]=C}else C=e[6];let b;e[14]!==o?(b=o("New tab"),e[14]=o,e[15]=b):b=e[15];let k=w.length>=De,N;e[16]!==o?(N=o("New tab"),e[16]=o,e[17]=N):N=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[18]=R):R=e[18];let q;e[19]!==l||e[20]!==b||e[21]!==k||e[22]!==N?(q=(0,u.jsx)("button",{"aria-label":b,className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:k,onClick:l,title:N,type:"button",children:R}),e[19]=l,e[20]=b,e[21]=k,e[22]=N,e[23]=q):q=e[23];let T;e[24]!==C||e[25]!==q?(T=(0,u.jsxs)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[C,q]}),e[24]=C,e[25]=q,e[26]=T):T=e[26];let L;e[27]!==d||e[28]!==c||e[29]!==m||e[30]!==p||e[31]!==f||e[32]!==v||e[33]!==g||e[34]!==E||e[35]!==y||e[36]!==o||e[37]!==S||e[38]!==w?(L=S!==null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:c,onContextMenu:f,role:"presentation"}),(0,u.jsx)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:p,children:y===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:w.length<=1,onClick:g,role:"menuitem",type:"button",children:o("Close other tabs")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:w.findIndex(I=>I.id===S.id)>=w.length-1,onClick:E,role:"menuitem",type:"button",children:o("Close tabs to the right")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:v,role:"menuitem",type:"button",children:o("Close all tabs")})]}):(0,u.jsxs)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,u.jsx)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:o("Discard unsaved tabs?")}),(0,u.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:m,type:"button",children:o("Discard")}),(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:d,type:"button",children:o("Cancel")})]})]})})]}),e[27]=d,e[28]=c,e[29]=m,e[30]=p,e[31]=f,e[32]=v,e[33]=g,e[34]=E,e[35]=y,e[36]=o,e[37]=S,e[38]=w,e[39]=L):L=e[39];let _;return e[40]!==T||e[41]!==L?(_=(0,u.jsxs)(u.Fragment,{children:[T,L]}),e[40]=T,e[41]=L,e[42]=_):_=e[42],_},"ts"),ro=me(he.runSql),so="lunora-studio-sql-split-view",lo=i(()=>ge(at[0]?.sql??""),"os"),io=i(()=>performance.now(),"ls"),ao=i(()=>{let s=(0,X.c)(2),e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,s[0]=e):e=s[0];let n=(0,j.useRef)(e),t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t={advance:i(o=>{n.current.set(o,(n.current.get(o)??0)+1)},"advance"),begin:i(o=>{let r=n.current.get(o)??0;return()=>(n.current.get(o)??0)===r},"begin")},s[1]=t):t=s[1],t},"rs"),Do=i(({initialShardKey:s,now:e=io})=>{let n=xe(),t=En(lo),{activeTab:o,output:r,patchActiveOutput:l,patchActiveTab:d,setActiveTabId:a,unlinkQuery:c}=t,m=ao(),p=Dn({loadIntoActiveTab:i((W,J)=>{m.advance(o.id),d({activeId:J,sql:W}),l({chart:void 0,durationMs:void 0,error:null,failed:void 0,result:null,running:!1,script:void 0})},"loadIntoActiveTab"),unlinkQuery:c}),{recordHistory:f,updateQuerySql:v}=p,g=o.sql,{activeId:E}=o,{chart:x,error:y,failed:h,result:S,running:w}=r,C=r.pane,[b,k]=(0,j.useState)(s??""),[N,R]=ye(so,!1),{probe:q,schema:T}=mn(b),L=i(W=>{d({sql:W}),E!==null&&v(E,W)},"L"),_=Vt(g,T,b),I=We(b),H=i(()=>{S!==null&&ae((async()=>{let W=await I.inferChart({columns:S.columns,rowCount:S.rowCount,types:Object.fromEntries(S.columns.map(J=>[J,typeof(S.rows[0]?.[J]??"")]))});l({chart:W})})())},"W"),B=i(async W=>{let J=e();try{let G=await n.query(ro,{sql:W},fe(b)),ee=e()-J;return f(W),{durationMs:ee,error:null,result:G,sql:W}}catch(G){return{error:Ae(G),result:null,sql:W}}},"K"),F=i(async W=>{if(g.trim()==="")return;let J=m.begin(o.id);l({running:!0});let G=W==="explain"?_e(St(g),0):tt(g),ee=[];for(let P of G){let V={error:P.rejection?.message??"",result:null,sql:P.sql};ee.push(P.rejection===void 0?await B(P.sql):V)}if(Oe(b),!J())return;let le=Math.max(ee.length-1,0),te=ee[le];l({chart:void 0,durationMs:te?.durationMs,error:te?.error??null,failed:te?.error===null||te===void 0?void 0:{error:te.error,sql:te.sql},pane:W,result:te?.result??null,running:!1,script:ee.length>1?{runs:ee,selected:le}:void 0})},"$"),O=i(W=>{let J=r.script?.runs,G=J?.[W];J===void 0||G===void 0||l({chart:void 0,durationMs:G.durationMs,error:G.error,failed:G.error===null?void 0:{error:G.error,sql:G.sql},result:G.result,script:{runs:J,selected:W}})},"F"),K=i(()=>{ae(F("results"))},"H"),$=bn({inlineEditEnabled:!I.unavailable,onSubmit:i(()=>{ae(F(r.pane))},"onSubmit"),probe:q,schema:T,setDraft:L}),{closeAutocomplete:D,closeInlineEdit:A}=$,Q=i(()=>{L(Tt(g))},"P"),z=i(W=>{D(),A(),a(W)},"oe"),re=i(()=>{l({pane:"results"})},"Z"),Z=i(()=>{ae(F("explain"))},"ne"),oe=i(()=>{l({pane:"chart"})},"q"),M=i(()=>{R(!N)},"j"),Y=N?"flex min-h-0 flex-1 flex-row":"flex min-h-0 flex-1 flex-col",U=N?"flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border":"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border";return(0,u.jsxs)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[(0,u.jsx)(Gn,{activeId:E,history:p.history,listRef:p.listRef,onClearHistory:p.clearHistory,onDelete:p.deleteQuery,onLoadHistory:p.loadFromHistory,onLoadTemplate:p.loadTemplate,onNew:p.newQuery,onSearchChange:p.onSearchChange,onSelect:p.selectQuery,onToggleRememberHistory:p.setRememberHistory,queries:p.queries,rememberHistory:p.rememberHistory,search:p.search}),(0,u.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,u.jsx)(oo,{model:t,onSelect:z}),(0,u.jsxs)("div",{className:Y,children:[(0,u.jsx)(Qn,{assistant:I,autocomplete:$.autocompleteState,diagnostics:_,draft:g,editorRef:$.editorRef,failed:h,gutterRef:$.gutterRef,handlers:$.handlers,inlineEdit:$.inlineEdit,listboxId:$.listboxId,onAcceptInlineEdit:$.acceptInlineEdit,onCancelInlineEdit:$.closeInlineEdit,onGenerated:L,onPickSuggestion:$.onPickSuggestion,onRevealDiagnostic:$.revealDiagnostic,overlayRef:$.overlayRef}),(0,u.jsx)(Un,{assistant:I,chart:x,className:U,durationMs:r.durationMs,error:y,onFormat:Q,onInferChart:H,onRun:K,onSelectStatement:O,onShardKeyChange:k,onShowChart:oe,onShowExplain:Z,onShowResults:re,onToggleSplit:M,pane:C,result:S,running:w,script:r.script,shardKey:b,splitView:N})]})]})]})},"Es");export{Do as SqlEditorPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as k}from"./chunk-BFE2DRP6.js";import{a as n,d as v,f as N,g as z}from"./chunk-OXFKZ4BM.js";var y=v(N(),1);var u=v(z(),1);var C={dialog:"fixed inset-0 z-[1000] flex justify-center bg-black/20 pt-[10vh]",drawer:"fixed inset-0 z-[1000] flex justify-end bg-black/20"},I={dialog:"flex h-fit w-[min(28rem,92vw)] flex-col gap-3 rounded-lg border border-border bg-background p-4 shadow-xl",drawer:"flex h-full w-[min(34rem,100vw)] flex-col gap-4 overflow-auto border-l border-border bg-background p-4 shadow-xl"},A=n(j=>{let e=(0,y.c)(18),{className:i,children:c,label:b,onClose:r,panelTestId:f,testId:g,variant:h}=j,o;e[0]!==r?(o=n(s=>{s.target===s.currentTarget&&r()},"r"),e[0]=r,e[1]=o):o=e[1];let m=o,t;e[2]!==r?(t=n(s=>{s.key==="Escape"&&r()},"a"),e[2]=r,e[3]=t):t=e[3];let p=t,x=C[h],w=I[h],l;e[4]!==i||e[5]!==w?(l=k(w,i),e[4]=i,e[5]=w,e[6]=l):l=e[6];let a;e[7]!==c||e[8]!==b||e[9]!==f||e[10]!==l?(a=(0,u.jsx)("div",{"aria-label":b,className:l,"data-testid":f,role:"dialog",children:c}),e[7]=c,e[8]=b,e[9]=f,e[10]=l,e[11]=a):a=e[11];let d;return e[12]!==m||e[13]!==p||e[14]!==x||e[15]!==a||e[16]!==g?(d=(0,u.jsx)("div",{className:x,"data-testid":g,onClick:m,onKeyDown:p,role:"presentation",children:a}),e[12]=m,e[13]=p,e[14]=x,e[15]=a,e[16]=g,e[17]=d):d=e[17],d},"_");export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Z}from"./chunk-5DNGK3NT.js";import{a as te}from"./chunk-FXPAJDES.js";import{a as Y}from"./chunk-XST3UEHU.js";import{b as X}from"./chunk-SLIDAWNX.js";import{a as W}from"./chunk-DBVJ5VLI.js";import"./chunk-6M7FLLMT.js";import{i as D}from"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{b as ae,c as ne}from"./chunk-WS36BO4R.js";import{a as q,b as ee}from"./chunk-BPEB4KFE.js";import{a as G}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as I}from"./chunk-6UTZXEW3.js";import{c as _}from"./chunk-4DAKKAK7.js";import{m as V}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import"./chunk-HHRYM6UW.js";import"./chunk-JSDKOE4U.js";import{l as M,n as C,o as A,u as Q,y as N}from"./chunk-BFE2DRP6.js";import{a as l,d as j,e as he,f as me,g as pe}from"./chunk-OXFKZ4BM.js";var E=j(me(),1);var c=j(he(),1);var S=j(pe(),1);var ge=l(t=>{let{suggestedIndex:e,table:i}=t;if(typeof i!="string"||i.length===0||typeof e!="object"||e===null)return!1;let{fields:a,name:n}=e;return!Array.isArray(a)||a.length===0||a.some(s=>typeof s!="string"||s.length===0)?!1:typeof n=="string"&&n.length>0},"ye"),be=l((t,e)=>`.index(${JSON.stringify(t)}, [${e.map(i=>JSON.stringify(i)).join(", ")}])`,"ge"),ye=l(t=>{let e=(0,E.c)(19),{fields:i,indexName:a,table:n,testId:s}=t,u=M(),[h,f]=(0,c.useState)(null),m;e[0]!==i||e[1]!==a?(m=l(()=>{let b=be(a,i),$="navigator"in globalThis?globalThis.navigator.clipboard:void 0;if($===void 0){f({copied:!1,declaration:b});return}N($.writeText(b).then(()=>(f({copied:!0,declaration:b}),!0)),()=>{f({copied:!1,declaration:b})})},"m"),e[0]=i,e[1]=a,e[2]=m):m=e[2];let x=m;if(h!==null){let b;return e[3]!==h.copied||e[4]!==h.declaration||e[5]!==u||e[6]!==n||e[7]!==s?(b=h.copied?(0,S.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`${s}-applied`,children:u("Index declaration copied \u2014 add it to {table} in lunora/schema.ts.",{table:n})}):(0,S.jsxs)("span",{className:"flex flex-col gap-1 text-xs text-muted-foreground","data-testid":`${s}-manual`,children:[u("Could not reach the clipboard \u2014 add this to {table} in lunora/schema.ts:",{table:n}),(0,S.jsx)("code",{className:"font-mono break-all select-all",children:h.declaration})]}),e[3]=h.copied,e[4]=h.declaration,e[5]=u,e[6]=n,e[7]=s,e[8]=b):b=e[8],b}let T;e[9]!==u?(T=u("Copy?"),e[9]=u,e[10]=T):T=e[10];let p;e[11]!==u||e[12]!==n?(p=u("Copy index declaration for {table}",{table:n}),e[11]=u,e[12]=n,e[13]=p):p=e[13];let w;return e[14]!==x||e[15]!==T||e[16]!==p||e[17]!==s?(w=(0,S.jsx)(te,{confirmLabel:T,onConfirm:x,testId:s,children:p}),e[14]=x,e[15]=T,e[16]=p,e[17]=s,e[18]=w):w=e[18],w},"ve"),xe=l((t,e)=>{let i=new Map;for(let a of e){let n=`${a.table} ${a.index}`;i.set(n,(i.get(n)??0)+a.reads)}return t.map(a=>({index:a.index,reads:i.get(`${a.table} ${a.index}`)??0,table:a.table}))},"Se"),ve=l(t=>{let e=new Map;for(let i of t)for(let a of i.scannedTables??[])e.set(a.table,(e.get(a.table)??0)+a.scans);return[...e].map(([i,a])=>({scans:a,table:i}))},"Te"),ie=l((t,e)=>e.map(i=>({index:i.name,table:t})),"P"),we=l(t=>{let e=xe(t.declaredIndexes??[],t.indexHits??[]),i=ve(t.functions??[]),a=t.shardTraffic??[],n=t.analyticsMetrics,s=n&&n.indexHits.length>0?n.indexHits:e,u=n&&n.tableScans.length>0?n.tableScans:i,h=n&&n.shardTraffic.length>0?n.shardTraffic:a,f=ne({indexHits:s,schema:{tables:[]},shardTraffic:h,tableScans:u},{lints:ae,source:"runtime"}),m=t.suppressHotScanTables;return(m===void 0?f:f.filter(x=>!(x.metadata.kind==="hot_scan"&&typeof x.metadata.table=="string"&&m.has(x.metadata.table)))).map(x=>q(x))},"we"),Se=C(I.listTables),Te=C(I.listTableIndexes),Ie=C(I.listTablesIndexes),B=l(t=>`${(t*100).toFixed(1)}%`,"H"),re=l(t=>`${(t/1e3).toFixed(2)}s`,"V"),$e=l(t=>{if(t.length<=1)return t[0]??"";let e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`},"Ne"),ke=l((t,e)=>({"high-error-rate":t("High error rate"),"high-evictions":t("High cache eviction rate"),"high-write-contention":t("High write contention"),"low-cache-hit-rate":t("Low cache hit rate"),"missing-index":t("Missing index"),"slow-function":t("Slow function"),"storage-headroom":t("Storage headroom")})[e.kind],"ke"),se=l((t,e)=>({"high-error-rate":t("{rate} of calls failed.",{rate:B(e.value)}),"high-evictions":t("{count} entries evicted recently.",{count:e.value}),"high-write-contention":t("{rate} of calls hit a write conflict \u2014 consider sharding to cut contention.",{rate:B(e.value)}),"low-cache-hit-rate":t("{rate} hit rate over recent traffic.",{rate:B(e.value)}),"missing-index":t("Slowest call took {duration} \u2014 it full-scanned {tables} with no index.",{duration:re(e.value),tables:$e(e.tables??[])}),"slow-function":t("Slowest call took {duration}.",{duration:re(e.value)}),"storage-headroom":t("{size} of the 10 GiB per-shard ceiling \u2014 plan a .shardBy() migration while it still has runway.",{size:Q(e.value)})})[e.kind],"U"),Ne=l(t=>{let e=(0,E.c)(10),{onJump:i,table:a}=t,n=M(),s;e[0]!==i||e[1]!==a?(s=l(()=>{i(a)},"i"),e[0]=i,e[1]=a,e[2]=s):s=e[2];let u=s,h=`in-add-index-${a}`,f;e[3]!==n||e[4]!==a?(f=n("Add index on {table}",{table:a}),e[3]=n,e[4]=a,e[5]=f):f=e[5];let m;return e[6]!==u||e[7]!==h||e[8]!==f?(m=(0,S.jsx)(G,{"data-testid":h,onClick:u,size:"sm",type:"button",variant:"outline",children:f}),e[6]=u,e[7]=h,e[8]=f,e[9]=m):m=e[9],m},"Be"),ze=l(({initialShardKey:t,loadShardTraffic:e})=>{let i=V(),a=D(),n=M(),{queryShardKey:s,setShardKey:u,shardKey:h}=Z(t),[f,m]=(0,c.useState)(null),[x,T]=(0,c.useState)(null),p=(0,c.useRef)(""),w=_(I.getMetrics,{},{live:!0,shardKey:s}),b=_(I.getFunctionStats,{},{live:!0,shardKey:s}),$=_(I.getAdvisories,{},{live:!0,shardKey:s}),L=w.data??null,H=b.data?.functions??null,F=$.data?.advisories??null,J=w.data?.indexHits??null,O=w.error!==null&&b.error!==null?w.error:null,oe=e??(r=>i.shardTraffic(r)),le=l(async(r,y)=>{let o=r[0];if(o===void 0||o===""){p.current===y&&T(null);return}try{let g=await oe(o);if(p.current!==y)return;let d=new Map;for(let v of g.shards)d.has(v.shardKey)||d.set(v.shardKey,{requests:v.requests,shardKey:v.shardKey});T([...d.values()])}catch{p.current===y&&T(null)}},"Y"),de=l(async(r,y)=>{let o=await Promise.allSettled(r.map(async d=>[d,await i.query(Te,{table:d},A(y))])),g=[];for(let d of o)if(d.status==="fulfilled"){let[v,k]=d.value;g.push(...ie(v,k.indexes))}return g},"Z"),z=(0,c.useEffectEvent)(async r=>{p.current=r;let y=[];try{let o=await i.query(Se,{},A(r));if(p.current!==r)return;X(r),y=o.map(d=>d.name);let g=[];if(y.length>0)try{let d=await i.query(Ie,{tables:y},A(r));if(p.current!==r)return;for(let[v,k]of Object.entries(d.indexesByTable))g.push(...ie(v,k))}catch{if(g=await de(y,r),p.current!==r)return}m(g)}catch{p.current===r&&m(null)}await le(y,r)});(0,c.useEffect)(()=>{N(z(s))},[s]);let ce=(0,c.useEffectEvent)(()=>{w.refetch(),b.refetch(),$.refetch(),N(z(s))});(0,c.useEffect)(()=>{let r=l(()=>{document.visibilityState==="visible"&&ce()},"r");return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[]);let U=(0,c.useCallback)(r=>{N(a({search:{table:r},to:"/schema"}))},[a]),K=(0,c.useMemo)(()=>W(L,H),[H,L]),P=(0,c.useMemo)(()=>new Set(K.filter(r=>r.kind==="missing-index").flatMap(r=>r.tables??[])),[K]),R=(0,c.useMemo)(()=>we({declaredIndexes:f??[],functions:H,indexHits:J,shardTraffic:x,suppressHotScanTables:P}),[f,H,J,P,x]),ue=(0,c.useMemo)(()=>{let r=K.map(o=>{let g=o.kind==="missing-index"?o.tables??[]:[];return{action:g.length>0?g.map(d=>(0,S.jsx)(Ne,{onJump:U,table:d},d)):void 0,description:o.message===void 0?se(n,o):`${se(n,o)} \u2014 ${o.message}`,entity:o.fn,issueType:ke(n,o),key:`${o.kind}:${o.fn??""}`,level:o.severity}}),y=new Set(["unindexed_foreign_key","unindexed_relation_target"]);return[...(F??[]).map(o=>{let g=q(o);if(y.has(o.name)&&ge(o.metadata)){let{table:d,suggestedIndex:v}=o.metadata,k=`in-apply-index-${d}-${v.name}`;return{...g,action:(0,S.jsx)(ye,{fields:v.fields,indexName:v.name,table:d,testId:k})}}return g}),...R,...r]},[F,K,U,R,n]),fe=(0,S.jsx)(Y,{onChange:u,testId:"in-shard-input",value:h});return(0,S.jsx)(ee,{error:O,errorSource:O===null?void 0:w.errorSource,rows:ue,testId:"lunora-insights",toolbar:fe})},"Ue");export{ze as InsightsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as de}from"./chunk-UYEZR3BI.js";import{a as te,b as re,c as ne}from"./chunk-YHTHRYP5.js";import"./chunk-6M7FLLMT.js";import{b as Y}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as ae}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as ee}from"./chunk-6UTZXEW3.js";import{c as Z}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as le,b as oe,c as se,d as H,e as z,f as G}from"./chunk-HHRYM6UW.js";import{a as P,e as q}from"./chunk-JSDKOE4U.js";import{l as X}from"./chunk-BFE2DRP6.js";import{a as g,d as W,f as ce,g as me}from"./chunk-OXFKZ4BM.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
|
+
import{a as re}from"./chunk-KYAG2YMF.js";import{a as X}from"./chunk-5DNGK3NT.js";import{a as V}from"./chunk-XST3UEHU.js";import"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as R}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as O}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as Y}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as Q}from"./chunk-6UTZXEW3.js";import{c as J}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as G}from"./chunk-XMSNLMWU.js";import{a as Z,b as ee,c as te,d as P,e as n,f as o}from"./chunk-HHRYM6UW.js";import{a as U,e as W}from"./chunk-JSDKOE4U.js";import{C as H,h as L,l as z}from"./chunk-BFE2DRP6.js";import{a as l,d as B,e as de,f as me,g as he}from"./chunk-OXFKZ4BM.js";var se=B(me(),1),le=B(de(),1);var t=B(he(),1);var ue={action:"outline",mutation:"default",query:"secondary"},ae=l(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"q"),fe=l(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"de"),pe=l(r=>{let e=r.conflicts??0;return r.calls===0?"\u2014":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},"me"),xe={calls:l((r,e)=>e.calls-r.calls,"calls"),recent:l((r,e)=>e.lastCalledAt-r.lastCalledAt,"recent"),slowest:l((r,e)=>e.maxDurationMs-r.maxDurationMs,"slowest")},Ee=l(r=>{let e=(0,se.c)(47),{functions:K,initialShardKey:ne}=r,s=z(),{queryShardKey:_,setShardKey:N,shardKey:v}=X(ne),[i,oe]=(0,le.useState)("recent"),w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];let C;e[1]!==_?(C={live:!0,shardKey:_},e[1]=_,e[2]=C):C=e[2];let{data:ie,error:c,errorSource:S,liveError:b}=J(Q.getFunctionStats,w,C),k=ie?.functions??null,$;e[3]!==K?($=new Map((K??[]).map(ge)),e[3]=K,e[4]=$):$=e[4];let T=$,F;e[5]===Symbol.for("react.memo_cache_sentinel")?(F=l(M=>{oe(M.currentTarget.dataset.sort)},"E"),e[5]=F):F=e[5];let ce=F,I;if(e[6]!==c||e[7]!==S||e[8]!==T||e[9]!==b||e[10]!==N||e[11]!==v||e[12]!==i||e[13]!==k||e[14]!==s){let M=k===null?[]:k.toSorted(xe[i]),d;e[16]!==s?(d=s("Recent"),e[16]=s,e[17]=d):d=e[17];let m;e[18]!==d?(m={key:"recent",label:d},e[18]=d,e[19]=m):m=e[19];let h;e[20]!==s?(h=s("Most called"),e[20]=s,e[21]=h):h=e[21];let u;e[22]!==h?(u={key:"calls",label:h},e[22]=h,e[23]=u):u=e[23];let f;e[24]!==s?(f=s("Slowest"),e[24]=s,e[25]=f):f=e[25];let p;e[26]!==f?(p={key:"slowest",label:f},e[26]=f,e[27]=p):p=e[27];let A;e[28]!==p||e[29]!==m||e[30]!==u?(A=[m,u,p],e[28]=p,e[29]=m,e[30]=u,e[31]=A):A=e[31];let j=A,x;e[32]!==N||e[33]!==v?(x=(0,t.jsx)(V,{onChange:N,testId:"fs-shard-input",value:v}),e[32]=N,e[33]=v,e[34]=x):x=e[34];let g;e[35]!==b?(g=(0,t.jsx)(re,{message:b,prefix:"fs"}),e[35]=b,e[36]=g):g=e[36];let y;e[37]!==j||e[38]!==i?(y=(0,t.jsx)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:j.map(a=>(0,t.jsx)(R,{"data-sort":a.key,"data-testid":`fs-sort-${a.key}`,onClick:ce,size:"sm",type:"button",variant:i===a.key?"secondary":"ghost",children:a.label},a.key))}),e[37]=j,e[38]=i,e[39]=y):y=e[39];let D;e[40]!==x||e[41]!==g||e[42]!==y?(D=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[x,g,y]}),e[40]=x,e[41]=g,e[42]=y,e[43]=D):D=e[43];let E;e[44]!==c||e[45]!==S?(E=c!==null&&(0,t.jsx)(Y,{error:S,testId:"fs-error"}),e[44]=c,e[45]=S,e[46]=E):E=e[46],I=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[D,E,k!==null&&M.length===0&&c===null&&(0,t.jsx)(G,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M3 3v18h18"}),(0,t.jsx)("path",{d:"M7 14l4-4 3 3 5-6"})]}),testId:"fs-empty",title:s("No functions have run on this shard yet.")}),M.length>0&&(0,t.jsx)(U,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"px-0",children:(0,t.jsxs)(Z,{"data-testid":"fs-table",children:[(0,t.jsx)(ee,{children:(0,t.jsxs)(P,{children:[(0,t.jsx)(n,{children:s("function")}),(0,t.jsx)(n,{children:s("kind")}),(0,t.jsx)(n,{className:"text-right",children:s("calls")}),(0,t.jsx)(n,{className:"text-right",children:s("errors")}),(0,t.jsx)(n,{className:"text-right",children:s("conflicts")}),(0,t.jsx)(n,{className:"text-right",children:s("avg")}),(0,t.jsx)(n,{className:"text-right",children:s("max")}),(0,t.jsx)(n,{children:s("last run")}),(0,t.jsx)(n,{children:s("last error")})]})}),(0,t.jsx)(te,{children:M.map(a=>{let q=T.get(a.path);return(0,t.jsxs)(P,{"data-testid":`fs-row-${a.path}`,children:[(0,t.jsx)(o,{className:"font-medium",children:a.path}),(0,t.jsx)(o,{children:q===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,t.jsx)(O,{variant:ue[q],children:q})}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls}),(0,t.jsx)(o,{className:L("text-right tabular-nums",a.errors>0&&"text-destructive"),children:fe(a)}),(0,t.jsx)(o,{className:L("text-right tabular-nums",(a.conflicts??0)>0&&"text-warning"),children:pe(a)}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls===0?"\u2014":ae(a.totalDurationMs/a.calls)}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls===0?"\u2014":ae(a.maxDurationMs)}),(0,t.jsx)(o,{className:"text-muted-foreground",children:H(a.lastCalledAt,"\u2014")}),(0,t.jsx)(o,{className:"max-w-[24ch] truncate text-destructive",title:a.lastErrorMessage??void 0,children:a.lastErrorMessage??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.path)})})]})})})]}),e[6]=c,e[7]=S,e[8]=T,e[9]=b,e[10]=N,e[11]=v,e[12]=i,e[13]=k,e[14]=s,e[15]=I}else I=e[15];return I},"Ae");function ge(r){return[r.path,r.kind]}l(ge,"fe");export{Ee as FunctionStatsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="https://dash.cloudflare.com/?to=/:account",a=`${s}/workers-and-pages/observability`,r=`${s}/workers-and-pages`,o=`${s}/r2`,e=`${s}/workers/d1`,t=`${s}/workers/durable-objects`;export{a,r as b,o as c,e as d,t as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-OXFKZ4BM.js";var e=i(t=>{let r=Math.floor(t/1e3),o=Math.floor(r/3600),n=Math.floor(r%3600/60),a=r%60;return o>0?`${o.toString()}h ${n.toString()}m`:n>0?`${n.toString()}m ${a.toString()}s`:`${a.toString()}s`},"e"),m=i((t,r)=>{let o=t+r;return o===0?"\u2014":`${(t/o*100).toFixed(1)}%`},"a"),s=i(t=>t<=0?"\u2014":t<1?`${(t*1e3).toFixed(0)}\u03BCs`:t<1e3?`${t.toFixed(1)}ms`:`${(t/1e3).toFixed(2)}s`,"s"),c=i((t,r)=>new Intl.NumberFormat(r,t===0||Math.abs(t)>=1?{currency:"USD",maximumFractionDigits:2,minimumFractionDigits:2,style:"currency"}:{currency:"USD",maximumSignificantDigits:3,style:"currency"}).format(t),"c"),u=i((t,r)=>new Intl.NumberFormat(r,{maximumFractionDigits:0}).format(t),"m");export{e as a,m as b,s as c,c as d,u as e};
|