@lunora/studio 1.0.0-alpha.1 → 1.0.0-alpha.100
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/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +823 -781
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/AdvisorHealthPanel.js +1 -0
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +6 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-Cu_QmzO0.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-DuIU1P8B.js +1 -0
- package/dist/packem_shared/CommandPalette-mPR8-vIm.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-CPNKM0KZ.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-BSmyOO0n.js +1 -0
- package/dist/packem_shared/HomePanel-BUO6BcYQ.js +1 -0
- package/dist/packem_shared/MigrationsPanel-BAnvY79E.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-DXeffPFr.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-pHVlh2xU.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-DG_n-8Pc.js +1 -0
- package/dist/packem_shared/StudioApp-bavavhpe.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-CGcwvlMo.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-D1bPR8FO.d.ts +252 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-B8oDHgnw.js +6 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-BMKx5UdA.js +1 -0
- package/dist/packem_shared/cf-links-Dmg86v1D.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-Ci4-tZkk.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/dropdown-menu-BgS2zw1i.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-_2q2VtVG.js +1 -0
- package/dist/packem_shared/grid-features-Y2YSjhCf.js +6 -0
- package/dist/packem_shared/home-panel-Ir3YHReO.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-zkEvTqy8.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DtUxwVNY.js +1 -0
- package/dist/packem_shared/reference-view-DncEStdm.js +12 -0
- package/dist/packem_shared/result-chart-0VgP_3FP.js +1 -0
- package/dist/packem_shared/schema-diagram-GVgnLWTf.js +2 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-BssZMiFY.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-BNvxiJj_.js +1 -0
- package/dist/packem_shared/stat-card-BGJdhfm6.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-C9Qvg13j.js +2 -0
- package/dist/packem_shared/table-DZAB8cs3.js +2 -0
- package/dist/packem_shared/table-list-sidebar-fz0m_4I4.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-CuZ6WGgo.js +1 -0
- package/dist/packem_shared/use-admin-query-CnnyWJXM.js +1 -0
- package/dist/packem_shared/use-async-submit-B32whHJO.js +1 -0
- package/dist/packem_shared/use-auth-config-0EnNCdLu.js +1 -0
- package/dist/packem_shared/use-shard-key-B2JtNa5m.js +1 -0
- package/dist/packem_shared/use-sql-assistant-Dtw55kKM.js +1 -0
- package/dist/packem_shared/useDebounced-CU-uftxO.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/packem_shared/wire-codec-DkrdsFXO.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2QSHLBCO.js +1 -0
- package/dist/standalone/chunk-322ZP3GW.js +1 -0
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/chunk-3CWGJYBB.js +1 -0
- package/dist/standalone/chunk-3SCGCJYS.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4HNNNIDW.js +1 -0
- package/dist/standalone/chunk-4KIQ5RLS.js +1 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-55PVLIN3.js +1 -0
- package/dist/standalone/chunk-5GQFG6QI.js +6 -0
- package/dist/standalone/chunk-5NCGZJ55.js +8 -0
- package/dist/standalone/chunk-5PQCUZIE.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-6UPCJAAI.js +1 -0
- package/dist/standalone/chunk-6UPIWTCN.js +1 -0
- package/dist/standalone/chunk-6V27P65N.js +6 -0
- package/dist/standalone/chunk-7LJL6UC2.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-AB5WGAX6.js +4 -0
- package/dist/standalone/chunk-APXXEXIX.js +1 -0
- package/dist/standalone/chunk-AREBQI6D.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BQNVN2OD.js +1 -0
- package/dist/standalone/chunk-BUVIRYQM.js +1 -0
- package/dist/standalone/chunk-C2OHUG2J.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-CJLOWFCK.js +4 -0
- package/dist/standalone/chunk-CZZWYUTR.js +1 -0
- package/dist/standalone/chunk-DB2D42KJ.js +1 -0
- package/dist/standalone/chunk-DBCMZ4NF.js +1 -0
- package/dist/standalone/chunk-DGRAPESO.js +1 -0
- package/dist/standalone/chunk-EALHAMLB.js +3 -0
- package/dist/standalone/chunk-EIK3BLGV.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-EV2NKHXP.js +1 -0
- package/dist/standalone/chunk-F6W6WUAJ.js +1 -0
- package/dist/standalone/chunk-F7IRBXWY.js +1 -0
- package/dist/standalone/chunk-FKAUVTSS.js +1 -0
- package/dist/standalone/chunk-FMM3XUZH.js +4 -0
- package/dist/standalone/chunk-FURI47Z2.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GGADAESO.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GRTTHN6U.js +1 -0
- package/dist/standalone/chunk-GVSKCIJR.js +1 -0
- package/dist/standalone/chunk-HGSIVV32.js +59 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-I6A5C46N.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IGCNMZSB.js +1 -0
- package/dist/standalone/chunk-IUYFXK4X.js +19 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-IVQUDVQV.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-JXF2J6QZ.js +3 -0
- package/dist/standalone/chunk-JYYXXMLM.js +1 -0
- package/dist/standalone/chunk-K3PSOZXH.js +1 -0
- package/dist/standalone/chunk-KESD5PH6.js +1 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LUIZB427.js +1 -0
- package/dist/standalone/chunk-M3NGYXDR.js +11 -0
- package/dist/standalone/chunk-M43KO276.js +1 -0
- package/dist/standalone/chunk-MKYEFQCA.js +1 -0
- package/dist/standalone/chunk-MLT5MMMY.js +1 -0
- package/dist/standalone/chunk-MQ2GKKQ6.js +13 -0
- package/dist/standalone/chunk-MZ2JNVMR.js +1 -0
- package/dist/standalone/chunk-NE4N6I57.js +1 -0
- package/dist/standalone/chunk-P4BOVBMR.js +1 -0
- package/dist/standalone/chunk-PKEBAPJY.js +1 -0
- package/dist/standalone/chunk-PKSAWP56.js +1 -0
- package/dist/standalone/chunk-PLFTCTMX.js +1 -0
- package/dist/standalone/chunk-PVF5J5UD.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QC2SRHZV.js +1 -0
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/chunk-QNWJ5Q2O.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QZFRZEDN.js +1 -0
- package/dist/standalone/chunk-RMN2JN4S.js +1 -0
- package/dist/standalone/chunk-RTMMB3OY.js +1 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TMGHRD6W.js +1 -0
- package/dist/standalone/chunk-UETRSNZI.js +2 -0
- package/dist/standalone/chunk-UF6XZKV3.js +1 -0
- package/dist/standalone/chunk-UF7QFJ65.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-V76WCOMM.js +1 -0
- package/dist/standalone/chunk-VC4WBYE6.js +1 -0
- package/dist/standalone/chunk-VDW32UET.js +1 -0
- package/dist/standalone/chunk-VJHQW5X5.js +1 -0
- package/dist/standalone/chunk-W25EQ7YQ.js +1 -0
- package/dist/standalone/chunk-WGEZGQZ5.js +1 -0
- package/dist/standalone/chunk-WJQLNYGX.js +1 -0
- package/dist/standalone/chunk-WMLKVJUX.js +1 -0
- package/dist/standalone/chunk-WQH3LT2P.js +1 -0
- package/dist/standalone/chunk-XAEG372C.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XF2B7P5A.js +1 -0
- package/dist/standalone/chunk-XHMHOSGK.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-Y7XGNPT6.js +1 -0
- package/dist/standalone/chunk-YC52XCPK.js +14 -0
- package/dist/standalone/chunk-Z6CJGUSL.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- package/dist/packem_shared/ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js +0 -45
- package/dist/packem_shared/ApiDocsPanel-DpRjJhG5.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-DMIUp-kK.js +0 -229
- package/dist/packem_shared/ApiTab-DURGU15e.js +0 -251
- package/dist/packem_shared/AuditPanel-BC59Nhst.js +0 -212
- package/dist/packem_shared/CommandPalette-Dx_CoB9i.js +0 -373
- package/dist/packem_shared/ConfirmButton-WQVUoGFb.js +0 -59
- package/dist/packem_shared/ConnectionBadge-Bxagrip8.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/DataBrowser-Coz6jJE6.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-WO34fJxy.js +0 -193
- package/dist/packem_shared/FileBrowser-Zcr-Qgxo.js +0 -2932
- package/dist/packem_shared/FunctionRunner-j0Rd5m9t.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-DboBl-XL.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-9MhPEfgN.js +0 -318
- package/dist/packem_shared/HealthPanel-DOIgbUtx.js +0 -640
- package/dist/packem_shared/HomePanel-bdOCNA-p.js +0 -1273
- package/dist/packem_shared/InsightsPanel-DaZPnSgt.js +0 -423
- package/dist/packem_shared/LogsPanel-CWdqAGpQ.js +0 -839
- package/dist/packem_shared/MailPanel-D_EGtDnS.js +0 -447
- package/dist/packem_shared/MetricsPanel-E4Gv6wTO.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-DQdPY9io.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-j2p3HB0s.js +0 -191
- package/dist/packem_shared/PitrPanel-BbBkQR6t.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-Ok1CYYwI.js +0 -159
- package/dist/packem_shared/SchemaViewer-D8XGnp-X.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-Cdm2IxLW.js +0 -79
- package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +0 -176
- package/dist/packem_shared/ShardInput-DNCsT1KW.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +0 -13
- package/dist/packem_shared/Studio-D36od9Oz.js +0 -33
- package/dist/packem_shared/StudioApp-dvywkJ8I.js +0 -383
- package/dist/packem_shared/StudioI18nProvider-Dcajsznk.js +0 -48
- package/dist/packem_shared/TableEditor-DIVDk3vT.js +0 -371
- package/dist/packem_shared/advisor-view-DBlzJi6C.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/createStudioI18n-CgvlmDkN.js +0 -27
- package/dist/packem_shared/data-grid-CCh2Couo.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-DTjG6Sex.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-BBZYexre.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-bPff1O7Y.js +0 -44
- package/dist/packem_shared/reference-view-BCKIoai7.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-CW2y2x9h.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-BDVd7rIV.js +0 -10303
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-aZHLq70w.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as me,e as _}from"./chunk-Y7XGNPT6.js";import{a as ue}from"./chunk-IGCNMZSB.js";import"./chunk-HGSIVV32.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import{a as de}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{b as T}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-VDW32UET.js";import{c as ce}from"./chunk-BQNVN2OD.js";import{f as ne,g as oe}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as A}from"./chunk-WQH3LT2P.js";import{d as D,f as j,g as W,h as X,o as K,r as ie}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as p,e as I,f as Ee,g as ae,h as le,j as E}from"./chunk-3XIESWL4.js";var Z=I(ae(),1);var f=I(Ee(),1);var fe=I(ae(),1);var $=I(le(),1);var Me={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},he=p(()=>{let t=(0,fe.c)(16),e=D(),a=oe(),s;e:switch(a){case"connected":{let o;t[0]!==e?(o=e("Connected"),t[0]=e,t[1]=o):o=t[1],s=o;break e}case"connecting":{let o;t[2]!==e?(o=e("Connecting\u2026"),t[2]=e,t[3]=o):o=t[3],s=o;break e}case"idle":{let o;t[4]!==e?(o=e("Idle"),t[4]=e,t[5]=o):o=t[5],s=o;break e}case"offline":{let o;t[6]!==e?(o=e("Offline"),t[6]=e,t[7]=o):o=t[7],s=o;break e}default:s=a}let l=Me[a],c;t[8]!==l?(c=E("size-2 rounded-full",l),t[8]=l,t[9]=c):c=t[9];let i;t[10]!==c?(i=(0,$.jsx)("span",{"aria-hidden":"true",className:c}),t[10]=c,t[11]=i):i=t[11];let n;return t[12]!==a||t[13]!==i||t[14]!==s?(n=(0,$.jsxs)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[i,s]}),t[12]=a,t[13]=i,t[14]=s,t[15]=n):n=t[15],n},"j");var r=I(le(),1);var Ae={crit:"destructive",ok:"secondary",warn:"default"},U=p((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"_"),Y=p((t,e,a)=>Number.isNaN(t)?"ok":t>=a?"crit":t>=e?"warn":"ok","V"),xe=.01,ve=.05,je=p(t=>{let e=(0,Z.c)(36),{errorCount:a,logsError:s,topErrors:l,worstFunctions:c}=t,i=D(),n;e[0]!==i?(n=i("Functions by error rate"),e[0]=i,e[1]=n):n=e[1];let o;e[2]!==n?(o=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n})}),e[2]=n,e[3]=o):o=e[3];let h;e[4]!==i||e[5]!==c?(h=c.length===0?(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:i("No function activity yet.")}):(0,r.jsx)("ul",{className:"divide-y divide-border",children:c.map(y=>(0,r.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:y.path}),(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)("span",{className:"tabular-nums text-muted-foreground",children:i("{count} calls",{count:y.calls.toString()})}),(0,r.jsx)(T,{variant:Ae[Y(y.errors/y.calls,xe,ve)],children:U(y.errors,y.calls)})]})]},y.path))}),e[4]=i,e[5]=c,e[6]=h):h=e[6];let g;e[7]!==o||e[8]!==h?(g=(0,r.jsxs)(A,{className:"gap-0 py-0","data-testid":"hl-functions",children:[o,h]}),e[7]=o,e[8]=h,e[9]=g):g=e[9];let b;e[10]!==i?(b=i("Recent errors"),e[10]=i,e[11]=b):b=e[11];let d;e[12]!==b?(d=(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b}),e[12]=b,e[13]=d):d=e[13];let u=a>0?"destructive":"outline",x;e[14]!==a||e[15]!==u?(x=(0,r.jsx)(T,{"data-testid":"hl-error-count",variant:u,children:a}),e[14]=a,e[15]=u,e[16]=x):x=e[16];let v;e[17]!==d||e[18]!==x?(v=(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[d,x]}),e[17]=d,e[18]=x,e[19]=v):v=e[19];let k;e[20]!==s?(k=s!==null&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:s}),e[20]=s,e[21]=k):k=e[21];let S;e[22]!==s||e[23]!==i||e[24]!==l.length?(S=s===null&&l.length===0&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:i("No recent errors.")}),e[22]=s,e[23]=i,e[24]=l.length,e[25]=S):S=e[25];let q;e[26]!==l?(q=l.length>0&&(0,r.jsx)("ul",{className:"divide-y divide-border",children:l.map(Ce)}),e[26]=l,e[27]=q):q=e[27];let N;e[28]!==k||e[29]!==S||e[30]!==q||e[31]!==v?(N=(0,r.jsxs)(A,{className:"gap-0 py-0",children:[v,k,S,q]}),e[28]=k,e[29]=S,e[30]=q,e[31]=v,e[32]=N):N=e[32];let w;return e[33]!==N||e[34]!==g?(w=(0,r.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[g,N]}),e[33]=N,e[34]=g,e[35]=w):w=e[35],w},"Se");function Ce(t,e){return(0,r.jsxs)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("time",{className:"shrink-0 text-muted-foreground",children:ie(t.timestamp)}),t.functionPath!==void 0&&(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:t.functionPath})]}),(0,r.jsx)("span",{className:"text-destructive",children:t.message})]},`${t.timestamp.toString()}-${e.toString()}`)}p(Ce,"qe");var pe={completed:0,failed:2,in_progress:1},Ie=p(t=>{let e=0,a=0,s=0,l=0,c=!1,i=[];for(let{metrics:n}of t){if(n===null){l+=1;continue}s+=1,e+=n.requests,a+=n.errors,i.push(...n.history??[]),c||=n.historyTruncated===!0}return{errors:a,failed:l,history:i,historyTruncated:c,reachable:s,requests:e}},"Ee"),De=p(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"Me"),Te=p(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let c=pe[s.status]-pe[l.status];(c>0||c===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"$e"),Pe=j(M.getAuthMetrics),Fe=j(M.getFunctionStats),Le=j(M.getLogs),Re=j(M.getMetrics),ze=j(M.migrationStatus),Oe=5,ge=2e3,Ke=5,_e=.1,$e=.3,He=1,Ue=50,Ge=p((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","_e"),Qe=p(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"ze"),Je=p(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"Ke"),Ve=p((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"He"),be={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},Ne={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},We={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Xe=p(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","Be"),H=p(t=>{let e=(0,Z.c)(19),{chart:a,label:s,level:l,testId:c,value:i}=t,n=be[l],o;e[0]!==n?(o=E("size-1.5 shrink-0 rounded-full",n),e[0]=n,e[1]=o):o=e[1];let h;e[2]!==o?(h=(0,r.jsx)("span",{"aria-hidden":"true",className:o}),e[2]=o,e[3]=h):h=e[3];let g;e[4]!==s||e[5]!==h?(g=(0,r.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[h,s]}),e[4]=s,e[5]=h,e[6]=g):g=e[6];let b=Ne[l],d;e[7]!==b?(d=E("truncate text-2xl font-semibold tabular-nums",b),e[7]=b,e[8]=d):d=e[8];let u;e[9]!==d||e[10]!==c||e[11]!==i?(u=(0,r.jsx)("span",{className:d,"data-testid":c,children:i}),e[9]=d,e[10]=c,e[11]=i,e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==u?(x=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[u,a]}),e[13]=a,e[14]=u,e[15]=x):x=e[15];let v;return e[16]!==g||e[17]!==x?(v=(0,r.jsx)(A,{className:"gap-0 py-0",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,x]})}),e[16]=g,e[17]=x,e[18]=v):v=e[18],v},"O"),Ye=p(async(t,e,a)=>{let s=await Promise.all(a.map(d=>{let u=W(d);return Promise.allSettled([t.query(Re,{},u),t.query(Fe,{},u),t.query(ze,{},u)])})),l=W(e),c=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[i,n,o]=await Promise.allSettled([t.query(Le,{},l),t.query(Pe,{},l),c]),h=s.map(([d,u,x])=>({functions:u.status==="fulfilled"?u.value.functions:[],metrics:d.status==="fulfilled"?d.value:null,migrations:x.status==="fulfilled"?x.value.migrations:[]})),g=Ie(h),b=s[0]?.[0];return{auth:n.status==="fulfilled"?n.value:null,entries:i.status==="fulfilled"?i.value.entries:[],functions:De(h.map(d=>d.functions)),logsError:i.status==="rejected"?X(i.reason):null,metricsError:g.reachable===0&&b?.status==="rejected"?X(b.reason):null,migrations:Te(h.map(d=>d.migrations)),scheduler:o.status==="fulfilled"?o.value:null,totals:g}},"Ge"),Ze=p(t=>{let e=t?.history??[];return{attempts:e.map(a=>a.attempts),failures:e.map(a=>a.failures)}},"Qe"),xt=p(({initialShardKey:t})=>{let e=ne(),a=D(),[s,l]=(0,f.useState)([]),[c,i]=(0,f.useState)(null),[n,o]=(0,f.useState)(null),[h,g]=(0,f.useState)(null),[b,d]=(0,f.useState)([]),[u,x]=(0,f.useState)(null),[v,k]=(0,f.useState)(null),[S,q]=(0,f.useState)([]),[N]=(0,f.useState)(de),w=(0,f.useRef)(!1),y=(0,f.useRef)(!0);(0,f.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let P=t??"",F=(0,f.useCallback)(async()=>{if(w.current)return;w.current=!0;let m=await Ye(e,P,me(P,N));if(!y.current){w.current=!1;return}o(m.totals),g(m.metricsError),d(m.functions),q(m.migrations),l(m.entries),i(m.logsError),x(m.auth),k(m.scheduler),w.current=!1},[e,N,P]);(0,f.useEffect)(()=>{K(F())},[F]);let G=(0,f.useRef)(0),C=(0,f.useRef)(null),ye=p(()=>{let m=Date.now()-G.current;if(m>=ge){G.current=Date.now(),K(F());return}C.current===null&&(C.current=setTimeout(()=>{C.current=null,G.current=Date.now(),K(F())},ge-m))},"de");(0,f.useEffect)(()=>()=>{C.current!==null&&clearTimeout(C.current)},[]);let{data:B,liveError:we}=ce(M.getMetrics,{},{live:!0,shardKey:P});(0,f.useEffect)(()=>{B!==void 0&&ye()},[B]);let ee=s.filter(m=>m.level==="error"),ke=ee.slice(0,Oe),L=Qe(n?.history),te=Ze(u),Se=b.filter(m=>m.calls>0).toSorted((m,V)=>V.errors/V.calls-m.errors/m.calls||V.calls-m.calls).slice(0,Ke),Q=Je(S),qe=n===null||n.requests===0?0:n.errors/n.requests,J=Y(qe,xe,ve),re=u===null?"ok":Y(u.failureRate,_e,$e),se=v===null?"ok":Ge(v.backlog,He,Ue),R=Xe([J,re,se,Q.level]),z,O;return R==="crit"?(z=a("Critical"),O=a("One or more service levels are breached.")):R==="warn"?(z=a("Degraded"),O=a("Some service levels need attention.")):(z=a("All systems healthy"),O=a("All service levels are within target.")),(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxs)(A,{className:"gap-0 py-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:E("flex size-10 shrink-0 items-center justify-center rounded-full",We[R]),children:(0,r.jsx)("span",{className:E("size-3 rounded-full",be[R])})}),(0,r.jsxs)("div",{className:"grid leading-tight",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:z}),(0,r.jsx)("span",{className:"text-[13px] text-muted-foreground",children:O})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[L.requests.length>=2&&(0,r.jsx)(_,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:L.requests,testId:"hl-spark-requests"}),(0,r.jsx)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(n?.requests??0).toString()})]})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")}),(0,r.jsx)("div",{className:E("text-lg font-semibold tabular-nums",Ne[J]),"data-testid":"hl-error-rate",children:n===null?"\u2014":U(n.errors,n.requests)})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(he,{}),(0,r.jsx)(ue,{message:we,prefix:"hl"})]})]})]}),h!==null&&(0,r.jsx)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:h}),h===null&&n?.historyTruncated===!0&&(0,r.jsx)("div",{className:"border-t border-border bg-warning/5 px-4 py-2 text-sm text-muted-foreground","data-testid":"hl-history-truncated",children:a("Showing a partial request/error history \u2014 one or more shards have more data than the trend chart can display.")})]}),(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsx)(H,{chart:L.errors.length>=2?(0,r.jsx)(_,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:L.errors,testId:"hl-spark-errors"}):void 0,label:a("Error rate"),level:J,testId:"hl-slo-errorrate",value:n===null?"\u2014":U(n.errors,n.requests)}),(0,r.jsx)(H,{chart:te.failures.length>=2?(0,r.jsx)(_,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:te.failures,testId:"hl-spark-auth"}):void 0,label:a("Auth failures"),level:re,testId:"hl-slo-auth",value:u===null?"\u2014":U(u.failures,u.attempts)}),(0,r.jsx)(H,{label:a("Scheduler backlog"),level:se,testId:"hl-slo-backlog",value:v===null?"\u2014":v.backlog.toString()}),(0,r.jsx)(H,{label:a("Migrations"),level:Q.level,testId:"hl-slo-migrations",value:Ve(Q,a)})]}),(0,r.jsx)(je,{errorCount:ee.length,logsError:c,topErrors:ke,worstFunctions:Se}),(0,r.jsxs)(A,{className:"gap-0 py-0",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")}),(0,r.jsx)(T,{"data-testid":"hl-shard-count",variant:"outline",children:N.length})]}),N.length>0&&(0,r.jsx)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:N.map(m=>(0,r.jsx)("li",{"data-testid":"hl-shard",children:(0,r.jsx)(T,{variant:"secondary",children:m})},m))})]})]})},"dt");export{xt as HealthPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as y}from"./chunk-CFPZYHPY.js";import{a as C,c as M,e as P}from"./chunk-2OUPA2WJ.js";import{d as T}from"./chunk-6ST5ECQA.js";import{a as o,e as L,f as S,h as z}from"./chunk-3XIESWL4.js";var O=L(S(),1);var w=L(S(),1);var _=w.createContext({register:o(()=>{},"register"),unregister:o(()=>{},"unregister"),subscribeMapChange:o(()=>()=>{},"subscribeMapChange"),elementsRef:{current:[]},nextIndexRef:{current:0}});function F(){return w.useContext(_)}o(F,"useCompositeListContext");var W=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function V(t={}){let{label:n,metadata:r,textRef:s,indexGuessBehavior:N,index:m}=t,{register:x,unregister:p,subscribeMapChange:f,elementsRef:d,labelsRef:h,nextIndexRef:c}=F(),g=O.useRef(-1),[a,i]=O.useState(m??(N===W.GuessFromOrder?()=>{if(g.current===-1){let e=c.current;c.current+=1,g.current=e}return g.current}:-1)),E=O.useRef(null),D=O.useCallback(e=>{if(E.current=e,a!==-1&&e!==null&&(d.current[a]=e,h)){let l=n!==void 0;h.current[a]=l?n:s?.current?.textContent??e.textContent}},[a,d,h,n,s]);return C(()=>{if(m!=null)return;let e=E.current;if(e)return x(e,r),()=>{p(e)}},[m,x,p,r]),C(()=>{if(m==null)return f(e=>{let l=E.current?e.get(E.current)?.index:null;l!=null&&i(l)})},[m,f,i]),{ref:D,index:a}}o(V,"useCompositeListItem");var b=L(S(),1);var v=L(z(),1);function Z(t){let{children:n,elementsRef:r,labelsRef:s,onMapChange:N}=t,m=M(N),x=b.useRef(0),p=T(U).current,f=T(k).current,[d,h]=b.useState(0),c=b.useRef(d),g=M((e,l)=>{f.set(e,l??null),c.current+=1,h(c.current)}),a=M(e=>{f.delete(e),c.current+=1,h(c.current)}),i=b.useMemo(()=>{let e=new Map;return Array.from(f.keys()).filter(u=>u.isConnected).sort(A).forEach((u,I)=>{let R=f.get(u)??{};e.set(u,{...R,index:I})}),e},[f,d]);C(()=>{if(typeof MutationObserver!="function"||i.size===0)return;let e=new MutationObserver(l=>{let u=new Set,I=o(R=>u.has(R)?u.delete(R):u.add(R),"updateDiff");l.forEach(R=>{R.removedNodes.forEach(I),R.addedNodes.forEach(I)}),u.size===0&&(c.current+=1,h(c.current))});return i.forEach((l,u)=>{u.parentElement&&e.observe(u.parentElement,{childList:!0})}),()=>{e.disconnect()}},[i]),C(()=>{c.current===d&&(r.current.length!==i.size&&(r.current.length=i.size),s&&s.current.length!==i.size&&(s.current.length=i.size),x.current=i.size),m(i)},[m,i,r,s,d]),C(()=>()=>{r.current=[]},[r]),C(()=>()=>{s&&(s.current=[])},[s]);let E=M(e=>(p.add(e),()=>{p.delete(e)}));C(()=>{p.forEach(e=>e(i))},[p,i]);let D=b.useMemo(()=>({register:g,unregister:a,subscribeMapChange:E,elementsRef:r,labelsRef:s,nextIndexRef:x}),[g,a,E,r,s,x]);return(0,v.jsx)(_.Provider,{value:D,children:n})}o(Z,"CompositeList");function k(){return new Map}o(k,"createMap");function U(){return new Set}o(U,"createListeners");function A(t,n){let r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}o(A,"sortByDocumentPosition");function re(t){let n=t.getBoundingClientRect(),r=P(t);if(y.env.jsdom)return n;let s=r.getComputedStyle(t,"::before"),N=r.getComputedStyle(t,"::after");if(!(s.content!=="none"||N.content!=="none"))return n;let x=parseFloat(s.width)||0,p=parseFloat(s.height)||0,f=parseFloat(N.width)||0,d=parseFloat(N.height)||0,h=Math.max(n.width,x,f),c=Math.max(n.height,p,d),g=h-n.width,a=c-n.height;return{left:n.left-g/2,right:n.right+g/2,top:n.top-a/2,bottom:n.bottom+a/2}}o(re,"getPseudoElementBounds");function ie(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}o(ie,"isElementDisabled");export{W as a,V as b,Z as c,re as d,ie as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-3XIESWL4.js";var u={highErrorRate:.05,highWriteContention:.1,lowCacheHitRate:.5,minCacheSamples:10,minConflictCalls:5,minErrorCalls:5,slowFunctionMs:1e3},h={error:0,info:2,warning:1},g=o((e,a)=>{let s=[];if(e.maxDurationMs>=a.slowFunctionMs){let n=e.scannedTables??[];n.length>0?s.push({fn:e.path,kind:"missing-index",severity:"warning",tables:n.map(t=>t.table),value:e.maxDurationMs}):s.push({fn:e.path,kind:"slow-function",severity:"info",value:e.maxDurationMs})}e.calls>=a.minErrorCalls&&e.errors/e.calls>=a.highErrorRate&&s.push({fn:e.path,kind:"high-error-rate",message:e.lastErrorMessage??void 0,severity:"error",value:e.errors/e.calls});let r=e.conflicts??0;return r>0&&e.calls>=a.minConflictCalls&&r/e.calls>=a.highWriteContention&&s.push({fn:e.path,kind:"high-write-contention",severity:"warning",value:r/e.calls}),s},"u"),v=o((e,a,s=u)=>{let r=[];if(e?.cache){let{evictions:n,hits:t,misses:c}=e.cache,i=t+c;if(i>=s.minCacheSamples){let l=t/i;l<s.lowCacheHitRate&&r.push({kind:"low-cache-hit-rate",severity:"warning",value:l})}n>0&&n>t&&r.push({kind:"high-evictions",severity:"warning",value:n})}for(let n of a??[])r.push(...g(n,s));return r.toSorted((n,t)=>h[n.severity]-h[t.severity])},"g");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Rs}from"./chunk-T6VMSOBB.js";import{a as ys}from"./chunk-7QIFDWQV.js";import{a as i,e as k,f as W,h as ot}from"./chunk-3XIESWL4.js";var Go=k(W(),1),ue=Go.createContext(null);var Jo=k(W(),1);function D(t){return Jo.useContext(ue)}i(D,"useRouter");var ze=k(W(),1),Mt=ze.createContext(void 0),Yo=ze.createContext(void 0);function pt(t){return t[t.length-1]}i(pt,"last");function Ss(t){return typeof t=="function"}i(Ss,"isFunction");function Y(t,o){return Ss(t)?t(o):t}i(Y,"functionalUpdate");var er=Object.prototype.hasOwnProperty,Xo=Object.prototype.propertyIsEnumerable;function mt(t){for(let o in t)if(er.call(t,o))return!0;return!1}i(mt,"hasKeys");var Ps=i(()=>Object.create(null),"createNull"),gt=i((t,o)=>at(t,o,Ps),"nullReplaceEqualDeep");function at(t,o,e=()=>({}),s=0){if(!1)return o;if(t===o)return t;if(s>500)return o;let r=o,n=Ke(t)&&Ke(r);if(!n&&!(Yt(t)&&Yt(r)))return r;let a=n?t:Zo(t);if(!a)return r;let c=n?r:Zo(r);if(!c)return r;let u=a.length,d=c.length,f=n?new Array(d):e(),l=0;for(let p=0;p<d;p++){let h=n?p:c[p],m=t[h],y=r[h];if(m===y){f[h]=m,(n?p<u:er.call(t,h))&&l++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[h]=y;continue}let g=at(m,y,e,s+1);f[h]=g,g===m&&l++}return u===d&&l===u?t:f}i(at,"replaceEqualDeep");function Zo(t){let o=Object.getOwnPropertyNames(t);for(let r of o)if(!Xo.call(t,r))return!1;let e=Object.getOwnPropertySymbols(t);if(e.length===0)return o;let s=o;for(let r of e){if(!Xo.call(t,r))return!1;s.push(r)}return s}i(Zo,"getEnumerableOwnKeys");function Yt(t){if(!Qo(t))return!1;let o=t.constructor;if(typeof o>"u")return!0;let e=o.prototype;return!(!Qo(e)||!e.hasOwnProperty("isPrototypeOf"))}i(Yt,"isPlainObject");function Qo(t){return Object.prototype.toString.call(t)==="[object Object]"}i(Qo,"hasObjectPrototype");function Ke(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(Ke,"isPlainArray");function st(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,r=t.length;s<r;s++)if(!st(t[s],o[s],e))return!1;return!0}if(Yt(t)&&Yt(o)){let s=e?.ignoreUndefined??!0;if(e?.partial){for(let a in o)if((!s||o[a]!==void 0)&&!st(t[a],o[a],e))return!1;return!0}let r=0;if(!s)r=Object.keys(t).length;else for(let a in t)t[a]!==void 0&&r++;let n=0;for(let a in o)if((!s||o[a]!==void 0)&&(n++,n>r||!st(t[a],o[a],e)))return!1;return r===n}return!1}i(st,"deepEqual");function ct(t){let o,e,s=new Promise((r,n)=>{o=r,e=n});return s.status="pending",s.resolve=r=>{s.status="resolved",s.value=r,o(r),t?.(r)},s.reject=r=>{s.status="rejected",e(r)},s}i(ct,"createControlledPromise");function vt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}i(vt,"isPromise");var xs=/[\x00-\x1f\x7f"<>`{}]/g;function ws(t){return t.replace(xs,o=>"%"+o.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(ws,"sanitizePathSegment");function tr(t){let o;try{o=decodeURI(t)}catch{o=t.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ws(o)}i(tr,"decodeSegment");var qe=["http:","https:","mailto:","tel:"];function ut(t,o){if(!t)return!1;try{let e=new URL(t);return!o.has(e.protocol)}catch{return!1}}i(ut,"isDangerousProtocol");function At(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let o=/%25|%5C/gi,e=0,s="",r;for(;(r=o.exec(t))!==null;)s+=tr(t.slice(e,r.index))+r[0],e=o.lastIndex;s=s+tr(e?t.slice(e):t);let n=!1;return s.startsWith("//")&&(n=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:n}}i(At,"decodePath");function or(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(or,"encodePathLikeUrl");function rr(t,o){if(t===o)return!0;if(t.length!==o.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==o[e])return!1;return!0}i(rr,"arraysEqual");function $(){throw new Error("Invariant failed")}i($,"invariant");function yt(t){let o=new Map,e,s,r=i(n=>{n.next&&(n.prev?(n.prev.next=n.next,n.next.prev=n.prev,n.next=void 0,s&&(s.next=n,n.prev=s)):(n.next.prev=void 0,e=n.next,n.next=void 0,s&&(n.prev=s,s.next=n)),s=n)},"touch");return{get(n){let a=o.get(n);if(a)return r(a),a.value},set(n,a){if(o.size>=t&&e){let u=e;o.delete(u.key),u.next&&(e=u.next,u.next.prev=void 0),u===s&&(s=void 0)}let c=o.get(n);if(c)c.value=a,r(c);else{let u={key:n,value:a,prev:s};s&&(s.next=u),s=u,e||(e=u),o.set(n,u)}},clear(){o.clear(),e=void 0,s=void 0}}}i(yt,"createLRUCache");var St=4,nr=5;function _s(t){let o=t.indexOf("{");if(o===-1)return null;let e=t.indexOf("}",o);return e===-1||o+1>=t.length?null:[o,e]}i(_s,"getOpenAndCloseBraces");function Ye(t,o,e=new Uint16Array(6)){let s=t.indexOf("/",o),r=s===-1?t.length:s,n=t.substring(o,r);if(!n||!n.includes("$"))return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e;if(n==="$"){let c=t.length;return e[0]=2,e[1]=o,e[2]=o,e[3]=c,e[4]=c,e[5]=c,e}if(n.charCodeAt(0)===36)return e[0]=1,e[1]=o,e[2]=o+1,e[3]=r,e[4]=r,e[5]=r,e;let a=_s(n);if(a){let[c,u]=a,d=n.charCodeAt(c+1);if(d===45){if(c+2<n.length&&n.charCodeAt(c+2)===36){let f=c+3,l=u;if(f<l)return e[0]=3,e[1]=o+c,e[2]=o+f,e[3]=o+l,e[4]=o+u+1,e[5]=r,e}}else if(d===36){let f=c+1,l=c+2;return l===u?(e[0]=2,e[1]=o+c,e[2]=o+f,e[3]=o+l,e[4]=o+u+1,e[5]=t.length,e):(e[0]=1,e[1]=o+c,e[2]=o+l,e[3]=o+u,e[4]=o+u+1,e[5]=r,e)}}return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e}i(Ye,"parseSegment");function de(t,o,e,s,r,n,a){a?.(e);let c=s;{let u=e.fullPath??e.from,d=u.length,f=e.options?.caseSensitive??t,l=e.options?.params?.parse??e.options?.parseParams;for(;c<d;){let h=Ye(u,c,o),m,y=c,g=h[5];switch(c=g+1,n++,h[0]){case 0:{let v=u.substring(h[2],h[3]);if(f){let R=r.static?.get(v);if(R)m=R;else{r.static??=new Map;let S=It(e.fullPath??e.from);S.parent=r,S.depth=n,m=S,r.static.set(v,S)}}else{let R=v.toLowerCase(),S=r.staticInsensitive?.get(R);if(S)m=S;else{r.staticInsensitive??=new Map;let P=It(e.fullPath??e.from);P.parent=r,P.depth=n,m=P,r.staticInsensitive.set(R,P)}}break}case 1:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=f&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=!l&&r.dynamic?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(b)m=b;else{let x=Je(1,e.fullPath??e.from,S,P,_);m=x,x.depth=n,x.parent=r,r.dynamic??=[],r.dynamic.push(x)}break}case 3:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=f&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=!l&&r.optional?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(b)m=b;else{let x=Je(3,e.fullPath??e.from,S,P,_);m=x,x.parent=r,x.depth=n,r.optional??=[],r.optional.push(x)}break}case 2:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=f&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=Je(2,e.fullPath??e.from,S,P,_);m=b,b.parent=r,b.depth=n,r.wildcard??=[],r.wildcard.push(b)}}r=m}if(l&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){let h=It(e.fullPath??e.from);h.kind=nr,h.parent=r,n++,h.depth=n,r.pathless??=[],r.pathless.push(h),r=h}let p=(e.path||!e.children)&&!e.isRoot;if(p&&u.endsWith("/")){let h=It(e.fullPath??e.from);h.kind=St,h.parent=r,n++,h.depth=n,r.index=h,r=h}r.parse=l??null,r.priority=e.options?.params?.priority??0,p&&!r.route&&(r.route=e,r.fullPath=e.fullPath??e.from)}if(e.children)for(let u of e.children)de(t,o,u,c,r,n,a)}i(de,"parseSegments");function Ge(t,o){if(t.parse&&!o.parse)return-1;if(!t.parse&&o.parse)return 1;if(t.parse&&o.parse&&(t.priority||o.priority))return o.priority-t.priority;if(t.prefix&&o.prefix&&t.prefix!==o.prefix){if(t.prefix.startsWith(o.prefix))return-1;if(o.prefix.startsWith(t.prefix))return 1}if(t.suffix&&o.suffix&&t.suffix!==o.suffix){if(t.suffix.endsWith(o.suffix))return-1;if(o.suffix.endsWith(t.suffix))return 1}return t.prefix&&!o.prefix?-1:!t.prefix&&o.prefix?1:t.suffix&&!o.suffix?-1:!t.suffix&&o.suffix?1:t.caseSensitive&&!o.caseSensitive?-1:!t.caseSensitive&&o.caseSensitive?1:0}i(Ge,"sortDynamic");function Rt(t){if(t.pathless)for(let o of t.pathless)Rt(o);if(t.static)for(let o of t.static.values())Rt(o);if(t.staticInsensitive)for(let o of t.staticInsensitive.values())Rt(o);if(t.dynamic?.length){t.dynamic.sort(Ge);for(let o of t.dynamic)Rt(o)}if(t.optional?.length){t.optional.sort(Ge);for(let o of t.optional)Rt(o)}if(t.wildcard?.length){t.wildcard.sort(Ge);for(let o of t.wildcard)Rt(o)}}i(Rt,"sortTreeNodes");function It(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}i(It,"createStaticNode");function Je(t,o,e,s,r){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:o,parent:null,parse:null,priority:0,caseSensitive:e,prefix:s,suffix:r}}i(Je,"createDynamicNode");function ir(t,o){let e=It("/"),s=new Uint16Array(6);for(let r of t)de(!1,s,r,1,e,0);Rt(e),o.masksTree=e,o.flatCache=yt(1e3)}i(ir,"processRouteMasks");function ar(t,o){t||="/";let e=o.flatCache.get(t);if(e)return e;let s=Xe(t,o.masksTree);return o.flatCache.set(t,s),s}i(ar,"findFlatMatch");function cr(t,o,e,s,r){t||="/",s||="/";let n=o?`case\0${t}`:t,a=r.singleCache.get(n);return a||(a=It("/"),de(o,new Uint16Array(6),{from:t},1,a,0),r.singleCache.set(n,a)),Xe(s,a,e)}i(cr,"findSingleMatch");function ur(t,o,e=!1){let s=e?t:`nofuzz\0${t}`,r=o.matchCache.get(s);if(r!==void 0)return r;t||="/";let n;try{n=Xe(t,o.segmentTree,e)}catch(a){if(a instanceof URIError)n=null;else throw a}return n&&(n.branch=Ze(n.route)),o.matchCache.set(s,n),n}i(ur,"findRouteMatch");function Cs(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Cs,"trimPathRight");function lr(t,o=!1,e){let s=It(t.fullPath),r=new Uint16Array(6),n={},a={},c=0;return de(o,r,t,1,s,0,u=>{if(e?.(u,c),u.id in n&&$(),n[u.id]=u,c!==0&&u.path){let d=Cs(u.fullPath);(!a[d]||u.fullPath.endsWith("/"))&&(a[d]=u)}c++}),Rt(s),{processedTree:{segmentTree:s,singleCache:yt(1e3),matchCache:yt(1e3),flatCache:null,masksTree:null},routesById:n,routesByPath:a}}i(lr,"processRouteTree");function Xe(t,o,e=!1){let s=t.split("/"),r=Ls(t,s,o,e);if(!r)return null;let[n]=fr(t,s,r);return{route:r.node.route,rawParams:n}}i(Xe,"findMatch");function fr(t,o,e){let s=bs(e.node),r=null,n=Object.create(null),a=e.extract?.part??0,c=e.extract?.node??0,u=e.extract?.path??0,d=e.extract?.segment??0;for(;c<s.length;a++,c++,u++,d++){let f=s[c];if(f.kind===St)break;if(f.kind===nr){d--,a--,u--;continue}let l=o[a],p=u;if(l&&(u+=l.length),f.kind===1){r??=e.node.fullPath.split("/");let h=r[d],m=f.prefix?.length??0;if(h.charCodeAt(m)===123){let y=f.suffix?.length??0,g=h.substring(m+2,h.length-y-1),v=l.substring(m,l.length-y);n[g]=decodeURIComponent(v)}else{let y=h.substring(1);n[y]=decodeURIComponent(l)}}else if(f.kind===3){if(e.skipped&1<<c){a--,u=p-1;continue}r??=e.node.fullPath.split("/");let h=r[d],m=f.prefix?.length??0,y=f.suffix?.length??0,g=h.substring(m+3,h.length-y-1),v=f.suffix||f.prefix?l.substring(m,l.length-y):l;v&&(n[g]=decodeURIComponent(v))}else if(f.kind===2){let h=f,m=t.substring(p+(h.prefix?.length??0),t.length-(h.suffix?.length??0)),y=decodeURIComponent(m);n["*"]=y,n._splat=y;break}}return e.rawParams&&Object.assign(n,e.rawParams),[n,{part:a,node:c,path:u,segment:d}]}i(fr,"extractParams");function Ze(t){let o=[t];for(;t.parentRoute;)t=t.parentRoute,o.push(t);return o.reverse(),o}i(Ze,"buildRouteBranch");function bs(t){let o=Array(t.depth+1);do o[t.depth]=t,t=t.parent;while(t);return o}i(bs,"buildBranch");function Ls(t,o,e,s){if(t==="/"&&e.index)return{node:e.index,skipped:0};let r=!pt(o),n=r&&t!=="/",a=o.length-(r?1:0),c=[{node:e,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],u=null,d=null;for(;c.length;){let f=c.pop(),{node:l,index:p,skipped:h,depth:m,statics:y,dynamics:g,optionals:v}=f,{extract:R,rawParams:S}=f;if(l.kind===2&&l.route&&!fe(d,f))continue;if(l.parse){if(!sr(t,o,f))continue;S=f.rawParams,R=f.extract}s&&l.route&&l.kind!==St&&fe(u,f)&&(u=f);let P=p===a;if(P&&(l.route&&(!n||l.kind===St||l.kind===2)&&fe(d,f)&&(d=f),!l.optional&&!l.wildcard&&!l.index&&!l.pathless))continue;let _=P?void 0:o[p],b;if(P&&l.index){let x={node:l.index,index:p,skipped:h,depth:m+1,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S},w=!0;if(l.index.parse&&(sr(t,o,x)||(w=!1)),w){if(!g&&!v&&!h&&Ms(y,a))return x;fe(d,x)&&(d=x)}}if(l.wildcard)for(let x=l.wildcard.length-1;x>=0;x--){let w=l.wildcard[x],{prefix:C,suffix:M}=w;if(!(C&&(P||!(w.caseSensitive?_:b??=_.toLowerCase()).startsWith(C)))){if(M){if(P)continue;let L=o.slice(p).join("/").slice(-M.length);if((w.caseSensitive?L:L.toLowerCase())!==M)continue}c.push({node:w,index:a,skipped:h,depth:m+1,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}}if(l.optional){let x=h|1<<m,w=m+1;for(let C=l.optional.length-1;C>=0;C--){let M=l.optional[C];c.push({node:M,index:p,skipped:x,depth:w,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}if(!P)for(let C=l.optional.length-1;C>=0;C--){let M=l.optional[C],{prefix:L,suffix:I}=M;if(L||I){let rt=M.caseSensitive?_:b??=_.toLowerCase();if(L&&!rt.startsWith(L)||I&&!rt.endsWith(I))continue}c.push({node:M,index:p+1,skipped:h,depth:w,statics:y,dynamics:g,optionals:v+le(a,p),extract:R,rawParams:S})}}if(!P&&l.dynamic&&_)for(let x=l.dynamic.length-1;x>=0;x--){let w=l.dynamic[x],{prefix:C,suffix:M}=w;if(C||M){let L=w.caseSensitive?_:b??=_.toLowerCase();if(C&&!L.startsWith(C)||M&&!L.endsWith(M))continue}c.push({node:w,index:p+1,skipped:h,depth:m+1,statics:y,dynamics:g+le(a,p),optionals:v,extract:R,rawParams:S})}if(!P&&l.staticInsensitive){let x=l.staticInsensitive.get(b??=_.toLowerCase());x&&c.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+le(a,p),dynamics:g,optionals:v,extract:R,rawParams:S})}if(!P&&l.static){let x=l.static.get(_);x&&c.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+le(a,p),dynamics:g,optionals:v,extract:R,rawParams:S})}if(l.pathless){let x=m+1;for(let w=l.pathless.length-1;w>=0;w--){let C=l.pathless[w];c.push({node:C,index:p,skipped:h,depth:x,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}}}if(d)return d;if(s&&u){let f=u.index;for(let p=0;p<u.index;p++)f+=o[p].length;let l=f===t.length?"/":t.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(l),u}return null}i(Ls,"getNodeMatch");function le(t,o){return 2**(t-o-1)}i(le,"segmentScore");function Ms(t,o){return t===2**(o-1)-1}i(Ms,"isPerfectStaticMatch");function sr(t,o,e){let s,r;try{[s,r]=fr(t,o,e)}catch{return null}if(e.rawParams=s,e.extract=r,!e.node.parse)return!0;try{if(e.node.parse(s)===!1)return null}catch{}return!0}i(sr,"validateParseParams");function fe(t,o){return t?o.statics>t.statics||o.statics===t.statics&&(o.dynamics>t.dynamics||o.dynamics===t.dynamics&&(o.optionals>t.optionals||o.optionals===t.optionals&&((o.node.kind===St)>(t.node.kind===St)||o.node.kind===St==(t.node.kind===St)&&o.depth>t.depth))):!0}i(fe,"isFrameMoreSpecific");function Et(t){return Zt(t.filter(o=>o!==void 0).join("/"))}i(Et,"joinPaths");function Zt(t){return t.replace(/\/{2,}/g,"/")}i(Zt,"cleanPath");function he(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(he,"trimPathLeft");function Z(t){let o=t.length;return o>1&&t[o-1]==="/"?t.replace(/\/{1,}$/,""):t}i(Z,"trimPathRight");function Qt(t){return Z(he(t))}i(Qt,"trimPath");function Pt(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}i(Pt,"removeTrailingSlash");function pe(t,o,e){return Pt(t,e)===Pt(o,e)}i(pe,"exactPathTest");function Qe({base:t,to:o,trailingSlash:e="never",cache:s}){let r=o.startsWith("/"),n=!r&&o===".",a;if(s){a=r?o:n?t:t+"\0"+o;let d=s.get(a);if(d)return d}let c;if(n)c=t.split("/");else if(r)c=o.split("/");else{for(c=t.split("/");c.length>1&&pt(c)==="";)c.pop();let d=o.split("/");for(let f=0,l=d.length;f<l;f++){let p=d[f];p===""?f?f===l-1&&c.push(p):c=[p]:p===".."?c.pop():p==="."||c.push(p)}}c.length>1&&(pt(c)===""?e==="never"&&c.pop():e==="always"&&c.push(""));let u=Zt(c.join("/"))||"/";return a&&s&&s.set(a,u),u}i(Qe,"resolvePath");function hr(t){let o=new Map(t.map(r=>[encodeURIComponent(r),r])),e=Array.from(o.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(e,"g");return r=>r.replace(s,n=>o.get(n)??n)}i(hr,"compileDecodeCharMap");function Xt(t,o,e){let s=o[t];return typeof s!="string"?s:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(r=>dr(r,e)).join("/"):dr(s,e)}i(Xt,"encodeParam");function me({path:t,params:o,decoder:e,...s}){let r=!1,n=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:n,isMissingParams:r};if(!t.includes("$"))return{interpolatedPath:t,usedParams:n,isMissingParams:r};if(!1){let f=t.length,l=0,p="";for(;l<f;){for(;l<f&&t.charCodeAt(l)===47;)l++;if(l>=f)break;let h=l,m=t.indexOf("/",l);m===-1&&(m=f),l=m;let y=t.substring(h,m);if(y)if(y.charCodeAt(0)===36)if(y.length===1){let g=o._splat;if(n._splat=g,n["*"]=g,!g){r=!0;continue}let v=Xt("_splat",o,e);p+="/"+v}else{let g=y.substring(1);!r&&!(g in o)&&(r=!0),n[g]=o[g];let v=Xt(g,o,e)??"undefined";p+="/"+v}else p+="/"+y}return t.endsWith("/")&&(p+="/"),{usedParams:n,interpolatedPath:p||"/",isMissingParams:r}}let a=t.length,c=0,u,d="";for(;c<a;){let f=c;u=Ye(t,f,u);let l=u[5];if(c=l+1,f===l)continue;let p=u[0];if(p===0){d+="/"+t.substring(f,l);continue}if(p===2){let h=o._splat;n._splat=h,n["*"]=h;let m=t.substring(f,u[1]),y=t.substring(u[4],l);if(!h){r=!0,(m||y)&&(d+="/"+m+y);continue}let g=Xt("_splat",o,e);d+="/"+m+g+y;continue}if(p===1){let h=t.substring(u[2],u[3]);!r&&!(h in o)&&(r=!0),n[h]=o[h];let m=t.substring(f,u[1]),y=t.substring(u[4],l),g=Xt(h,o,e)??"undefined";d+="/"+m+g+y;continue}if(p===3){let h=t.substring(u[2],u[3]),m=o[h];if(m==null)continue;n[h]=m;let y=t.substring(f,u[1]),g=t.substring(u[4],l),v=Xt(h,o,e)??"";d+="/"+y+v+g;continue}}return t.endsWith("/")&&(d+="/"),{usedParams:n,interpolatedPath:d||"/",isMissingParams:r}}i(me,"interpolatePath");function dr(t,o){let e=encodeURIComponent(t);return o?.(e)??e}i(dr,"encodePathParam");function A(t){return t?.isNotFound===!0}i(A,"isNotFound");function Is(){try{return sessionStorage}catch{return}}i(Is,"getSafeSessionStorage");var Es="tsr-scroll-restoration-v1_3",gr=Is();function ks(){try{return JSON.parse(gr?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(ks,"createScrollRestorationCache");function Ts(){try{gr?.setItem(Es,JSON.stringify(Bt))}catch{}}i(Ts,"persistScrollRestorationCache");var Bt=ks(),pr="data-scroll-restoration-id",Os=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Ns(t){let o=t.getAttribute(pr);if(o)return`[${pr}="${o}"]`;let e="",s=t,r;for(;r=s.parentNode;){let n=1,a=s;for(;a=a.previousElementSibling;)n++;let c=`${s.localName}:nth-child(${n})`;e=e?`${c} > ${e}`:c,s=r}return e}i(Ns,"getScrollRestorationSelector");var ge=!1,ve="window";function to(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(to,"getElement");function mr(t){let o=new Set;for(let e of t){if(e===ve)continue;let s=to(e);s&&o.add(s)}return o}i(mr,"getScrollToTopElements");function vr(t,o){let e=o??t.options.scrollRestoration,s=t._scroll;if(e&&(s.restoring=!0),!1)return;let r=t.options.getScrollRestorationKey||Os,n=new Set,a=i(c=>{let u=Bt[c]||={};for(let d of n)d===document?u[ve]={scrollX,scrollY}:d.isConnected&&(u[Ns(d)]={scrollX:d.scrollLeft,scrollY:d.scrollTop})},"snapshotCurrentScrollTargets");e&&!s.restoration&&(s.restoration=!0,ge=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{ge||n.add(c.target)},!0),t.subscribe("onBeforeLoad",c=>{c.fromLocation&&a(r(c.fromLocation)),n.clear()}),addEventListener("pagehide",()=>{a(r(t.stores.resolvedLocation.get()??t.stores.location.get())),Ts()})),!s.reset&&(s.reset=!0,t.subscribe("onRendered",c=>{let u=t.options.scrollRestorationBehavior,d=t.options.scrollToTopSelectors,f=s.next,l=s.hash,p;if(n.clear(),s.next=!0,s.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let h=r(c.toLocation),m=c.fromLocation&&r(c.fromLocation);if(s.restoring&&m&&m!==h){let y=Bt[m];if(y){let g=Bt[h];for(let v in y){if(v===ve){if(f)continue}else{let R=to(v);if(!R||f&&d&&(p??=mr(d),p.has(R)))continue}g||(g=Bt[h]={}),g[v]??=y[v]}}}ge=!0;try{let y=c.toLocation.hash,g=c.toLocation.state.__hashScrollIntoViewOptions??!0,v=!1;if(f){!y&&d&&(p??=mr(d));let R=y&&g&&l,S=s.restoring?Bt[h]:void 0;if(S)for(let P in S){let{scrollX:_,scrollY:b}=S[P];if(P===ve){if(R)continue;scrollTo({top:b,left:_,behavior:u}),v=!0}else{let x=to(P);x&&(x.scrollLeft=_,x.scrollTop=b,p?.delete(x))}}if(!y){let P={top:0,left:0,behavior:u};if(v||scrollTo(P),p)for(let _ of p)_.scrollTo(P)}}!v&&y&&g&&document.getElementById(y)?.scrollIntoView(g)}finally{ge=!1}}))}i(vr,"setupScrollRestoration");function yr(t,o=String){let e=new URLSearchParams;for(let s in t){let r=t[s];r!==void 0&&e.set(s,o(r))}return e.toString()}i(yr,"encode");function eo(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(eo,"toValue");function Rr(t){let o=new URLSearchParams(t),e=Object.create(null);for(let[s,r]of o.entries()){let n=e[s];n==null?e[s]=eo(r):Array.isArray(n)?n.push(eo(r)):e[s]=[n,eo(r)]}return e}i(Rr,"decode");var Sr=Ds(JSON.parse),Pr=Fs(JSON.stringify,JSON.parse);function Ds(t){return o=>{o[0]==="?"&&(o=o.substring(1));let e=Rr(o);for(let s in e){let r=e[s];if(typeof r=="string")try{e[s]=t(r)}catch{}}return e}}i(Ds,"parseSearchWith");function Fs(t,o){let e=typeof o=="function";function s(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(e&&typeof r=="string")try{return o(r),t(r)}catch{}return r}return i(s,"stringifyValue"),r=>{let n=yr(r,s);return n?`?${n}`:""}}i(Fs,"stringifySearchWith");var X="__root__";function $t(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);let e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}i($t,"redirect");function H(t){return t instanceof Response&&!!t.options}i(H,"isRedirect");function xr(t){return{input:i(({url:o})=>{for(let e of t)o=ye(e,o);return o},"input"),output:i(({url:o})=>{for(let e=t.length-1;e>=0;e--)o=oo(t[e],o);return o},"output")}}i(xr,"composeRewrites");function wr(t){let o=Qt(t.basepath),e=`/${o}`,s=t.caseSensitive?e:e.toLowerCase(),r=`${s}/`;return{input:i(({url:n})=>{let a=t.caseSensitive?n.pathname:n.pathname.toLowerCase();return a===s?n.pathname="/":a.startsWith(r)&&(n.pathname=n.pathname.slice(e.length)),n},"input"),output:i(({url:n})=>(n.pathname=Et(["/",o,n.pathname]),n),"output")}}i(wr,"rewriteBasepath");function ye(t,o){let e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(ye,"executeRewriteInput");function oo(t,o){let e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(oo,"executeRewriteOutput");function no(t){let o=t;return{get(){return o},set(e){o=Y(e,o)}}}i(no,"createNonReactiveMutableStore");function io(t){return{get(){return t()}}}i(io,"createNonReactiveReadonlyStore");function _r(t,o){let{createMutableStore:e,createReadonlyStore:s,batch:r,init:n}=o,a=new Map,c=new Map,u=new Map,d=e(t.status),f=e(t.loadedAt),l=e(t.isLoading),p=e(t.isTransitioning),h=e(t.location),m=e(t.resolvedLocation),y=e(t.statusCode),g=e(t.redirect),v=e([]),R=e([]),S=e([]),P=s(()=>ro(a,v.get())),_=s(()=>ro(c,R.get())),b=s(()=>ro(u,S.get())),x=s(()=>v.get()[0]),w=s(()=>v.get().some(tt=>a.get(tt)?.get().status==="pending")),C=s(()=>({locationHref:h.get().href,resolvedLocationHref:m.get()?.href,status:d.get()})),M=s(()=>({status:d.get(),loadedAt:f.get(),isLoading:l.get(),isTransitioning:p.get(),matches:P.get(),location:h.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:g.get()})),L=yt(64);function I(tt){let zt=L.get(tt);return zt||(zt=s(()=>{let Fo=v.get();for(let Ao of Fo){let ie=a.get(Ao);if(ie&&ie.routeId===tt)return ie.get()}}),L.set(tt,zt)),zt}i(I,"getRouteMatchStore");let rt={status:d,loadedAt:f,isLoading:l,isTransitioning:p,location:h,resolvedLocation:m,statusCode:y,redirect:g,matchesId:v,pendingIds:R,cachedIds:S,matches:P,pendingMatches:_,cachedMatches:b,firstId:x,hasPending:w,matchRouteDeps:C,matchStores:a,pendingMatchStores:c,cachedMatchStores:u,__store:M,getRouteMatchStore:I,setMatches:K,setPending:dt,setCached:ne};K(t.matches),n?.(rt);function K(tt){so(tt,a,v,e,r)}i(K,"setMatches");function dt(tt){so(tt,c,R,e,r)}i(dt,"setPending");function ne(tt){so(tt,u,S,e,r)}return i(ne,"setCached"),rt}i(_r,"createRouterStores");function ro(t,o){let e=[];for(let s of o){let r=t.get(s);r&&e.push(r.get())}return e}i(ro,"readPoolMatches");function so(t,o,e,s,r){let n=t.map(c=>c.id),a=new Set(n);r(()=>{for(let c of o.keys())a.has(c)||o.delete(c);for(let c of t){let u=o.get(c.id);if(!u){let d=s(c);d.routeId=c.routeId,o.set(c.id,d);continue}u.routeId=c.routeId,u.get()!==c&&u.set(c)}rr(e.get(),n)||e.set(n)})}i(so,"reconcileMatchPool");var ao=i(t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},"triggerOnReady"),As=i(t=>t.stores.matchesId.get().some(o=>t.stores.matchStores.get(o)?.get()._forcePending),"hasForcePendingActiveMatch"),Pe=i((t,o)=>!!(t.preload&&!t.router.stores.matchStores.has(o)),"resolvePreload"),kt=i((t,o,e=!0)=>{let s={...t.router.options.context??{}},r=e?o:o-1;for(let n=0;n<=r;n++){let a=t.matches[n];if(!a)continue;let c=t.router.getMatch(a.id);c&&Object.assign(s,c.__routeContext,c.__beforeLoadContext)}return s},"buildMatchContext"),Cr=i((t,o)=>{if(!t.matches.length)return;let e=o.routeId,s=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),r=s>=0?s:0,n=e?t.matches.findIndex(a=>a.routeId===e):t.firstBadMatchIndex??t.matches.length-1;n<0&&(n=r);for(let a=n;a>=0;a--){let c=t.matches[a];if(t.router.looseRoutesById[c.routeId].options.notFoundComponent)return a}return e?n:r},"getNotFoundBoundaryIndex"),xt=i((t,o,e)=>{if(!(!H(e)&&!A(e)))throw H(e)&&e.redirectHandled&&!e.options.reloadDocument||(o&&(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0,o._nonReactive.error=e,t.updateMatch(o.id,s=>({...s,status:H(e)?"redirected":A(e)?"notFound":s.status==="pending"?"success":s.status,context:kt(t,o.index),isFetching:!1,error:e})),A(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()),H(e)&&(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e))),e},"handleRedirectAndNotFound"),Ir=i((t,o)=>{let e=t.router.getMatch(o);return!!(!e||!!1&&e._nonReactive.dehydrated||!1)},"shouldSkipLoader"),br=i((t,o,e)=>{let s=kt(t,e);t.updateMatch(o,r=>({...r,context:s}))},"syncMatchContext"),te=i((t,o,e)=>{let{id:s,routeId:r}=t.matches[o],n=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;t.firstBadMatchIndex??=o,xt(t,t.router.getMatch(s),e);try{n.options.onError?.(e)}catch(a){e=a,xt(t,t.router.getMatch(s),e)}t.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!H(e)&&!A(e)&&(t.serialError??=e)},"handleSerialError"),Bs=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=t.matches[e-1]?.id,a=n?t.router.getMatch(n):void 0;if(t.router.isShell()){r.ssr=s.id===X;return}if(a?.ssr===!1){r.ssr=!1;return}let c=i(h=>h===!0&&a?.ssr==="data-only"?"data-only":h,"parentOverride"),u=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){r.ssr=c(u);return}if(typeof s.options.ssr!="function"){r.ssr=c(s.options.ssr);return}let{search:d,params:f}=r,l={search:Re(d,r.searchError),params:Re(f,r.paramsError),location:t.location,matches:t.matches.map(h=>({index:h.index,pathname:h.pathname,fullPath:h.fullPath,staticData:h.staticData,id:h.id,routeId:h.routeId,search:Re(h.search,h.searchError),params:Re(h.params,h.paramsError),ssr:h.ssr}))},p=s.options.ssr(l);if(vt(p))return p.then(h=>{r.ssr=c(h??u)});r.ssr=c(p??u)},"isBeforeLoadSsr"),Er=i((t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;let r=e.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!!1&&!Pe(t,o)&&(e.options.loader||e.options.beforeLoad||uo(e))&&typeof r=="number"&&r!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent)){let n=setTimeout(()=>{ao(t)},r);s._nonReactive.pendingTimeout=n}},"setupPendingTimeout"),$s=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Er(t,o,e,s);let r=i(()=>{let n=t.router.getMatch(o);n.preload&&(n.status==="redirected"||n.status==="notFound")&&xt(t,n,n.error)},"then");return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()},"preBeforeLoadSetup"),Us=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=r._nonReactive.loadPromise;r._nonReactive.loadPromise=ct(()=>{n?.resolve(),n=void 0});let{paramsError:a,searchError:c}=r;a&&te(t,e,a),c&&te(t,e,c),Er(t,o,s,r);let u=new AbortController,d=!1,f=i(()=>{d||(d=!0,t.updateMatch(o,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:u})))},"pending"),l=i(()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,P=>({...P,isFetching:!1}))},"resolve");if(!s.options.beforeLoad){t.router.batch(()=>{f(),l()});return}r._nonReactive.beforeLoadPromise=ct();let p={...kt(t,e,!1),...r.__routeContext},{search:h,params:m,cause:y}=r,g=Pe(t,o),v={search:h,abortController:u,params:m,preload:g,context:p,location:t.location,navigate:i(P=>t.router.navigate({...P,_fromLocation:t.location}),"navigate"),buildLocation:t.router.buildLocation,cause:g?"preload":y,matches:t.matches,routeId:s.id,...t.router.options.additionalContext},R=i(P=>{if(P===void 0){t.router.batch(()=>{f(),l()});return}(H(P)||A(P))&&(f(),te(t,e,P)),t.router.batch(()=>{f(),t.updateMatch(o,_=>({..._,__beforeLoadContext:P})),l()})},"updateContext"),S;try{if(S=s.options.beforeLoad(v),vt(S))return f(),S.catch(P=>{te(t,e,P)}).then(R)}catch(P){f(),te(t,e,P)}R(S)},"executeBeforeLoad"),Hs=i((t,o)=>{let{id:e,routeId:s}=t.matches[o],r=t.router.looseRoutesById[s],n=i(()=>{if(!1){let u=Bs(t,e,o,r);if(vt(u))return u.then(c)}return c()},"serverSsr"),a=i(()=>Us(t,e,o,r),"execute"),c=i(()=>{if(Ir(t,e))return;let u=$s(t,e,r);return vt(u)?u.then(a):a()},"queueExecution");return n()},"handleBeforeLoad"),Vs=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;let r={ssr:t.router.options.ssr,matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(r),e.options.scripts?.(r),e.options.headers?.(r)]).then(([n,a,c])=>({meta:n?.meta,links:n?.links,headScripts:n?.scripts,headers:c,scripts:a,styles:n?.styles}))},"executeHead"),kr=i((t,o,e,s,r)=>{let n=o[s-1],{params:a,loaderDeps:c,abortController:u,cause:d}=t.router.getMatch(e),f=kt(t,s),l=Pe(t,e);return{params:a,deps:c,preload:!!l,parentMatchPromise:n,abortController:u,context:f,location:t.location,navigate:i(p=>t.router.navigate({...p,_fromLocation:t.location}),"navigate"),cause:l?"preload":d,route:r,...t.router.options.additionalContext}},"getLoaderContext"),Lr=i(async(t,o,e,s,r)=>{try{let n=t.router.getMatch(e);try{(!!1||n.ssr===!0)&&Ut(r);let a=r.options.loader,c=typeof a=="function"?a:a?.handler,u=c?.(kr(t,o,e,s,r)),d=!!c&&vt(u);if((d||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(e,l=>({...l,isFetching:"loader"})),c){let l=d?await u:u;xt(t,t.router.getMatch(e),l),l!==void 0&&t.updateMatch(e,p=>({...p,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;let f=n._nonReactive.minPendingPromise;f&&await f,r._componentsPromise&&await r._componentsPromise,t.updateMatch(e,l=>({...l,error:void 0,context:kt(t,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let c=a;if(c?.name==="AbortError"){if(n.abortController.signal.aborted){n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:kt(t,s)}));return}let u=n._nonReactive.minPendingPromise;u&&await u,A(a)&&await r.options.notFoundComponent?.preload?.(),xt(t,t.router.getMatch(e),a);try{r.options.onError?.(a)}catch(d){c=d,xt(t,t.router.getMatch(e),d)}!H(c)&&!A(c)&&await Ut(r,["errorComponent"]),t.updateMatch(e,d=>({...d,error:c,context:kt(t,s),status:"error",isFetching:!1}))}}catch(n){let a=t.router.getMatch(e);a&&(a._nonReactive.loaderPromise=void 0),xt(t,a,n)}},"runLoader"),Ws=i(async(t,o,e)=>{async function s(h,m,y,g,v){let R=Date.now()-m.updatedAt,S=h?v.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??t.router.options.defaultStaleTime??0,P=v.options.shouldReload,_=typeof P=="function"?P(kr(t,o,r,e,v)):P,{status:b,invalid:x}=g,w=R>=S&&(!!t.forceStaleReload||g.cause==="enter"||y!==void 0&&y!==g.id);a=b==="success"&&(x||(_??w)),h&&v.options.preload===!1||(a&&!t.sync&&f?(c=!0,(async()=>{try{await Lr(t,o,r,e,v);let C=t.router.getMatch(r);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0,C._nonReactive.loadPromise=void 0}catch(C){H(C)&&await t.router.navigate(C.options)}})()):b!=="success"||a?await Lr(t,o,r,e,v):br(t,r,e))}i(s,"handleLoader");let{id:r,routeId:n}=t.matches[e],a=!1,c=!1,u=t.router.looseRoutesById[n],d=u.options.loader,f=((typeof d=="function"?void 0:d?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Ir(t,r)){if(!t.router.getMatch(r))return t.matches[e];if(br(t,r,e),!1)return t.router.getMatch(r)}else{let h=t.router.getMatch(r),m=t.router.stores.matchesId.get()[e],y=(m&&t.router.stores.matchStores.get(m)||null)?.routeId===n?m:t.router.stores.matches.get().find(v=>v.routeId===n)?.id,g=Pe(t,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!t.sync&&!h.preload&&f)return h;await h._nonReactive.loaderPromise;let v=t.router.getMatch(r),R=v._nonReactive.error||v.error;R&&xt(t,v,R),v.status==="pending"&&await s(g,h,y,v,u)}else{let v=g&&!t.router.stores.matchStores.has(r),R=t.router.getMatch(r);R._nonReactive.loaderPromise=ct(),v!==R.preload&&t.updateMatch(r,S=>({...S,preload:v})),await s(g,h,y,R,u)}}let l=t.router.getMatch(r);c||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve(),l._nonReactive.loadPromise=void 0),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,c||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;let p=c?l.isFetching:!1;return p!==l.isFetching||l.invalid!==!1?(t.updateMatch(r,h=>({...h,isFetching:p,invalid:!1})),t.router.getMatch(r)):l},"loadRouteMatch");async function co(t){let o=t,e=[];!!1&&As(o.router)&&ao(o);let s;for(let p=0;p<o.matches.length;p++){try{let h=Hs(o,p);vt(h)&&await h}catch(h){if(H(h))throw h;if(A(h))s=h;else if(!o.preload)throw h;break}if(o.serialError||o.firstBadMatchIndex!=null)break}let r=o.firstBadMatchIndex??o.matches.length,n=s&&!o.preload?Cr(o,s):void 0,a=s&&o.preload?0:n!==void 0?Math.min(n+1,r):r,c,u;for(let p=0;p<a;p++)e.push(Ws(o,e,p));try{await Promise.all(e)}catch{let p=await Promise.allSettled(e);for(let h of p){if(h.status!=="rejected")continue;let m=h.reason;if(H(m))throw m;A(m)?c??=m:u??=m}if(u!==void 0)throw u}let d=c??(s&&!o.preload?s:void 0),f=o.firstBadMatchIndex!==void 0?o.firstBadMatchIndex:o.matches.length-1;if(!d&&s&&o.preload)return o.matches;if(d){let p=Cr(o,d);p===void 0&&$();let h=o.matches[p],m=o.router.looseRoutesById[h.routeId],y=o.router.options?.defaultNotFoundComponent;!m.options.notFoundComponent&&y&&(m.options.notFoundComponent=y),d.routeId=h.routeId;let g=h.routeId===o.router.routeTree.id;o.updateMatch(h.id,v=>({...v,...g?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),f=p,await Ut(m,["notFoundComponent"])}else if(!o.preload){let p=o.matches[0];p.globalNotFound||o.router.getMatch(p.id)?.globalNotFound&&o.updateMatch(p.id,h=>({...h,globalNotFound:!1,error:void 0}))}if(o.serialError&&o.firstBadMatchIndex!==void 0){let p=o.router.looseRoutesById[o.matches[o.firstBadMatchIndex].routeId];await Ut(p,["errorComponent"])}for(let p=0;p<=f;p++){let{id:h,routeId:m}=o.matches[p],y=o.router.looseRoutesById[m];try{let g=Vs(o,h,y);if(g){let v=await g;o.updateMatch(h,R=>({...R,...v}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}let l=ao(o);if(vt(l)&&await l,d)throw d;if(o.serialError&&!o.preload&&!o.onReady)throw o.serialError;return o.matches}i(co,"loadMatches");function Mr(t,o){let e=o.map(s=>t.options[s]?.preload?.()).filter(Boolean);if(e.length!==0)return Promise.all(e)}i(Mr,"preloadRouteComponents");function Ut(t,o=Se){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(s=>{let{id:r,...n}=s.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);let e=i(()=>t._componentsLoaded?void 0:o===Se?(()=>{if(t._componentsPromise===void 0){let s=Mr(t,Se);s?t._componentsPromise=s.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():Mr(t,o),"runAfterLazy");return t._lazyPromise?t._lazyPromise.then(e):e()}i(Ut,"loadRouteChunk");function Re(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}i(Re,"makeMaybe");function uo(t){for(let o of Se)if(t.options[o]?.preload)return!0;return!1}i(uo,"routeNeedsPreload");var Se=["component","errorComponent","pendingComponent","notFoundComponent"];var wt="__TSR_index",Tr="popstate",Or="beforeunload";function fo(t){let o=t.getLocation(),e=new Set,s=i(a=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:a}))},"notify"),r=i(a=>{t.notifyOnIndexChange??!0?s(a):o=t.getLocation()},"handleIndexChange"),n=i(async({task:a,navigateOpts:c,...u})=>{if(c?.ignoreBlocker??!1){a();return}let d=t.getBlockers?.()??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(let l of d){let p=Ht(u.path,u.state);if(await l.blockerFn({currentLocation:o,nextLocation:p,action:u.type})){t.onBlocked?.();return}}a()},"tryNavigation");return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i(a=>(e.add(a),()=>{e.delete(a)}),"subscribe"),push:i((a,c,u)=>{let d=o.state[wt];c=lo(d+1,c),n({task:i(()=>{t.pushState(a,c),s({type:"PUSH"})},"task"),navigateOpts:u,type:"PUSH",path:a,state:c})},"push"),replace:i((a,c,u)=>{let d=o.state[wt];c=lo(d,c),n({task:i(()=>{t.replaceState(a,c),s({type:"REPLACE"})},"task"),navigateOpts:u,type:"REPLACE",path:a,state:c})},"replace"),go:i((a,c)=>{n({task:i(()=>{t.go(a),r({type:"GO",index:a})},"task"),navigateOpts:c,type:"GO"})},"go"),back:i(a=>{n({task:i(()=>{t.back(a?.ignoreBlocker??!1),r({type:"BACK"})},"task"),navigateOpts:a,type:"BACK"})},"back"),forward:i(a=>{n({task:i(()=>{t.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},"task"),navigateOpts:a,type:"FORWARD"})},"forward"),canGoBack:i(()=>o.state[wt]!==0,"canGoBack"),createHref:i(a=>t.createHref(a),"createHref"),block:i(a=>{if(!t.setBlockers)return()=>{};let c=t.getBlockers?.()??[];return t.setBlockers([...c,a]),()=>{let u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(d=>d!==a))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:s}}i(fo,"createHistory");function lo(t,o){o||(o={});let e=po();return{...o,key:e,__TSR_key:e,[wt]:t}}i(lo,"assignKeyAndIndex");function ho(t){let o=t?.window??(typeof document<"u"?window:void 0),e=o.history.pushState,s=o.history.replaceState,r=[],n=i(()=>r,"_getBlockers"),a=i(w=>r=w,"_setBlockers"),c=t?.createHref??(w=>w),u=t?.parseLocation??(()=>Ht(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){let w=po();o.history.replaceState({[wt]:0,key:w,__TSR_key:w},"")}let d=u(),f,l=!1,p=!1,h=!1,m=!1,y=i(()=>d,"getLocation"),g,v,R=i(()=>{g&&(x._ignoreSubscribers=!0,(g.isPush?o.history.pushState:o.history.replaceState)(g.state,"",g.href),x._ignoreSubscribers=!1,g=void 0,v=void 0,f=void 0)},"flush"),S=i((w,C,M)=>{let L=c(C);v||(f=d),d=Ht(C,M),g={href:L,state:M,isPush:g?.isPush||w==="push"},v||(v=Promise.resolve().then(()=>R()))},"queueHistoryAction"),P=i(w=>{d=u(),x.notify({type:w})},"onPushPop"),_=i(async()=>{if(p){p=!1;return}let w=u(),C=w.state[wt]-d.state[wt],M=C===1,L=C===-1,I=!M&&!L||l;l=!1;let rt=I?"GO":L?"BACK":"FORWARD",K=I?{type:"GO",index:C}:{type:L?"BACK":"FORWARD"};if(h)h=!1;else{let dt=n();if(typeof document<"u"&&dt.length){for(let ne of dt)if(await ne.blockerFn({currentLocation:d,nextLocation:w,action:rt})){p=!0,o.history.go(1),x.notify(K);return}}}d=u(),x.notify(K)},"onPushPopEvent"),b=i(w=>{if(m){m=!1;return}let C=!1,M=n();if(typeof document<"u"&&M.length)for(let L of M){let I=L.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return w.preventDefault(),w.returnValue=""},"onBeforeUnload"),x=fo({getLocation:y,getLength:i(()=>o.history.length,"getLength"),pushState:i((w,C)=>S("push",w,C),"pushState"),replaceState:i((w,C)=>S("replace",w,C),"replaceState"),back:i(w=>(w&&(h=!0),m=!0,o.history.back()),"back"),forward:i(w=>{w&&(h=!0),m=!0,o.history.forward()},"forward"),go:i(w=>{l=!0,o.history.go(w)},"go"),createHref:i(w=>c(w),"createHref"),flush:R,destroy:i(()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(Or,b,{capture:!0}),o.removeEventListener(Tr,_)},"destroy"),onBlocked:i(()=>{f&&d!==f&&(d=f)},"onBlocked"),getBlockers:n,setBlockers:a,notifyOnIndexChange:!1});return o.addEventListener(Or,b,{capture:!0}),o.addEventListener(Tr,_),o.history.pushState=function(...w){let C=e.apply(o.history,w);return x._ignoreSubscribers||P("PUSH"),C},o.history.replaceState=function(...w){let C=s.apply(o.history,w);return x._ignoreSubscribers||P("REPLACE"),C},x}i(ho,"createBrowserHistory");function js(t={initialEntries:["/"]}){let o=t.initialEntries,e=t.initialIndex?Math.min(Math.max(t.initialIndex,0),o.length-1):o.length-1,s=o.map((u,d)=>lo(d,void 0)),r=i(()=>Ht(o[e],s[e]),"getLocation"),n=[];return fo({getLocation:r,getLength:i(()=>o.length,"getLength"),pushState:i((u,d)=>{e<o.length-1&&(o.splice(e+1),s.splice(e+1)),s.push(d),o.push(u),e=Math.max(o.length-1,0)},"pushState"),replaceState:i((u,d)=>{s[e]=d,o[e]=u},"replaceState"),back:i(()=>{e=Math.max(e-1,0)},"back"),forward:i(()=>{e=Math.min(e+1,o.length-1)},"forward"),go:i(u=>{e=Math.min(Math.max(e+u,0),o.length-1)},"go"),createHref:i(u=>u,"createHref"),getBlockers:i(()=>n,"_getBlockers"),setBlockers:i(u=>n=u,"_setBlockers")})}i(js,"createMemoryHistory");function zs(t){let o=t.replace(/[\x00-\x1f\x7f]/g,"");return o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}i(zs,"sanitizePath");function Ht(t,o){let e=zs(t),s=e.indexOf("#"),r=e.indexOf("?"),n=po();return{href:e,pathname:e.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:e.length),hash:s>-1?e.substring(s):"",search:r>-1?e.slice(r,s===-1?void 0:s):"",state:o||{[wt]:0,key:n,__TSR_key:n}}}i(Ht,"parseHref");function po(){return(Math.random()+1).toString(36).substring(7)}i(po,"createRandomKey");function ht(t,o){let e=o,s=t;return{fromLocation:e,toLocation:s,pathChanged:e?.pathname!==s.pathname,hrefChanged:e?.href!==s.href,hashChanged:e?.hash!==s.hash}}i(ht,"getLocationChangeInfo");var mo=class{static{i(this,"RouterCore")}constructor(t,o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let s=this.options,r=this.basepath??s?.basepath??"/",n=this.basepath===void 0,a=s?.rewrite;if(this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=hr(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ho()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;if(!1){let l=globalThis.__TSR_CACHE__;this.resolvePathCache=l.resolvePathCache,f=l.processRouteTreeResult}else this.resolvePathCache=yt(1e3),f=this.buildRouteTree(),!1;this.setRoutes(f)}if(!this.stores&&this.latestLocation){let f=this.getStoreConfig(this);this.batch=f.batch,this.stores=_r(Fr(this.latestLocation),f),vr(this)}let c=!1,u=this.options.basepath??"/",d=this.options.rewrite;if(n||r!==u||a!==d){this.basepath=u;let f=[],l=Qt(u);l&&l!=="/"&&f.push(wr({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:xr(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=lr(this.routeTree,this.options.caseSensitive,(s,r)=>{s.init({originalIndex:r})});return this.options.routeMasks&&ir(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,s)=>{let r={eventType:e,fn:s};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{let r=i(({pathname:u,search:d,hash:f,href:l,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){let v=this.options.parseSearch(d),R=this.options.stringifySearch(v);return{href:u+R+f,publicHref:u+R+f,pathname:At(u).path,external:!1,searchStr:R,search:gt(s?.search,v),hash:At(f.slice(1)).path,state:at(s?.state,p)}}let h=new URL(l,this.origin),m=ye(this.rewrite,h),y=this.options.parseSearch(m.search),g=this.options.stringifySearch(y);return m.search=g,{href:m.href.replace(m.origin,""),publicHref:l,pathname:At(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:g,search:gt(s?.search,y),hash:At(m.hash.slice(1)).path,state:at(s?.state,p)}},"parse"),n=r(e),{__tempLocation:a,__tempKey:c}=n.state;if(a&&(!c||c===this.tempLocationKey)){let u=r(a);return u.state.key=n.state.key,u.state.__TSR_key=n.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:n}}return n},this.resolvePathWithBase=(e,s)=>Qe({base:e,to:s.includes("//")?Zt(s):s,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,s,r)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},r):this.matchRoutesInternal(e,s),this.getMatchedRoutes=e=>Ar({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let s=this.stores.matchStores.get(e)?.get();s&&(s.status==="pending"||s.isFetching==="loader")&&this.cancelMatch(e)})},this.buildLocation=e=>{let s=i((n={})=>{let a=n._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(a);n.from;let u=n.unsafeRelative==="path"?a.pathname:n.from??c.fullPath,d=n.to?`${n.to}`:void 0,f=c.search,l=Object.assign(Object.create(null),c.params),p=d?.charCodeAt(0)===47?"/":this.resolvePathWithBase(u,"."),h=d?this.resolvePathWithBase(p,d):p,m=n.params===!1||n.params===null?Object.create(null):(n.params??!0)===!0?l:Object.assign(l,Y(n.params,l)),y=this.routesByPath[Z(h)],g;if(y)g=this.getRouteBranch(y);else if(h.includes("$"))g=[];else{let L=this.getMatchedRoutes(h);g=L.matchedRoutes,this.options.notFoundRoute&&(!L.foundRoute||L.foundRoute.path!=="/"&&L.routeParams["**"])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&mt(m))for(let L of g){let I=L.options.params?.stringify??L.options.stringifyParams;if(I)try{Object.assign(m,I(m))}catch{}}let v=e.leaveParams?h:At(me({path:h,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,R=f;if(e._includeValidateSearch&&this.options.search?.strict){let L={};g.forEach(I=>{if(I.options.validateSearch)try{Object.assign(L,xe(I.options.validateSearch,{...L,...R}))}catch{}}),R=L}R=Ks({search:R,dest:n,destRoutes:g,_includeValidateSearch:e._includeValidateSearch}),R=gt(f,R);let S=this.options.stringifySearch(R),P=n.hash===!0?a.hash:n.hash?Y(n.hash,a.hash):void 0,_=P?`#${P}`:"",b=n.state===!0?a.state:n.state?Y(n.state,a.state):{};b=at(a.state,b);let x=`${v}${S}${_}`,w,C,M=!1;if(this.rewrite){let L=new URL(x,this.origin),I=oo(this.rewrite,L);w=L.href.replace(L.origin,""),I.origin!==this.origin?(C=I.href,M=!0):C=I.pathname+I.search+I.hash}else w=or(x),C=w;return{publicHref:C,href:w,pathname:v,search:R,searchStr:S,state:b,hash:P??"",external:M,unmaskOnReload:n.unmaskOnReload}},"build"),r=i((n={},a)=>{let c=s(n),u=a?s(a):void 0;if(!u){let d=Object.create(null);if(this.options.routeMasks){let f=ar(c.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);let{from:l,params:p,...h}=f.route,m=p===!1||p===null?Object.create(null):(p??!0)===!0?d:Object.assign(d,Y(p,d));a={from:e.from,...h,params:m},u=s(a)}}}return u&&(c.maskedLocation=u),c},"buildWithMatches");return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:s,...r})=>{let n,a=i(()=>{let d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(l=>{r.state[l]=this.latestLocation.state[l]});let f=st(r.state,this.latestLocation.state);return d.forEach(l=>{delete r.state[l]}),f},"isSameState"),c=Z(this.latestLocation.href)===Z(r.href),u=this.commitLocationPromise;if(this.commitLocationPromise=ct(()=>{u?.resolve(),u=void 0}),c&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...l}=r;d&&(l={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...l,search:l.searchStr,state:{...l.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(l.unmaskOnReload??this.options.unmaskOnReload??!1)&&(l.state.__tempKey=this.tempLocationKey)),l.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,n=r.replace?"REPLACE":"PUSH",this.history[n==="REPLACE"?"replace":"push"](l.publicHref,l.state,{ignoreBlocker:s})}return this._scroll.next=r.resetScroll??!0,this.history.subscribers.size||this.load(n?{action:{type:n}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:r,viewTransition:n,ignoreBlocker:a,href:c,...u}={})=>{if(c){let l=this.history.location.state.__TSR_index,p=Ht(c,{__TSR_index:e?l:l+1}),h=new URL(p.pathname,this.origin);u.to=ye(this.rewrite,h).pathname,u.search=this.options.parseSearch(p.search),u.hash=p.hash.slice(1)}let d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;let f=this.commitLocation({...d,viewTransition:n,replace:e,resetScroll:s,hashScrollIntoView:r,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:e,reloadDocument:s,href:r,publicHref:n,...a})=>{let c=!1;if(r)try{new URL(`${r}`),c=!0}catch{}if(c&&!s&&(s=!0),s){if(e!==void 0||!r){let d=this.buildLocation({to:e,...a});r=r??d.publicHref,n=n??d.publicHref}let u=!c&&n?n:r;if(ut(u,this.protocolAllowlist))return;if(!a.ignoreBlocker){let d=this.history.getBlockers?.()??[];for(let f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(u):window.location.href=u;return}return this.buildAndCommitLocation({...a,href:r,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),!1){let r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==r.publicHref){let n=this.getParsedLocationHref(r);throw r.external?$t({href:n}):$t({href:n,_builtLocation:r})}}let e=this.matchRoutes(this.latestLocation),s=this.stores.cachedMatches.get().filter(r=>!e.some(n=>n.id===r.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(s)})},this.load=async e=>{let s=e?.action?.type,r,n,a,c=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad(),s&&(this._scroll.hash=s==="PUSH"||s==="REPLACE");let f=this.latestLocation,l=ht(f,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...l}),this.emit({type:"onBeforeLoad",...l}),await co({router:this,sync:e?.sync,forceStaleReload:c.href===f.href,matches:this.stores.pendingMatches.get(),location:f,updateMatch:this.updateMatch,onReady:i(async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=null,h=null,m=null,y=null;this.batch(()=>{let g=this.stores.pendingMatches.get(),v=g.length,R=this.stores.matches.get();p=v?R.filter(_=>!this.stores.pendingMatchStores.has(_.id)):null;let S=new Set;for(let _ of this.stores.pendingMatchStores.values())_.routeId&&S.add(_.routeId);let P=new Set;for(let _ of this.stores.matchStores.values())_.routeId&&P.add(_.routeId);h=v?R.filter(_=>!S.has(_.routeId)):null,m=v?g.filter(_=>!P.has(_.routeId)):null,y=v?g.filter(_=>P.has(_.routeId)):R,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(g),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(_=>_.status!=="error"&&_.status!=="notFound"&&_.status!=="redirected")]),this.clearExpiredCache())});for(let[g,v]of[[h,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(g)for(let R of g)this.looseRoutesById[R.routeId].options[v]?.(R)})})},"onReady")})}catch(f){H(f)?(r=f,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):A(f)&&(n=f);let l=r?r.status:n?404:this.stores.matches.get().some(p=>p.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(l),this.stores.redirect.set(r)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.stores.matches.get().some(d=>d.status==="error")&&(u=500),u!==void 0&&this.stores.statusCode.set(u)},this.startViewTransition=e=>{let s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof s=="object"&&this.isViewTransitionTypesSupported){let n=this.latestLocation,a=this.stores.resolvedLocation.get(),c=typeof s.types=="function"?s.types(ht(n,a)):s.types;if(c===!1){e();return}r={update:e,types:c}}else r=e;document.startViewTransition(r)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{let r=this.stores.pendingMatchStores.get(e);if(r){r.set(s);return}let n=this.stores.matchStores.get(e);if(n){n.set(s);return}let a=this.stores.cachedMatchStores.get(e);if(a){let c=s(a.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(u=>u.filter(d=>d!==e)):a.set(c)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let s=i(r=>e?.filter?.(r)??!0?{...r,invalid:!0,...e?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r,"invalidate");return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(s)),this.stores.setCached(this.stores.cachedMatches.get().map(s)),this.stores.setPending(this.stores.pendingMatches.get().map(s))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||"/",this.resolveRedirect=e=>{let s=e.headers.get("Location");if(!e.options.href||e.options._builtLocation){let r=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(r);e.options.href=n,e.headers.set("Location",n)}else if(s)try{let r=new URL(s);if(this.origin&&r.origin===this.origin){let n=r.pathname+r.search+r.hash;e.options.href=n,e.headers.set("Location",n)}}catch{}if(e.options.href&&!e.options._builtLocation&&ut(e.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{let s=e?.filter;s!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(r=>!s(r))):this.stores.setCached([])},this.clearExpiredCache=()=>{let e=Date.now(),s=i(r=>{let n=this.looseRoutesById[r.routeId];if(!n.options.loader)return!0;let a=(r.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:e-r.updatedAt>=a},"filter");this.clearCache({filter:s})},this.loadRouteChunk=Ut,this.preloadRoute=async e=>{let s=e._builtLocation??this.buildLocation(e),r=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e}),n=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...n,...this.stores.cachedIds.get()]),c=r.filter(u=>!a.has(u.id));if(c.length){let u=this.stores.cachedMatches.get();this.stores.setCached([...u,...c])}try{return r=await co({router:this,matches:r,location:s,preload:!0,updateMatch:i((u,d)=>{n.has(u)?r=r.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)},"updateMatch")}),r}catch(u){if(H(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:s});A(u)||console.error(u);return}},this.matchRoute=(e,s)=>{let r={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},n=this.buildLocation(r);if(s?.pending&&this.stores.status.get()!=="pending")return!1;let a=(s?.pending===void 0?!this.stores.isLoading.get():s.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=cr(n.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!c||e.params&&!st(c.rawParams,e.params,{partial:!0})?!1:s?.includeSearch??!0?st(a.search,n.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status==="notFound"||e.globalNotFound),this.getStoreConfig=o,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Pr,parseSearch:t.parseSearch??Sr,protocolAllowlist:t.protocolAllowlist??qe}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:o,processedTree:e}){this.routesById=t,this.routesByPath=o,this.processedTree=e;let s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}getRouteBranch(t){let o=this.routeBranchCache.get(t);return o||(o=Ze(t),this.routeBranchCache.set(t,o)),o}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,o){let e=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:r}=e,{matchedRoutes:n}=e,a=!1;(s?s.path!=="/"&&r["**"]:Z(t.pathname))&&(this.options.notFoundRoute?n=[...n,this.options.notFoundRoute]:a=!0);let c=a?Gs(this.options.notFoundMode,n):void 0,u=new Array(n.length),d=new Map;for(let f of this.stores.matchStores.values())f.routeId&&d.set(f.routeId,f.get());for(let f=0;f<n.length;f++){let l=n[f],p=u[f-1],h,m,y;{let I=p?.search??t.search,rt=p?._strictSearch??void 0;try{let K=xe(l.options.validateSearch,{...I})??void 0;h={...I,...K},m={...rt,...K},y=void 0}catch(K){let dt=K;if(K instanceof ee||(dt=new ee(K.message,{cause:K})),o?.throwOnError)throw dt;h=I,m={},y=dt}}let g=l.options.loaderDeps?.({search:h})??"",v=g?JSON.stringify(g):"",{interpolatedPath:R,usedParams:S}=me({path:l.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),P=l.id+R+v,_=this.getMatch(P),b=d.get(l.id),x=_?._strictParams??S,w;if(!_)try{Nr(l,x)}catch(I){if(A(I)||H(I)?w=I:w=new Dr(I.message,{cause:I}),o?.throwOnError)throw w}Object.assign(r,x);let C=b?"stay":"enter",M;if(_)M={..._,cause:C,params:b?.params??r,_strictParams:x,search:b?gt(b.search,h):gt(_.search,h),_strictSearch:m};else{let I=l.options.loader||l.options.beforeLoad||l.lazyFn||uo(l)?"pending":"success";M={id:P,ssr:l.options.ssr,index:f,routeId:l.id,params:b?.params??r,_strictParams:x,pathname:R,updatedAt:Date.now(),search:b?gt(b.search,h):h,_strictSearch:m,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:ct()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?at(b.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:l.options.staticData||{},fullPath:l.fullPath}}o?.preload||(M.globalNotFound=c===l.id),M.searchError=y;let L=this.getParentContext(p);M.context={...L,...M.__routeContext,...M.__beforeLoadContext},u[f]=M}for(let f=0;f<u.length;f++){let l=u[f],p=this.looseRoutesById[l.routeId],h=this.getMatch(l.id),m=d.get(l.routeId);if(l.params=m?gt(m.params,r):r,!h){let y=u[f-1],g=this.getParentContext(y);if(p.options.context){let v={deps:l.loaderDeps,params:l.params,context:g??{},location:t,navigate:i(R=>this.navigate({...R,_fromLocation:t}),"navigate"),buildLocation:this.buildLocation,cause:l.cause,abortController:l.abortController,preload:!!l.preload,matches:u,routeId:p.id};l.__routeContext=p.options.context(v)??void 0}l.context={...g,...l.__routeContext,...l.__beforeLoadContext}}}return u}matchRoutesLightweight(t){let o=pt(this.stores.matchesId.get()),e=this.lightweightCache.get(t);if(e&&e[0]===o)return e[1];let{matchedRoutes:s,routeParams:r}=this.getMatchedRoutes(t.pathname),n=pt(s),a={...t.search};for(let l of s)try{Object.assign(a,xe(l.options.validateSearch,a))}catch{}let c=o&&this.stores.matchStores.get(o)?.get(),u=c&&c.routeId===n.id&&c.pathname===t.pathname,d;if(u)d=c.params;else{let l=Object.assign(Object.create(null),r);for(let p of s)try{Nr(p,l)}catch{}d=l}let f={matchedRoutes:s,fullPath:n.fullPath,search:a,params:d};return this.lightweightCache.set(t,[o,f]),f}},ee=class extends Error{static{i(this,"SearchParamError")}},Dr=class extends Error{static{i(this,"PathParamError")}};function Fr(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}i(Fr,"getInitialRouterState");function xe(t,o){if(t==null)return{};if("~standard"in t){let e=t["~standard"].validate(o);if(e instanceof Promise)throw new ee("Async validation not supported");if(e.issues)throw new ee(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}i(xe,"validateSearch");function Ar({pathname:t,routesById:o,processedTree:e}){let s=Object.create(null),r=Z(t),n,a=ur(r,e,!0);return a&&(n=a.route,Object.assign(s,a.rawParams)),{matchedRoutes:a?.branch||[o.__root__],routeParams:s,foundRoute:n}}i(Ar,"getMatchedRoutes");function Ks({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){return qs(e)(t,o,s??!1)}i(Ks,"applySearchMiddleware");function qs(t){let o,e,s=[];for(let n of t){let a=n.options;if("search"in a)a.search?.middlewares&&s.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let u=i(({search:d,next:f})=>{let l=f(a.preSearchFilters?a.preSearchFilters.reduce((p,h)=>h(p),d):d);return a.postSearchFilters?a.postSearchFilters.reduce((p,h)=>h(p),l):l},"legacyMiddleware");s.push(u)}let c=a.validateSearch;if(c){let u=i(({search:d,next:f,meta:l})=>{let p=f(d);if(e)try{let h=xe(c,p);if(l&&h)for(let m in h)m in p||(l.defaulted||=new Map).set(m,h[m]);return{...p,...h}}catch{}return p},"validate");s.push(u)}}let r=i((n,a,c)=>{if(n>=s.length){if(!o.search)return{};if(o.search===!0)return a;let d=Y(o.search,a);return c&&(c.explicit=d),d}let u=i((d,f)=>{if(f){let l=c||{};return{search:r(n+1,d,l),meta:l}}return r(n+1,d,c)},"next");return s[n]({search:a,next:u,meta:c})},"applyNext");return i(function(a,c,u){return o=c,e=u,r(0,a)},"middleware")}i(qs,"buildMiddlewareChain");function Gs(t,o){if(t!=="root")for(let e=o.length-1;e>=0;e--){let s=o[e];if(s.children)return s.id}return X}i(Gs,"findGlobalNotFoundRouteId");function Nr(t,o){let e=t.options.params?.parse??t.options.parseParams;if(e){let s=e(o);if(s===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(o,s)}}i(Nr,"extractStrictParams");var go="Error preloading route! \u261D\uFE0F";var we=class{static{i(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=o=>{this.originalIndex=o.originalIndex;let e=this.options,s=!e?.path&&!e?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=X:this.parentRoute||$();let r=s?X:e?.path;r&&r!=="/"&&(r=he(r));let n=e?.id||r,a=s?X:Et([this.parentRoute.id==="__root__"?"":this.parentRoute.id,n]);r==="__root__"&&(r="/"),a!=="__root__"&&(a=Et(["/",a]));let c=a==="__root__"?"/":Et([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=c,this._to=Z(c)},this.addChildren=o=>this._addFileChildren(o),this._addFileChildren=o=>(Array.isArray(o)&&(this.children=o),typeof o=="object"&&o!==null&&(this.children=Object.values(o)),this),this._addFileTypes=()=>this,this.updateLoader=o=>(Object.assign(this.options,o),this),this.update=o=>(Object.assign(this.options,o),this),this.lazy=o=>(this.lazyFn=o,this),this.redirect=o=>$t({from:this.fullPath,...o}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var vo=class extends we{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Me=k(W(),1);var F=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(F||{});function Br({update:t,notify:o,unwatched:e}){return{link:s,unlink:r,propagate:n,checkDirty:a,shallowPropagate:c};function s(d,f,l){let p=f.depsTail;if(p!==void 0&&p.dep===d)return;let h=p!==void 0?p.nextDep:f.deps;if(h!==void 0&&h.dep===d){h.version=l,f.depsTail=h;return}let m=d.subsTail;if(m!==void 0&&m.version===l&&m.sub===f)return;let y=f.depsTail=d.subsTail={version:l,dep:d,sub:f,prevDep:p,nextDep:h,prevSub:m,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:f.deps=y,m!==void 0?m.nextSub=y:d.subs=y}function r(d,f=d.sub){let l=d.dep,p=d.prevDep,h=d.nextDep,m=d.nextSub,y=d.prevSub;return h!==void 0?h.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=h:f.deps=h,m!==void 0?m.prevSub=y:l.subsTail=y,y!==void 0?y.nextSub=m:(l.subs=m)===void 0&&e(l),h}function n(d){let f=d.nextSub,l;t:do{let p=d.sub,h=p.flags;if(h&60?h&12?h&4?!(h&48)&&u(d,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&o(p),h&1){let m=p.subs;if(m!==void 0){let y=(d=m).nextSub;y!==void 0&&(l={value:f,prev:l},f=y);continue}}if((d=f)!==void 0){f=d.nextSub;continue}for(;l!==void 0;)if(d=l.value,l=l.prev,d!==void 0){f=d.nextSub;continue t}break}while(!0)}function a(d,f){let l,p=0,h=!1;t:do{let m=d.dep,y=m.flags;if(f.flags&16)h=!0;else if((y&17)===17){if(t(m)){let g=m.subs;g.nextSub!==void 0&&c(g),h=!0}}else if((y&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(l={value:d,prev:l}),d=m.deps,f=m,++p;continue}if(!h){let g=d.nextDep;if(g!==void 0){d=g;continue}}for(;p--;){let g=f.subs,v=g.nextSub!==void 0;if(v?(d=l.value,l=l.prev):d=g,h){if(t(f)){v&&c(g),f=d.sub;continue}h=!1}else f.flags&=-33;f=d.sub;let R=d.nextDep;if(R!==void 0){d=R;continue t}}return h}while(!0)}function c(d){do{let f=d.sub,l=f.flags;(l&48)===32&&(f.flags=l|16,(l&6)===2&&o(f))}while((d=d.nextSub)!==void 0)}function u(d,f){let l=f.depsTail;for(;l!==void 0;){if(l===d)return!0;l=l.prevDep}return!1}}i(Br,"createReactiveSystem");function Hr(t,o,e){let s=typeof t=="object",r=s?t:void 0;return{next:(s?t.next:t)?.bind(r),error:(s?t.error:o)?.bind(r),complete:(s?t.complete:e)?.bind(r)}}i(Hr,"toObserver");var yo=[],Ce=0,{link:$r,unlink:Xs,propagate:Zs,checkDirty:Vr,shallowPropagate:Ur}=Br({update(t){return t._update()},notify(t){yo[Ro++]=t,t.flags&=~F.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=F.Mutable|F.Dirty,be(t))}}),_e=0,Ro=0,lt,So=0;function oe(t){try{++So,t()}finally{--So||Po()}}i(oe,"batch");function be(t){let o=t.depsTail,e=o!==void 0?o.nextDep:t.deps;for(;e!==void 0;)e=Xs(e,t)}i(be,"purgeDeps");function Po(){if(!(So>0)){for(;_e<Ro;){let t=yo[_e];yo[_e++]=void 0,t.notify()}_e=0,Ro=0}}i(Po,"flush");function Le(t,o){let e=typeof t=="function",s=t,r={_snapshot:e?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:e?F.None:F.Mutable,get(){return lt!==void 0&&$r(r,lt,Ce),r._snapshot},subscribe(n){let a=Hr(n),c={current:!1},u=Qs(()=>{r.get(),c.current?a.next?.(r._snapshot):c.current=!0});return{unsubscribe:i(()=>{u.stop()},"unsubscribe")}},_update(n){let a=lt,c=o?.compare??Object.is;if(e)lt=r,++Ce,r.depsTail=void 0;else if(n===void 0)return!1;e&&(r.flags=F.Mutable|F.RecursedCheck);try{let u=r._snapshot,d=typeof n=="function"?n(u):n===void 0&&e?s(u):n;return u===void 0||!c(u,d)?(r._snapshot=d,!0):!1}finally{lt=a,e&&(r.flags&=~F.RecursedCheck),be(r)}}};return e?(r.flags=F.Mutable|F.Dirty,r.get=function(){let n=r.flags;if(n&F.Dirty||n&F.Pending&&Vr(r.deps,r)){if(r._update()){let a=r.subs;a!==void 0&&Ur(a)}}else n&F.Pending&&(r.flags=n&~F.Pending);return lt!==void 0&&$r(r,lt,Ce),r._snapshot}):r.set=function(n){if(r._update(n)){let a=r.subs;a!==void 0&&(Zs(a),Ur(a),Po())}},r}i(Le,"createAtom");function Qs(t){let o=i(()=>{let s=lt;lt=e,++Ce,e.depsTail=void 0,e.flags=F.Watching|F.RecursedCheck;try{return t()}finally{lt=s,e.flags&=~F.RecursedCheck,be(e)}},"run"),e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:F.Watching|F.RecursedCheck,notify(){let s=this.flags;s&F.Dirty||s&F.Pending&&Vr(this.deps,this)?o():this.flags=F.Watching},stop(){this.flags=F.None,this.depsTail=void 0,be(this)}};return o(),e}i(Qs,"effect");var xo=k(W(),1),Wr=k(Rs(),1);function tn(t,o){return t===o}i(tn,"defaultCompare");function B(t,o,e=tn){let s=(0,xo.useCallback)(a=>{if(!t)return()=>{};let{unsubscribe:c}=t.subscribe(a);return c},[t]),r=(0,xo.useCallback)(()=>t?.get(),[t]);return(0,Wr.useSyncExternalStoreWithSelector)(s,r,r,o,e)}i(B,"useStore");var wo={get(){},subscribe(){return{unsubscribe(){}}}};function _o(t,o){let e=Me.useRef();return s=>{let r=t?.select?t.select(s):s;return t?.structuralSharing??o.options.defaultStructuralSharing?e.current=at(e.current,r):r}}i(_o,"useStructuralSharing");function Q(t){let o=D(),e=Me.useContext(t.from?Yo:Mt),s=t.from?o.stores.getRouteMatchStore(t.from):o.stores.matchStores.get(e);if(!1){let a=s?.get();if(!a){(t.shouldThrow??!0)&&$();return}return t.select?t.select(a):a}let r=_o(t,o),n=B(s??wo,a=>a?r(a):wo);if(n!==wo)return n;(t.shouldThrow??!0)&&$()}i(Q,"useMatch");function Ie(t){return Q({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.search):o.search,"select")})}i(Ie,"useSearch");var nt=k(W(),1);var Tt=typeof window<"u"?nt.useLayoutEffect:nt.useEffect;function Ee(t){let o=nt.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}i(Ee,"usePrevious");function jr(t,o,e={},s={}){nt.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;let r=new IntersectionObserver(([n])=>{o(n)},e);return r.observe(t.current),()=>{r.disconnect()}},[o,e,s.disabled,t])}i(jr,"useIntersectionObserver");function zr(t){let o=nt.useRef(null);return nt.useImperativeHandle(t,()=>o.current,[]),o}i(zr,"useForwardedRef");var Co=k(W(),1);function ke(t){let o=D();return Co.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}i(ke,"useNavigate");var Vt=k(W(),1),it=k(ot(),1);function Ot(t){let o=t.errorComponent??Nt;return(0,it.jsx)(en,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:i(({error:e,reset:s})=>e?Vt.createElement(o,{error:e,reset:s}):t.children,"children")})}i(Ot,"CatchBoundary");var en=class extends Vt.Component{static{i(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,o){let e=t.getResetKey();return o.error&&o.resetKey!==e?{resetKey:e,error:null}:{resetKey:e}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,o){this.props.onCatch&&this.props.onCatch(t,o)}render(){return this.props.children({error:this.state.error,reset:i(()=>{this.reset()},"reset")})}};function Nt({error:t}){let[o,e]=Vt.useState(!1);return(0,it.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,it.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,it.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,it.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>e(s=>!s),"onClick"),children:o?"Hide Error":"Show Error"})]}),(0,it.jsx)("div",{style:{height:".25rem"}}),o?(0,it.jsx)("div",{children:(0,it.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,it.jsx)("code",{children:t.message}):null})}):null]})}i(Nt,"ErrorComponent");var Te=k(W(),1),bo=k(ot(),1);function Kr({children:t,fallback:o=null}){return Lo()?(0,bo.jsx)(Te.default.Fragment,{children:t}):(0,bo.jsx)(Te.default.Fragment,{children:o})}i(Kr,"ClientOnly");function Lo(){return Te.default.useSyncExternalStore(on,()=>!0,()=>!1)}i(Lo,"useHydrated");function on(){return()=>{}}i(on,"subscribe");function Mo(t){return Q({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.loaderData):o.loaderData,"select")})}i(Mo,"useLoaderData");function Io(t){let{select:o,...e}=t;return Q({...e,select:i(s=>o?o(s.loaderDeps):s.loaderDeps,"select")})}i(Io,"useLoaderDeps");function Eo(t){return Q({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(o=>{let e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e},"select")})}i(Eo,"useParams");function ko(t){return Q({...t,select:i(o=>t.select?t.select(o.context):o.context,"select")})}i(ko,"useRouteContext");var U=k(W(),1),rn=k(ot(),1);var Zr=k(ys(),1);function sn(t,o){let e=D(),s=zr(o),r=!1,{activeProps:n,inactiveProps:a,activeOptions:c,to:u,preload:d,preloadDelay:f,preloadIntentProximity:l,hashScrollIntoView:p,replace:h,startTransition:m,resetScroll:y,viewTransition:g,children:v,target:R,disabled:S,style:P,className:_,onClick:b,onBlur:x,onFocus:w,onMouseEnter:C,onMouseLeave:M,onTouchStart:L,ignoreBlocker:I,params:rt,search:K,hash:dt,state:ne,mask:tt,reloadDocument:zt,unsafeRelative:Fo,from:Ao,_fromLocation:ie,...Dt}=t;if(r){let O=Xr(u);if(typeof u=="string"&&!O&&u.indexOf(":")>-1)try{return new URL(u),ut(u,e.protocolAllowlist)?{...Dt,ref:s,href:void 0,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}:{...Dt,ref:s,href:u,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}}catch{}let T=e.buildLocation({...t,from:t.from}),et=Yr(T.maskedLocation?T.maskedLocation.publicHref:T.publicHref,T.maskedLocation?T.maskedLocation.external:T.external,e.history,S),Jt=(()=>{if(et?.external)return ut(et.href,e.protocolAllowlist)?void 0:et.href;if(!O&&typeof u=="string"&&u.indexOf(":")>-1)try{return new URL(u),ut(u,e.protocolAllowlist)?void 0:u}catch{}})(),Ve=(()=>{if(Jt)return!1;let V=e.stores.location.get(),G=c?.exact??!1;if(G){if(!pe(V.pathname,T.pathname,e.basepath))return!1}else{let j=Pt(V.pathname,e.basepath),J=Pt(T.pathname,e.basepath);if(!(j.startsWith(J)&&(j.length===J.length||j[J.length]==="/")))return!1}if((c?.includeSearch??!0)&&V.search!==T.search){let j=!V.search||typeof V.search=="object"&&!mt(V.search),J=!T.search||typeof T.search=="object"&&!mt(T.search);if(!(j&&J)&&!st(V.search,T.search,{partial:!G,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(Jt)return{...Dt,ref:s,href:Jt,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}};let We=Ve?Y(n,{})??qr:Wt,je=Ve?Wt:Y(a,{})??Wt,Ko=(()=>{let V=P,G=We.style,j=je.style;if(!(!V&&!G&&!j))return V&&!G&&!j?V:!V&&G&&!j?G:!V&&!G&&j?j:{...V,...G,...j}})(),qo=(()=>{let V=_,G=We.className,j=je.className;if(!V&&!G&&!j)return"";let J="";return V&&(J=V),G&&(J=J?`${J} ${G}`:G),j&&(J=J?`${J} ${j}`:j),J})();return{...Dt,...We,...je,href:et?.href,ref:s,disabled:!!S,target:R,...Ko&&{style:Ko},...qo&&{className:qo},...S&&Gr,...Ve&&Jr}}let $e=Lo(),Kt=U.useMemo(()=>t,[e,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),bt=B(e.stores.location,O=>O,(O,T)=>O.href===T.href),q=U.useMemo(()=>{let O={_fromLocation:bt,...Kt};return e.buildLocation(O)},[e,bt,Kt]),Bo=q.maskedLocation?q.maskedLocation.publicHref:q.publicHref,$o=q.maskedLocation?q.maskedLocation.external:q.external,qt=U.useMemo(()=>Yr(Bo,$o,e.history,S),[S,$o,Bo,e.history]),Gt=U.useMemo(()=>{if(qt?.external)return ut(qt.href,e.protocolAllowlist)?void 0:qt.href;if(!Xr(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),ut(u,e.protocolAllowlist)?void 0:u}catch{}},[u,qt,e.protocolAllowlist]),Ue=U.useMemo(()=>{if(Gt)return!1;if(c?.exact){if(!pe(bt.pathname,q.pathname,e.basepath))return!1}else{let O=Pt(bt.pathname,e.basepath),T=Pt(q.pathname,e.basepath);if(!(O.startsWith(T)&&(O.length===T.length||O[T.length]==="/")))return!1}return(c?.includeSearch??!0)&&!st(bt.search,q.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?$e&&bt.hash===q.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,bt,Gt,$e,q.hash,q.pathname,q.search,e.basepath]),ae=Ue?Y(n,{})??qr:Wt,ce=Ue?Wt:Y(a,{})??Wt,Uo=[_,ae.className,ce.className].filter(Boolean).join(" "),Ho=(P||ae.style||ce.style)&&{...P,...ae.style,...ce.style},[ms,Vo]=U.useState(!1),Wo=U.useRef(!1),Ft=t.reloadDocument||Gt?!1:d??e.options.defaultPreload,He=f??e.options.defaultPreloadDelay??0,Lt=U.useCallback(()=>{e.preloadRoute({...Kt,_builtLocation:q}).catch(O=>{console.warn(O),console.warn(go)})},[e,Kt,q]);jr(s,U.useCallback(O=>{O?.isIntersecting&&Lt()},[Lt]),an,{disabled:!!S||Ft!=="viewport"}),U.useEffect(()=>{Wo.current||!S&&Ft==="render"&&(Lt(),Wo.current=!0)},[S,Lt,Ft]);let gs=i(O=>{let T=O.currentTarget.getAttribute("target"),et=R!==void 0?R:T;if(!S&&!cn(O)&&!O.defaultPrevented&&(!et||et==="_self")&&O.button===0){O.preventDefault(),(0,Zr.flushSync)(()=>{Vo(!0)});let Jt=e.subscribe("onResolved",()=>{Jt(),Vo(!1)});e.navigate({...Kt,replace:h,resetScroll:y,hashScrollIntoView:p,startTransition:m,viewTransition:g,ignoreBlocker:I})}},"handleClick");if(Gt)return{...Dt,ref:s,href:Gt,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_},...b&&{onClick:b},...x&&{onBlur:x},...w&&{onFocus:w},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...L&&{onTouchStart:L}};let jo=i(O=>{if(S||Ft!=="intent")return;if(!He){Lt();return}let T=O.currentTarget;if(re.has(T))return;let et=setTimeout(()=>{re.delete(T),Lt()},He);re.set(T,et)},"enqueueIntentPreload"),vs=i(O=>{S||Ft!=="intent"||Lt()},"handleTouchStart"),zo=i(O=>{if(S||!Ft||!He)return;let T=O.currentTarget,et=re.get(T);et&&(clearTimeout(et),re.delete(T))},"handleLeave");return{...Dt,...ae,...ce,href:qt?.href,ref:s,onClick:jt([b,gs]),onBlur:jt([x,zo]),onFocus:jt([w,jo]),onMouseEnter:jt([C,jo]),onMouseLeave:jt([M,zo]),onTouchStart:jt([L,vs]),disabled:!!S,target:R,...Ho&&{style:Ho},...Uo&&{className:Uo},...S&&Gr,...Ue&&Jr,...$e&&ms&&nn}}i(sn,"useLinkProps");var Wt={},qr={className:"active"},Gr={role:"link","aria-disabled":!0},Jr={"data-status":"active","aria-current":"page"},nn={"data-transitioning":"transitioning"},re=new WeakMap,an={rootMargin:"100px"},jt=i(t=>o=>{for(let e of t)if(e){if(o.defaultPrevented)return;e(o)}},"composeHandlers");function Yr(t,o,e,s){if(!s)return o?{href:t,external:!0}:{href:e.createHref(t)||"/",external:!1}}i(Yr,"getHrefOption");function Xr(t){if(typeof t!="string")return!1;let o=t.charCodeAt(0);return o===47?t.charCodeAt(1)!==47:o===46}i(Xr,"isSafeInternal");var To=U.forwardRef((t,o)=>{let{_asChild:e,...s}=t,{type:r,...n}=sn(s,o),a=typeof s.children=="function"?s.children({isActive:n["data-status"]==="active"}):s.children;if(!e){let{disabled:c,...u}=n;return U.createElement("a",u,a)}return U.createElement(e,n,a)});function cn(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}i(cn,"isCtrlEvent");var Oo=k(W(),1),No=k(ot(),1);var Qr=class extends we{static{i(this,"Route")}constructor(t){super(t),this.useMatch=o=>Q({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>ko({...o,from:this.id}),this.useSearch=o=>Ie({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>Eo({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>Io({...o,from:this.id}),this.useLoaderData=o=>Mo({...o,from:this.id}),this.useNavigate=()=>ke({from:this.fullPath}),this.Link=Oo.default.forwardRef((o,e)=>(0,No.jsx)(To,{ref:e,from:this.fullPath,...o}))}};function un(t){return new Qr(t)}i(un,"createRoute");var ts=class extends vo{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=o=>Q({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>ko({...o,from:this.id}),this.useSearch=o=>Ie({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>Eo({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>Io({...o,from:this.id}),this.useLoaderData=o=>Mo({...o,from:this.id}),this.useNavigate=()=>ke({from:this.fullPath}),this.Link=Oo.default.forwardRef((o,e)=>(0,No.jsx)(To,{ref:e,from:this.fullPath,...o}))}};function ln(t){return new ts(t)}i(ln,"createRootRoute");var Rc=k(W(),1),Oe=k(ot(),1);function es(t){let o=D();if(!1){let s=`not-found-${o.stores.location.get().pathname}-${o.stores.status.get()}`;return(0,Oe.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),onCatch:i((r,n)=>{if(A(r))t.onCatch?.(r,n);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(A(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}let e=`not-found-${B(o.stores.location,s=>s.pathname)}-${B(o.stores.status,s=>s)}`;return(0,Oe.jsx)(Ot,{getResetKey:i(()=>e,"getResetKey"),onCatch:i((s,r)=>{if(A(s))t.onCatch?.(s,r);else throw s},"onCatch"),errorComponent:i(({error:s})=>{if(A(s))return t.fallback?.(s);throw s},"errorComponent"),children:t.children})}i(es,"CatchNotFound");function os(){return(0,Oe.jsx)("p",{children:"Not Found"})}i(os,"DefaultGlobalNotFound");var rs=k(ot(),1);function ss({children:t}){let o=D();return null}i(ss,"ScriptOnce");var bc=k(W(),1),Ne=k(ot(),1);function _t(t){return(0,Ne.jsx)(Ne.Fragment,{children:t.children})}i(_t,"SafeFragment");var Ec=k(W(),1),De=k(ot(),1);function Fe(t,o,e){return o.options.notFoundComponent?(0,De.jsx)(o.options.notFoundComponent,{...e}):t.options.defaultNotFoundComponent?(0,De.jsx)(t.options.defaultNotFoundComponent,{...e}):(0,De.jsx)(os,{})}i(Fe,"renderRouteNotFound");var is=k(ot(),1);function ns(t){return null}i(ns,"getScrollRestorationScriptForRouter");function as(){let t=ns(D());return t?(0,is.jsx)(ss,{children:t}):null}i(as,"ScrollRestoration");var z=k(W(),1),N=k(ot(),1);var fn=i((t,o)=>t.routeId===o.routeId&&t._displayPending===o._displayPending,"matchViewFieldsEqual"),dn=i((t,o)=>t[0]===o[0]&&t[1]===o[1],"outletMatchSelectionEqual"),Ae=z.memo(i(function({matchId:o}){let e=D();if(!1){let a=e.stores.matchStores.get(o)?.get();a||$();let c=a.routeId,u=e.routesById[c].parentRoute?.id;return(0,N.jsx)(cs,{router:e,matchId:o,resetKey:e.stores.loadedAt.get(),matchState:{routeId:c,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}})}let s=e.stores.matchStores.get(o);s||$();let r=B(e.stores.loadedAt,a=>a),n=B(s,a=>a,fn);return(0,N.jsx)(cs,{router:e,matchId:o,resetKey:r,matchState:z.useMemo(()=>{let a=n.routeId,c=e.routesById[a].parentRoute?.id;return{routeId:a,ssr:n.ssr,_displayPending:n._displayPending,parentRouteId:c}},[n._displayPending,n.routeId,n.ssr,e.routesById])})},"MatchImpl"));function cs({router:t,matchId:o,resetKey:e,matchState:s}){let r=t.routesById[s.routeId],n=r.options.pendingComponent??t.options.defaultPendingComponent,a=n?(0,N.jsx)(n,{}):null,c=r.options.errorComponent??t.options.defaultErrorComponent,u=r.options.onCatch??t.options.defaultOnCatch,d=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,f=s.ssr===!1||s.ssr==="data-only",l=(!r.isRoot||r.options.wrapInSuspense||f)&&(r.options.wrapInSuspense??n??(r.options.errorComponent?.preload||f))?z.Suspense:_t,p=c?Ot:_t,h=d?es:_t;return(0,N.jsxs)(r.isRoot?r.options.shellComponent??_t:_t,{children:[(0,N.jsx)(Mt.Provider,{value:o,children:(0,N.jsx)(l,{fallback:a,children:(0,N.jsx)(p,{getResetKey:i(()=>e,"getResetKey"),errorComponent:c||Nt,onCatch:i((m,y)=>{if(A(m))throw m.routeId??=s.routeId,m;u?.(m,y)},"onCatch"),children:(0,N.jsx)(h,{fallback:i(m=>{if(m.routeId??=s.routeId,!d||m.routeId&&m.routeId!==s.routeId||!m.routeId&&!r.isRoot)throw m;return z.createElement(d,m)},"fallback"),children:f||s._displayPending?(0,N.jsx)(Kr,{fallback:a,children:(0,N.jsx)(us,{matchId:o})}):(0,N.jsx)(us,{matchId:o})})})})}),s.parentRouteId===X?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(hn,{}),t.options.scrollRestoration&&!1?(0,N.jsx)(as,{}):null]}):null]})}i(cs,"MatchView");function hn(){let t=D();if(!1)return null;let o=z.useRef();return Tt(()=>{let e=t.stores.resolvedLocation.get(),s=o.current;e&&(!s||s.href!==e.href)&&t.emit({type:"onRendered",...ht(t.stores.location.get(),s??e)}),o.current=e},[B(t.stores.resolvedLocation,e=>e?.state.__TSR_key),t]),null}i(hn,"OnRendered");var us=z.memo(i(function({matchId:o}){let e=D(),s=i((f,l)=>e.getMatch(f.id)?._nonReactive[l]??f._nonReactive[l],"getMatchPromise");if(!1){let f=e.stores.matchStores.get(o)?.get();f||$();let l=f.routeId,p=e.routesById[l],h=(e.routesById[l].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:l,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch}),m=h?JSON.stringify(h):void 0,y=p.options.component??e.options.defaultComponent,g=y?(0,N.jsx)(y,{},m):(0,N.jsx)(Do,{});if(f._displayPending)throw s(f,"displayPendingPromise");if(f._forcePending)throw s(f,"minPendingPromise");if(f.status==="pending")throw s(f,"loadPromise");if(f.status==="notFound")return A(f.error)||$(),Fe(e,p,f.error);if(f.status==="redirected")throw H(f.error)||$(),s(f,"loadPromise");return f.status==="error"?(0,N.jsx)((p.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:f.error,reset:void 0,info:{componentStack:""}}):g}let r=e.stores.matchStores.get(o);r||$();let n=B(r,f=>f),a=n.routeId,c=e.routesById[a],u=z.useMemo(()=>{let f=(e.routesById[a].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:a,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return f?JSON.stringify(f):void 0},[a,n.loaderDeps,n._strictParams,n._strictSearch,e.options.defaultRemountDeps,e.routesById]),d=z.useMemo(()=>{let f=c.options.component??e.options.defaultComponent;return f?(0,N.jsx)(f,{},u):(0,N.jsx)(Do,{})},[u,c.options.component,e.options.defaultComponent]);if(n._displayPending)throw s(n,"displayPendingPromise");if(n._forcePending)throw s(n,"minPendingPromise");if(n.status==="pending"){let f=c.options.pendingMinMs??e.options.defaultPendingMinMs;if(f){let l=e.getMatch(n.id);if(l&&!l._nonReactive.minPendingPromise&&!!1){let p=ct();l._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),l._nonReactive.minPendingPromise=void 0},f)}}throw s(n,"loadPromise")}if(n.status==="notFound")return A(n.error)||$(),Fe(e,c,n.error);if(n.status==="redirected")throw H(n.error)||$(),s(n,"loadPromise");if(n.status==="error"){if(!1)return(0,N.jsx)((c.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:n.error,reset:void 0,info:{componentStack:""}});throw n.error}return d},"MatchInnerImpl")),Do=z.memo(i(function(){let o=D(),e=z.useContext(Mt),s,r=!1,n;if(!1){let d=o.stores.matches.get(),f=e?d.findIndex(p=>p.id===e):-1,l=f>=0?d[f]:void 0;s=l?.routeId,r=l?.globalNotFound??!1,n=f>=0?d[f+1]?.id:void 0}else{let d=e?o.stores.matchStores.get(e):void 0;[s,r]=B(d,f=>[f?.routeId,f?.globalNotFound??!1],dn),n=B(o.stores.matchesId,f=>f[f.findIndex(l=>l===e)+1])}let a=s?o.routesById[s]:void 0,c=o.options.defaultPendingComponent?(0,N.jsx)(o.options.defaultPendingComponent,{}):null;if(r)return a||$(),Fe(o,a,void 0);if(!n)return null;let u=(0,N.jsx)(Ae,{matchId:n});return s===X?(0,N.jsx)(z.Suspense,{fallback:c,children:u}):u},"OutletImpl"));var Ct=k(W(),1);function ls(){let t=D(),o=Ct.useRef({router:t,mounted:!1}),[e,s]=Ct.useState(!1),r=B(t.stores.isLoading,l=>l),n=B(t.stores.hasPending,l=>l),a=Ee(r),c=r||e||n,u=Ee(c),d=r||n,f=Ee(d);return t.startTransition=l=>{s(!0),Ct.startTransition(()=>{l(),s(!1)})},Ct.useEffect(()=>{let l=t.history.subscribe(t.load),p=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Z(t.latestLocation.publicHref)!==Z(p.publicHref)&&t.commitLocation({...p,replace:!0}),()=>{l()}},[t,t.history]),Tt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},i(async()=>{try{await t.load()}catch(p){console.error(p)}},"tryLoad")()},[t]),Tt(()=>{a&&!r&&t.emit({type:"onLoad",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[a,t,r]),Tt(()=>{f&&!d&&t.emit({type:"onBeforeRouteMount",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[d,f,t]),Tt(()=>{if(u&&!c){let l=ht(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...l}),oe(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[c,u,t]),null}i(ls,"Transitioner");var Be=k(W(),1),ft=k(ot(),1);function fs(){let t=D(),o=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,e=o?(0,ft.jsx)(o,{}):null,s=(0,ft.jsxs)(typeof document<"u"&&t.ssr?_t:Be.Suspense,{fallback:e,children:[!!1&&(0,ft.jsx)(ls,{}),(0,ft.jsx)(pn,{})]});return t.options.InnerWrap?(0,ft.jsx)(t.options.InnerWrap,{children:s}):s}i(fs,"Matches");function pn(){let t=D(),o=!1,e=o?t.stores.firstId.get():B(t.stores.firstId,n=>n),s=o?t.stores.loadedAt.get():B(t.stores.loadedAt,n=>n),r=e?(0,ft.jsx)(Ae,{matchId:e}):null;return(0,ft.jsx)(Mt.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:(0,ft.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),errorComponent:Nt,onCatch:void 0,children:r})})}i(pn,"MatchesInner");var ds=i(t=>({createMutableStore:Le,createReadonlyStore:Le,batch:oe}),"getStoreFactory");var mn=i(t=>new hs(t),"createRouter"),hs=class extends mo{static{i(this,"Router")}constructor(t){super(t,ds)}};var Lu=k(W(),1),se=k(ot(),1);function ps({router:t,children:o,...e}){mt(e)&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});let s=(0,se.jsx)(ue.Provider,{value:t,children:o});return t.options.Wrap?(0,se.jsx)(t.options.Wrap,{children:s}):s}i(ps,"RouterContextProvider");function gn({router:t,...o}){return(0,se.jsx)(ps,{router:t,...o,children:(0,se.jsx)(fs,{})})}i(gn,"RouterProvider");function vn(t){let o=D({warn:t?.router===void 0}),e=t?.router||o;if(!1){let s=e.stores.__store.get();return t?.select?t.select(s):s}return B(e.stores.__store,_o(t,e))}i(vn,"useRouterState");export{ho as a,js as b,D as c,Ie as d,ke as e,un as f,ln as g,Do as h,mn as i,gn as j,vn as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,c as m,f as V}from"./chunk-3XIESWL4.js";var h=m(w=>{"use strict";var a=V();function z(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}s(z,"is");var I=typeof Object.is=="function"?Object.is:z,M=a.useState,_=a.useEffect,g=a.useLayoutEffect,G=a.useDebugValue;function L(e,u){var t=u(),i=M({inst:{value:t,getSnapshot:u}}),r=i[0].inst,n=i[1];return g(function(){r.value=t,r.getSnapshot=u,y(r)&&n({inst:r})},[e,t,u]),_(function(){return y(r)&&n({inst:r}),e(function(){y(r)&&n({inst:r})})},[e]),G(t),t}s(L,"useSyncExternalStore$2");function y(e){var u=e.getSnapshot;e=e.value;try{var t=u();return!I(e,t)}catch{return!0}}s(y,"checkIfSnapshotChanged");function $(e,u){return u()}s($,"useSyncExternalStore$1");var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$:L;w.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:k});var O=m((T,D)=>{"use strict";D.exports=h()});var N=m(R=>{"use strict";var E=V(),C=O();function U(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}s(U,"is");var W=typeof Object.is=="function"?Object.is:U,A=C.useSyncExternalStore,B=E.useRef,F=E.useEffect,H=E.useMemo,J=E.useDebugValue;R.useSyncExternalStoreWithSelector=function(e,u,t,i,r){var n=B(null);if(n.current===null){var c={hasValue:!1,value:null};n.current=c}else c=n.current;n=H(function(){function j(o){if(!S){if(S=!0,v=o,o=i(o),r!==void 0&&c.hasValue){var f=c.value;if(r(f,o))return d=f}return d=o}if(f=d,W(v,o))return f;var p=i(o);return r!==void 0&&r(f,p)?(v=o,f):(v=o,d=p)}s(j,"memoizedSelector");var S=!1,v,d,b=t===void 0?null:t;return[function(){return j(u())},b===null?void 0:function(){return j(b())}]},[u,t,i,r]);var l=A(e,n[0],n[1]);return F(function(){c.hasValue=!0,c.value=l},[l]),J(l),l}});var K=m((Z,q)=>{"use strict";q.exports=N()});export{O as a,K as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,j as a}from"./chunk-6ST5ECQA.js";import{a as o}from"./chunk-XBDKZZ67.js";import{a as r,j as n}from"./chunk-3XIESWL4.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-WQH3LT2P.js";import{a as x,e as u,g as h,h as N}from"./chunk-3XIESWL4.js";var b=u(h(),1);var t=u(N(),1);var v=x(g=>{let e=(0,b.c)(16),{chart:c,footer:n,label:i,testId:m,value:p}=g,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==m||e[3]!==p?(a=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":m,children:p}),e[2]=m,e[3]=p,e[4]=a):a=e[4];let s;e[5]!==c||e[6]!==a?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[5]=c,e[6]=a,e[7]=s):s=e[7];let l;e[8]!==r||e[9]!==s?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[r,s]}),e[8]=r,e[9]=s,e[10]=l):l=e[10];let o;e[11]!==n?(o=n!=null&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==l||e[14]!==o?(d=(0,t.jsxs)(f,{className:"justify-between gap-0 py-0",children:[l,o]}),e[13]=l,e[14]=o,e[15]=d):d=e[15],d},"j");export{v as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as fe}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as ie}from"./chunk-IC4L6G56.js";import{a as pe}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{R as de}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as x}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as ne}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as he}from"./chunk-322ZP3GW.js";import"./chunk-XXQUMVWH.js";import"./chunk-P4BOVBMR.js";import"./chunk-QLQADHFE.js";import{a as P}from"./chunk-VDW32UET.js";import{c as ue}from"./chunk-BQNVN2OD.js";import{f as le}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as ce}from"./chunk-XQCVZAGU.js";import{d as oe,f as Z,g as ee,h as te,o as ae,q as me,r as re}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as i,e as Y,f as ge,g as ve,h as Ne,j as se}from"./chunk-3XIESWL4.js";var t=Y(Ne(),1);var xe=Y(ve(),1);var N=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:se("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}i(ye,"xe");var we=/https?:\/\/[^\s"'<>)]+/i,be=i(a=>a===void 0?void 0:we.exec(a)?.[0],"ae"),y=i(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"N"),Ce=i(a=>{if(a!==void 0)return be(a.html)??be(a.text)},"Ne"),ke=i((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${y(o.to)} ${y(o.cc)}`.toLowerCase().includes(s))},"ye"),Se=i((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"we"),Te=Z(P.clearCapturedMail),Le=Z(P.sendTestMail),je=i(a=>{let e=(0,xe.c)(38),{limit:s}=a,o=le(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:D,error:w,errorSource:C,isLoading:g,refetch:n}=ue(P.getCapturedMail,p),[k,f]=(0,N.useState)(null),[E,S]=(0,N.useState)(null),[v,l]=(0,N.useState)("html"),[c,U]=(0,N.useState)(""),b=D?.entries??[],r=w??k,u=w===null?k:C,T;e[2]!==o||e[3]!==n?(T=i(async()=>{f(null);try{await o.query(Te,{},ee("")),S(null),n()}catch(m){f(te(m))}},"S"),e[2]=o,e[3]=n,e[4]=T):T=e[4];let W=T,L;e[5]!==o||e[6]!==n?(L=i(async()=>{f(null);try{await o.query(Le,{},ee("")),n()}catch(m){f(te(m))}},"$"),e[5]=o,e[6]=n,e[7]=L):L=e[7];let B=L,j;e[8]!==n?(j=i(()=>{n()},"T"),e[8]=n,e[9]=j):j=e[9],pe(j,!0);let M;e[10]!==W?(M=i(()=>{ae(W())},"L"),e[10]=W,e[11]=M):M=e[11];let R=M,_;e[12]!==B?(_=i(()=>{ae(B())},"j"),e[12]=B,e[13]=_):_=e[13];let G=_,$;e[14]===Symbol.for("react.memo_cache_sentinel")?($=i(m=>{U(m.currentTarget.value)},"M"),e[14]=$):$=e[14];let J=$,z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=i(m=>{let{id:h}=m.currentTarget.dataset;h!==void 0&&S(h)},"_"),e[15]=z):z=e[15];let K=z,A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=i(m=>{let h=m.currentTarget.dataset.tab;(h==="headers"||h==="html"||h==="text")&&l(h)},"z"),e[16]=A):A=e[16];let Q=A,F=ke(b,c),O=Se(F,E),d=Ce(O),q;e[17]!==d?(q=i(()=>{d!==void 0&&me(d)},"O"),e[17]=d,e[18]=q):q=e[18];let V=q,H;e[19]!==d?(H=i(()=>{d!==void 0&&"window"in globalThis&&globalThis.window.open(d,"_blank","noopener")},"I"),e[19]=d,e[20]=H):H=e[20];let X=H,I;return e[21]!==b||e[22]!==r||e[23]!==u||e[24]!==c||e[25]!==g||e[26]!==d||e[27]!==R||e[28]!==V||e[29]!==J||e[30]!==X||e[31]!==K||e[32]!==Q||e[33]!==G||e[34]!==O||e[35]!==v||e[36]!==F?(I={entries:b,error:r,errorSource:u,filter:c,isLoading:g,link:d,onClear:R,onCopyLink:V,onFilterChange:J,onOpenLink:X,onSelectMessage:K,onSelectTab:Q,onSendTest:G,selected:O,tab:v,visible:F},e[21]=b,e[22]=r,e[23]=u,e[24]=c,e[25]=g,e[26]=d,e[27]=R,e[28]=V,e[29]=J,e[30]=X,e[31]=K,e[32]=Q,e[33]=G,e[34]=O,e[35]=v,e[36]=F,e[37]=I):I=e[37],I},"Se"),Me=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,_e=i(a=>`${Me}${a}`,"Te"),Je=i(({limit:a=100})=>{let e=oe(),{entries:s,error:o,errorSource:p,filter:D,isLoading:w,link:C,onClear:g,onCopyLink:n,onFilterChange:k,onOpenLink:f,onSelectMessage:E,onSelectTab:S,onSendTest:v,selected:l,tab:c,visible:U}=je({limit:a}),b=i(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"b");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)(x,{"data-testid":"mail-send-test",onClick:v,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(x,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(ne,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(he,{error:p,testId:"mail-error"}),o===null&&!w&&s.length===0&&(0,t.jsx)(ce,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(de,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:k,placeholder:e("Filter messages"),type:"search",value:D}),(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:U.map(r=>{let u=r.id===l?.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 ${u?"bg-muted":""}`,"data-active":u,"data-id":r.id,"data-testid":"mail-list-item",onClick:E,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:y(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),l!==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:l.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:l.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.to)}),l.cc!==void 0&&l.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:y(l.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(l.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(x,{"data-testid":"mail-copy-link",disabled:C===void 0,onClick:n,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(x,{"data-testid":"mail-open-link",disabled:C===void 0,onClick:f,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)(x,{"aria-selected":c===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:S,role:"tab",size:"sm",type:"button",variant:c===r?"secondary":"ghost",children:b(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[c==="html"&&(l.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(l.html),title:e("Email preview")})),c==="text"&&(l.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:l.text})),c==="headers"&&(l.headers===void 0||Object.keys(l.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(l.headers).map(([r,u])=>`${r}: ${u}`).join(`
|
|
2
|
+
`)}))]})]})]})]})},"We");export{Je as MailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as W}from"./chunk-54MMVNPT.js";import{a as F}from"./chunk-3CWGJYBB.js";import{a as E}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as L}from"./chunk-322ZP3GW.js";import"./chunk-XXQUMVWH.js";import"./chunk-P4BOVBMR.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-VDW32UET.js";import{c as _}from"./chunk-BQNVN2OD.js";import"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as T}from"./chunk-XQCVZAGU.js";import{a as O,b as P,c as U,d as w,e as h,f as p}from"./chunk-WJQLNYGX.js";import{a as $,e as j}from"./chunk-WQH3LT2P.js";import{d as M}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as S,e as A,g as R,h as Z}from"./chunk-3XIESWL4.js";var B=A(R(),1);var t=A(Z(),1);var q=80,z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>q?`${e.slice(0,q)}\u2026`:e},"W"),G=S(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"B"),C=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),oe=S(a=>{let e=(0,B.c)(22),{initialShardKey:r}=a,n=M(),{queryShardKey:l,setShardKey:i,shardKey:m}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:u,refetch:J}=_(D.listSubscriptions,f,b);W(J,!0);let x;if(e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==i||e[7]!==m||e[8]!==n){let k=s===void 0?[]:G(s.connections),c;e[10]!==i||e[11]!==m?(c=(0,t.jsx)(E,{onChange:i,testId:"subs-shard-input",value:m}),e[10]=i,e[11]=m,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(y,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(y,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==u?(v=o!==null&&(0,t.jsx)(L,{error:u,testId:"subs-error"}),e[19]=o,e[20]=u,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)(T,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)($,{className:"overflow-hidden py-0",children:(0,t.jsx)(j,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(w,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(U,{children:k.map(N=>{let{subscription:I}=N,K=z(I?.args);return(0,t.jsxs)(w,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",N.connectionId,N.admin&&(0,t.jsx)(y,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??C}),(0,t.jsx)(p,{children:I?.table??C}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||C})]},N.key)})})]})})})]}),e[3]=o,e[4]=u,e[5]=s,e[6]=i,e[7]=m,e[8]=n,e[9]=x}else x=e[9];return x},"oe");export{oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as L}from"./chunk-54MMVNPT.js";import{c as w}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{b as $}from"./chunk-BQNVN2OD.js";import{f as A}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as j}from"./chunk-XQCVZAGU.js";import{a as z,b as B,c as E,d as g,e as i,f as l}from"./chunk-WJQLNYGX.js";import{a as I,e as S}from"./chunk-WQH3LT2P.js";import{d as k,o as R,r as _}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as h,e as y,g as O,h as Q}from"./chunk-3XIESWL4.js";var C=y(O(),1);var s=y(Q(),1);var T=200,U=h(()=>{let e=(0,C.c)(21),n=A(),t=k(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=["lunora-auth-sessions",T],e[0]=u):u=e[0];let p;e[1]!==n?(p=h(()=>n.listAuthSessions({limit:T}),"u"),e[1]=n,e[2]=p):p=e[2];let o=$(u,p),{error:f}=o,a=o.data?.rows??null,x;e[3]!==o?(x=h(()=>{o.refetch()},"p"),e[3]=o,e[4]=x):x=e[4],L(x,!0);let N;e[5]!==n||e[6]!==o?(N=h(r=>{R((async()=>{await n.revokeAuthSession({sessionId:r}),o.refetch()})())},"x"),e[5]=n,e[6]=o,e[7]=N):N=e[7];let b=N,d;e[8]!==f?(d=f!==null&&(0,s.jsx)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:f}),e[8]=f,e[9]=d):d=e[9];let c;e[10]!==a||e[11]!==t?(c=a!==null&&a.length===0&&(0,s.jsx)(j,{testId:"auth-sessions-empty",title:t("No active sessions.")}),e[10]=a,e[11]=t,e[12]=c):c=e[12];let m;e[13]!==b||e[14]!==a||e[15]!==t?(m=a!==null&&a.length>0&&(0,s.jsx)(I,{className:"overflow-hidden py-0",children:(0,s.jsx)(S,{className:"px-0",children:(0,s.jsxs)(z,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)(B,{children:(0,s.jsxs)(g,{children:[(0,s.jsx)(i,{children:t("user")}),(0,s.jsx)(i,{children:t("expires")}),(0,s.jsx)(i,{children:t("ip")}),(0,s.jsx)(i,{children:t("user agent")}),(0,s.jsx)(i,{children:t("impersonated by")}),(0,s.jsx)(i,{"aria-label":t("Actions")})]})}),(0,s.jsx)(E,{children:a.map(r=>(0,s.jsxs)(g,{"data-testid":`auth-session-${r.id}`,children:[(0,s.jsx)(l,{className:"font-mono text-xs",children:r.userId}),(0,s.jsx)(l,{className:"text-muted-foreground tabular-nums",children:_(r.expiresAt)}),(0,s.jsx)(l,{children:r.ipAddress??""}),(0,s.jsx)(l,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,s.jsx)(l,{className:"font-mono text-xs",children:r.impersonatedBy??""}),(0,s.jsx)(l,{children:(0,s.jsx)(w,{"data-testid":`auth-session-revoke-${r.id}`,onClick:h(()=>{b(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Revoke")})})]},r.id))})]})})}),e[13]=b,e[14]=a,e[15]=t,e[16]=m):m=e[16];let v;return e[17]!==d||e[18]!==c||e[19]!==m?(v=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[d,c,m]}),e[17]=d,e[18]=c,e[19]=m,e[20]=v):v=e[20],v},"Q");export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,e as o,f as c,g as b,h as p,j as s}from"./chunk-3XIESWL4.js";var l=o(b(),1),g=o(c(),1);var u=o(p(),1);function v(d){let i=(0,l.c)(8),r,e;i[0]!==d?({className:r,...e}=d,i[0]=d,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=s("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=(0,u.jsx)("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}n(v,"p");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as u,n as d}from"./chunk-HGSIVV32.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import"./chunk-YC52XCPK.js";import{a as c,e as m,g as y,h as b}from"./chunk-3XIESWL4.js";var h=m(y(),1);var n=m(b(),1);var p={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},_=c(o=>{let e=(0,h.c)(6),{data:i}=o,a,r;if(e[0]!==i){r=Symbol.for("react.early_return_sentinel");e:{let f=i.slice(-16);if(f.length<3){r=null;break e}a=f.map(g)}e[0]=i,e[1]=a,e[2]=r}else a=e[1],r=e[2];if(r!==Symbol.for("react.early_return_sentinel"))return r;let s=a,t;e[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)(d,{dataKey:"value"}),e[3]=t):t=e[3];let l;return e[4]!==s?(l=(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28",children:(0,n.jsx)(u,{animationType:"none",barCategoryGap:1,className:"h-8 w-full",config:p,data:s,children:t})}),e[4]=s,e[5]=l):l=e[5],l},"b");function g(o,e){return{index:e,value:o}}c(g,"h");export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as de,c as ie}from"./chunk-PKSAWP56.js";import{a as le}from"./chunk-QWGT25SE.js";import{a as oe}from"./chunk-IGCNMZSB.js";import{a as se}from"./chunk-3CWGJYBB.js";import{a as ae}from"./chunk-RMN2JN4S.js";import{b as re}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Y}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as X}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as ne}from"./chunk-322ZP3GW.js";import"./chunk-XXQUMVWH.js";import"./chunk-P4BOVBMR.js";import"./chunk-QLQADHFE.js";import{a as te}from"./chunk-VDW32UET.js";import{c as ee}from"./chunk-BQNVN2OD.js";import"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as Z}from"./chunk-XQCVZAGU.js";import{d as z,r as V}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as y,e as J,f as ue,g as he,h as fe,j as Q}from"./chunk-3XIESWL4.js";var H=J(he(),1),E=J(ue(),1);var a=J(fe(),1);var ce=y(o=>Math.min(100,Math.max(0,o)),"Q"),pe=y((o,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=ce(o.offsetMs/e*100),s=o.durationMs/e*100,r=Math.max(.5,Math.min(ce(s),100-t));return{leftPercent:t,widthPercent:r}},"ue"),ge=y((o,e)=>{let t=e.trim().toLowerCase();return t===""?[...o]:o.filter(s=>s.rootName.toLowerCase().includes(t)||s.functionPath.toLowerCase().includes(t)||s.traceId.toLowerCase().includes(t))},"he"),G=y(o=>Number.isFinite(o)?o>0&&o<1?`${o.toFixed(2)}ms`:`${String(Math.round(o))}ms`:"\u2014","H"),xe=14,be=y(o=>Array.isArray(o?.traces)?o.traces:[],"pe"),we=y(o=>{let e=(0,H.c)(50),{span:t,traceDurationMs:s}=o,r=z(),n;e[0]!==t||e[1]!==s?(n=pe(t,s),e[0]=t,e[1]=s,e[2]=n):n=e[2];let{leftPercent:p,widthPercent:k}=n,g;e[3]!==t.attributes?(g=le(t.attributes),e[3]=t.attributes,e[4]=g):g=e[4];let P=g,$=t.depth*xe,C;e[5]!==$?(C={paddingLeft:$},e[5]=$,e[6]=C):C=e[6];let x=C,b=`${String(p)}%`,w=`${String(k)}%`,l;e[7]!==b||e[8]!==w?(l={left:b,width:w},e[7]=b,e[8]=w,e[9]=l):l=e[9];let d=l,I=t.depth,u;e[10]!==t.ok||e[11]!==r?(u=t.ok?null:(0,a.jsx)("span",{"aria-label":r("Errored span"),className:"mr-1 text-destructive","data-testid":"tr-span-error",role:"img",children:"\u25CF"}),e[10]=t.ok,e[11]=r,e[12]=u):u=e[12];let h;e[13]!==x||e[14]!==t.name||e[15]!==u?(h=(0,a.jsxs)("span",{className:"w-56 shrink-0 truncate",role:"gridcell",style:x,title:t.name,children:[u,t.name]}),e[13]=x,e[14]=t.name,e[15]=u,e[16]=h):h=e[16];let i;e[17]!==t.durationMs||e[18]!==t.offsetMs||e[19]!==r?(i=r("starts {offset} in, runs {duration}",{duration:G(t.durationMs),offset:G(t.offsetMs)}),e[17]=t.durationMs,e[18]=t.offsetMs,e[19]=r,e[20]=i):i=e[20];let N=t.ok?"bg-primary/70":"bg-destructive",c;e[21]!==N?(c=Q("absolute inset-y-0 rounded-sm",N),e[21]=N,e[22]=c):c=e[22];let m;e[23]!==d||e[24]!==p||e[25]!==c||e[26]!==k?(m=(0,a.jsx)("span",{className:c,"data-left":p,"data-testid":"tr-span-bar","data-width":k,style:d}),e[23]=d,e[24]=p,e[25]=c,e[26]=k,e[27]=m):m=e[27];let f;e[28]!==i||e[29]!==m?(f=(0,a.jsx)("span",{"aria-label":i,className:"relative h-3 flex-1 overflow-hidden rounded-sm bg-muted",role:"gridcell",children:m}),e[28]=i,e[29]=m,e[30]=f):f=e[30];let M;e[31]!==t.durationMs?(M=G(t.durationMs),e[31]=t.durationMs,e[32]=M):M=e[32];let v;e[33]!==M?(v=(0,a.jsx)("span",{className:"w-16 shrink-0 text-right tabular-nums text-muted-foreground",role:"gridcell",children:M}),e[33]=M,e[34]=v):v=e[34];let S;e[35]!==t.error?(S=t.error===void 0?null:(0,a.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=S):S=e[36];let _;e[37]!==S?(_=(0,a.jsx)("span",{className:"w-64 shrink-0 truncate text-muted-foreground",role:"gridcell",children:S}),e[37]=S,e[38]=_):_=e[38];let T;e[39]!==P?(T=P===""?null:(0,a.jsx)("span",{"data-testid":"tr-span-attributes",title:P,children:P}),e[39]=P,e[40]=T):T=e[40];let F;e[41]!==T?(F=(0,a.jsx)("span",{className:"w-64 shrink-0 truncate text-muted-foreground",role:"gridcell",children:T}),e[41]=T,e[42]=F):F=e[42];let A;return e[43]!==t.depth||e[44]!==h||e[45]!==f||e[46]!==v||e[47]!==_||e[48]!==F?(A=(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-1.5 font-mono text-xs last:border-b-0 hover:bg-muted/50","data-depth":I,"data-testid":"tr-span-row",role:"row",children:[h,f,v,_,F]}),e[43]=t.depth,e[44]=h,e[45]=f,e[46]=v,e[47]=_,e[48]=F,e[49]=A):A=e[49],A},"ge"),Ne=y(o=>{let e=(0,H.c)(50),{expanded:t,onToggle:s,trace:r}=o,n=z(),p;e[0]!==s||e[1]!==r.traceId?(p=y(()=>{s(r.traceId)},"p"),e[0]=s,e[1]=r.traceId,e[2]=p):p=e[2];let k=p,g=`tr-row-${r.traceId}`,P=`tr-waterfall-${r.traceId}`,$=`tr-toggle-${r.traceId}`,C=t?"\u25BE":"\u25B8",x;e[3]!==C?(x=(0,a.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:C}),e[3]=C,e[4]=x):x=e[4];let b;e[5]!==r.rootName?(b=(0,a.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=b):b=e[6];let w;e[7]!==r.functionPath?(w=(0,a.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let l;e[9]!==r.durationMs?(l=G(r.durationMs),e[9]=r.durationMs,e[10]=l):l=e[10];let d;e[11]!==l?(d=(0,a.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:l}),e[11]=l,e[12]=d):d=e[12];let I;e[13]!==n||e[14]!==r.spans.length?(I=n("{count} spans",{count:r.spans.length}),e[13]=n,e[14]=r.spans.length,e[15]=I):I=e[15];let u;e[16]!==I?(u=(0,a.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:I}),e[16]=I,e[17]=u):u=e[17];let h=r.ok?"secondary":"destructive",i;e[18]!==n||e[19]!==r.ok?(i=r.ok?n("ok"):n("error"),e[18]=n,e[19]=r.ok,e[20]=i):i=e[20];let N;e[21]!==h||e[22]!==i?(N=(0,a.jsx)("span",{className:"shrink-0",children:(0,a.jsx)(X,{variant:h,children:i})}),e[21]=h,e[22]=i,e[23]=N):N=e[23];let c;e[24]!==r.startTs?(c=V(r.startTs),e[24]=r.startTs,e[25]=c):c=e[25];let m;e[26]!==c?(m=(0,a.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:c}),e[26]=c,e[27]=m):m=e[27];let f;e[28]!==t||e[29]!==k||e[30]!==d||e[31]!==u||e[32]!==N||e[33]!==m||e[34]!==P||e[35]!==$||e[36]!==x||e[37]!==b||e[38]!==w?(f=(0,a.jsxs)("button",{"aria-controls":P,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":$,onClick:k,type:"button",children:[x,b,w,d,u,N,m]}),e[28]=t,e[29]=k,e[30]=d,e[31]=u,e[32]=N,e[33]=m,e[34]=P,e[35]=$,e[36]=x,e[37]=b,e[38]=w,e[39]=f):f=e[39];let M;e[40]!==t||e[41]!==n||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(M=t&&(0,a.jsx)("div",{"aria-label":n("Trace waterfall"),className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,role:"grid",children:r.spans.map(S=>(0,a.jsx)(we,{span:S,traceDurationMs:r.durationMs},S.spanId))}),e[40]=t,e[41]=n,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=M):M=e[45];let v;return e[46]!==f||e[47]!==M||e[48]!==g?(v=(0,a.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":g,children:[f,M]}),e[46]=f,e[47]=M,e[48]=g,e[49]=v):v=e[49],v},"xe"),De=y(o=>{let e=(0,H.c)(44),{initialShardKey:t}=o,s=z(),[r]=(0,E.useState)(de),{queryShardKey:n,setShardKey:p,shardKey:k}=se(r?.shardKey!==void 0&&r.shardKey!==""?r.shardKey:t??""),[g,P]=(0,E.useState)(r?.traceId??""),[$,C]=(0,E.useState)(Me),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0],(0,E.useEffect)(ve,x);let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b={},e[1]=b):b=e[1];let w;e[2]!==n?(w={live:!0,shardKey:n},e[2]=n,e[3]=w):w=e[3];let{data:l,error:d,errorSource:I,isLoading:u,liveError:h}=ee(te.getTraces,b,w),i,N;e[4]!==l||e[5]!==n?(i=y(()=>{l!==void 0&&re(n)},"d"),N=[l,n],e[4]=l,e[5]=n,e[6]=i,e[7]=N):(i=e[6],N=e[7]),(0,E.useEffect)(i,N);let c;if(e[8]!==l||e[9]!==d||e[10]!==I||e[11]!==$||e[12]!==u||e[13]!==h||e[14]!==g||e[15]!==p||e[16]!==k||e[17]!==s){let m=be(l),f=l?.total??m.length,M=f>m.length,v=ge(m,g),S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=y(K=>{P(K.target.value)},"S"),e[19]=S):S=e[19];let _=S,T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=y(K=>{C(me=>{let W=new Set(me);return W.has(K)?W.delete(K):W.add(K),W})},"T"),e[20]=T):T=e[20];let F=T,A=d===null&&v.length===0&&!u,L;e[21]!==p||e[22]!==k?(L=(0,a.jsx)(ae,{onChange:p,testId:"tr-shard-input",value:k}),e[21]=p,e[22]=k,e[23]=L):L=e[23];let j;e[24]!==s?(j=s("Search traces"),e[24]=s,e[25]=j):j=e[25];let D;e[26]!==s?(D=s("search trace or function"),e[26]=s,e[27]=D):D=e[27];let U;e[28]!==g||e[29]!==j||e[30]!==D?(U=(0,a.jsx)(Y,{"aria-label":j,className:"h-8 w-56","data-testid":"tr-search",onChange:_,placeholder:D,value:g}),e[28]=g,e[29]=j,e[30]=D,e[31]=U):U=e[31];let q;e[32]!==h?(q=(0,a.jsx)(oe,{message:h,prefix:"tr"}),e[32]=h,e[33]=q):q=e[33];let B;e[34]!==U||e[35]!==q||e[36]!==L?(B=(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[L,U,q]}),e[34]=U,e[35]=q,e[36]=L,e[37]=B):B=e[37];let O;e[38]!==d||e[39]!==I?(O=d!==null&&(0,a.jsx)(ne,{error:I,testId:"tr-error"}),e[38]=d,e[39]=I,e[40]=O):O=e[40];let R;e[41]!==A||e[42]!==s?(R=A&&(0,a.jsx)(Z,{description:s("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:s("No traces")}),e[41]=A,e[42]=s,e[43]=R):R=e[43],c=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[B,O,R,d===null&&M&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:s("Showing the {shown} most recent of {total} traces in the buffer.",{shown:m.length,total:f})}),d===null&&v.length>0&&(0,a.jsx)("div",{"aria-label":s("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:v.map(K=>(0,a.jsx)(Ne,{expanded:$.has(K.traceId),onToggle:F,trace:K},K.traceId))})]}),e[8]=l,e[9]=d,e[10]=I,e[11]=$,e[12]=u,e[13]=h,e[14]=g,e[15]=p,e[16]=k,e[17]=s,e[18]=c}else c=e[18];return c},"Ae");function Me(){return new Set}y(Me,"be");function ve(){ie()}y(ve,"we");export{De as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _={aiAvailable:"__lunora_admin__:aiAvailable",aiChartConfig:"__lunora_admin__:aiChartConfig",aiGenerateSql:"__lunora_admin__:aiGenerateSql",aiTableFilter:"__lunora_admin__:aiTableFilter",assignIssue:"__lunora_admin__:assignIssue",backRelationCounts:"__lunora_admin__:backRelationCounts",clearCapturedMail:"__lunora_admin__:clearCapturedMail",clearQueueMessages:"__lunora_admin__:clearQueueMessages",clearTable:"__lunora_admin__:clearTable",createWorkflowInstance:"__lunora_admin__:createWorkflowInstance",deleteRows:"__lunora_admin__:deleteRows",describeTable:"__lunora_admin__:describeTable",describeTables:"__lunora_admin__:describeTables",explainIssue:"__lunora_admin__:explainIssue",exportShard:"__lunora_admin__:exportShard",facetColumn:"__lunora_admin__:facetColumn",getAdvisories:"__lunora_admin__:getAdvisories",getAdvisorProcedures:"__lunora_admin__:getAdvisorProcedures",getAuditLog:"__lunora_admin__:getAuditLog",getAuthAuditLog:"__lunora_admin__:getAuthAuditLog",getAuthMetrics:"__lunora_admin__:getAuthMetrics",getCapturedMail:"__lunora_admin__:getCapturedMail",getFanoutMetrics:"__lunora_admin__:getFanoutMetrics",getFunctionStats:"__lunora_admin__:getFunctionStats",getIssues:"__lunora_admin__:getIssues",lintSql:"__lunora_admin__:lintSql",listFlags:"__lunora_admin__:listFlags",listPushSubscriptions:"__lunora_admin__:listPushSubscriptions",listQueues:"__lunora_admin__:listQueues",listSubscriptions:"__lunora_admin__:listSubscriptions",listTableIndexes:"__lunora_admin__:listTableIndexes",listTablesIndexes:"__lunora_admin__:listTablesIndexes",listWorkflows:"__lunora_admin__:listWorkflows",getLogs:"__lunora_admin__:getLogs",getMetricHistory:"__lunora_admin__:getMetricHistory",getMetricSeries:"__lunora_admin__:getMetricSeries",getMetrics:"__lunora_admin__:getMetrics",getPitrBookmark:"__lunora_admin__:getPitrBookmark",getQueryInsights:"__lunora_admin__:getQueryInsights",getQueueMessages:"__lunora_admin__:getQueueMessages",getRequestLog:"__lunora_admin__:getRequestLog",getSecurityAudit:"__lunora_admin__:getSecurityAudit",getSettings:"__lunora_admin__:getSettings",getTraces:"__lunora_admin__:getTraces",getWorkflowInstanceStatus:"__lunora_admin__:getWorkflowInstanceStatus",ignoreIssue:"__lunora_admin__:ignoreIssue",importShard:"__lunora_admin__:importShard",listTables:"__lunora_admin__:listTables",maskPolicies:"__lunora_admin__:maskPolicies",migrationStatus:"__lunora_admin__:migrationStatus",pitrRestore:"__lunora_admin__:pitrRestore",readTablePage:"__lunora_admin__:readTablePage",replayQueueMessage:"__lunora_admin__:replayQueueMessage",resolveIssue:"__lunora_admin__:resolveIssue",rlsPolicies:"__lunora_admin__:rlsPolicies",schemaHistory:"__lunora_admin__:schemaHistory",schemaVersion:"__lunora_admin__:schemaVersion",runAs:"__lunora_admin__:runAs",runMigration:"__lunora_admin__:runMigration",runSql:"__lunora_admin__:runSql",sendQueueMessage:"__lunora_admin__:sendQueueMessage",sendTestMail:"__lunora_admin__:sendTestMail",setIssueSeverity:"__lunora_admin__:setIssueSeverity",storageOrphans:"__lunora_admin__:storageOrphans",storageReferences:"__lunora_admin__:storageReferences",storageRules:"__lunora_admin__:storageRules",studioFeatures:"__lunora_admin__:studioFeatures",writeRow:"__lunora_admin__:writeRow"};export{_ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G}from"./chunk-V53KNYRN.js";import{a as g}from"./chunk-5Y3QLNWX.js";import{a as B}from"./chunk-RMN2JN4S.js";import{b as U}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as O}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as h}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as w}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as M}from"./chunk-VDW32UET.js";import{f as D}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{d as K,e as _,f as z,h as P,o as q,r as E}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as s,e as T,f as ie,h as oe}from"./chunk-3XIESWL4.js";var i=T(ie(),1);var e=T(oe(),1);var de=s(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"ie"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"oe"),ue=s(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"de"),ce=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ue(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(M.runAs),fe=10,pe=s(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"me"),Fe=s(({functions:r,runAsIdentity:o=!1}={})=>{let a=K(),c=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),x=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[u,F]=(0,i.useState)(""),[f,W]=(0,i.useState)(""),[v,p]=(0,i.useState)("idle"),[X,y]=(0,i.useState)(void 0),[C,N]=(0,i.useState)(null),[$,Y]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(r!==void 0)return;let t=!1;return c.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(P(d))}),()=>{t=!0}},[c,r]);let R=I===""?x[0]?.path??"":I,n=x.find(t=>t.path===R),Z=s(async()=>{if(!n)return;let t;try{t=m.trim()===""?{}:JSON.parse(m)}catch(l){p("error"),y(void 0),N(a("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:n.path},j=u.trim()===""?{}:{shardKey:u.trim()},A=o?f.trim():"",J=s(l=>{Y(L=>[{argsText:m,at:Date.now(),id:(L[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:u,status:l},...L].slice(0,fe))},"j");p("running"),N(null);try{let l=A===""?await _(c,n.kind,d,t,j):await c.query(me,{args:t,functionPath:n.path,userId:A},j);U(u),y(l),p("success"),J("success")}catch(l){y(void 0),N(l.message),p("error"),J("error")}},"_"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"q"),te=s(t=>{S(t.target.value)},"B"),re=s(t=>{b(t.target.value)},"D"),ae=s(t=>{W(t.target.value)},"E"),se=s(()=>{q(Z())},"U"),ne=s(()=>{b(ce(n?.args))},"X");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(g,{htmlFor:"function-select",children:a("Function")}),(0,e.jsx)("select",{"aria-label":a("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:R,children:x.map(t=>(0,e.jsxs)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path))}),n!==void 0&&(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"mr-1.5 font-medium",children:a("Signature")}),(0,e.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:le(n.args)})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(g,{htmlFor:"args-input",children:a("Arguments")}),(0,e.jsx)(h,{"data-testid":"prefill-button",disabled:n===void 0,onClick:ne,size:"xs",type:"button",variant:"ghost",children:a("Prefill")})]}),(0,e.jsx)(G,{"aria-label":a("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:m})]}),(0,e.jsx)(B,{onChange:F,testId:"shard-input",value:u}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(g,{htmlFor:"run-as-input",children:a("Run as identity (userId)")}),(0,e.jsx)(O,{"aria-label":a("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:ae,placeholder:a("Leave empty to run as admin"),value:f}),(0,e.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(h,{"data-testid":"run-button",disabled:v==="running"||n===void 0,onClick:se,type:"button",children:a("Run")}),n!==void 0&&(0,e.jsx)(w,{variant:"outline",children:n.kind}),o&&f.trim()!==""&&(0,e.jsx)(w,{"data-testid":"run-as-badge",variant:"secondary",children:a("as {userId}",{userId:f.trim()})})]})]}),v==="error"&&C!==null&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C}),v==="success"&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:pe(X)}),$.length>0&&(0,e.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:$.map((t,d)=>(0,e.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsx)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"})," ",(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]})," ",(0,e.jsx)("time",{className:"text-xs text-muted-foreground",children:E(t.at)})," ",(0,e.jsx)(h,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:s(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Load")})]},t.id))})]})},"Ie");export{Fe as FunctionRunner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as jt}from"./chunk-PKSAWP56.js";import{a as me}from"./chunk-TMGHRD6W.js";import{a as Kt,b as Lt,c as At,d as Ot,e as ot}from"./chunk-Y7XGNPT6.js";import{a as zt}from"./chunk-QWGT25SE.js";import{e as Dt}from"./chunk-XF2B7P5A.js";import{a as It,b as Ct,c as Tt,d as Rt,e as Pe}from"./chunk-MKYEFQCA.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as _t}from"./chunk-IGCNMZSB.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as et,b as tt,c as rt,d as yt,e as Nt,f as at,g as st,h as St,i as wt}from"./chunk-HGSIVV32.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import{a as Mt}from"./chunk-3CWGJYBB.js";import{a as $t}from"./chunk-RMN2JN4S.js";import{a as qt,b as kt}from"./chunk-GRL5MG3Z.js";import{e as ut}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as Ze}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as Be}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as Le}from"./chunk-VDW32UET.js";import{c as je}from"./chunk-BQNVN2OD.js";import{f as mt}from"./chunk-M3NGYXDR.js";import"./chunk-XBDKZZ67.js";import{a as ft}from"./chunk-XQCVZAGU.js";import{a as lt,b as nt,c as it,d as Ee,e as ce,f as B}from"./chunk-WJQLNYGX.js";import{a as fe,b as Ae,c as Oe,d as gt,e as pe}from"./chunk-WQH3LT2P.js";import{d as ge,f as pt,g as xt,h as bt,i as vt,l as Ge,o as Ue}from"./chunk-IUYFXK4X.js";import"./chunk-YC52XCPK.js";import{a as o,e as Ye,f as Ft,g as Jt,h as Ht,j as ht}from"./chunk-3XIESWL4.js";var P=Ye(Ft(),1);var xe=Ye(Jt(),1);var t=Ye(Ht(),1);var Wt=o((s,e)=>s<e?-1:s>e?1:0,"Jt"),ct=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s))return`[${s.map(c=>ct(c)).join(",")}]`;let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let c=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${c} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).toSorted(Wt),r=[];for(let c of a){let i=l[c];i!==void 0&&r.push(`${JSON.stringify(c)}:${ct(i)}`)}return`{${r.join(",")}}`},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${ct(l??{})}`,"gt"),Qt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"ft"),Bt=o((s,e)=>Qt(s,e),"Ht"),Gt=o(s=>Qt(s.kind,s),"Gt"),dt=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"Xe"),Vt=o(s=>Array.isArray(s?.series)?s.series:[],"Wt"),Xt="FUNCTION_NOT_FOUND",Yt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Yt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},Ut=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,c=ge();if(r===void 0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=u):u=e[0],u}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let u=`mt-instrument-trace-${l}`,h;return e[3]!==n||e[4]!==u||e[5]!==r?(h=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":u,title:r,children:n}),e[3]=n,e[4]=u,e[5]=r,e[6]=h):h=e[6],h}let $=`mt-instrument-trace-${l}`,f;e[7]!==a||e[8]!==r?(f=o(()=>{a(r)},"f"),e[7]=a,e[8]=r,e[9]=f):f=e[9];let S;e[10]!==c||e[11]!==r?(S=c("Open the exemplar trace {trace}",{trace:r}),e[10]=c,e[11]=r,e[12]=S):S=e[12];let p;return e[13]!==n||e[14]!==$||e[15]!==f||e[16]!==S?(p=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":$,onClick:f,title:S,type:"button",children:n}),e[13]=n,e[14]=$,e[15]=f,e[16]=S,e[17]=p):p=e[17],p},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:$,errorSource:f}=je(Le.getMetricSeries,c,i),S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S={},e[3]=S):S=e[3];let p;e[4]!==a?(p={live:!0,shardKey:a},e[4]=a,e[5]=p):p=e[5];let{data:u}=je(Le.getMetricHistory,S,p),h,M,b,w,_,d,g,x,q,k,y,D,I;if(e[6]!==n||e[7]!==$||e[8]!==f||e[9]!==u||e[10]!==l||e[11]!==r){x=Symbol.for("react.early_return_sentinel");e:{let A=Vt(n),j=vt(f)===Xt;if($!==null&&!j){let m;e[25]!==r?(m=r("Instruments"),e[25]=r,e[26]=m):m=e[26];let E;e[27]!==m?(E=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[27]=m,e[28]=E):E=e[28];let Q;e[29]!==$||e[30]!==r?(Q=r("Instruments unavailable: {error}",{error:$}),e[29]=$,e[30]=r,e[31]=Q):Q=e[31];let F;e[32]!==Q?(F=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:Q}),e[32]=Q,e[33]=F):F=e[33];let de;e[34]!==E||e[35]!==F?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[E,F]}),e[34]=E,e[35]=F,e[36]=de):de=e[36],x=de;break e}if(A.length===0){x=null;break e}let J=Yt(u),K;e[37]!==r?(K=o(m=>r(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),"L"),e[37]=r,e[38]=K):K=e[38];let H=K;_="flex flex-col gap-2",d="mt-instruments";let L;e[39]!==r?(L=r("Instruments"),e[39]=r,e[40]=L):L=e[40],e[41]!==L?(g=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:L}),e[41]=L,e[42]=g):g=e[42],w=fe,I="overflow-hidden py-0",b=pe,D="px-0",M=lt,k="mt-instruments-table";let O;e[43]!==r?(O=r("name"),e[43]=r,e[44]=O):O=e[44];let G;e[45]!==O?(G=(0,t.jsx)(ce,{children:O}),e[45]=O,e[46]=G):G=e[46];let V;e[47]!==r?(V=r("kind"),e[47]=r,e[48]=V):V=e[48];let X;e[49]!==V?(X=(0,t.jsx)(ce,{children:V}),e[49]=V,e[50]=X):X=e[50];let Y;e[51]!==r?(Y=r("value"),e[51]=r,e[52]=Y):Y=e[52];let Z;e[53]!==Y?(Z=(0,t.jsx)(ce,{className:"text-right",children:Y}),e[53]=Y,e[54]=Z):Z=e[54];let U;e[55]!==r?(U=r("count"),e[55]=r,e[56]=U):U=e[56];let ee;e[57]!==U?(ee=(0,t.jsx)(ce,{className:"text-right",children:U}),e[57]=U,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==X||e[77]!==Z||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(y=(0,t.jsx)(nt,{children:(0,t.jsxs)(Ee,{children:[G,X,Z,ee,re,se,ne,oe]})}),e[75]=G,e[76]=X,e[77]=Z,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=y):y=e[83],h=it,q=A.map(m=>{let E=zt(m.attributes),Q=Pt(m.kind,m.name,m.attributes),F=(J.get(Q)??[]).map(de=>Bt(m.kind,de));return(0,t.jsxs)(Ee,{"data-testid":`mt-instrument-${m.name}`,children:[(0,t.jsx)(B,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),(0,t.jsx)(B,{children:(0,t.jsx)(Be,{variant:Zt[m.kind],children:H(m.kind)})}),(0,t.jsx)(B,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:dt(Gt(m))}),(0,t.jsx)(B,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),(0,t.jsx)(B,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"\u2014":`${dt(m.min)}\u2013${dt(m.max)}`}),(0,t.jsx)(B,{children:F.length>=2?(0,t.jsx)(ot,{ariaLabel:r("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:F,testId:`mt-instrument-trend-${m.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(B,{className:"font-mono text-xs",children:(0,t.jsx)(Ut,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),(0,t.jsx)(B,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:E,children:E===""?"\u2014":E})]},Q)})}e[6]=n,e[7]=$,e[8]=f,e[9]=u,e[10]=l,e[11]=r,e[12]=h,e[13]=M,e[14]=b,e[15]=w,e[16]=_,e[17]=d,e[18]=g,e[19]=x,e[20]=q,e[21]=k,e[22]=y,e[23]=D,e[24]=I}else h=e[12],M=e[13],b=e[14],w=e[15],_=e[16],d=e[17],g=e[18],x=e[19],q=e[20],k=e[21],y=e[22],D=e[23],I=e[24];if(x!==Symbol.for("react.early_return_sentinel"))return x;let C;e[84]!==h||e[85]!==q?(C=(0,t.jsx)(h,{children:q}),e[84]=h,e[85]=q,e[86]=C):C=e[86];let T;e[87]!==M||e[88]!==C||e[89]!==k||e[90]!==y?(T=(0,t.jsxs)(M,{"data-testid":k,children:[y,C]}),e[87]=M,e[88]=C,e[89]=k,e[90]=y,e[91]=T):T=e[91];let N;e[92]!==b||e[93]!==T||e[94]!==D?(N=(0,t.jsx)(b,{className:D,children:T}),e[92]=b,e[93]=T,e[94]=D,e[95]=N):N=e[95];let v;e[96]!==w||e[97]!==N||e[98]!==I?(v=(0,t.jsx)(w,{className:I,children:N}),e[96]=w,e[97]=N,e[98]=I,e[99]=v):v=e[99];let z;return e[100]!==_||e[101]!==d||e[102]!==g||e[103]!==v?(z=(0,t.jsxs)("section",{className:_,"data-testid":d,children:[g,v]}),e[100]=_,e[101]=d,e[102]=g,e[103]=v,e[104]=z):z=e[104],z},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),c;e[0]!==r?(c=r("Shards"),e[0]=r,e[1]=c):c=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==c||e[7]!==i?(n=(0,t.jsx)(me,{label:c,testId:"mt-agg-shards",value:i}),e[6]=c,e[7]=i,e[8]=n):n=e[8];let $;e[9]!==r?($=r("Total requests"),e[9]=r,e[10]=$):$=e[10];let f;e[11]!==l.totalRequests||e[12]!==$?(f=(0,t.jsx)(me,{label:$,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=$,e[13]=f):f=e[13];let S;e[14]!==r?(S=r("Total errors"),e[14]=r,e[15]=S):S=e[15];let p;e[16]!==l.totalErrors||e[17]!==S?(p=(0,t.jsx)(me,{label:S,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=S,e[18]=p):p=e[18];let u;e[19]!==r?(u=r("Total database size"),e[19]=r,e[20]=u):u=e[20];let h;e[21]!==l.totalDatabaseSize?(h=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=h):h=e[22];let M;e[23]!==u||e[24]!==h?(M=(0,t.jsx)(me,{label:u,testId:"mt-agg-db-size",value:h}),e[23]=u,e[24]=h,e[25]=M):M=e[25];let b;e[26]!==r?(b=r("Combined cache hit rate"),e[26]=r,e[27]=b):b=e[27];let w;e[28]!==l.hitRate||e[29]!==r?(w=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=w):w=e[30];let _;e[31]!==b||e[32]!==w?(_=(0,t.jsx)(me,{label:b,testId:"mt-agg-cache",value:w}),e[31]=b,e[32]=w,e[33]=_):_=e[33];let d;e[34]!==M||e[35]!==_||e[36]!==n||e[37]!==f||e[38]!==p?(d=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,f,p,M,_]}),e[34]=M,e[35]=_,e[36]=n,e[37]=f,e[38]=p,e[39]=d):d=e[39];let g;e[40]!==r?(g=r("shard"),e[40]=r,e[41]=g):g=e[41];let x;e[42]!==g?(x=(0,t.jsx)(ce,{children:g}),e[42]=g,e[43]=x):x=e[43];let q;e[44]!==r?(q=r("requests"),e[44]=r,e[45]=q):q=e[45];let k;e[46]!==q?(k=(0,t.jsx)(ce,{children:q}),e[46]=q,e[47]=k):k=e[47];let y;e[48]!==r?(y=r("errors"),e[48]=r,e[49]=y):y=e[49];let D;e[50]!==y?(D=(0,t.jsx)(ce,{children:y}),e[50]=y,e[51]=D):D=e[51];let I;e[52]!==r?(I=r("db size"),e[52]=r,e[53]=I):I=e[53];let C;e[54]!==I?(C=(0,t.jsx)(ce,{children:I}),e[54]=I,e[55]=C):C=e[55];let T;e[56]!==x||e[57]!==k||e[58]!==D||e[59]!==C?(T=(0,t.jsx)(nt,{children:(0,t.jsxs)(Ee,{children:[x,k,D,C]})}),e[56]=x,e[57]=k,e[58]=D,e[59]=C,e[60]=T):T=e[60];let N;if(e[61]!==a||e[62]!==r){let j;e[64]!==r?(j=o(J=>(0,t.jsxs)(Ee,{"data-testid":`mt-agg-row-${J.shard}`,children:[(0,t.jsx)(B,{children:J.shard}),J.metrics===null?(0,t.jsx)(B,{className:"text-destructive",colSpan:3,children:J.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{className:"tabular-nums",children:J.metrics.requests}),(0,t.jsx)(B,{className:"tabular-nums",children:J.metrics.errors}),(0,t.jsx)(B,{className:"tabular-nums",children:Ge(J.metrics.databaseSize)})]})]},J.shard),"K"),e[64]=r,e[65]=j):j=e[65],N=a.map(j),e[61]=a,e[62]=r,e[63]=N}else N=e[63];let v;e[66]!==N?(v=(0,t.jsx)(it,{children:N}),e[66]=N,e[67]=v):v=e[67];let z;e[68]!==T||e[69]!==v?(z=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(lt,{"data-testid":"mt-agg-table",children:[T,v]})})}),e[68]=T,e[69]=v,e[70]=z):z=e[70];let A;return e[71]!==d||e[72]!==z?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[d,z]}),e[71]=d,e[72]=z,e[73]=A):A=e[73],A},"tr"),rr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"rr"),ar=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"ar"),Et=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ct"),sr=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:c,metrics:i}=s,n=ge(),$;e[0]!==r||e[1]!==n?($=r.length>=2?(0,t.jsx)(ot,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=$):$=e[2];let f;e[3]!==l||e[4]!==r.length||e[5]!==n?(f=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=f):f=e[6];let S;e[7]!==n?(S=n("Requests"),e[7]=n,e[8]=S):S=e[8];let p;e[9]!==i.requests||e[10]!==$||e[11]!==f||e[12]!==S?(p=(0,t.jsx)(me,{chart:$,footer:f,label:S,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=$,e[11]=f,e[12]=S,e[13]=p):p=e[13];let u;e[14]!==a||e[15]!==n?(u=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=u):u=e[16];let h;e[17]!==n?(h=n("Errors"),e[17]=n,e[18]=h):h=e[18];let M;e[19]!==a||e[20]!==i.errors?(M=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=M):M=e[21];let b;e[22]!==u||e[23]!==h||e[24]!==M?(b=(0,t.jsx)(me,{footer:u,label:h,testId:"mt-errors",value:M}),e[22]=u,e[23]=h,e[24]=M,e[25]=b):b=e[25];let w;e[26]!==c.p90?(w=c.p90>0?`P90 ${Et(c.p90)}`:void 0,e[26]=c.p90,e[27]=w):w=e[27];let _;e[28]!==n?(_=n("P95 latency"),e[28]=n,e[29]=_):_=e[29];let d;e[30]!==c.p95?(d=c.p95>0?Et(c.p95):"\u2014",e[30]=c.p95,e[31]=d):d=e[31];let g;e[32]!==_||e[33]!==d||e[34]!==w?(g=(0,t.jsx)(me,{footer:w,label:_,testId:"mt-p95",value:d}),e[32]=_,e[33]=d,e[34]=w,e[35]=g):g=e[35];let x;e[36]!==i.cache||e[37]!==n?(x=i.cache===null?void 0:`${i.cache.entries.toLocaleString()} ${n("cache entries")}`,e[36]=i.cache,e[37]=n,e[38]=x):x=e[38];let q;e[39]!==n?(q=n("Database size"),e[39]=n,e[40]=q):q=e[40];let k;e[41]!==i.databaseSize?(k=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=k):k=e[42];let y;e[43]!==x||e[44]!==q||e[45]!==k?(y=(0,t.jsx)(me,{footer:x,label:q,testId:"mt-db-size",value:k}),e[43]=x,e[44]=q,e[45]=k,e[46]=y):y=e[46];let D;e[47]!==n?(D=n("Shard"),e[47]=n,e[48]=D):D=e[48];let I;e[49]!==i.shard||e[50]!==D?(I=(0,t.jsx)(me,{label:D,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=D,e[51]=I):I=e[51];let C;e[52]!==n?(C=n("Uptime"),e[52]=n,e[53]=C):C=e[53];let T;e[54]!==i.uptimeMs?(T=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=T):T=e[55];let N;e[56]!==C||e[57]!==T?(N=(0,t.jsx)(me,{label:C,testId:"mt-uptime",value:T}),e[56]=C,e[57]=T,e[58]=N):N=e[58];let v;e[59]!==n?(v=n("Cache hit rate"),e[59]=n,e[60]=v):v=e[60];let z;e[61]!==i.cache||e[62]!==n?(z=i.cache===null?n("no cache configured"):n("{rate} ({count} entries)",{count:i.cache.entries,rate:ar(i.cache.hits,i.cache.misses)}),e[61]=i.cache,e[62]=n,e[63]=z):z=e[63];let A;e[64]!==v||e[65]!==z?(A=(0,t.jsx)(me,{label:v,testId:"mt-cache",value:z}),e[64]=v,e[65]=z,e[66]=A):A=e[66];let j;return e[67]!==g||e[68]!==y||e[69]!==I||e[70]!==N||e[71]!==A||e[72]!==p||e[73]!==b?(j=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[p,b,g,y,I,N,A]}),e[67]=g,e[68]=y,e[69]=I,e[70]=N,e[71]=A,e[72]=p,e[73]=b,e[74]=j):j=e[74],j},"lr"),Xe=o(s=>s>=100?"critical":s>=50?"warning":"good","Ge"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Oe"),Ve=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"Be"),lr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(Be,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"sr"),nr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"nr"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,c]=(0,P.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,$]=(0,P.useState)(i),f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=o(I=>{I!==null&&c(I)},"f"),e[1]=f):f=e[1];let S=f,p,u,h,M,b,w,_,d,g,x;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){h=Symbol.for("react.early_return_sentinel");e:{let I=nr(l,r),C;e[16]!==l?(C=l.filter(or),e[16]=l,e[17]=C):C=e[17];let T=C.length,N;e[18]!==l?(N=l.filter(dr),e[18]=l,e[19]=N):N=e[19];let v=N.length,z;e[20]!==l?(z=l.filter(cr),e[20]=l,e[21]=z):z=e[21];let A=z.length,j;e[22]===Symbol.for("react.memo_cache_sentinel")?(j=o(R=>{$(ue=>{let W=new Set(ue);return W.has(R)?W.delete(R):W.add(R),W})},"K"),e[22]=j):j=e[22];let J=j;if(l.length===0){let R;e[23]!==a?(R=a("No query insights yet"),e[23]=a,e[24]=R):R=e[24];let ue;e[25]!==R?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:R}),e[25]=R,e[26]=ue):ue=e[26];let W;e[27]!==a?(W=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=W):W=e[28];let he;e[29]!==W?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:W}),e[29]=W,e[30]=he):he=e[30];let We;e[31]!==ue||e[32]!==he?(We=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=We):We=e[33],h=We;break e}_="space-y-4",d="qi-root";let K;e[34]!==a?(K=a("Critical queries"),e[34]=a,e[35]=K):K=e[35];let H;e[36]!==K?(H=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Oe,{className:"text-sm font-medium",children:K})}),e[36]=K,e[37]=H):H=e[37];let L;e[38]!==T?(L=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:T}),e[38]=T,e[39]=L):L=e[39];let O;e[40]!==a?(O=a(">100ms avg execution"),e[40]=a,e[41]=O):O=e[41];let G;e[42]!==O?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:O}),e[42]=O,e[43]=G):G=e[43];let V;e[44]!==L||e[45]!==G?(V=(0,t.jsxs)(pe,{children:[L,G]}),e[44]=L,e[45]=G,e[46]=V):V=e[46];let X;e[47]!==H||e[48]!==V?(X=(0,t.jsxs)(fe,{children:[H,V]}),e[47]=H,e[48]=V,e[49]=X):X=e[49];let Y;e[50]!==a?(Y=a("Moderate queries"),e[50]=a,e[51]=Y):Y=e[51];let Z;e[52]!==Y?(Z=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Oe,{className:"text-sm font-medium",children:Y})}),e[52]=Y,e[53]=Z):Z=e[53];let U;e[54]!==v?(U=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:v}),e[54]=v,e[55]=U):U=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==U||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[U,te]}),e[60]=U,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Z||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Z,re]}),e[63]=Z,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Oe,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==A?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:A}),e[70]=A,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let m;e[76]!==ne||e[77]!==oe?(m=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=m):m=e[78];let E;e[79]!==le||e[80]!==m?(E=(0,t.jsxs)(fe,{children:[le,m]}),e[79]=le,e[80]=m,e[81]=E):E=e[81],e[82]!==X||e[83]!==ae||e[84]!==E?(g=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[X,ae,E]}),e[82]=X,e[83]=ae,e[84]=E,e[85]=g):g=e[85];let Q;e[86]!==a?(Q=a("Query leaderboard"),e[86]=a,e[87]=Q):Q=e[87];let F;e[88]!==Q?(F=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:Q}),e[88]=Q,e[89]=F):F=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==F||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[F,be]}),e[95]=F,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Fe;e[104]===Symbol.for("react.memo_cache_sentinel")?(Fe=(0,t.jsx)(Ct,{}),e[104]=Fe):Fe=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(Tt,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Fe}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let ke;e[109]!==qe?(ke=(0,t.jsx)(Pe,{value:"totalTime",children:qe}),e[109]=qe,e[110]=ke):ke=e[110];let $e;e[111]!==a?($e=a("Avg time"),e[111]=a,e[112]=$e):$e=e[112];let Me;e[113]!==$e?(Me=(0,t.jsx)(Pe,{value:"avgTime",children:$e}),e[113]=$e,e[114]=Me):Me=e[114];let _e;e[115]!==a?(_e=a("Execution count"),e[115]=a,e[116]=_e):_e=e[116];let De;e[117]!==_e?(De=(0,t.jsx)(Pe,{value:"execCount",children:_e}),e[117]=_e,e[118]=De):De=e[118];let Ie;e[119]!==a?(Ie=a("Rows read"),e[119]=a,e[120]=Ie):Ie=e[120];let Ce;e[121]!==Ie?(Ce=(0,t.jsx)(Pe,{value:"rowsRead",children:Ie}),e[121]=Ie,e[122]=Ce):Ce=e[122];let Te;e[123]!==ke||e[124]!==Me||e[125]!==De||e[126]!==Ce?(Te=(0,t.jsxs)(Rt,{children:[ke,Me,De,Ce]}),e[123]=ke,e[124]=Me,e[125]=De,e[126]=Ce,e[127]=Te):Te=e[127];let Re;e[128]!==r||e[129]!==we||e[130]!==Te?(Re=(0,t.jsxs)(It,{onValueChange:S,value:r,children:[we,Te]}),e[128]=r,e[129]=we,e[130]=Te,e[131]=Re):Re=e[131];let ze;e[132]!==Ne||e[133]!==Re?(ze=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Re]}),e[132]=Ne,e[133]=Re,e[134]=ze):ze=e[134],e[135]!==ve||e[136]!==ze?(x=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,ze]}),e[135]=ve,e[136]=ze,e[137]=x):x=e[137],u=fe;let Ke;e[138]!==a?(Ke=a("Statements"),e[138]=a,e[139]=Ke):Ke=e[139];let Je;e[140]!==Ke?(Je=(0,t.jsx)(Oe,{children:Ke}),e[140]=Ke,e[141]=Je):Je=e[141],w=(0,t.jsxs)(Ae,{children:[Je,(0,t.jsx)(gt,{children:a("{count} tracked statements",{count:I.length})})]}),p=pe,M="space-y-2";let He;e[142]!==n||e[143]!==a?(He=o(R=>{let ue=R.normalizedSql,W=n.has(ue),he=Xe(R.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":W,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{J(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(lr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),R.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(R.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),W&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[R.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsWritten)})]})]})]})]},ue)},"Ee"),e[142]=n,e[143]=a,e[144]=He):He=e[144],b=I.map(He)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=p,e[7]=u,e[8]=h,e[9]=M,e[10]=b,e[11]=w,e[12]=_,e[13]=d,e[14]=g,e[15]=x}else p=e[6],u=e[7],h=e[8],M=e[9],b=e[10],w=e[11],_=e[12],d=e[13],g=e[14],x=e[15];if(h!==Symbol.for("react.early_return_sentinel"))return h;let q;e[145]!==M||e[146]!==b?(q=(0,t.jsx)("div",{className:M,children:b}),e[145]=M,e[146]=b,e[147]=q):q=e[147];let k;e[148]!==p||e[149]!==q?(k=(0,t.jsx)(p,{children:q}),e[148]=p,e[149]=q,e[150]=k):k=e[150];let y;e[151]!==u||e[152]!==k||e[153]!==w?(y=(0,t.jsxs)(u,{children:[w,k]}),e[151]=u,e[152]=k,e[153]=w,e[154]=y):y=e[154];let D;return e[155]!==y||e[156]!==_||e[157]!==d||e[158]!==g||e[159]!==x?(D=(0,t.jsxs)("div",{className:_,"data-testid":d,children:[g,x,y]}),e[155]=y,e[156]=_,e[157]=d,e[158]=g,e[159]=x,e[160]=D):D=e[160],D},"ir");function or(s){return Xe(s.avgDurationMs)==="critical"}o(or,"or");function dr(s){return Xe(s.avgDurationMs)==="warning"}o(dr,"cr");function cr(s){return Xe(s.avgDurationMs)==="good"}o(cr,"dr");var mr=["1m","5m","15m","1h"],ur=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ur"),hr=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:ur(e.bucketMs)})),"hr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,P.useState)("15m"),r=je(Le.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,c=hr(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:mr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:ht("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(Be,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),c.length===0?(0,t.jsx)(ft,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(et,{height:140,width:"100%",children:(0,t.jsxs)(wt,{data:c,children:[(0,t.jsx)(rt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(at,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(st,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(tt,{}),(0,t.jsx)(Nt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(et,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:c,children:[(0,t.jsx)(rt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(at,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(st,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(tt,{}),(0,t.jsx)(yt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"gr"),fr=pt(Le.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),Pr=o(({initialShardKey:s})=>{let e=mt(),l=ge(),a=ut(),{queryShardKey:r,setShardKey:c,shardKey:i}=Mt(s),[n,$]=(0,P.useState)("overview"),[f,S]=(0,P.useState)([]),p=(0,P.useRef)(null),u=(0,P.useRef)(null),h=(0,P.useRef)(!0);(0,P.useEffect)(()=>(h.current=!0,()=>{h.current=!1}),[]);let M=o(K=>{jt({shardKey:r,traceId:K}),Ue(a({to:"/traces"}))},"M"),{data:b,error:w,liveError:_}=je(Le.getMetrics,{},{live:!0,shardKey:r}),d=b??null;(0,P.useEffect)(()=>{if(b===void 0)return;kt(r);let K=b,H=p.current,L=u.current!==null&&u.current!==K.shard;if(u.current=K.shard,p.current=K.requests,L){S([]);return}H!==null&&K.requests>=H&&S(O=>[...O,K.requests-H].slice(-30))},[b,r]);let[g,x]=(0,P.useState)(null),[q,k]=(0,P.useState)(!1),y=o(async()=>{k(!0);let K=Lt(i,qt());try{let H=await Promise.all(K.map(async L=>{try{let O=await e.query(fr,{},xt(L));return{error:null,metrics:O,shard:L===""?O.shard:L}}catch(O){return{error:bt(O),metrics:null,shard:L===""?"__root__":L}}}));h.current&&x(H)}finally{h.current&&k(!1)}},"y"),D=g===null?null:Kt(g),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,C=f.length>0?f.at(-1):0,T=d?At(d):{p90:0,p95:0},N=(0,P.useMemo)(()=>{if(!d||!("queryStats"in d))return;let K=d.queryStats;if(!(!K||!Array.isArray(K)))return Ot(K)},[d]),v=pr(N!==void 0,n),z=o(()=>{Ue(y())},"T"),A=o(()=>{x(null)},"z"),j=o(()=>{$("overview")},"K"),J=o(()=>{$("query-insights")},"U");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)($t,{onChange:c,testId:"mt-shard-input",value:i}),(0,t.jsx)(_t,{message:_,prefix:"mt"}),(0,t.jsx)(Ze,{"data-testid":"mt-aggregate",disabled:q,onClick:z,size:"sm",type:"button",variant:"secondary",children:l(q?"Aggregating\u2026":"All shards")}),g!==null&&(0,t.jsx)(Ze,{"data-testid":"mt-aggregate-clear",onClick:A,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:Dt,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),w!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:w}),N!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:j,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:J,type:"button",children:[l("Query insights"),N.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:N.length})]})]}),v==="query-insights"&&N!==void 0&&(0,t.jsx)(gr,{shardKey:r}),v==="overview"&&d!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:f,latencyPercentiles:T,metrics:d}),v==="overview"&&d===null&&null,v==="overview"&&(0,t.jsx)(er,{onOpenTrace:M,shardKey:r}),v==="overview"&&D!==null&&g!==null&&(0,t.jsx)(tr,{aggregate:D,shardResults:g})]})},"Qr");export{Pr as MetricsPanel};
|