@jingyi0605/codingns 0.6.1 → 0.7.0
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/bin/codingns.mjs +225 -0
- package/dist/public/assets/AdaptiveButlerPage-B8mg25ze.js +3 -0
- package/dist/public/assets/{App-Dsf3ooXU.js → App-C2lNmeKL.js} +6 -6
- package/dist/public/assets/{BootstrapPage-CE0m1qSR.js → BootstrapPage-CAVA-a8h.js} +1 -1
- package/dist/public/assets/ConversationPage-B6BGOX4C.js +6 -0
- package/dist/public/assets/{DesktopDetachPreviewPage-Dxarr_Wf.js → DesktopDetachPreviewPage-B37DUL15.js} +1 -1
- package/dist/public/assets/{DesktopWindowPage-VytPwJ4c.js → DesktopWindowPage-CDA6l7lm.js} +1 -1
- package/dist/public/assets/{FileContextPanel-DwFzLsOp.js → FileContextPanel-CMGTtAB6.js} +1 -1
- package/dist/public/assets/{GitSidebar-CH6WqTrM.js → GitSidebar--DCqBiGL.js} +1 -1
- package/dist/public/assets/{MobileCreateSessionSheet-DcxKM00P.js → MobileCreateSessionSheet-THIrIzJ3.js} +1 -1
- package/dist/public/assets/{MobileTopHeaderFrame-C5rIKQT6.js → MobileTopHeaderFrame-D-X7pVnV.js} +1 -1
- package/dist/public/assets/{MobileWorkspaceSwitcherHeader-CfUnHgv_.js → MobileWorkspaceSwitcherHeader-Cczi7RYu.js} +1 -1
- package/dist/public/assets/{RelayConnectEntryPage-CgMvVZwa.js → RelayConnectEntryPage-D417tgWj.js} +1 -1
- package/dist/public/assets/{ServerSettingsModal-CFul__z1.js → ServerSettingsModal-BdTxbRbU.js} +1 -1
- package/dist/public/assets/SessionIndexPage-D5iefVcc.js +1 -0
- package/dist/public/assets/SettingsPage-iCFe_DHP.js +2 -0
- package/dist/public/assets/{TerminalManagerPanel-BbORd-ee.js → TerminalManagerPanel-CtldwWz8.js} +1 -1
- package/dist/public/assets/{TerminalPage-DWHv6mlu.js → TerminalPage-DAzQTmQC.js} +19 -19
- package/dist/public/assets/{TerminalRuntimeFallbackModal-B29YxbQe.js → TerminalRuntimeFallbackModal-DLOhAvaq.js} +1 -1
- package/dist/public/assets/{ToolFilesPage-Dx9cv9hu.js → ToolFilesPage-D7thcDEv.js} +1 -1
- package/dist/public/assets/{ToolGitPage-D7H3vAia.js → ToolGitPage-uPRsxdcn.js} +1 -1
- package/dist/public/assets/{ToolProcessesPage-PqQWxsy-.js → ToolProcessesPage-B1uOk0Ef.js} +1 -1
- package/dist/public/assets/{ToolsHomePage-CX05Pe_4.js → ToolsHomePage-rU3V8mmh.js} +1 -1
- package/dist/public/assets/{WorkbenchLandingPage-CchkAC75.js → WorkbenchLandingPage-BudM2C69.js} +1 -1
- package/dist/public/assets/WorkbenchLayout-Dybarc1V.js +244 -0
- package/dist/public/assets/WorkbenchModal-DMQutm1x.js +1 -0
- package/dist/public/assets/WorkbenchShellRoute-Cy4WBbzq.js +1 -0
- package/dist/public/assets/{WorkbenchShellRoute-RGZpA0_J.css → WorkbenchShellRoute-DhQo_0vu.css} +1 -1
- package/dist/public/assets/{WorkspaceDebugDetailPage-Deqy2_pO.js → WorkspaceDebugDetailPage-CHqo-uDf.js} +1 -1
- package/dist/public/assets/{WorkspaceDetailPage-Cvf-ZdlB.js → WorkspaceDetailPage-CGkAH1W-.js} +1 -1
- package/dist/public/assets/{WorkspaceHomePage-Dsyvqyk1.js → WorkspaceHomePage-CfuPVITd.js} +1 -1
- package/dist/public/assets/{client-runtime-manager-DROQJ9v3.js → client-runtime-manager-CKbtaemV.js} +1 -1
- package/dist/public/assets/file-tree-icon-Bc0KADEl.js +3 -0
- package/dist/public/assets/index-DNRyROOG.css +1 -0
- package/dist/public/assets/index-oGylLBIX.js +42 -0
- package/dist/public/assets/{login-direct-candidate-resolver-DotM530R.js → login-direct-candidate-resolver-DjJMbqB7.js} +1 -1
- package/dist/public/assets/model-switch-api-T55eW6D4.js +1 -0
- package/dist/public/assets/{preferences-service-BG6GKG29.js → preferences-service-BTKBl5xM.js} +1 -1
- package/dist/public/assets/realtime-client-ww7MnbTD.js +1 -0
- package/dist/public/assets/{relay-entry-pmr-c42O.js → relay-entry-sdeFnTbY.js} +1 -1
- package/dist/public/assets/styles-BjPytabP.css +1 -0
- package/dist/public/assets/{terminal-runtime-meta-8_uRZf7h.js → terminal-runtime-meta-Cvt1ID92.js} +1 -1
- package/dist/public/assets/{useRegisteredDebugTemplates-DWX7LXQu.js → useRegisteredDebugTemplates-O-ymgLd9.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/server/config/env.js +21 -1
- package/dist/server/config/env.js.map +1 -1
- package/dist/server/config/opencode-base-url-resolver.d.ts +16 -0
- package/dist/server/config/opencode-base-url-resolver.js +154 -0
- package/dist/server/config/opencode-base-url-resolver.js.map +1 -1
- package/dist/server/helpers/wechat-claw-runtime/main.d.ts +1 -0
- package/dist/server/helpers/wechat-claw-runtime/main.js +38 -0
- package/dist/server/helpers/wechat-claw-runtime/main.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/errors.d.ts +5 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/errors.js +32 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/errors.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/login-service.d.ts +16 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/login-service.js +209 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/login-service.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/poll-service.d.ts +18 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/poll-service.js +135 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/poll-service.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.d.ts +34 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.js +394 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/send-service.d.ts +9 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/send-service.js +64 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/send-service.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/types.d.ts +167 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/types.js +3 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/types.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/wechat-api-client.d.ts +34 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/wechat-api-client.js +160 -0
- package/dist/server/helpers/wechat-claw-runtime/modules/wechat-api-client.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/routes/accounts.d.ts +9 -0
- package/dist/server/helpers/wechat-claw-runtime/routes/accounts.js +24 -0
- package/dist/server/helpers/wechat-claw-runtime/routes/accounts.js.map +1 -0
- package/dist/server/helpers/wechat-claw-runtime/server.d.ts +5 -0
- package/dist/server/helpers/wechat-claw-runtime/server.js +36 -0
- package/dist/server/helpers/wechat-claw-runtime/server.js.map +1 -0
- package/dist/server/middlewares/auth-guard.js +4 -1
- package/dist/server/middlewares/auth-guard.js.map +1 -1
- package/dist/server/modules/assistant-capability/assistant-capability-service.d.ts +4 -1
- package/dist/server/modules/assistant-capability/assistant-capability-service.js +12 -1
- package/dist/server/modules/assistant-capability/assistant-capability-service.js.map +1 -1
- package/dist/server/modules/butler/butler-control-session-service.d.ts +20 -2
- package/dist/server/modules/butler/butler-control-session-service.js +121 -74
- package/dist/server/modules/butler/butler-control-session-service.js.map +1 -1
- package/dist/server/modules/butler/butler-profile-service.d.ts +3 -1
- package/dist/server/modules/butler/butler-profile-service.js +16 -4
- package/dist/server/modules/butler/butler-profile-service.js.map +1 -1
- package/dist/server/modules/butler/butler-session-service.js +44 -15
- package/dist/server/modules/butler/butler-session-service.js.map +1 -1
- package/dist/server/modules/channels/channel-bridge-service.d.ts +55 -0
- package/dist/server/modules/channels/channel-bridge-service.js +340 -0
- package/dist/server/modules/channels/channel-bridge-service.js.map +1 -0
- package/dist/server/modules/channels/channel-controller.d.ts +52 -0
- package/dist/server/modules/channels/channel-controller.js +54 -0
- package/dist/server/modules/channels/channel-controller.js.map +1 -0
- package/dist/server/modules/channels/channel-delivery-service.d.ts +63 -0
- package/dist/server/modules/channels/channel-delivery-service.js +429 -0
- package/dist/server/modules/channels/channel-delivery-service.js.map +1 -0
- package/dist/server/modules/channels/channel-gateway-controller.d.ts +15 -0
- package/dist/server/modules/channels/channel-gateway-controller.js +16 -0
- package/dist/server/modules/channels/channel-gateway-controller.js.map +1 -0
- package/dist/server/modules/channels/channel-gateway-service.d.ts +24 -0
- package/dist/server/modules/channels/channel-gateway-service.js +56 -0
- package/dist/server/modules/channels/channel-gateway-service.js.map +1 -0
- package/dist/server/modules/channels/channel-platform-adapters.d.ts +46 -0
- package/dist/server/modules/channels/channel-platform-adapters.js +315 -0
- package/dist/server/modules/channels/channel-platform-adapters.js.map +1 -0
- package/dist/server/modules/channels/channel-platform-catalog.d.ts +3 -0
- package/dist/server/modules/channels/channel-platform-catalog.js +42 -0
- package/dist/server/modules/channels/channel-platform-catalog.js.map +1 -0
- package/dist/server/modules/channels/channel-polling-scheduler.d.ts +31 -0
- package/dist/server/modules/channels/channel-polling-scheduler.js +93 -0
- package/dist/server/modules/channels/channel-polling-scheduler.js.map +1 -0
- package/dist/server/modules/channels/channel-polling-service.d.ts +46 -0
- package/dist/server/modules/channels/channel-polling-service.js +176 -0
- package/dist/server/modules/channels/channel-polling-service.js.map +1 -0
- package/dist/server/modules/channels/channel-service.d.ts +108 -0
- package/dist/server/modules/channels/channel-service.js +397 -0
- package/dist/server/modules/channels/channel-service.js.map +1 -0
- package/dist/server/modules/channels/wechat-claw-client.d.ts +51 -0
- package/dist/server/modules/channels/wechat-claw-client.js +245 -0
- package/dist/server/modules/channels/wechat-claw-client.js.map +1 -0
- package/dist/server/modules/channels/wechat-claw-runtime-boundary.d.ts +4 -0
- package/dist/server/modules/channels/wechat-claw-runtime-boundary.js +13 -0
- package/dist/server/modules/channels/wechat-claw-runtime-boundary.js.map +1 -0
- package/dist/server/modules/channels/wechat-claw-runtime-client.d.ts +14 -0
- package/dist/server/modules/channels/wechat-claw-runtime-client.js +95 -0
- package/dist/server/modules/channels/wechat-claw-runtime-client.js.map +1 -0
- package/dist/server/modules/channels/wechat-claw-runtime-manager.d.ts +16 -0
- package/dist/server/modules/channels/wechat-claw-runtime-manager.js +133 -0
- package/dist/server/modules/channels/wechat-claw-runtime-manager.js.map +1 -0
- package/dist/server/modules/channels/wechat-claw-runtime-types.d.ts +1 -0
- package/dist/server/modules/channels/wechat-claw-runtime-types.js +2 -0
- package/dist/server/modules/channels/wechat-claw-runtime-types.js.map +1 -0
- package/dist/server/modules/opencli/opencli-bridge-skill-service.d.ts +12 -0
- package/dist/server/modules/opencli/opencli-bridge-skill-service.js +125 -0
- package/dist/server/modules/opencli/opencli-bridge-skill-service.js.map +1 -0
- package/dist/server/modules/opencli/opencli-catalog-service.d.ts +50 -0
- package/dist/server/modules/opencli/opencli-catalog-service.js +345 -0
- package/dist/server/modules/opencli/opencli-catalog-service.js.map +1 -0
- package/dist/server/modules/opencli/opencli-controller.d.ts +13 -0
- package/dist/server/modules/opencli/opencli-controller.js +30 -0
- package/dist/server/modules/opencli/opencli-controller.js.map +1 -0
- package/dist/server/modules/opencli/opencli-health-service.d.ts +28 -0
- package/dist/server/modules/opencli/opencli-health-service.js +106 -0
- package/dist/server/modules/opencli/opencli-health-service.js.map +1 -0
- package/dist/server/modules/opencli/opencli-install-discovery.d.ts +23 -0
- package/dist/server/modules/opencli/opencli-install-discovery.js +130 -0
- package/dist/server/modules/opencli/opencli-install-discovery.js.map +1 -0
- package/dist/server/modules/opencli/opencli-management-service.d.ts +59 -0
- package/dist/server/modules/opencli/opencli-management-service.js +152 -0
- package/dist/server/modules/opencli/opencli-management-service.js.map +1 -0
- package/dist/server/modules/opencli/opencli-runtime-builder.d.ts +11 -0
- package/dist/server/modules/opencli/opencli-runtime-builder.js +214 -0
- package/dist/server/modules/opencli/opencli-runtime-builder.js.map +1 -0
- package/dist/server/modules/opencli/opencli-runtime-layout.d.ts +3 -0
- package/dist/server/modules/opencli/opencli-runtime-layout.js +11 -0
- package/dist/server/modules/opencli/opencli-runtime-layout.js.map +1 -0
- package/dist/server/modules/opencli/opencli-runtime-profile-service.d.ts +29 -0
- package/dist/server/modules/opencli/opencli-runtime-profile-service.js +104 -0
- package/dist/server/modules/opencli/opencli-runtime-profile-service.js.map +1 -0
- package/dist/server/modules/opencli/opencli-runtime-resolver.d.ts +29 -0
- package/dist/server/modules/opencli/opencli-runtime-resolver.js +110 -0
- package/dist/server/modules/opencli/opencli-runtime-resolver.js.map +1 -0
- package/dist/server/modules/opencli/opencli-session-prompt-service.d.ts +11 -0
- package/dist/server/modules/opencli/opencli-session-prompt-service.js +66 -0
- package/dist/server/modules/opencli/opencli-session-prompt-service.js.map +1 -0
- package/dist/server/modules/provider/provider-catalog-service.d.ts +45 -0
- package/dist/server/modules/provider/provider-catalog-service.js +204 -0
- package/dist/server/modules/provider/provider-catalog-service.js.map +1 -0
- package/dist/server/modules/provider/provider-controller.d.ts +16 -2
- package/dist/server/modules/provider/provider-controller.js +49 -6
- package/dist/server/modules/provider/provider-controller.js.map +1 -1
- package/dist/server/modules/provider/provider-disabled.d.ts +8 -0
- package/dist/server/modules/provider/provider-disabled.js +45 -0
- package/dist/server/modules/provider/provider-disabled.js.map +1 -0
- package/dist/server/modules/provider/provider-discovery-helper-client.d.ts +1 -0
- package/dist/server/modules/provider/provider-discovery-helper-client.js.map +1 -1
- package/dist/server/modules/provider/provider-discovery-helper-process.js +3 -3
- package/dist/server/modules/provider/provider-discovery-helper-process.js.map +1 -1
- package/dist/server/modules/provider/provider-discovery-runtime.d.ts +1 -1
- package/dist/server/modules/provider/provider-discovery-runtime.js +12 -8
- package/dist/server/modules/provider/provider-discovery-runtime.js.map +1 -1
- package/dist/server/modules/provider/provider-runtime-state-service.d.ts +24 -0
- package/dist/server/modules/provider/provider-runtime-state-service.js +141 -0
- package/dist/server/modules/provider/provider-runtime-state-service.js.map +1 -0
- package/dist/server/modules/sessions/claude-compatible-provider-registry.d.ts +16 -0
- package/dist/server/modules/sessions/claude-compatible-provider-registry.js +91 -0
- package/dist/server/modules/sessions/claude-compatible-provider-registry.js.map +1 -0
- package/dist/server/modules/sessions/session-history-service.d.ts +9 -3
- package/dist/server/modules/sessions/session-history-service.js +198 -62
- package/dist/server/modules/sessions/session-history-service.js.map +1 -1
- package/dist/server/modules/sessions/session-live-runtime-router-service.js +9 -4
- package/dist/server/modules/sessions/session-live-runtime-router-service.js.map +1 -1
- package/dist/server/modules/sessions/session-live-runtime-service.d.ts +8 -4
- package/dist/server/modules/sessions/session-live-runtime-service.js +99 -88
- package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
- package/dist/server/modules/sessions/session-permission-request-service.d.ts +5 -2
- package/dist/server/modules/sessions/session-permission-request-service.js +26 -27
- package/dist/server/modules/sessions/session-permission-request-service.js.map +1 -1
- package/dist/server/modules/sessions/session-provider-config-service.d.ts +18 -1
- package/dist/server/modules/sessions/session-provider-config-service.js +142 -17
- package/dist/server/modules/sessions/session-provider-config-service.js.map +1 -1
- package/dist/server/modules/sessions/session-provider-error-mapper.js +7 -0
- package/dist/server/modules/sessions/session-provider-error-mapper.js.map +1 -1
- package/dist/server/modules/skills/skill-manager-service.d.ts +5 -0
- package/dist/server/modules/skills/skill-manager-service.js +26 -0
- package/dist/server/modules/skills/skill-manager-service.js.map +1 -1
- package/dist/server/modules/tasks/task-helper-process-handlers.d.ts +1 -0
- package/dist/server/modules/tasks/task-helper-process-handlers.js +1 -1
- package/dist/server/modules/tasks/task-helper-process-handlers.js.map +1 -1
- package/dist/server/modules/tasks/task-types.d.ts +2 -0
- package/dist/server/modules/tasks/task-types.js +2 -0
- package/dist/server/modules/tasks/task-types.js.map +1 -1
- package/dist/server/routes/channels.d.ts +3 -0
- package/dist/server/routes/channels.js +16 -0
- package/dist/server/routes/channels.js.map +1 -0
- package/dist/server/routes/opencli.d.ts +3 -0
- package/dist/server/routes/opencli.js +7 -0
- package/dist/server/routes/opencli.js.map +1 -0
- package/dist/server/routes/providers.js +5 -2
- package/dist/server/routes/providers.js.map +1 -1
- package/dist/server/routes/public.d.ts +2 -1
- package/dist/server/routes/public.js +3 -1
- package/dist/server/routes/public.js.map +1 -1
- package/dist/server/server/create-server.d.ts +30 -0
- package/dist/server/server/create-server.js +104 -12
- package/dist/server/server/create-server.js.map +1 -1
- package/dist/server/shared/http/error-handler.js +59 -3
- package/dist/server/shared/http/error-handler.js.map +1 -1
- package/dist/server/storage/repositories/channel-account-repository.d.ts +12 -0
- package/dist/server/storage/repositories/channel-account-repository.js +153 -0
- package/dist/server/storage/repositories/channel-account-repository.js.map +1 -0
- package/dist/server/storage/repositories/channel-delivery-repository.d.ts +13 -0
- package/dist/server/storage/repositories/channel-delivery-repository.js +156 -0
- package/dist/server/storage/repositories/channel-delivery-repository.js.map +1 -0
- package/dist/server/storage/repositories/channel-inbound-event-repository.d.ts +12 -0
- package/dist/server/storage/repositories/channel-inbound-event-repository.js +144 -0
- package/dist/server/storage/repositories/channel-inbound-event-repository.js.map +1 -0
- package/dist/server/storage/repositories/channel-thread-repository.d.ts +12 -0
- package/dist/server/storage/repositories/channel-thread-repository.js +152 -0
- package/dist/server/storage/repositories/channel-thread-repository.js.map +1 -0
- package/dist/server/storage/repositories/opencli-catalog-entry-repository.d.ts +9 -0
- package/dist/server/storage/repositories/opencli-catalog-entry-repository.js +85 -0
- package/dist/server/storage/repositories/opencli-catalog-entry-repository.js.map +1 -0
- package/dist/server/storage/repositories/opencli-provider-repository.d.ts +8 -0
- package/dist/server/storage/repositories/opencli-provider-repository.js +88 -0
- package/dist/server/storage/repositories/opencli-provider-repository.js.map +1 -0
- package/dist/server/storage/repositories/opencli-runtime-profile-repository.d.ts +11 -0
- package/dist/server/storage/repositories/opencli-runtime-profile-repository.js +127 -0
- package/dist/server/storage/repositories/opencli-runtime-profile-repository.js.map +1 -0
- package/dist/server/storage/repositories/provider-control-repository.d.ts +9 -0
- package/dist/server/storage/repositories/provider-control-repository.js +51 -0
- package/dist/server/storage/repositories/provider-control-repository.js.map +1 -0
- package/dist/server/storage/repositories/provider-runtime-state-repository.d.ts +9 -0
- package/dist/server/storage/repositories/provider-runtime-state-repository.js +50 -0
- package/dist/server/storage/repositories/provider-runtime-state-repository.js.map +1 -0
- package/dist/server/storage/sqlite/client.js +53 -0
- package/dist/server/storage/sqlite/client.js.map +1 -1
- package/dist/server/storage/sqlite/schema.sql +180 -0
- package/dist/server/types/domain.d.ts +132 -0
- package/dist/server/ws/workbench-ws-hub.js +8 -2
- package/dist/server/ws/workbench-ws-hub.js.map +1 -1
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +28 -11
- package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -1
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js +61 -8
- package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js.map +1 -1
- package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.d.ts +5 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.js +1 -1
- package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.js.map +1 -1
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.d.ts +3 -0
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js +94 -21
- package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js.map +1 -1
- package/package.json +1 -1
- package/dist/public/assets/AdaptiveButlerPage-Dw72U3hG.js +0 -3
- package/dist/public/assets/ConversationPage-8wOY7SX-.js +0 -4
- package/dist/public/assets/SessionIndexPage-B-tRhBXC.js +0 -1
- package/dist/public/assets/SettingsPage-C9LGxSQZ.js +0 -1
- package/dist/public/assets/WorkbenchLayout-pOZvEqp7.js +0 -3
- package/dist/public/assets/WorkbenchModal-ColqvV6a.js +0 -1
- package/dist/public/assets/WorkbenchShellRoute-C0_h4lP6.js +0 -1
- package/dist/public/assets/file-tree-icon-Bp3Ntt7u.js +0 -31
- package/dist/public/assets/index-B84Po2NA.css +0 -1
- package/dist/public/assets/index-C-0oeG_5.js +0 -42
- package/dist/public/assets/model-switch-api-Bh9nYslz.js +0 -1
- package/dist/public/assets/session-runtime-machine-YN84QBlr.js +0 -21
- package/dist/public/assets/styles-CsEMfdaS.css +0 -1
- /package/dist/public/assets/{styles-DRVvx_kv.js → styles-lhQGDlPF.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/window-BVUB8gMK.js","assets/event-DvH9tcej.js","assets/ServerSettingsModal-
|
|
2
|
-
var In=Object.defineProperty;var Un=(e,t,r)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/window-BVUB8gMK.js","assets/event-DvH9tcej.js","assets/ServerSettingsModal-BdTxbRbU.js","assets/index-oGylLBIX.js","assets/index-DNRyROOG.css","assets/relay-entry-sdeFnTbY.js","assets/WorkbenchModal-DMQutm1x.js","assets/BootstrapPage-CAVA-a8h.js","assets/RelayConnectEntryPage-D417tgWj.js","assets/DesktopDetachPreviewPage-B37DUL15.js","assets/DesktopWindowPage-CDA6l7lm.js","assets/model-switch-api-T55eW6D4.js","assets/FileContextPanel-CMGTtAB6.js","assets/WorkbenchLayout-Dybarc1V.js","assets/file-tree-icon-Bc0KADEl.js","assets/GitSidebar--DCqBiGL.js","assets/TerminalManagerPanel-CtldwWz8.js","assets/terminal-runtime-meta-Cvt1ID92.js","assets/TerminalRuntimeFallbackModal-DLOhAvaq.js","assets/TerminalPage-DAzQTmQC.js","assets/MobileWorkspaceSwitcherHeader-Cczi7RYu.js","assets/MobileTopHeaderFrame-D-X7pVnV.js","assets/TerminalPage-6GBZ9nXN.css","assets/WorkbenchShellRoute-Cy4WBbzq.js","assets/WorkbenchShellRoute-DhQo_0vu.css","assets/WorkbenchLandingPage-BudM2C69.js","assets/WorkspaceHomePage-CfuPVITd.js","assets/butler-records-events-DgWCG364.js","assets/MobileCreateSessionSheet-THIrIzJ3.js","assets/WorkspaceDetailPage-CGkAH1W-.js","assets/useRegisteredDebugTemplates-O-ymgLd9.js","assets/WorkspaceDebugDetailPage-CHqo-uDf.js","assets/SessionIndexPage-D5iefVcc.js","assets/styles-lhQGDlPF.js","assets/styles-BjPytabP.css","assets/ConversationPage-B6BGOX4C.js","assets/realtime-client-ww7MnbTD.js","assets/ToolsHomePage-rU3V8mmh.js","assets/ToolFilesPage-D7thcDEv.js","assets/ToolGitPage-uPRsxdcn.js","assets/ToolProcessesPage-B1uOk0Ef.js","assets/AdaptiveButlerPage-B8mg25ze.js","assets/AdaptiveButlerPage-B153lk5H.css","assets/SettingsPage-iCFe_DHP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var In=Object.defineProperty;var Un=(e,t,r)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Re=(e,t,r)=>Un(e,typeof t!="symbol"?t+"":t,r);import{u as qe,j as m,t as be,a as Jt,g as On,r as An,b as h,R as kn,c as ct,_ as Y,d as Fn,e as ye,f as Xe,h as Ct,n as Br,i as Hr,k as Vn,l as zn,m as Rt,o as Bn,p as Hn,q as Wn,s as $n,v as Kn,w as Bt,x as Yn,y as Gn,z as Jn,A as Xn,B as qn,I as Qn}from"./index-oGylLBIX.js";function Zn(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const ea=[{id:"zh-CN",labelKey:"locale.zhCN"},{id:"en-US",labelKey:"locale.enUS"}];function ta({variant:e="default",className:t}){const r=qe(a=>a.profile.language);function n(a){a!==r&&Jt({language:a}).catch(()=>{})}return m.jsxs("label",{className:`language-switcher language-switcher-${e}${t?` ${t}`:""}`,children:[m.jsx("span",{className:"language-switcher-label",children:be("common.language")}),m.jsx("div",{className:"language-switcher-options",role:"group","aria-label":be("common.language"),children:ea.map(a=>m.jsx("button",{type:"button",className:`language-switcher-option${r===a.id?" active":""}`,"aria-pressed":r===a.id,onClick:()=>n(a.id),children:be(a.labelKey)},a.id))})]})}var Wr=An();const ra=On(Wr),na=Zn({__proto__:null,default:ra},[Wr]);/**
|
|
3
3
|
* @remix-run/router v1.23.2
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
@@ -8,8 +8,8 @@ var In=Object.defineProperty;var Un=(e,t,r)=>t in e?In(e,t,{enumerable:!0,config
|
|
|
8
8
|
* LICENSE.md file in the root directory of this source tree.
|
|
9
9
|
*
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},G.apply(this,arguments)}var ee;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ee||(ee={}));const pr="popstate";function aa(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:c}=n.location;return st("",{pathname:i,search:o,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ut(a)}return oa(t,r,null,e)}function U(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function He(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ia(){return Math.random().toString(36).substr(2,8)}function vr(e,t){return{usr:e.state,key:e.key,idx:t}}function st(e,t,r,n){return r===void 0&&(r=null),G({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ie(t):t,{state:r,key:t&&t.key||n||ia()})}function ut(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ie(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function oa(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,c=ee.Pop,l=null,d=p();d==null&&(d=0,o.replaceState(G({},o.state,{idx:d}),""));function p(){return(o.state||{idx:null}).idx}function v(){c=ee.Pop;let D=p(),k=D==null?null:D-d;d=D,l&&l({action:c,location:E.location,delta:k})}function b(D,k){c=ee.Push;let L=st(E.location,D,k);d=p()+1;let K=vr(L,d),te=E.createHref(L);try{o.pushState(K,"",te)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(te)}i&&l&&l({action:c,location:E.location,delta:1})}function w(D,k){c=ee.Replace;let L=st(E.location,D,k);d=p();let K=vr(L,d),te=E.createHref(L);o.replaceState(K,"",te),i&&l&&l({action:c,location:E.location,delta:0})}function T(D){let k=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof D=="string"?D:ut(D);return L=L.replace(/ $/,"%20"),U(k,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,k)}let E={get action(){return c},get location(){return e(a,o)},listen(D){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(pr,v),l=D,()=>{a.removeEventListener(pr,v),l=null}},createHref(D){return t(a,D)},createURL:T,encodeLocation(D){let k=T(D);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:b,replace:w,go(D){return o.go(D)}};return E}var B;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(B||(B={}));const sa=new Set(["lazy","caseSensitive","path","id","index","children"]);function la(e){return e.index===!0}function Dt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let o=[...r,String(i)],c=typeof a.id=="string"?a.id:o.join("-");if(U(a.index!==!0||!a.children,"Cannot specify children on an index route"),U(!n[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),la(a)){let l=G({},a,t(a),{id:c});return n[c]=l,l}else{let l=G({},a,t(a),{id:c,children:void 0});return n[c]=l,a.children&&(l.children=Dt(a.children,t,o,n)),l}})}function Ve(e,t,r){return r===void 0&&(r="/"),Tt(e,t,r,!1)}function Tt(e,t,r,n){let a=typeof t=="string"?Ie(t):t,i=dt(a.pathname||"/",r);if(i==null)return null;let o=$r(e);ua(o);let c=null;for(let l=0;c==null&&l<o.length;++l){let d=xa(i);c=ba(o[l],d,n)}return c}function ca(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function $r(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,c)=>{let l={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(U(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let d=Me([n,l.relativePath]),p=r.concat(l);i.children&&i.children.length>0&&(U(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),$r(i.children,t,p,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:ga(d,i.index),routesMeta:p})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let l of Kr(i.path))a(i,o,l)}),t}function Kr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=Kr(n.join("/")),c=[];return c.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&c.push(...o),c.map(l=>e.startsWith("/")&&l===""?"/":l)}function ua(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ya(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const da=/^:[\w-]+$/,fa=3,ha=2,ma=1,pa=10,va=-2,gr=e=>e==="*";function ga(e,t){let r=e.split("/"),n=r.length;return r.some(gr)&&(n+=va),t&&(n+=ha),r.filter(a=>!gr(a)).reduce((a,i)=>a+(da.test(i)?fa:i===""?ma:pa),n)}function ya(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ba(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",o=[];for(let c=0;c<n.length;++c){let l=n[c],d=c===n.length-1,p=i==="/"?t:t.slice(i.length)||"/",v=yr({path:l.relativePath,caseSensitive:l.caseSensitive,end:d},p),b=l.route;if(!v&&d&&r&&!n[n.length-1].route.index&&(v=yr({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},p)),!v)return null;Object.assign(a,v.params),o.push({params:a,pathname:Me([i,v.pathname]),pathnameBase:Pa(Me([i,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(i=Me([i,v.pathnameBase]))}return o}function yr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=wa(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:n.reduce((d,p,v)=>{let{paramName:b,isOptional:w}=p;if(b==="*"){let E=c[v]||"";o=i.slice(0,i.length-E.length).replace(/(.)\/+$/,"$1")}const T=c[v];return w&&!T?d[b]=void 0:d[b]=(T||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function wa(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),He(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,l)=>(n.push({paramName:c,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function xa(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return He(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function dt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Ea=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sa=e=>Ea.test(e);function Ra(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ie(e):e,i;if(r)if(Sa(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),He(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=br(r.substring(1),"/"):i=br(r,t)}else i=t;return{pathname:i,search:Ta(n),hash:_a(a)}}function br(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function kt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Yr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Jt(e,t){let r=Yr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Xt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Ie(e):(a=G({},e),U(!a.pathname||!a.pathname.includes("?"),kt("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),kt("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),kt("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,c;if(o==null)c=r;else{let v=t.length-1;if(!n&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),v-=1;a.pathname=b.join("/")}c=v>=0?t[v]:"/"}let l=Ra(a,c),d=o&&o!=="/"&&o.endsWith("/"),p=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(d||p)&&(l.pathname+="/"),l}const Me=e=>e.join("/").replace(/\/\/+/g,"/"),Pa=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_a=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Lt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function lt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Gr=["post","put","patch","delete"],Ca=new Set(Gr),Da=["get",...Gr],La=new Set(Da),ja=new Set([301,302,303,307,308]),Na=new Set([307,308]),Ft={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ma={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ia=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Jr="remix-router-transitions";function Ua(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;U(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let s=e.detectErrorBoundary;a=u=>({hasErrorBoundary:s(u)})}else a=Ia;let i={},o=Dt(e.routes,a,void 0,i),c,l=e.basename||"/",d=e.dataStrategy||Fa,p=e.patchRoutesOnNavigation,v=G({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,w=new Set,T=null,E=null,D=null,k=e.hydrationData!=null,L=Ve(o,e.history.location,l),K=!1,te=null;if(L==null&&!p){let s=le(404,{pathname:e.history.location.pathname}),{matches:u,route:f}=Lr(o);L=u,te={[f.id]:s}}L&&!e.hydrationData&&wt(L,o,e.history.location.pathname).active&&(L=null);let $;if(L)if(L.some(s=>s.route.lazy))$=!1;else if(!L.some(s=>s.route.loader))$=!0;else if(v.v7_partialHydration){let s=e.hydrationData?e.hydrationData.loaderData:null,u=e.hydrationData?e.hydrationData.errors:null;if(u){let f=L.findIndex(y=>u[y.route.id]!==void 0);$=L.slice(0,f+1).every(y=>!Ht(y.route,s,u))}else $=L.every(f=>!Ht(f.route,s,u))}else $=e.hydrationData!=null;else if($=!1,L=[],v.v7_partialHydration){let s=wt(null,o,e.history.location.pathname);s.active&&s.matches&&(K=!0,L=s.matches)}let he,g={historyAction:e.history.action,location:e.history.location,matches:L,initialized:$,navigation:Ft,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||te,fetchers:new Map,blockers:new Map},N=ee.Pop,F=!1,I,re=!1,J=new Map,oe=null,ae=!1,se=!1,We=[],$e=new Set,Q=new Map,Te=0,_e=-1,be=new Map,ce=new Set,Ce=new Map,Ue=new Map,ue=new Set,we=new Map,pe=new Map,Oe;function vt(){if(b=e.history.listen(s=>{let{action:u,location:f,delta:y}=s;if(Oe){Oe(),Oe=void 0;return}He(pe.size===0||y!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let x=dr({currentLocation:g.location,nextLocation:f,historyAction:u});if(x&&y!=null){let C=new Promise(j=>{Oe=j});e.history.go(y*-1),bt(x,{state:"blocked",location:f,proceed(){bt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),C.then(()=>e.history.go(y))},reset(){let j=new Map(g.blockers);j.set(x,nt),H({blockers:j})}});return}return Ae(u,f)}),r){Za(t,J);let s=()=>ei(t,J);t.addEventListener("pagehide",s),oe=()=>t.removeEventListener("pagehide",s)}return g.initialized||Ae(ee.Pop,g.location,{initialHydration:!0}),he}function V(){b&&b(),oe&&oe(),w.clear(),I&&I.abort(),g.fetchers.forEach((s,u)=>yt(u)),g.blockers.forEach((s,u)=>ur(u))}function de(s){return w.add(s),()=>w.delete(s)}function H(s,u){u===void 0&&(u={}),g=G({},g,s);let f=[],y=[];v.v7_fetcherPersist&&g.fetchers.forEach((x,C)=>{x.state==="idle"&&(ue.has(C)?y.push(C):f.push(C))}),ue.forEach(x=>{!g.fetchers.has(x)&&!Q.has(x)&&y.push(x)}),[...w].forEach(x=>x(g,{deletedFetchers:y,viewTransitionOpts:u.viewTransitionOpts,flushSync:u.flushSync===!0})),v.v7_fetcherPersist?(f.forEach(x=>g.fetchers.delete(x)),y.forEach(x=>yt(x))):y.forEach(x=>ue.delete(x))}function ve(s,u,f){var y,x;let{flushSync:C}=f===void 0?{}:f,j=g.actionData!=null&&g.navigation.formMethod!=null&&me(g.navigation.formMethod)&&g.navigation.state==="loading"&&((y=s.state)==null?void 0:y._isRedirect)!==!0,R;u.actionData?Object.keys(u.actionData).length>0?R=u.actionData:R=null:j?R=g.actionData:R=null;let P=u.loaderData?Cr(g.loaderData,u.loaderData,u.matches||[],u.errors):g.loaderData,S=g.blockers;S.size>0&&(S=new Map(S),S.forEach((O,ie)=>S.set(ie,nt)));let _=F===!0||g.navigation.formMethod!=null&&me(g.navigation.formMethod)&&((x=s.state)==null?void 0:x._isRedirect)!==!0;c&&(o=c,c=void 0),ae||N===ee.Pop||(N===ee.Push?e.history.push(s,s.state):N===ee.Replace&&e.history.replace(s,s.state));let M;if(N===ee.Pop){let O=J.get(g.location.pathname);O&&O.has(s.pathname)?M={currentLocation:g.location,nextLocation:s}:J.has(s.pathname)&&(M={currentLocation:s,nextLocation:g.location})}else if(re){let O=J.get(g.location.pathname);O?O.add(s.pathname):(O=new Set([s.pathname]),J.set(g.location.pathname,O)),M={currentLocation:g.location,nextLocation:s}}H(G({},u,{actionData:R,loaderData:P,historyAction:N,location:s,initialized:!0,navigation:Ft,revalidation:"idle",restoreScrollPosition:hr(s,u.matches||g.matches),preventScrollReset:_,blockers:S}),{viewTransitionOpts:M,flushSync:C===!0}),N=ee.Pop,F=!1,re=!1,ae=!1,se=!1,We=[]}async function gt(s,u){if(typeof s=="number"){e.history.go(s);return}let f=Bt(g.location,g.matches,l,v.v7_prependBasename,s,v.v7_relativeSplatPath,u==null?void 0:u.fromRouteId,u==null?void 0:u.relative),{path:y,submission:x,error:C}=wr(v.v7_normalizeFormMethod,!1,f,u),j=g.location,R=st(g.location,y,u&&u.state);R=G({},R,e.history.encodeLocation(R));let P=u&&u.replace!=null?u.replace:void 0,S=ee.Push;P===!0?S=ee.Replace:P===!1||x!=null&&me(x.formMethod)&&x.formAction===g.location.pathname+g.location.search&&(S=ee.Replace);let _=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,M=(u&&u.flushSync)===!0,O=dr({currentLocation:j,nextLocation:R,historyAction:S});if(O){bt(O,{state:"blocked",location:R,proceed(){bt(O,{state:"proceeding",proceed:void 0,reset:void 0,location:R}),gt(s,u)},reset(){let ie=new Map(g.blockers);ie.set(O,nt),H({blockers:ie})}});return}return await Ae(S,R,{submission:x,pendingError:C,preventScrollReset:_,replace:u&&u.replace,enableViewTransition:u&&u.viewTransition,flushSync:M})}function wn(){if(It(),H({revalidation:"loading"}),g.navigation.state!=="submitting"){if(g.navigation.state==="idle"){Ae(g.historyAction,g.location,{startUninterruptedRevalidation:!0});return}Ae(N||g.historyAction,g.navigation.location,{overrideNavigation:g.navigation,enableViewTransition:re===!0})}}async function Ae(s,u,f){I&&I.abort(),I=null,N=s,ae=(f&&f.startUninterruptedRevalidation)===!0,Ln(g.location,g.matches),F=(f&&f.preventScrollReset)===!0,re=(f&&f.enableViewTransition)===!0;let y=c||o,x=f&&f.overrideNavigation,C=f!=null&&f.initialHydration&&g.matches&&g.matches.length>0&&!K?g.matches:Ve(y,u,l),j=(f&&f.flushSync)===!0;if(C&&g.initialized&&!se&&$a(g.location,u)&&!(f&&f.submission&&me(f.submission.formMethod))){ve(u,{matches:C},{flushSync:j});return}let R=wt(C,y,u.pathname);if(R.active&&R.matches&&(C=R.matches),!C){let{error:W,notFoundMatches:z,route:X}=Ut(u.pathname);ve(u,{matches:z,loaderData:{},errors:{[X.id]:W}},{flushSync:j});return}I=new AbortController;let P=Je(e.history,u,I.signal,f&&f.submission),S;if(f&&f.pendingError)S=[ze(C).route.id,{type:B.error,error:f.pendingError}];else if(f&&f.submission&&me(f.submission.formMethod)){let W=await xn(P,u,f.submission,C,R.active,{replace:f.replace,flushSync:j});if(W.shortCircuited)return;if(W.pendingActionResult){let[z,X]=W.pendingActionResult;if(fe(X)&<(X.error)&&X.error.status===404){I=null,ve(u,{matches:W.matches,loaderData:{},errors:{[z]:X.error}});return}}C=W.matches||C,S=W.pendingActionResult,x=Vt(u,f.submission),j=!1,R.active=!1,P=Je(e.history,P.url,P.signal)}let{shortCircuited:_,matches:M,loaderData:O,errors:ie}=await En(P,u,C,R.active,x,f&&f.submission,f&&f.fetcherSubmission,f&&f.replace,f&&f.initialHydration===!0,j,S);_||(I=null,ve(u,G({matches:M||C},Dr(S),{loaderData:O,errors:ie})))}async function xn(s,u,f,y,x,C){C===void 0&&(C={}),It();let j=qa(u,f);if(H({navigation:j},{flushSync:C.flushSync===!0}),x){let S=await xt(y,u.pathname,s.signal);if(S.type==="aborted")return{shortCircuited:!0};if(S.type==="error"){let _=ze(S.partialMatches).route.id;return{matches:S.partialMatches,pendingActionResult:[_,{type:B.error,error:S.error}]}}else if(S.matches)y=S.matches;else{let{notFoundMatches:_,error:M,route:O}=Ut(u.pathname);return{matches:_,pendingActionResult:[O.id,{type:B.error,error:M}]}}}let R,P=ot(y,u);if(!P.route.action&&!P.route.lazy)R={type:B.error,error:le(405,{method:s.method,pathname:u.pathname,routeId:P.route.id})};else if(R=(await Ze("action",g,s,[P],y,null))[P.route.id],s.signal.aborted)return{shortCircuited:!0};if(Be(R)){let S;return C&&C.replace!=null?S=C.replace:S=Pr(R.response.headers.get("Location"),new URL(s.url),l,e.history)===g.location.pathname+g.location.search,await ke(s,R,!0,{submission:f,replace:S}),{shortCircuited:!0}}if(Ne(R))throw le(400,{type:"defer-action"});if(fe(R)){let S=ze(y,P.route.id);return(C&&C.replace)!==!0&&(N=ee.Push),{matches:y,pendingActionResult:[S.route.id,R]}}return{matches:y,pendingActionResult:[P.route.id,R]}}async function En(s,u,f,y,x,C,j,R,P,S,_){let M=x||Vt(u,C),O=C||j||Nr(M),ie=!ae&&(!v.v7_partialHydration||!P);if(y){if(ie){let q=ar(_);H(G({navigation:M},q!==void 0?{actionData:q}:{}),{flushSync:S})}let A=await xt(f,u.pathname,s.signal);if(A.type==="aborted")return{shortCircuited:!0};if(A.type==="error"){let q=ze(A.partialMatches).route.id;return{matches:A.partialMatches,loaderData:{},errors:{[q]:A.error}}}else if(A.matches)f=A.matches;else{let{error:q,notFoundMatches:Ye,route:rt}=Ut(u.pathname);return{matches:Ye,loaderData:{},errors:{[rt.id]:q}}}}let W=c||o,[z,X]=Er(e.history,g,f,O,u,v.v7_partialHydration&&P===!0,v.v7_skipActionErrorRevalidation,se,We,$e,ue,Ce,ce,W,l,_);if(Ot(A=>!(f&&f.some(q=>q.route.id===A))||z&&z.some(q=>q.route.id===A)),_e=++Te,z.length===0&&X.length===0){let A=lr();return ve(u,G({matches:f,loaderData:{},errors:_&&fe(_[1])?{[_[0]]:_[1].error}:null},Dr(_),A?{fetchers:new Map(g.fetchers)}:{}),{flushSync:S}),{shortCircuited:!0}}if(ie){let A={};if(!y){A.navigation=M;let q=ar(_);q!==void 0&&(A.actionData=q)}X.length>0&&(A.fetchers=Sn(X)),H(A,{flushSync:S})}X.forEach(A=>{Le(A.key),A.controller&&Q.set(A.key,A.controller)});let Ke=()=>X.forEach(A=>Le(A.key));I&&I.signal.addEventListener("abort",Ke);let{loaderResults:et,fetcherResults:Ee}=await ir(g,f,z,X,s);if(s.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Ke),X.forEach(A=>Q.delete(A.key));let ge=Pt(et);if(ge)return await ke(s,ge.result,!0,{replace:R}),{shortCircuited:!0};if(ge=Pt(Ee),ge)return ce.add(ge.key),await ke(s,ge.result,!0,{replace:R}),{shortCircuited:!0};let{loaderData:At,errors:tt}=_r(g,f,et,_,X,Ee,we);we.forEach((A,q)=>{A.subscribe(Ye=>{(Ye||A.done)&&we.delete(q)})}),v.v7_partialHydration&&P&&g.errors&&(tt=G({},g.errors,tt));let Fe=lr(),Et=cr(_e),St=Fe||Et||X.length>0;return G({matches:f,loaderData:At,errors:tt},St?{fetchers:new Map(g.fetchers)}:{})}function ar(s){if(s&&!fe(s[1]))return{[s[0]]:s[1].data};if(g.actionData)return Object.keys(g.actionData).length===0?null:g.actionData}function Sn(s){return s.forEach(u=>{let f=g.fetchers.get(u.key),y=at(void 0,f?f.data:void 0);g.fetchers.set(u.key,y)}),new Map(g.fetchers)}function Rn(s,u,f,y){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Le(s);let x=(y&&y.flushSync)===!0,C=c||o,j=Bt(g.location,g.matches,l,v.v7_prependBasename,f,v.v7_relativeSplatPath,u,y==null?void 0:y.relative),R=Ve(C,j,l),P=wt(R,C,j);if(P.active&&P.matches&&(R=P.matches),!R){xe(s,u,le(404,{pathname:j}),{flushSync:x});return}let{path:S,submission:_,error:M}=wr(v.v7_normalizeFormMethod,!0,j,y);if(M){xe(s,u,M,{flushSync:x});return}let O=ot(R,S),ie=(y&&y.preventScrollReset)===!0;if(_&&me(_.formMethod)){Pn(s,u,S,O,R,P.active,x,ie,_);return}Ce.set(s,{routeId:u,path:S}),Tn(s,u,S,O,R,P.active,x,ie,_)}async function Pn(s,u,f,y,x,C,j,R,P){It(),Ce.delete(s);function S(Z){if(!Z.route.action&&!Z.route.lazy){let Ge=le(405,{method:P.formMethod,pathname:f,routeId:u});return xe(s,u,Ge,{flushSync:j}),!0}return!1}if(!C&&S(y))return;let _=g.fetchers.get(s);De(s,Qa(P,_),{flushSync:j});let M=new AbortController,O=Je(e.history,f,M.signal,P);if(C){let Z=await xt(x,new URL(O.url).pathname,O.signal,s);if(Z.type==="aborted")return;if(Z.type==="error"){xe(s,u,Z.error,{flushSync:j});return}else if(Z.matches){if(x=Z.matches,y=ot(x,f),S(y))return}else{xe(s,u,le(404,{pathname:f}),{flushSync:j});return}}Q.set(s,M);let ie=Te,z=(await Ze("action",g,O,[y],x,s))[y.route.id];if(O.signal.aborted){Q.get(s)===M&&Q.delete(s);return}if(v.v7_fetcherPersist&&ue.has(s)){if(Be(z)||fe(z)){De(s,je(void 0));return}}else{if(Be(z))if(Q.delete(s),_e>ie){De(s,je(void 0));return}else return ce.add(s),De(s,at(P)),ke(O,z,!1,{fetcherSubmission:P,preventScrollReset:R});if(fe(z)){xe(s,u,z.error);return}}if(Ne(z))throw le(400,{type:"defer-action"});let X=g.navigation.location||g.location,Ke=Je(e.history,X,M.signal),et=c||o,Ee=g.navigation.state!=="idle"?Ve(et,g.navigation.location,l):g.matches;U(Ee,"Didn't find any matches after fetcher action");let ge=++Te;be.set(s,ge);let At=at(P,z.data);g.fetchers.set(s,At);let[tt,Fe]=Er(e.history,g,Ee,P,X,!1,v.v7_skipActionErrorRevalidation,se,We,$e,ue,Ce,ce,et,l,[y.route.id,z]);Fe.filter(Z=>Z.key!==s).forEach(Z=>{let Ge=Z.key,mr=g.fetchers.get(Ge),Mn=at(void 0,mr?mr.data:void 0);g.fetchers.set(Ge,Mn),Le(Ge),Z.controller&&Q.set(Ge,Z.controller)}),H({fetchers:new Map(g.fetchers)});let Et=()=>Fe.forEach(Z=>Le(Z.key));M.signal.addEventListener("abort",Et);let{loaderResults:St,fetcherResults:A}=await ir(g,Ee,tt,Fe,Ke);if(M.signal.aborted)return;M.signal.removeEventListener("abort",Et),be.delete(s),Q.delete(s),Fe.forEach(Z=>Q.delete(Z.key));let q=Pt(St);if(q)return ke(Ke,q.result,!1,{preventScrollReset:R});if(q=Pt(A),q)return ce.add(q.key),ke(Ke,q.result,!1,{preventScrollReset:R});let{loaderData:Ye,errors:rt}=_r(g,Ee,St,void 0,Fe,A,we);if(g.fetchers.has(s)){let Z=je(z.data);g.fetchers.set(s,Z)}cr(ge),g.navigation.state==="loading"&&ge>_e?(U(N,"Expected pending action"),I&&I.abort(),ve(g.navigation.location,{matches:Ee,loaderData:Ye,errors:rt,fetchers:new Map(g.fetchers)})):(H({errors:rt,loaderData:Cr(g.loaderData,Ye,Ee,rt),fetchers:new Map(g.fetchers)}),se=!1)}async function Tn(s,u,f,y,x,C,j,R,P){let S=g.fetchers.get(s);De(s,at(P,S?S.data:void 0),{flushSync:j});let _=new AbortController,M=Je(e.history,f,_.signal);if(C){let z=await xt(x,new URL(M.url).pathname,M.signal,s);if(z.type==="aborted")return;if(z.type==="error"){xe(s,u,z.error,{flushSync:j});return}else if(z.matches)x=z.matches,y=ot(x,f);else{xe(s,u,le(404,{pathname:f}),{flushSync:j});return}}Q.set(s,_);let O=Te,W=(await Ze("loader",g,M,[y],x,s))[y.route.id];if(Ne(W)&&(W=await Qt(W,M.signal,!0)||W),Q.get(s)===_&&Q.delete(s),!M.signal.aborted){if(ue.has(s)){De(s,je(void 0));return}if(Be(W))if(_e>O){De(s,je(void 0));return}else{ce.add(s),await ke(M,W,!1,{preventScrollReset:R});return}if(fe(W)){xe(s,u,W.error);return}U(!Ne(W),"Unhandled fetcher deferred data"),De(s,je(W.data))}}async function ke(s,u,f,y){let{submission:x,fetcherSubmission:C,preventScrollReset:j,replace:R}=y===void 0?{}:y;u.response.headers.has("X-Remix-Revalidate")&&(se=!0);let P=u.response.headers.get("Location");U(P,"Expected a Location header on the redirect Response"),P=Pr(P,new URL(s.url),l,e.history);let S=st(g.location,P,{_isRedirect:!0});if(r){let z=!1;if(u.response.headers.has("X-Remix-Reload-Document"))z=!0;else if(qt.test(P)){const X=e.history.createURL(P);z=X.origin!==t.location.origin||dt(X.pathname,l)==null}if(z){R?t.location.replace(P):t.location.assign(P);return}}I=null;let _=R===!0||u.response.headers.has("X-Remix-Replace")?ee.Replace:ee.Push,{formMethod:M,formAction:O,formEncType:ie}=g.navigation;!x&&!C&&M&&O&&ie&&(x=Nr(g.navigation));let W=x||C;if(Na.has(u.response.status)&&W&&me(W.formMethod))await Ae(_,S,{submission:G({},W,{formAction:P}),preventScrollReset:j||F,enableViewTransition:f?re:void 0});else{let z=Vt(S,x);await Ae(_,S,{overrideNavigation:z,fetcherSubmission:C,preventScrollReset:j||F,enableViewTransition:f?re:void 0})}}async function Ze(s,u,f,y,x,C){let j,R={};try{j=await Va(d,s,u,f,y,x,C,i,a)}catch(P){return y.forEach(S=>{R[S.route.id]={type:B.error,error:P}}),R}for(let[P,S]of Object.entries(j))if(Ka(S)){let _=S.result;R[P]={type:B.redirect,response:Ha(_,f,P,x,l,v.v7_relativeSplatPath)}}else R[P]=await Ba(S);return R}async function ir(s,u,f,y,x){let C=s.matches,j=Ze("loader",s,x,f,u,null),R=Promise.all(y.map(async _=>{if(_.matches&&_.match&&_.controller){let O=(await Ze("loader",s,Je(e.history,_.path,_.controller.signal),[_.match],_.matches,_.key))[_.match.route.id];return{[_.key]:O}}else return Promise.resolve({[_.key]:{type:B.error,error:le(404,{pathname:_.path})}})})),P=await j,S=(await R).reduce((_,M)=>Object.assign(_,M),{});return await Promise.all([Ja(u,P,x.signal,C,s.loaderData),Xa(u,S,y)]),{loaderResults:P,fetcherResults:S}}function It(){se=!0,We.push(...Ot()),Ce.forEach((s,u)=>{Q.has(u)&&$e.add(u),Le(u)})}function De(s,u,f){f===void 0&&(f={}),g.fetchers.set(s,u),H({fetchers:new Map(g.fetchers)},{flushSync:(f&&f.flushSync)===!0})}function xe(s,u,f,y){y===void 0&&(y={});let x=ze(g.matches,u);yt(s),H({errors:{[x.route.id]:f},fetchers:new Map(g.fetchers)},{flushSync:(y&&y.flushSync)===!0})}function or(s){return Ue.set(s,(Ue.get(s)||0)+1),ue.has(s)&&ue.delete(s),g.fetchers.get(s)||Ma}function yt(s){let u=g.fetchers.get(s);Q.has(s)&&!(u&&u.state==="loading"&&be.has(s))&&Le(s),Ce.delete(s),be.delete(s),ce.delete(s),v.v7_fetcherPersist&&ue.delete(s),$e.delete(s),g.fetchers.delete(s)}function _n(s){let u=(Ue.get(s)||0)-1;u<=0?(Ue.delete(s),ue.add(s),v.v7_fetcherPersist||yt(s)):Ue.set(s,u),H({fetchers:new Map(g.fetchers)})}function Le(s){let u=Q.get(s);u&&(u.abort(),Q.delete(s))}function sr(s){for(let u of s){let f=or(u),y=je(f.data);g.fetchers.set(u,y)}}function lr(){let s=[],u=!1;for(let f of ce){let y=g.fetchers.get(f);U(y,"Expected fetcher: "+f),y.state==="loading"&&(ce.delete(f),s.push(f),u=!0)}return sr(s),u}function cr(s){let u=[];for(let[f,y]of be)if(y<s){let x=g.fetchers.get(f);U(x,"Expected fetcher: "+f),x.state==="loading"&&(Le(f),be.delete(f),u.push(f))}return sr(u),u.length>0}function Cn(s,u){let f=g.blockers.get(s)||nt;return pe.get(s)!==u&&pe.set(s,u),f}function ur(s){g.blockers.delete(s),pe.delete(s)}function bt(s,u){let f=g.blockers.get(s)||nt;U(f.state==="unblocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="proceeding"||f.state==="blocked"&&u.state==="unblocked"||f.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+u.state);let y=new Map(g.blockers);y.set(s,u),H({blockers:y})}function dr(s){let{currentLocation:u,nextLocation:f,historyAction:y}=s;if(pe.size===0)return;pe.size>1&&He(!1,"A router only supports one blocker at a time");let x=Array.from(pe.entries()),[C,j]=x[x.length-1],R=g.blockers.get(C);if(!(R&&R.state==="proceeding")&&j({currentLocation:u,nextLocation:f,historyAction:y}))return C}function Ut(s){let u=le(404,{pathname:s}),f=c||o,{matches:y,route:x}=Lr(f);return Ot(),{notFoundMatches:y,route:x,error:u}}function Ot(s){let u=[];return we.forEach((f,y)=>{(!s||s(y))&&(f.cancel(),u.push(y),we.delete(y))}),u}function Dn(s,u,f){if(T=s,D=u,E=f||null,!k&&g.navigation===Ft){k=!0;let y=hr(g.location,g.matches);y!=null&&H({restoreScrollPosition:y})}return()=>{T=null,D=null,E=null}}function fr(s,u){return E&&E(s,u.map(y=>ca(y,g.loaderData)))||s.key}function Ln(s,u){if(T&&D){let f=fr(s,u);T[f]=D()}}function hr(s,u){if(T){let f=fr(s,u),y=T[f];if(typeof y=="number")return y}return null}function wt(s,u,f){if(p)if(s){if(Object.keys(s[0].params).length>0)return{active:!0,matches:Tt(u,f,l,!0)}}else return{active:!0,matches:Tt(u,f,l,!0)||[]};return{active:!1,matches:null}}async function xt(s,u,f,y){if(!p)return{type:"success",matches:s};let x=s;for(;;){let C=c==null,j=c||o,R=i;try{await p({signal:f,path:u,matches:x,fetcherKey:y,patch:(_,M)=>{f.aborted||Rr(_,M,j,R,a)}})}catch(_){return{type:"error",error:_,partialMatches:x}}finally{C&&!f.aborted&&(o=[...o])}if(f.aborted)return{type:"aborted"};let P=Ve(j,u,l);if(P)return{type:"success",matches:P};let S=Tt(j,u,l,!0);if(!S||x.length===S.length&&x.every((_,M)=>_.route.id===S[M].route.id))return{type:"success",matches:null};x=S}}function jn(s){i={},c=Dt(s,a,void 0,i)}function Nn(s,u){let f=c==null;Rr(s,u,c||o,i,a),f&&(o=[...o],H({}))}return he={get basename(){return l},get future(){return v},get state(){return g},get routes(){return o},get window(){return t},initialize:vt,subscribe:de,enableScrollRestoration:Dn,navigate:gt,fetch:Rn,revalidate:wn,createHref:s=>e.history.createHref(s),encodeLocation:s=>e.history.encodeLocation(s),getFetcher:or,deleteFetcher:_n,dispose:V,getBlocker:Cn,deleteBlocker:ur,patchRoutes:Nn,_internalFetchControllers:Q,_internalActiveDeferreds:we,_internalSetRoutes:jn},he}function Oa(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Bt(e,t,r,n,a,i,o,c){let l,d;if(o){l=[];for(let v of t)if(l.push(v),v.route.id===o){d=v;break}}else l=t,d=t[t.length-1];let p=Xt(a||".",Jt(l,i),dt(e.pathname,r)||e.pathname,c==="path");if(a==null&&(p.search=e.search,p.hash=e.hash),(a==null||a===""||a===".")&&d){let v=Zt(p.search);if(d.route.index&&!v)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&v){let b=new URLSearchParams(p.search),w=b.getAll("index");b.delete("index"),w.filter(E=>E).forEach(E=>b.append("index",E));let T=b.toString();p.search=T?"?"+T:""}}return n&&r!=="/"&&(p.pathname=p.pathname==="/"?r:Me([r,p.pathname])),ut(p)}function wr(e,t,r,n){if(!n||!Oa(n))return{path:r};if(n.formMethod&&!Ga(n.formMethod))return{path:r,error:le(405,{method:n.formMethod})};let a=()=>({path:r,error:le(400,{type:"invalid-body"})}),i=n.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),c=Qr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!me(o))return a();let b=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,T)=>{let[E,D]=T;return""+w+E+"="+D+`
|
|
12
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:b}}}else if(n.formEncType==="application/json"){if(!me(o))return a();try{let b=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}U(typeof FormData=="function","FormData is not available in this environment");let l,d;if(n.formData)l=Wt(n.formData),d=n.formData;else if(n.body instanceof FormData)l=Wt(n.body),d=n.body;else if(n.body instanceof URLSearchParams)l=n.body,d=Tr(l);else if(n.body==null)l=new URLSearchParams,d=new FormData;else try{l=new URLSearchParams(n.body),d=Tr(l)}catch{return a()}let p={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(me(p.formMethod))return{path:r,submission:p};let v=Ie(r);return t&&v.search&&Zt(v.search)&&l.append("index",""),v.search="?"+l,{path:ut(v),submission:p}}function xr(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function Er(e,t,r,n,a,i,o,c,l,d,p,v,b,w,T,E){let D=E?fe(E[1])?E[1].error:E[1].data:void 0,k=e.createURL(t.location),L=e.createURL(a),K=r;i&&t.errors?K=xr(r,Object.keys(t.errors)[0],!0):E&&fe(E[1])&&(K=xr(r,E[0]));let te=E?E[1].statusCode:void 0,$=o&&te&&te>=400,he=K.filter((N,F)=>{let{route:I}=N;if(I.lazy)return!0;if(I.loader==null)return!1;if(i)return Ht(I,t.loaderData,t.errors);if(Aa(t.loaderData,t.matches[F],N)||l.some(oe=>oe===N.route.id))return!0;let re=t.matches[F],J=N;return Sr(N,G({currentUrl:k,currentParams:re.params,nextUrl:L,nextParams:J.params},n,{actionResult:D,actionStatus:te,defaultShouldRevalidate:$?!1:c||k.pathname+k.search===L.pathname+L.search||k.search!==L.search||Xr(re,J)}))}),g=[];return v.forEach((N,F)=>{if(i||!r.some(ae=>ae.route.id===N.routeId)||p.has(F))return;let I=Ve(w,N.path,T);if(!I){g.push({key:F,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let re=t.fetchers.get(F),J=ot(I,N.path),oe=!1;b.has(F)?oe=!1:d.has(F)?(d.delete(F),oe=!0):re&&re.state!=="idle"&&re.data===void 0?oe=c:oe=Sr(J,G({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},n,{actionResult:D,actionStatus:te,defaultShouldRevalidate:$?!1:c})),oe&&g.push({key:F,routeId:N.routeId,path:N.path,matches:I,match:J,controller:new AbortController})}),[he,g]}function Ht(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Aa(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Xr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Sr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Rr(e,t,r,n,a){var i;let o;if(e){let d=n[e];U(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),o=d.children}else o=r;let c=t.filter(d=>!o.some(p=>qr(d,p))),l=Dt(c,a,[e||"_","patch",String(((i=o)==null?void 0:i.length)||"0")],n);o.push(...l)}function qr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(i=>qr(r,i))}):!1}async function ka(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];U(a,"No route found in manifest");let i={};for(let o in n){let l=a[o]!==void 0&&o!=="hasErrorBoundary";He(!l,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!sa.has(o)&&(i[o]=n[o])}Object.assign(a,i),Object.assign(a,G({},t(a),{lazy:void 0}))}async function Fa(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,i,o)=>Object.assign(a,{[r[o].route.id]:i}),{})}async function Va(e,t,r,n,a,i,o,c,l,d){let p=i.map(w=>w.route.lazy?ka(w.route,l,c):void 0),v=i.map((w,T)=>{let E=p[T],D=a.some(L=>L.route.id===w.route.id);return G({},w,{shouldLoad:D,resolve:async L=>(L&&n.method==="GET"&&(w.route.lazy||w.route.loader)&&(D=!0),D?za(t,n,w,E,L,d):Promise.resolve({type:B.data,result:void 0}))})}),b=await e({matches:v,request:n,params:i[0].params,fetcherKey:o,context:d});try{await Promise.all(p)}catch{}return b}async function za(e,t,r,n,a,i){let o,c,l=d=>{let p,v=new Promise((T,E)=>p=E);c=()=>p(),t.signal.addEventListener("abort",c);let b=T=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...T!==void 0?[T]:[]),w=(async()=>{try{return{type:"data",result:await(a?a(E=>b(E)):b())}}catch(T){return{type:"error",result:T}}})();return Promise.race([w,v])};try{let d=r.route[e];if(n)if(d){let p,[v]=await Promise.all([l(d).catch(b=>{p=b}),n]);if(p!==void 0)throw p;o=v}else if(await n,d=r.route[e],d)o=await l(d);else if(e==="action"){let p=new URL(t.url),v=p.pathname+p.search;throw le(405,{method:t.method,pathname:v,routeId:r.route.id})}else return{type:B.data,result:void 0};else if(d)o=await l(d);else{let p=new URL(t.url),v=p.pathname+p.search;throw le(404,{pathname:v})}U(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:B.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return o}async function Ba(e){let{result:t,type:r}=e;if(Zr(t)){let v;try{let b=t.headers.get("Content-Type");b&&/\bapplication\/json\b/.test(b)?t.body==null?v=null:v=await t.json():v=await t.text()}catch(b){return{type:B.error,error:b}}return r===B.error?{type:B.error,error:new Lt(t.status,t.statusText,v),statusCode:t.status,headers:t.headers}:{type:B.data,data:v,statusCode:t.status,headers:t.headers}}if(r===B.error){if(jr(t)){var n,a;if(t.data instanceof Error){var i,o;return{type:B.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:B.error,error:new Lt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:lt(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:B.error,error:t,statusCode:lt(t)?t.status:void 0}}if(Ya(t)){var c,l;return{type:B.deferred,deferredData:t,statusCode:(c=t.init)==null?void 0:c.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(jr(t)){var d,p;return{type:B.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(p=t.init)!=null&&p.headers?new Headers(t.init.headers):void 0}}return{type:B.data,data:t}}function Ha(e,t,r,n,a,i){let o=e.headers.get("Location");if(U(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!qt.test(o)){let c=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=Bt(new URL(t.url),c,a,!0,o,i),e.headers.set("Location",o)}return e}function Pr(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(qt.test(e)){let i=e,o=i.startsWith("//")?new URL(t.protocol+i):new URL(i);if(a.includes(o.protocol))throw new Error("Invalid redirect location");let c=dt(o.pathname,r)!=null;if(o.origin===t.origin&&c)return o.pathname+o.search+o.hash}try{let i=n.createURL(e);if(a.includes(i.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Je(e,t,r,n){let a=e.createURL(Qr(t)).toString(),i={signal:r};if(n&&me(n.formMethod)){let{formMethod:o,formEncType:c}=n;i.method=o.toUpperCase(),c==="application/json"?(i.headers=new Headers({"Content-Type":c}),i.body=JSON.stringify(n.json)):c==="text/plain"?i.body=n.text:c==="application/x-www-form-urlencoded"&&n.formData?i.body=Wt(n.formData):i.body=n.formData}return new Request(a,i)}function Wt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Tr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Wa(e,t,r,n,a){let i={},o=null,c,l=!1,d={},p=r&&fe(r[1])?r[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let b=v.route.id,w=t[b];if(U(!Be(w),"Cannot handle redirect results in processLoaderData"),fe(w)){let T=w.error;p!==void 0&&(T=p,p=void 0),o=o||{};{let E=ze(e,b);o[E.route.id]==null&&(o[E.route.id]=T)}i[b]=void 0,l||(l=!0,c=lt(w.error)?w.error.status:500),w.headers&&(d[b]=w.headers)}else Ne(w)?(n.set(b,w.deferredData),i[b]=w.deferredData.data,w.statusCode!=null&&w.statusCode!==200&&!l&&(c=w.statusCode),w.headers&&(d[b]=w.headers)):(i[b]=w.data,w.statusCode&&w.statusCode!==200&&!l&&(c=w.statusCode),w.headers&&(d[b]=w.headers))}),p!==void 0&&r&&(o={[r[0]]:p},i[r[0]]=void 0),{loaderData:i,errors:o,statusCode:c||200,loaderHeaders:d}}function _r(e,t,r,n,a,i,o){let{loaderData:c,errors:l}=Wa(t,r,n,o);return a.forEach(d=>{let{key:p,match:v,controller:b}=d,w=i[p];if(U(w,"Did not find corresponding fetcher result"),!(b&&b.signal.aborted))if(fe(w)){let T=ze(e.matches,v==null?void 0:v.route.id);l&&l[T.route.id]||(l=G({},l,{[T.route.id]:w.error})),e.fetchers.delete(p)}else if(Be(w))U(!1,"Unhandled fetcher revalidation redirect");else if(Ne(w))U(!1,"Unhandled fetcher deferred data");else{let T=je(w.data);e.fetchers.set(p,T)}}),{loaderData:c,errors:l}}function Cr(e,t,r,n){let a=G({},t);for(let i of r){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&i.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function Dr(e){return e?fe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ze(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Lr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function le(e,t){let{pathname:r,routeId:n,method:a,type:i,message:o}=t===void 0?{}:t,c="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(c="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(c="Not Found",l='No route matches URL "'+r+'"'):e===405&&(c="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new Lt(e||500,c,new Error(l),!0)}function Pt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Be(a))return{key:n,result:a}}}function Qr(e){let t=typeof e=="string"?Ie(e):e;return ut(G({},t,{hash:""}))}function $a(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ka(e){return Zr(e.result)&&ja.has(e.result.status)}function Ne(e){return e.type===B.deferred}function fe(e){return e.type===B.error}function Be(e){return(e&&e.type)===B.redirect}function jr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ya(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Zr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ga(e){return La.has(e.toLowerCase())}function me(e){return Ca.has(e.toLowerCase())}async function Ja(e,t,r,n,a){let i=Object.entries(t);for(let o=0;o<i.length;o++){let[c,l]=i[o],d=e.find(b=>(b==null?void 0:b.route.id)===c);if(!d)continue;let p=n.find(b=>b.route.id===d.route.id),v=p!=null&&!Xr(p,d)&&(a&&a[d.route.id])!==void 0;Ne(l)&&v&&await Qt(l,r,!1).then(b=>{b&&(t[c]=b)})}}async function Xa(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:i,controller:o}=r[n],c=t[a];e.find(d=>(d==null?void 0:d.route.id)===i)&&Ne(c)&&(U(o,"Expected an AbortController for revalidating fetcher deferred result"),await Qt(c,o.signal,!0).then(d=>{d&&(t[a]=d)}))}}async function Qt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:B.data,data:e.deferredData.unwrappedData}}catch(a){return{type:B.error,error:a}}return{type:B.data,data:e.deferredData.data}}}function Zt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ot(e,t){let r=typeof t=="string"?Ie(t).search:t.search;if(e[e.length-1].route.index&&Zt(r||""))return e[e.length-1];let n=Yr(e);return n[n.length-1]}function Nr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Vt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function qa(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function at(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Qa(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function je(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Za(e,t){try{let r=e.sessionStorage.getItem(Jr);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function ei(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Jr,JSON.stringify(r))}catch(n){He(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
11
|
+
*/function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},G.apply(this,arguments)}var ee;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ee||(ee={}));const vr="popstate";function aa(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:c}=n.location;return st("",{pathname:i,search:o,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ut(a)}return oa(t,r,null,e)}function U(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function He(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ia(){return Math.random().toString(36).substr(2,8)}function gr(e,t){return{usr:e.state,key:e.key,idx:t}}function st(e,t,r,n){return r===void 0&&(r=null),G({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ie(t):t,{state:r,key:t&&t.key||n||ia()})}function ut(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ie(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function oa(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,c=ee.Pop,l=null,d=p();d==null&&(d=0,o.replaceState(G({},o.state,{idx:d}),""));function p(){return(o.state||{idx:null}).idx}function v(){c=ee.Pop;let D=p(),k=D==null?null:D-d;d=D,l&&l({action:c,location:E.location,delta:k})}function b(D,k){c=ee.Push;let L=st(E.location,D,k);d=p()+1;let K=gr(L,d),te=E.createHref(L);try{o.pushState(K,"",te)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(te)}i&&l&&l({action:c,location:E.location,delta:1})}function w(D,k){c=ee.Replace;let L=st(E.location,D,k);d=p();let K=gr(L,d),te=E.createHref(L);o.replaceState(K,"",te),i&&l&&l({action:c,location:E.location,delta:0})}function T(D){let k=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof D=="string"?D:ut(D);return L=L.replace(/ $/,"%20"),U(k,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,k)}let E={get action(){return c},get location(){return e(a,o)},listen(D){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(vr,v),l=D,()=>{a.removeEventListener(vr,v),l=null}},createHref(D){return t(a,D)},createURL:T,encodeLocation(D){let k=T(D);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:b,replace:w,go(D){return o.go(D)}};return E}var B;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(B||(B={}));const sa=new Set(["lazy","caseSensitive","path","id","index","children"]);function la(e){return e.index===!0}function Dt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let o=[...r,String(i)],c=typeof a.id=="string"?a.id:o.join("-");if(U(a.index!==!0||!a.children,"Cannot specify children on an index route"),U(!n[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),la(a)){let l=G({},a,t(a),{id:c});return n[c]=l,l}else{let l=G({},a,t(a),{id:c,children:void 0});return n[c]=l,a.children&&(l.children=Dt(a.children,t,o,n)),l}})}function Ve(e,t,r){return r===void 0&&(r="/"),Tt(e,t,r,!1)}function Tt(e,t,r,n){let a=typeof t=="string"?Ie(t):t,i=dt(a.pathname||"/",r);if(i==null)return null;let o=$r(e);ua(o);let c=null;for(let l=0;c==null&&l<o.length;++l){let d=xa(i);c=ba(o[l],d,n)}return c}function ca(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function $r(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,c)=>{let l={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(U(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let d=Me([n,l.relativePath]),p=r.concat(l);i.children&&i.children.length>0&&(U(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),$r(i.children,t,p,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:ga(d,i.index),routesMeta:p})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let l of Kr(i.path))a(i,o,l)}),t}function Kr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=Kr(n.join("/")),c=[];return c.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&c.push(...o),c.map(l=>e.startsWith("/")&&l===""?"/":l)}function ua(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ya(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const da=/^:[\w-]+$/,fa=3,ha=2,ma=1,pa=10,va=-2,yr=e=>e==="*";function ga(e,t){let r=e.split("/"),n=r.length;return r.some(yr)&&(n+=va),t&&(n+=ha),r.filter(a=>!yr(a)).reduce((a,i)=>a+(da.test(i)?fa:i===""?ma:pa),n)}function ya(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ba(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",o=[];for(let c=0;c<n.length;++c){let l=n[c],d=c===n.length-1,p=i==="/"?t:t.slice(i.length)||"/",v=br({path:l.relativePath,caseSensitive:l.caseSensitive,end:d},p),b=l.route;if(!v&&d&&r&&!n[n.length-1].route.index&&(v=br({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},p)),!v)return null;Object.assign(a,v.params),o.push({params:a,pathname:Me([i,v.pathname]),pathnameBase:Pa(Me([i,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(i=Me([i,v.pathnameBase]))}return o}function br(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=wa(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:n.reduce((d,p,v)=>{let{paramName:b,isOptional:w}=p;if(b==="*"){let E=c[v]||"";o=i.slice(0,i.length-E.length).replace(/(.)\/+$/,"$1")}const T=c[v];return w&&!T?d[b]=void 0:d[b]=(T||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function wa(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),He(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,l)=>(n.push({paramName:c,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function xa(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return He(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function dt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Ea=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sa=e=>Ea.test(e);function Ra(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ie(e):e,i;if(r)if(Sa(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),He(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=wr(r.substring(1),"/"):i=wr(r,t)}else i=t;return{pathname:i,search:Ta(n),hash:_a(a)}}function wr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function kt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Yr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Xt(e,t){let r=Yr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Ie(e):(a=G({},e),U(!a.pathname||!a.pathname.includes("?"),kt("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),kt("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),kt("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,c;if(o==null)c=r;else{let v=t.length-1;if(!n&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),v-=1;a.pathname=b.join("/")}c=v>=0?t[v]:"/"}let l=Ra(a,c),d=o&&o!=="/"&&o.endsWith("/"),p=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(d||p)&&(l.pathname+="/"),l}const Me=e=>e.join("/").replace(/\/\/+/g,"/"),Pa=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_a=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Lt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function lt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Gr=["post","put","patch","delete"],Ca=new Set(Gr),Da=["get",...Gr],La=new Set(Da),ja=new Set([301,302,303,307,308]),Na=new Set([307,308]),Ft={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ma={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Qt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ia=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Jr="remix-router-transitions";function Ua(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;U(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let s=e.detectErrorBoundary;a=u=>({hasErrorBoundary:s(u)})}else a=Ia;let i={},o=Dt(e.routes,a,void 0,i),c,l=e.basename||"/",d=e.dataStrategy||Fa,p=e.patchRoutesOnNavigation,v=G({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,w=new Set,T=null,E=null,D=null,k=e.hydrationData!=null,L=Ve(o,e.history.location,l),K=!1,te=null;if(L==null&&!p){let s=le(404,{pathname:e.history.location.pathname}),{matches:u,route:f}=jr(o);L=u,te={[f.id]:s}}L&&!e.hydrationData&&wt(L,o,e.history.location.pathname).active&&(L=null);let $;if(L)if(L.some(s=>s.route.lazy))$=!1;else if(!L.some(s=>s.route.loader))$=!0;else if(v.v7_partialHydration){let s=e.hydrationData?e.hydrationData.loaderData:null,u=e.hydrationData?e.hydrationData.errors:null;if(u){let f=L.findIndex(y=>u[y.route.id]!==void 0);$=L.slice(0,f+1).every(y=>!Wt(y.route,s,u))}else $=L.every(f=>!Wt(f.route,s,u))}else $=e.hydrationData!=null;else if($=!1,L=[],v.v7_partialHydration){let s=wt(null,o,e.history.location.pathname);s.active&&s.matches&&(K=!0,L=s.matches)}let he,g={historyAction:e.history.action,location:e.history.location,matches:L,initialized:$,navigation:Ft,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||te,fetchers:new Map,blockers:new Map},N=ee.Pop,F=!1,I,re=!1,J=new Map,oe=null,ae=!1,se=!1,We=[],$e=new Set,Q=new Map,Te=0,_e=-1,we=new Map,ce=new Set,Ce=new Map,Ue=new Map,ue=new Set,xe=new Map,pe=new Map,Oe;function vt(){if(b=e.history.listen(s=>{let{action:u,location:f,delta:y}=s;if(Oe){Oe(),Oe=void 0;return}He(pe.size===0||y!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let x=fr({currentLocation:g.location,nextLocation:f,historyAction:u});if(x&&y!=null){let C=new Promise(j=>{Oe=j});e.history.go(y*-1),bt(x,{state:"blocked",location:f,proceed(){bt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),C.then(()=>e.history.go(y))},reset(){let j=new Map(g.blockers);j.set(x,nt),H({blockers:j})}});return}return Ae(u,f)}),r){Za(t,J);let s=()=>ei(t,J);t.addEventListener("pagehide",s),oe=()=>t.removeEventListener("pagehide",s)}return g.initialized||Ae(ee.Pop,g.location,{initialHydration:!0}),he}function V(){b&&b(),oe&&oe(),w.clear(),I&&I.abort(),g.fetchers.forEach((s,u)=>yt(u)),g.blockers.forEach((s,u)=>dr(u))}function de(s){return w.add(s),()=>w.delete(s)}function H(s,u){u===void 0&&(u={}),g=G({},g,s);let f=[],y=[];v.v7_fetcherPersist&&g.fetchers.forEach((x,C)=>{x.state==="idle"&&(ue.has(C)?y.push(C):f.push(C))}),ue.forEach(x=>{!g.fetchers.has(x)&&!Q.has(x)&&y.push(x)}),[...w].forEach(x=>x(g,{deletedFetchers:y,viewTransitionOpts:u.viewTransitionOpts,flushSync:u.flushSync===!0})),v.v7_fetcherPersist?(f.forEach(x=>g.fetchers.delete(x)),y.forEach(x=>yt(x))):y.forEach(x=>ue.delete(x))}function ve(s,u,f){var y,x;let{flushSync:C}=f===void 0?{}:f,j=g.actionData!=null&&g.navigation.formMethod!=null&&me(g.navigation.formMethod)&&g.navigation.state==="loading"&&((y=s.state)==null?void 0:y._isRedirect)!==!0,R;u.actionData?Object.keys(u.actionData).length>0?R=u.actionData:R=null:j?R=g.actionData:R=null;let P=u.loaderData?Dr(g.loaderData,u.loaderData,u.matches||[],u.errors):g.loaderData,S=g.blockers;S.size>0&&(S=new Map(S),S.forEach((O,ie)=>S.set(ie,nt)));let _=F===!0||g.navigation.formMethod!=null&&me(g.navigation.formMethod)&&((x=s.state)==null?void 0:x._isRedirect)!==!0;c&&(o=c,c=void 0),ae||N===ee.Pop||(N===ee.Push?e.history.push(s,s.state):N===ee.Replace&&e.history.replace(s,s.state));let M;if(N===ee.Pop){let O=J.get(g.location.pathname);O&&O.has(s.pathname)?M={currentLocation:g.location,nextLocation:s}:J.has(s.pathname)&&(M={currentLocation:s,nextLocation:g.location})}else if(re){let O=J.get(g.location.pathname);O?O.add(s.pathname):(O=new Set([s.pathname]),J.set(g.location.pathname,O)),M={currentLocation:g.location,nextLocation:s}}H(G({},u,{actionData:R,loaderData:P,historyAction:N,location:s,initialized:!0,navigation:Ft,revalidation:"idle",restoreScrollPosition:mr(s,u.matches||g.matches),preventScrollReset:_,blockers:S}),{viewTransitionOpts:M,flushSync:C===!0}),N=ee.Pop,F=!1,re=!1,ae=!1,se=!1,We=[]}async function gt(s,u){if(typeof s=="number"){e.history.go(s);return}let f=Ht(g.location,g.matches,l,v.v7_prependBasename,s,v.v7_relativeSplatPath,u==null?void 0:u.fromRouteId,u==null?void 0:u.relative),{path:y,submission:x,error:C}=xr(v.v7_normalizeFormMethod,!1,f,u),j=g.location,R=st(g.location,y,u&&u.state);R=G({},R,e.history.encodeLocation(R));let P=u&&u.replace!=null?u.replace:void 0,S=ee.Push;P===!0?S=ee.Replace:P===!1||x!=null&&me(x.formMethod)&&x.formAction===g.location.pathname+g.location.search&&(S=ee.Replace);let _=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,M=(u&&u.flushSync)===!0,O=fr({currentLocation:j,nextLocation:R,historyAction:S});if(O){bt(O,{state:"blocked",location:R,proceed(){bt(O,{state:"proceeding",proceed:void 0,reset:void 0,location:R}),gt(s,u)},reset(){let ie=new Map(g.blockers);ie.set(O,nt),H({blockers:ie})}});return}return await Ae(S,R,{submission:x,pendingError:C,preventScrollReset:_,replace:u&&u.replace,enableViewTransition:u&&u.viewTransition,flushSync:M})}function wn(){if(It(),H({revalidation:"loading"}),g.navigation.state!=="submitting"){if(g.navigation.state==="idle"){Ae(g.historyAction,g.location,{startUninterruptedRevalidation:!0});return}Ae(N||g.historyAction,g.navigation.location,{overrideNavigation:g.navigation,enableViewTransition:re===!0})}}async function Ae(s,u,f){I&&I.abort(),I=null,N=s,ae=(f&&f.startUninterruptedRevalidation)===!0,Ln(g.location,g.matches),F=(f&&f.preventScrollReset)===!0,re=(f&&f.enableViewTransition)===!0;let y=c||o,x=f&&f.overrideNavigation,C=f!=null&&f.initialHydration&&g.matches&&g.matches.length>0&&!K?g.matches:Ve(y,u,l),j=(f&&f.flushSync)===!0;if(C&&g.initialized&&!se&&$a(g.location,u)&&!(f&&f.submission&&me(f.submission.formMethod))){ve(u,{matches:C},{flushSync:j});return}let R=wt(C,y,u.pathname);if(R.active&&R.matches&&(C=R.matches),!C){let{error:W,notFoundMatches:z,route:X}=Ut(u.pathname);ve(u,{matches:z,loaderData:{},errors:{[X.id]:W}},{flushSync:j});return}I=new AbortController;let P=Je(e.history,u,I.signal,f&&f.submission),S;if(f&&f.pendingError)S=[ze(C).route.id,{type:B.error,error:f.pendingError}];else if(f&&f.submission&&me(f.submission.formMethod)){let W=await xn(P,u,f.submission,C,R.active,{replace:f.replace,flushSync:j});if(W.shortCircuited)return;if(W.pendingActionResult){let[z,X]=W.pendingActionResult;if(fe(X)&<(X.error)&&X.error.status===404){I=null,ve(u,{matches:W.matches,loaderData:{},errors:{[z]:X.error}});return}}C=W.matches||C,S=W.pendingActionResult,x=Vt(u,f.submission),j=!1,R.active=!1,P=Je(e.history,P.url,P.signal)}let{shortCircuited:_,matches:M,loaderData:O,errors:ie}=await En(P,u,C,R.active,x,f&&f.submission,f&&f.fetcherSubmission,f&&f.replace,f&&f.initialHydration===!0,j,S);_||(I=null,ve(u,G({matches:M||C},Lr(S),{loaderData:O,errors:ie})))}async function xn(s,u,f,y,x,C){C===void 0&&(C={}),It();let j=qa(u,f);if(H({navigation:j},{flushSync:C.flushSync===!0}),x){let S=await xt(y,u.pathname,s.signal);if(S.type==="aborted")return{shortCircuited:!0};if(S.type==="error"){let _=ze(S.partialMatches).route.id;return{matches:S.partialMatches,pendingActionResult:[_,{type:B.error,error:S.error}]}}else if(S.matches)y=S.matches;else{let{notFoundMatches:_,error:M,route:O}=Ut(u.pathname);return{matches:_,pendingActionResult:[O.id,{type:B.error,error:M}]}}}let R,P=ot(y,u);if(!P.route.action&&!P.route.lazy)R={type:B.error,error:le(405,{method:s.method,pathname:u.pathname,routeId:P.route.id})};else if(R=(await Ze("action",g,s,[P],y,null))[P.route.id],s.signal.aborted)return{shortCircuited:!0};if(Be(R)){let S;return C&&C.replace!=null?S=C.replace:S=Tr(R.response.headers.get("Location"),new URL(s.url),l,e.history)===g.location.pathname+g.location.search,await ke(s,R,!0,{submission:f,replace:S}),{shortCircuited:!0}}if(Ne(R))throw le(400,{type:"defer-action"});if(fe(R)){let S=ze(y,P.route.id);return(C&&C.replace)!==!0&&(N=ee.Push),{matches:y,pendingActionResult:[S.route.id,R]}}return{matches:y,pendingActionResult:[P.route.id,R]}}async function En(s,u,f,y,x,C,j,R,P,S,_){let M=x||Vt(u,C),O=C||j||Mr(M),ie=!ae&&(!v.v7_partialHydration||!P);if(y){if(ie){let q=ir(_);H(G({navigation:M},q!==void 0?{actionData:q}:{}),{flushSync:S})}let A=await xt(f,u.pathname,s.signal);if(A.type==="aborted")return{shortCircuited:!0};if(A.type==="error"){let q=ze(A.partialMatches).route.id;return{matches:A.partialMatches,loaderData:{},errors:{[q]:A.error}}}else if(A.matches)f=A.matches;else{let{error:q,notFoundMatches:Ye,route:rt}=Ut(u.pathname);return{matches:Ye,loaderData:{},errors:{[rt.id]:q}}}}let W=c||o,[z,X]=Sr(e.history,g,f,O,u,v.v7_partialHydration&&P===!0,v.v7_skipActionErrorRevalidation,se,We,$e,ue,Ce,ce,W,l,_);if(Ot(A=>!(f&&f.some(q=>q.route.id===A))||z&&z.some(q=>q.route.id===A)),_e=++Te,z.length===0&&X.length===0){let A=cr();return ve(u,G({matches:f,loaderData:{},errors:_&&fe(_[1])?{[_[0]]:_[1].error}:null},Lr(_),A?{fetchers:new Map(g.fetchers)}:{}),{flushSync:S}),{shortCircuited:!0}}if(ie){let A={};if(!y){A.navigation=M;let q=ir(_);q!==void 0&&(A.actionData=q)}X.length>0&&(A.fetchers=Sn(X)),H(A,{flushSync:S})}X.forEach(A=>{Le(A.key),A.controller&&Q.set(A.key,A.controller)});let Ke=()=>X.forEach(A=>Le(A.key));I&&I.signal.addEventListener("abort",Ke);let{loaderResults:et,fetcherResults:Se}=await or(g,f,z,X,s);if(s.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Ke),X.forEach(A=>Q.delete(A.key));let ge=Pt(et);if(ge)return await ke(s,ge.result,!0,{replace:R}),{shortCircuited:!0};if(ge=Pt(Se),ge)return ce.add(ge.key),await ke(s,ge.result,!0,{replace:R}),{shortCircuited:!0};let{loaderData:At,errors:tt}=Cr(g,f,et,_,X,Se,xe);xe.forEach((A,q)=>{A.subscribe(Ye=>{(Ye||A.done)&&xe.delete(q)})}),v.v7_partialHydration&&P&&g.errors&&(tt=G({},g.errors,tt));let Fe=cr(),Et=ur(_e),St=Fe||Et||X.length>0;return G({matches:f,loaderData:At,errors:tt},St?{fetchers:new Map(g.fetchers)}:{})}function ir(s){if(s&&!fe(s[1]))return{[s[0]]:s[1].data};if(g.actionData)return Object.keys(g.actionData).length===0?null:g.actionData}function Sn(s){return s.forEach(u=>{let f=g.fetchers.get(u.key),y=at(void 0,f?f.data:void 0);g.fetchers.set(u.key,y)}),new Map(g.fetchers)}function Rn(s,u,f,y){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Le(s);let x=(y&&y.flushSync)===!0,C=c||o,j=Ht(g.location,g.matches,l,v.v7_prependBasename,f,v.v7_relativeSplatPath,u,y==null?void 0:y.relative),R=Ve(C,j,l),P=wt(R,C,j);if(P.active&&P.matches&&(R=P.matches),!R){Ee(s,u,le(404,{pathname:j}),{flushSync:x});return}let{path:S,submission:_,error:M}=xr(v.v7_normalizeFormMethod,!0,j,y);if(M){Ee(s,u,M,{flushSync:x});return}let O=ot(R,S),ie=(y&&y.preventScrollReset)===!0;if(_&&me(_.formMethod)){Pn(s,u,S,O,R,P.active,x,ie,_);return}Ce.set(s,{routeId:u,path:S}),Tn(s,u,S,O,R,P.active,x,ie,_)}async function Pn(s,u,f,y,x,C,j,R,P){It(),Ce.delete(s);function S(Z){if(!Z.route.action&&!Z.route.lazy){let Ge=le(405,{method:P.formMethod,pathname:f,routeId:u});return Ee(s,u,Ge,{flushSync:j}),!0}return!1}if(!C&&S(y))return;let _=g.fetchers.get(s);De(s,Qa(P,_),{flushSync:j});let M=new AbortController,O=Je(e.history,f,M.signal,P);if(C){let Z=await xt(x,new URL(O.url).pathname,O.signal,s);if(Z.type==="aborted")return;if(Z.type==="error"){Ee(s,u,Z.error,{flushSync:j});return}else if(Z.matches){if(x=Z.matches,y=ot(x,f),S(y))return}else{Ee(s,u,le(404,{pathname:f}),{flushSync:j});return}}Q.set(s,M);let ie=Te,z=(await Ze("action",g,O,[y],x,s))[y.route.id];if(O.signal.aborted){Q.get(s)===M&&Q.delete(s);return}if(v.v7_fetcherPersist&&ue.has(s)){if(Be(z)||fe(z)){De(s,je(void 0));return}}else{if(Be(z))if(Q.delete(s),_e>ie){De(s,je(void 0));return}else return ce.add(s),De(s,at(P)),ke(O,z,!1,{fetcherSubmission:P,preventScrollReset:R});if(fe(z)){Ee(s,u,z.error);return}}if(Ne(z))throw le(400,{type:"defer-action"});let X=g.navigation.location||g.location,Ke=Je(e.history,X,M.signal),et=c||o,Se=g.navigation.state!=="idle"?Ve(et,g.navigation.location,l):g.matches;U(Se,"Didn't find any matches after fetcher action");let ge=++Te;we.set(s,ge);let At=at(P,z.data);g.fetchers.set(s,At);let[tt,Fe]=Sr(e.history,g,Se,P,X,!1,v.v7_skipActionErrorRevalidation,se,We,$e,ue,Ce,ce,et,l,[y.route.id,z]);Fe.filter(Z=>Z.key!==s).forEach(Z=>{let Ge=Z.key,pr=g.fetchers.get(Ge),Mn=at(void 0,pr?pr.data:void 0);g.fetchers.set(Ge,Mn),Le(Ge),Z.controller&&Q.set(Ge,Z.controller)}),H({fetchers:new Map(g.fetchers)});let Et=()=>Fe.forEach(Z=>Le(Z.key));M.signal.addEventListener("abort",Et);let{loaderResults:St,fetcherResults:A}=await or(g,Se,tt,Fe,Ke);if(M.signal.aborted)return;M.signal.removeEventListener("abort",Et),we.delete(s),Q.delete(s),Fe.forEach(Z=>Q.delete(Z.key));let q=Pt(St);if(q)return ke(Ke,q.result,!1,{preventScrollReset:R});if(q=Pt(A),q)return ce.add(q.key),ke(Ke,q.result,!1,{preventScrollReset:R});let{loaderData:Ye,errors:rt}=Cr(g,Se,St,void 0,Fe,A,xe);if(g.fetchers.has(s)){let Z=je(z.data);g.fetchers.set(s,Z)}ur(ge),g.navigation.state==="loading"&&ge>_e?(U(N,"Expected pending action"),I&&I.abort(),ve(g.navigation.location,{matches:Se,loaderData:Ye,errors:rt,fetchers:new Map(g.fetchers)})):(H({errors:rt,loaderData:Dr(g.loaderData,Ye,Se,rt),fetchers:new Map(g.fetchers)}),se=!1)}async function Tn(s,u,f,y,x,C,j,R,P){let S=g.fetchers.get(s);De(s,at(P,S?S.data:void 0),{flushSync:j});let _=new AbortController,M=Je(e.history,f,_.signal);if(C){let z=await xt(x,new URL(M.url).pathname,M.signal,s);if(z.type==="aborted")return;if(z.type==="error"){Ee(s,u,z.error,{flushSync:j});return}else if(z.matches)x=z.matches,y=ot(x,f);else{Ee(s,u,le(404,{pathname:f}),{flushSync:j});return}}Q.set(s,_);let O=Te,W=(await Ze("loader",g,M,[y],x,s))[y.route.id];if(Ne(W)&&(W=await Zt(W,M.signal,!0)||W),Q.get(s)===_&&Q.delete(s),!M.signal.aborted){if(ue.has(s)){De(s,je(void 0));return}if(Be(W))if(_e>O){De(s,je(void 0));return}else{ce.add(s),await ke(M,W,!1,{preventScrollReset:R});return}if(fe(W)){Ee(s,u,W.error);return}U(!Ne(W),"Unhandled fetcher deferred data"),De(s,je(W.data))}}async function ke(s,u,f,y){let{submission:x,fetcherSubmission:C,preventScrollReset:j,replace:R}=y===void 0?{}:y;u.response.headers.has("X-Remix-Revalidate")&&(se=!0);let P=u.response.headers.get("Location");U(P,"Expected a Location header on the redirect Response"),P=Tr(P,new URL(s.url),l,e.history);let S=st(g.location,P,{_isRedirect:!0});if(r){let z=!1;if(u.response.headers.has("X-Remix-Reload-Document"))z=!0;else if(Qt.test(P)){const X=e.history.createURL(P);z=X.origin!==t.location.origin||dt(X.pathname,l)==null}if(z){R?t.location.replace(P):t.location.assign(P);return}}I=null;let _=R===!0||u.response.headers.has("X-Remix-Replace")?ee.Replace:ee.Push,{formMethod:M,formAction:O,formEncType:ie}=g.navigation;!x&&!C&&M&&O&&ie&&(x=Mr(g.navigation));let W=x||C;if(Na.has(u.response.status)&&W&&me(W.formMethod))await Ae(_,S,{submission:G({},W,{formAction:P}),preventScrollReset:j||F,enableViewTransition:f?re:void 0});else{let z=Vt(S,x);await Ae(_,S,{overrideNavigation:z,fetcherSubmission:C,preventScrollReset:j||F,enableViewTransition:f?re:void 0})}}async function Ze(s,u,f,y,x,C){let j,R={};try{j=await Va(d,s,u,f,y,x,C,i,a)}catch(P){return y.forEach(S=>{R[S.route.id]={type:B.error,error:P}}),R}for(let[P,S]of Object.entries(j))if(Ka(S)){let _=S.result;R[P]={type:B.redirect,response:Ha(_,f,P,x,l,v.v7_relativeSplatPath)}}else R[P]=await Ba(S);return R}async function or(s,u,f,y,x){let C=s.matches,j=Ze("loader",s,x,f,u,null),R=Promise.all(y.map(async _=>{if(_.matches&&_.match&&_.controller){let O=(await Ze("loader",s,Je(e.history,_.path,_.controller.signal),[_.match],_.matches,_.key))[_.match.route.id];return{[_.key]:O}}else return Promise.resolve({[_.key]:{type:B.error,error:le(404,{pathname:_.path})}})})),P=await j,S=(await R).reduce((_,M)=>Object.assign(_,M),{});return await Promise.all([Ja(u,P,x.signal,C,s.loaderData),Xa(u,S,y)]),{loaderResults:P,fetcherResults:S}}function It(){se=!0,We.push(...Ot()),Ce.forEach((s,u)=>{Q.has(u)&&$e.add(u),Le(u)})}function De(s,u,f){f===void 0&&(f={}),g.fetchers.set(s,u),H({fetchers:new Map(g.fetchers)},{flushSync:(f&&f.flushSync)===!0})}function Ee(s,u,f,y){y===void 0&&(y={});let x=ze(g.matches,u);yt(s),H({errors:{[x.route.id]:f},fetchers:new Map(g.fetchers)},{flushSync:(y&&y.flushSync)===!0})}function sr(s){return Ue.set(s,(Ue.get(s)||0)+1),ue.has(s)&&ue.delete(s),g.fetchers.get(s)||Ma}function yt(s){let u=g.fetchers.get(s);Q.has(s)&&!(u&&u.state==="loading"&&we.has(s))&&Le(s),Ce.delete(s),we.delete(s),ce.delete(s),v.v7_fetcherPersist&&ue.delete(s),$e.delete(s),g.fetchers.delete(s)}function _n(s){let u=(Ue.get(s)||0)-1;u<=0?(Ue.delete(s),ue.add(s),v.v7_fetcherPersist||yt(s)):Ue.set(s,u),H({fetchers:new Map(g.fetchers)})}function Le(s){let u=Q.get(s);u&&(u.abort(),Q.delete(s))}function lr(s){for(let u of s){let f=sr(u),y=je(f.data);g.fetchers.set(u,y)}}function cr(){let s=[],u=!1;for(let f of ce){let y=g.fetchers.get(f);U(y,"Expected fetcher: "+f),y.state==="loading"&&(ce.delete(f),s.push(f),u=!0)}return lr(s),u}function ur(s){let u=[];for(let[f,y]of we)if(y<s){let x=g.fetchers.get(f);U(x,"Expected fetcher: "+f),x.state==="loading"&&(Le(f),we.delete(f),u.push(f))}return lr(u),u.length>0}function Cn(s,u){let f=g.blockers.get(s)||nt;return pe.get(s)!==u&&pe.set(s,u),f}function dr(s){g.blockers.delete(s),pe.delete(s)}function bt(s,u){let f=g.blockers.get(s)||nt;U(f.state==="unblocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="proceeding"||f.state==="blocked"&&u.state==="unblocked"||f.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+u.state);let y=new Map(g.blockers);y.set(s,u),H({blockers:y})}function fr(s){let{currentLocation:u,nextLocation:f,historyAction:y}=s;if(pe.size===0)return;pe.size>1&&He(!1,"A router only supports one blocker at a time");let x=Array.from(pe.entries()),[C,j]=x[x.length-1],R=g.blockers.get(C);if(!(R&&R.state==="proceeding")&&j({currentLocation:u,nextLocation:f,historyAction:y}))return C}function Ut(s){let u=le(404,{pathname:s}),f=c||o,{matches:y,route:x}=jr(f);return Ot(),{notFoundMatches:y,route:x,error:u}}function Ot(s){let u=[];return xe.forEach((f,y)=>{(!s||s(y))&&(f.cancel(),u.push(y),xe.delete(y))}),u}function Dn(s,u,f){if(T=s,D=u,E=f||null,!k&&g.navigation===Ft){k=!0;let y=mr(g.location,g.matches);y!=null&&H({restoreScrollPosition:y})}return()=>{T=null,D=null,E=null}}function hr(s,u){return E&&E(s,u.map(y=>ca(y,g.loaderData)))||s.key}function Ln(s,u){if(T&&D){let f=hr(s,u);T[f]=D()}}function mr(s,u){if(T){let f=hr(s,u),y=T[f];if(typeof y=="number")return y}return null}function wt(s,u,f){if(p)if(s){if(Object.keys(s[0].params).length>0)return{active:!0,matches:Tt(u,f,l,!0)}}else return{active:!0,matches:Tt(u,f,l,!0)||[]};return{active:!1,matches:null}}async function xt(s,u,f,y){if(!p)return{type:"success",matches:s};let x=s;for(;;){let C=c==null,j=c||o,R=i;try{await p({signal:f,path:u,matches:x,fetcherKey:y,patch:(_,M)=>{f.aborted||Pr(_,M,j,R,a)}})}catch(_){return{type:"error",error:_,partialMatches:x}}finally{C&&!f.aborted&&(o=[...o])}if(f.aborted)return{type:"aborted"};let P=Ve(j,u,l);if(P)return{type:"success",matches:P};let S=Tt(j,u,l,!0);if(!S||x.length===S.length&&x.every((_,M)=>_.route.id===S[M].route.id))return{type:"success",matches:null};x=S}}function jn(s){i={},c=Dt(s,a,void 0,i)}function Nn(s,u){let f=c==null;Pr(s,u,c||o,i,a),f&&(o=[...o],H({}))}return he={get basename(){return l},get future(){return v},get state(){return g},get routes(){return o},get window(){return t},initialize:vt,subscribe:de,enableScrollRestoration:Dn,navigate:gt,fetch:Rn,revalidate:wn,createHref:s=>e.history.createHref(s),encodeLocation:s=>e.history.encodeLocation(s),getFetcher:sr,deleteFetcher:_n,dispose:V,getBlocker:Cn,deleteBlocker:dr,patchRoutes:Nn,_internalFetchControllers:Q,_internalActiveDeferreds:xe,_internalSetRoutes:jn},he}function Oa(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ht(e,t,r,n,a,i,o,c){let l,d;if(o){l=[];for(let v of t)if(l.push(v),v.route.id===o){d=v;break}}else l=t,d=t[t.length-1];let p=qt(a||".",Xt(l,i),dt(e.pathname,r)||e.pathname,c==="path");if(a==null&&(p.search=e.search,p.hash=e.hash),(a==null||a===""||a===".")&&d){let v=er(p.search);if(d.route.index&&!v)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&v){let b=new URLSearchParams(p.search),w=b.getAll("index");b.delete("index"),w.filter(E=>E).forEach(E=>b.append("index",E));let T=b.toString();p.search=T?"?"+T:""}}return n&&r!=="/"&&(p.pathname=p.pathname==="/"?r:Me([r,p.pathname])),ut(p)}function xr(e,t,r,n){if(!n||!Oa(n))return{path:r};if(n.formMethod&&!Ga(n.formMethod))return{path:r,error:le(405,{method:n.formMethod})};let a=()=>({path:r,error:le(400,{type:"invalid-body"})}),i=n.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),c=Qr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!me(o))return a();let b=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,T)=>{let[E,D]=T;return""+w+E+"="+D+`
|
|
12
|
+
`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:b}}}else if(n.formEncType==="application/json"){if(!me(o))return a();try{let b=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}U(typeof FormData=="function","FormData is not available in this environment");let l,d;if(n.formData)l=$t(n.formData),d=n.formData;else if(n.body instanceof FormData)l=$t(n.body),d=n.body;else if(n.body instanceof URLSearchParams)l=n.body,d=_r(l);else if(n.body==null)l=new URLSearchParams,d=new FormData;else try{l=new URLSearchParams(n.body),d=_r(l)}catch{return a()}let p={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(me(p.formMethod))return{path:r,submission:p};let v=Ie(r);return t&&v.search&&er(v.search)&&l.append("index",""),v.search="?"+l,{path:ut(v),submission:p}}function Er(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function Sr(e,t,r,n,a,i,o,c,l,d,p,v,b,w,T,E){let D=E?fe(E[1])?E[1].error:E[1].data:void 0,k=e.createURL(t.location),L=e.createURL(a),K=r;i&&t.errors?K=Er(r,Object.keys(t.errors)[0],!0):E&&fe(E[1])&&(K=Er(r,E[0]));let te=E?E[1].statusCode:void 0,$=o&&te&&te>=400,he=K.filter((N,F)=>{let{route:I}=N;if(I.lazy)return!0;if(I.loader==null)return!1;if(i)return Wt(I,t.loaderData,t.errors);if(Aa(t.loaderData,t.matches[F],N)||l.some(oe=>oe===N.route.id))return!0;let re=t.matches[F],J=N;return Rr(N,G({currentUrl:k,currentParams:re.params,nextUrl:L,nextParams:J.params},n,{actionResult:D,actionStatus:te,defaultShouldRevalidate:$?!1:c||k.pathname+k.search===L.pathname+L.search||k.search!==L.search||Xr(re,J)}))}),g=[];return v.forEach((N,F)=>{if(i||!r.some(ae=>ae.route.id===N.routeId)||p.has(F))return;let I=Ve(w,N.path,T);if(!I){g.push({key:F,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let re=t.fetchers.get(F),J=ot(I,N.path),oe=!1;b.has(F)?oe=!1:d.has(F)?(d.delete(F),oe=!0):re&&re.state!=="idle"&&re.data===void 0?oe=c:oe=Rr(J,G({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},n,{actionResult:D,actionStatus:te,defaultShouldRevalidate:$?!1:c})),oe&&g.push({key:F,routeId:N.routeId,path:N.path,matches:I,match:J,controller:new AbortController})}),[he,g]}function Wt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Aa(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Xr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Rr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Pr(e,t,r,n,a){var i;let o;if(e){let d=n[e];U(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),o=d.children}else o=r;let c=t.filter(d=>!o.some(p=>qr(d,p))),l=Dt(c,a,[e||"_","patch",String(((i=o)==null?void 0:i.length)||"0")],n);o.push(...l)}function qr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(i=>qr(r,i))}):!1}async function ka(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];U(a,"No route found in manifest");let i={};for(let o in n){let l=a[o]!==void 0&&o!=="hasErrorBoundary";He(!l,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!sa.has(o)&&(i[o]=n[o])}Object.assign(a,i),Object.assign(a,G({},t(a),{lazy:void 0}))}async function Fa(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,i,o)=>Object.assign(a,{[r[o].route.id]:i}),{})}async function Va(e,t,r,n,a,i,o,c,l,d){let p=i.map(w=>w.route.lazy?ka(w.route,l,c):void 0),v=i.map((w,T)=>{let E=p[T],D=a.some(L=>L.route.id===w.route.id);return G({},w,{shouldLoad:D,resolve:async L=>(L&&n.method==="GET"&&(w.route.lazy||w.route.loader)&&(D=!0),D?za(t,n,w,E,L,d):Promise.resolve({type:B.data,result:void 0}))})}),b=await e({matches:v,request:n,params:i[0].params,fetcherKey:o,context:d});try{await Promise.all(p)}catch{}return b}async function za(e,t,r,n,a,i){let o,c,l=d=>{let p,v=new Promise((T,E)=>p=E);c=()=>p(),t.signal.addEventListener("abort",c);let b=T=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...T!==void 0?[T]:[]),w=(async()=>{try{return{type:"data",result:await(a?a(E=>b(E)):b())}}catch(T){return{type:"error",result:T}}})();return Promise.race([w,v])};try{let d=r.route[e];if(n)if(d){let p,[v]=await Promise.all([l(d).catch(b=>{p=b}),n]);if(p!==void 0)throw p;o=v}else if(await n,d=r.route[e],d)o=await l(d);else if(e==="action"){let p=new URL(t.url),v=p.pathname+p.search;throw le(405,{method:t.method,pathname:v,routeId:r.route.id})}else return{type:B.data,result:void 0};else if(d)o=await l(d);else{let p=new URL(t.url),v=p.pathname+p.search;throw le(404,{pathname:v})}U(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:B.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return o}async function Ba(e){let{result:t,type:r}=e;if(Zr(t)){let v;try{let b=t.headers.get("Content-Type");b&&/\bapplication\/json\b/.test(b)?t.body==null?v=null:v=await t.json():v=await t.text()}catch(b){return{type:B.error,error:b}}return r===B.error?{type:B.error,error:new Lt(t.status,t.statusText,v),statusCode:t.status,headers:t.headers}:{type:B.data,data:v,statusCode:t.status,headers:t.headers}}if(r===B.error){if(Nr(t)){var n,a;if(t.data instanceof Error){var i,o;return{type:B.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:B.error,error:new Lt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:lt(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:B.error,error:t,statusCode:lt(t)?t.status:void 0}}if(Ya(t)){var c,l;return{type:B.deferred,deferredData:t,statusCode:(c=t.init)==null?void 0:c.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(Nr(t)){var d,p;return{type:B.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(p=t.init)!=null&&p.headers?new Headers(t.init.headers):void 0}}return{type:B.data,data:t}}function Ha(e,t,r,n,a,i){let o=e.headers.get("Location");if(U(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Qt.test(o)){let c=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=Ht(new URL(t.url),c,a,!0,o,i),e.headers.set("Location",o)}return e}function Tr(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Qt.test(e)){let i=e,o=i.startsWith("//")?new URL(t.protocol+i):new URL(i);if(a.includes(o.protocol))throw new Error("Invalid redirect location");let c=dt(o.pathname,r)!=null;if(o.origin===t.origin&&c)return o.pathname+o.search+o.hash}try{let i=n.createURL(e);if(a.includes(i.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Je(e,t,r,n){let a=e.createURL(Qr(t)).toString(),i={signal:r};if(n&&me(n.formMethod)){let{formMethod:o,formEncType:c}=n;i.method=o.toUpperCase(),c==="application/json"?(i.headers=new Headers({"Content-Type":c}),i.body=JSON.stringify(n.json)):c==="text/plain"?i.body=n.text:c==="application/x-www-form-urlencoded"&&n.formData?i.body=$t(n.formData):i.body=n.formData}return new Request(a,i)}function $t(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function _r(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Wa(e,t,r,n,a){let i={},o=null,c,l=!1,d={},p=r&&fe(r[1])?r[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let b=v.route.id,w=t[b];if(U(!Be(w),"Cannot handle redirect results in processLoaderData"),fe(w)){let T=w.error;p!==void 0&&(T=p,p=void 0),o=o||{};{let E=ze(e,b);o[E.route.id]==null&&(o[E.route.id]=T)}i[b]=void 0,l||(l=!0,c=lt(w.error)?w.error.status:500),w.headers&&(d[b]=w.headers)}else Ne(w)?(n.set(b,w.deferredData),i[b]=w.deferredData.data,w.statusCode!=null&&w.statusCode!==200&&!l&&(c=w.statusCode),w.headers&&(d[b]=w.headers)):(i[b]=w.data,w.statusCode&&w.statusCode!==200&&!l&&(c=w.statusCode),w.headers&&(d[b]=w.headers))}),p!==void 0&&r&&(o={[r[0]]:p},i[r[0]]=void 0),{loaderData:i,errors:o,statusCode:c||200,loaderHeaders:d}}function Cr(e,t,r,n,a,i,o){let{loaderData:c,errors:l}=Wa(t,r,n,o);return a.forEach(d=>{let{key:p,match:v,controller:b}=d,w=i[p];if(U(w,"Did not find corresponding fetcher result"),!(b&&b.signal.aborted))if(fe(w)){let T=ze(e.matches,v==null?void 0:v.route.id);l&&l[T.route.id]||(l=G({},l,{[T.route.id]:w.error})),e.fetchers.delete(p)}else if(Be(w))U(!1,"Unhandled fetcher revalidation redirect");else if(Ne(w))U(!1,"Unhandled fetcher deferred data");else{let T=je(w.data);e.fetchers.set(p,T)}}),{loaderData:c,errors:l}}function Dr(e,t,r,n){let a=G({},t);for(let i of r){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&i.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function Lr(e){return e?fe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ze(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function jr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function le(e,t){let{pathname:r,routeId:n,method:a,type:i,message:o}=t===void 0?{}:t,c="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(c="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(c="Not Found",l='No route matches URL "'+r+'"'):e===405&&(c="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new Lt(e||500,c,new Error(l),!0)}function Pt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Be(a))return{key:n,result:a}}}function Qr(e){let t=typeof e=="string"?Ie(e):e;return ut(G({},t,{hash:""}))}function $a(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ka(e){return Zr(e.result)&&ja.has(e.result.status)}function Ne(e){return e.type===B.deferred}function fe(e){return e.type===B.error}function Be(e){return(e&&e.type)===B.redirect}function Nr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ya(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Zr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ga(e){return La.has(e.toLowerCase())}function me(e){return Ca.has(e.toLowerCase())}async function Ja(e,t,r,n,a){let i=Object.entries(t);for(let o=0;o<i.length;o++){let[c,l]=i[o],d=e.find(b=>(b==null?void 0:b.route.id)===c);if(!d)continue;let p=n.find(b=>b.route.id===d.route.id),v=p!=null&&!Xr(p,d)&&(a&&a[d.route.id])!==void 0;Ne(l)&&v&&await Zt(l,r,!1).then(b=>{b&&(t[c]=b)})}}async function Xa(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:i,controller:o}=r[n],c=t[a];e.find(d=>(d==null?void 0:d.route.id)===i)&&Ne(c)&&(U(o,"Expected an AbortController for revalidating fetcher deferred result"),await Zt(c,o.signal,!0).then(d=>{d&&(t[a]=d)}))}}async function Zt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:B.data,data:e.deferredData.unwrappedData}}catch(a){return{type:B.error,error:a}}return{type:B.data,data:e.deferredData.data}}}function er(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ot(e,t){let r=typeof t=="string"?Ie(t).search:t.search;if(e[e.length-1].route.index&&er(r||""))return e[e.length-1];let n=Yr(e);return n[n.length-1]}function Mr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function Vt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function qa(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function at(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Qa(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function je(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Za(e,t){try{let r=e.sessionStorage.getItem(Jr);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function ei(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Jr,JSON.stringify(r))}catch(n){He(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
13
13
|
* React Router v6.30.3
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) Remix Software Inc.
|
|
@@ -18,7 +18,7 @@ var In=Object.defineProperty;var Un=(e,t,r)=>t in e?In(e,t,{enumerable:!0,config
|
|
|
18
18
|
* LICENSE.md file in the root directory of this source tree.
|
|
19
19
|
*
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/function jt(){return jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jt.apply(this,arguments)}const Mt=h.createContext(null),en=h.createContext(null),ft=h.createContext(null),
|
|
21
|
+
*/function jt(){return jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jt.apply(this,arguments)}const Mt=h.createContext(null),en=h.createContext(null),ft=h.createContext(null),tr=h.createContext(null),Pe=h.createContext({outlet:null,matches:[],isDataRoute:!1}),tn=h.createContext(null);function ht(){return h.useContext(tr)!=null}function mt(){return ht()||U(!1),h.useContext(tr).location}function rn(e){h.useContext(ft).static||h.useLayoutEffect(e)}function rr(){let{isDataRoute:e}=h.useContext(Pe);return e?mi():ti()}function ti(){ht()||U(!1);let e=h.useContext(Mt),{basename:t,future:r,navigator:n}=h.useContext(ft),{matches:a}=h.useContext(Pe),{pathname:i}=mt(),o=JSON.stringify(Xt(a,r.v7_relativeSplatPath)),c=h.useRef(!1);return rn(()=>{c.current=!0}),h.useCallback(function(d,p){if(p===void 0&&(p={}),!c.current)return;if(typeof d=="number"){n.go(d);return}let v=qt(d,JSON.parse(o),i,p.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Me([t,v.pathname])),(p.replace?n.replace:n.push)(v,p.state,p)},[t,n,o,i,e])}const ri=h.createContext(null);function ni(e){let t=h.useContext(Pe).outlet;return t&&h.createElement(ri.Provider,{value:e},t)}function Ko(){let{matches:e}=h.useContext(Pe),t=e[e.length-1];return t?t.params:{}}function ai(e,t,r,n){ht()||U(!1);let{navigator:a}=h.useContext(ft),{matches:i}=h.useContext(Pe),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let d=mt(),p;p=d;let v=p.pathname||"/",b=v;if(l!=="/"){let E=l.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=Ve(e,{pathname:b});return ci(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:Me([l,a.encodeLocation?a.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?l:Me([l,a.encodeLocation?a.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),i,r,n)}function ii(){let e=hi(),t=lt(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,null)}const oi=h.createElement(ii,null);class si extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?h.createElement(Pe.Provider,{value:this.props.routeContext},h.createElement(tn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function li(e){let{routeContext:t,match:r,children:n}=e,a=h.useContext(Mt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(Pe.Provider,{value:t},n)}function ci(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,c=(a=r)==null?void 0:a.errors;if(c!=null){let p=o.findIndex(v=>v.route.id&&(c==null?void 0:c[v.route.id])!==void 0);p>=0||U(!1),o=o.slice(0,Math.min(o.length,p+1))}let l=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let p=0;p<o.length;p++){let v=o[p];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(d=p),v.route.id){let{loaderData:b,errors:w}=r,T=v.route.loader&&b[v.route.id]===void 0&&(!w||w[v.route.id]===void 0);if(v.route.lazy||T){l=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((p,v,b)=>{let w,T=!1,E=null,D=null;r&&(w=c&&v.route.id?c[v.route.id]:void 0,E=v.route.errorElement||oi,l&&(d<0&&b===0?(pi("route-fallback"),T=!0,D=null):d===b&&(T=!0,D=v.route.hydrateFallbackElement||null)));let k=t.concat(o.slice(0,b+1)),L=()=>{let K;return w?K=E:T?K=D:v.route.Component?K=h.createElement(v.route.Component,null):v.route.element?K=v.route.element:K=p,h.createElement(li,{match:v,routeContext:{outlet:p,matches:k,isDataRoute:r!=null},children:K})};return r&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?h.createElement(si,{location:r.location,revalidation:r.revalidation,component:E,error:w,children:L(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):L()},null)}var nn=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(nn||{}),an=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(an||{});function ui(e){let t=h.useContext(Mt);return t||U(!1),t}function di(e){let t=h.useContext(en);return t||U(!1),t}function fi(e){let t=h.useContext(Pe);return t||U(!1),t}function on(e){let t=fi(),r=t.matches[t.matches.length-1];return r.route.id||U(!1),r.route.id}function hi(){var e;let t=h.useContext(tn),r=di(an.UseRouteError),n=on();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function mi(){let{router:e}=ui(nn.UseNavigateStable),t=on(),r=h.useRef(!1);return rn(()=>{r.current=!0}),h.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,jt({fromRouteId:t},i)))},[e,t])}const Ir={};function pi(e,t,r){Ir[e]||(Ir[e]=!0)}function vi(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function sn(e){let{to:t,replace:r,state:n,relative:a}=e;ht()||U(!1);let{future:i,static:o}=h.useContext(ft),{matches:c}=h.useContext(Pe),{pathname:l}=mt(),d=rr(),p=qt(t,Xt(c,i.v7_relativeSplatPath),l,a==="path"),v=JSON.stringify(p);return h.useEffect(()=>d(JSON.parse(v),{replace:r,state:n,relative:a}),[d,v,a,r,n]),null}function gi(e){return ni(e.context)}function yi(e){let{basename:t="/",children:r=null,location:n,navigationType:a=ee.Pop,navigator:i,static:o=!1,future:c}=e;ht()&&U(!1);let l=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:l,navigator:i,static:o,future:jt({v7_relativeSplatPath:!1},c)}),[l,c,i,o]);typeof n=="string"&&(n=Ie(n));let{pathname:p="/",search:v="",hash:b="",state:w=null,key:T="default"}=n,E=h.useMemo(()=>{let D=dt(p,l);return D==null?null:{location:{pathname:D,search:v,hash:b,state:w,key:T},navigationType:a}},[l,p,v,b,w,T,a]);return E==null?null:h.createElement(ft.Provider,{value:d},h.createElement(tr.Provider,{children:r,value:E}))}new Promise(()=>{});function bi(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:h.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
22
22
|
* React Router DOM v6.30.3
|
|
23
23
|
*
|
|
24
24
|
* Copyright (c) Remix Software Inc.
|
|
@@ -27,4 +27,4 @@ var In=Object.defineProperty;var Un=(e,t,r)=>t in e?In(e,t,{enumerable:!0,config
|
|
|
27
27
|
* LICENSE.md file in the root directory of this source tree.
|
|
28
28
|
*
|
|
29
29
|
* @license MIT
|
|
30
|
-
*/function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nt.apply(this,arguments)}function $t(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function wi(e,t){let r=$t(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const xi="6";try{window.__reactRouterVersion=xi}catch{}function Ei(e,t){return Ua({basename:void 0,future:Nt({},void 0,{v7_prependBasename:!0}),history:aa({window:void 0}),hydrationData:Si(),routes:e,mapRouteProperties:bi,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Si(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Nt({},t,{errors:Ri(t.errors)})),t}function Ri(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new Lt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let o=new i(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let i=new Error(a.message);i.stack="",r[n]=i}}else r[n]=a;return r}const Pi=h.createContext({isTransitioning:!1}),Ti=h.createContext(new Map),_i="startTransition",Ir=kn[_i],Ci="flushSync",Ur=na[Ci];function Di(e){Ir?Ir(e):e()}function it(e){Ur?Ur(e):e()}class Li{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function ji(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=h.useState(r.state),[o,c]=h.useState(),[l,d]=h.useState({isTransitioning:!1}),[p,v]=h.useState(),[b,w]=h.useState(),[T,E]=h.useState(),D=h.useRef(new Map),{v7_startTransition:k}=n||{},L=h.useCallback(N=>{k?Di(N):N()},[k]),K=h.useCallback((N,F)=>{let{deletedFetchers:I,flushSync:re,viewTransitionOpts:J}=F;N.fetchers.forEach((ae,se)=>{ae.data!==void 0&&D.current.set(se,ae.data)}),I.forEach(ae=>D.current.delete(ae));let oe=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!J||oe){re?it(()=>i(N)):L(()=>i(N));return}if(re){it(()=>{b&&(p&&p.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:J.currentLocation,nextLocation:J.nextLocation})});let ae=r.window.document.startViewTransition(()=>{it(()=>i(N))});ae.finished.finally(()=>{it(()=>{v(void 0),w(void 0),c(void 0),d({isTransitioning:!1})})}),it(()=>w(ae));return}b?(p&&p.resolve(),b.skipTransition(),E({state:N,currentLocation:J.currentLocation,nextLocation:J.nextLocation})):(c(N),d({isTransitioning:!0,flushSync:!1,currentLocation:J.currentLocation,nextLocation:J.nextLocation}))},[r.window,b,p,D,L]);h.useLayoutEffect(()=>r.subscribe(K),[r,K]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&v(new Li)},[l]),h.useEffect(()=>{if(p&&o&&r.window){let N=o,F=p.promise,I=r.window.document.startViewTransition(async()=>{L(()=>i(N)),await F});I.finished.finally(()=>{v(void 0),w(void 0),c(void 0),d({isTransitioning:!1})}),w(I)}},[L,o,p,r.window]),h.useEffect(()=>{p&&o&&a.location.key===o.location.key&&p.resolve()},[p,b,a.location,o]),h.useEffect(()=>{!l.isTransitioning&&T&&(c(T.state),d({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),E(void 0))},[l.isTransitioning,T]),h.useEffect(()=>{},[]);let te=h.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:N=>r.navigate(N),push:(N,F,I)=>r.navigate(N,{state:F,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(N,F,I)=>r.navigate(N,{replace:!0,state:F,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[r]),$=r.basename||"/",he=h.useMemo(()=>({router:r,navigator:te,static:!1,basename:$}),[r,te,$]),g=h.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return h.useEffect(()=>vi(n,r.future),[n,r.future]),h.createElement(h.Fragment,null,h.createElement(Mt.Provider,{value:he},h.createElement(en.Provider,{value:a},h.createElement(Ti.Provider,{value:D.current},h.createElement(Pi.Provider,{value:l},h.createElement(yi,{basename:$,location:a.location,navigationType:a.historyAction,navigator:te,future:g},a.initialized||r.future.v7_partialHydration?h.createElement(Ni,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Ni=h.memo(Mi);function Mi(e){let{routes:t,future:r,state:n}=e;return ai(t,void 0,n,r)}var Or;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Or||(Or={}));var Ar;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ar||(Ar={}));function Ii(e){let t=h.useRef($t(e)),r=h.useRef(!1),n=mt(),a=h.useMemo(()=>wi(n.search,r.current?null:t.current),[n.search]),i=tr(),o=h.useCallback((c,l)=>{const d=$t(typeof c=="function"?c(a):c);r.current=!0,i("?"+d,l)},[i,a]);return[a,o]}const Ui="desktop://window-lifecycle",Oi=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function Ai(e){return e instanceof HTMLInputElement?!Oi.has(e.type.toLowerCase()):!1}function ki(e){const t=e.activeElement;if(Ai(t)||t instanceof HTMLTextAreaElement){const r=t.selectionStart??0,n=t.selectionEnd??r;return n<=r?null:t.value.slice(r,n)}return null}function Fi(e){const t=ki(e);if(t!==null)return t;const r=e.getSelection();if(!r||r.isCollapsed)return null;const n=r.toString();return n.length>0?n:null}function Vi(e,t){var a;const r=(a=e.execCommand)==null?void 0:a.bind(e);if(typeof r!="function")return!1;const n=e.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.top="-9999px",n.style.opacity="0",e.body.append(n),n.select();try{return r("copy")}catch{return!1}finally{n.remove()}}async function zi(e,t,r){var a,i;try{if(await r(t))return}catch{}const n=(a=e.defaultView)==null?void 0:a.navigator;if((i=n==null?void 0:n.clipboard)!=null&&i.writeText)try{await n.clipboard.writeText(t);return}catch{}Vi(e,t)}function Bi(e){const{window:t,document:r,writeClipboardText:n}=e;function a(i){if(i.defaultPrevented||!i.metaKey||i.ctrlKey||i.altKey||i.key.toLowerCase()!=="c")return;const o=Fi(r);o&&(i.preventDefault(),zi(r,o,n))}return t.addEventListener("keydown",a,!0),()=>{t.removeEventListener("keydown",a,!0)}}const ln=h.createContext(null),Hi=["--desktop-macos-traffic-light-center-y","--desktop-macos-traffic-light-leading-inset","--desktop-macos-traffic-light-safe-zone-width","--desktop-macos-titlebar-height","--desktop-macos-traffic-light-button-diameter"];function Wi(e){if(typeof document>"u")return;const{documentElement:t,body:r}=document;t.dataset.runtimePlatform=e.platform,t.dataset.osFamily=e.ui.osFamily,t.dataset.windowControls=e.ui.windowControlsStyle,t.dataset.viewportClass=e.viewportClass,t.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar),r&&(r.dataset.runtimePlatform=e.platform,r.dataset.osFamily=e.ui.osFamily,r.dataset.windowControls=e.ui.windowControlsStyle,r.dataset.viewportClass=e.viewportClass,r.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar))}function Kt(){var e;if(!(typeof document>"u"))for(const t of Hi)document.documentElement.style.removeProperty(t),(e=document.body)==null||e.style.removeProperty(t)}function $i(e){if(typeof document>"u")return;if(!e){Kt();return}const t=[document.documentElement,document.body].filter(n=>!!n),r=[["--desktop-macos-traffic-light-center-y",`${e.trafficLightCenterY}px`],["--desktop-macos-traffic-light-leading-inset",`${e.trafficLightLeadingInset}px`],["--desktop-macos-traffic-light-safe-zone-width",`${e.trafficLightSafeZoneWidth}px`],["--desktop-macos-titlebar-height",`${e.titlebarHeight}px`],["--desktop-macos-traffic-light-button-diameter",`${e.trafficLightButtonDiameter}px`]];for(const n of t)for(const[a,i]of r)n.style.setProperty(a,i)}function Ki(){if(!(typeof window>"u"))return window.innerWidth}function Yi({children:e}){const[t,r]=h.useState(()=>Ki()),n=h.useMemo(()=>ct({viewportWidth:t}),[t]);return h.useEffect(()=>{if(typeof window>"u")return;function a(){r(window.innerWidth)}return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]),h.useEffect(()=>{Wi(n)},[n]),h.useEffect(()=>{if(!(typeof window>"u"||typeof document>"u")&&!(!n.isDesktop||n.ui.osFamily!=="macos"||!n.bridge.supported))return Bi({window,document,writeClipboardText:async a=>(await n.bridge.writeClipboardText(a)).ok})},[n]),h.useEffect(()=>()=>{Kt()},[]),h.useEffect(()=>{let a=!1,i=null;return!n.isDesktop||!n.bridge.supported?()=>{a=!0}:(Y(()=>import("./event-DvH9tcej.js").then(o=>o.c),[]).then(async({listen:o})=>{const c=await o(Ui,l=>{const d=l.payload,p=d==null?void 0:d.descriptor;p!=null&&p.windowId&&(n.windows.registerDescriptor(p),d.isOpen?n.windows.markWindowOpen(p.windowId):n.windows.markWindowClosed(p.windowId))});if(a){c();return}i=c}).catch(()=>{}),()=>{a=!0,i==null||i()})},[n]),h.useEffect(()=>{let a=!1,i=null;async function o(){var l,d;const c=await n.bridge.getRuntimeInfo();a||$i(c.ok?(d=(l=c.value)==null?void 0:l.windowChrome)==null?void 0:d.macosTitlebar:null)}return!n.isDesktop||n.ui.osFamily!=="macos"||!n.ui.prefersOverlayTitlebar?(Kt(),()=>{a=!0}):(o(),Y(()=>import("./window-BVUB8gMK.js").then(c=>c.w),__vite__mapDeps([0,1])).then(async({getCurrentWindow:c})=>{const l=await c().onScaleChanged(()=>{o()});if(a){l();return}i=l}).catch(()=>{}),()=>{a=!0,i==null||i()})},[n]),m.jsx(ln.Provider,{value:n,children:e})}function pt(){return h.useContext(ln)??ct()}const Yo=[{id:"light",labelKey:"theme.light",color:"#f6f4ef"},{id:"dark",labelKey:"theme.dark",color:"#1b1b1b"},{id:"sky-blue",labelKey:"theme.skyBlue",color:"#00f0ff"},{id:"eye-green",labelKey:"theme.eyeGreen",color:"#16a34a"}];function Go(e){return Re(e.labelKey)}function Gi(){return typeof window>"u"||typeof window.matchMedia!="function"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function cn(e,t){return t?Gi():e}function Ji(){const{theme:e,autoTheme:t}=Fn.getState().profile;return cn(e,t)}function Xi(e){Gt({theme:e,autoTheme:!1}).catch(()=>{})}function qi(e){Gt({autoTheme:e}).catch(()=>{})}function un(e){typeof window>"u"||document.documentElement.setAttribute("data-theme",e)}function Qi(){const e=qe(n=>n.profile.theme),t=qe(n=>n.profile.autoTheme);return{theme:cn(e,t),selectedTheme:e,autoTheme:t,setTheme:Xi,setAutoTheme:qi}}function Zi(){un(Ji())}function eo({children:e}){const t=qe(n=>n.profile.theme),r=qe(n=>n.profile.autoTheme);return h.useEffect(()=>{Zi()},[t,r]),h.useEffect(()=>{if(!r||typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{un(n.matches?"dark":"light")};return a(),typeof n.addEventListener=="function"?(n.addEventListener("change",a),()=>n.removeEventListener("change",a)):(n.addListener(a),()=>n.removeListener(a))},[r]),m.jsx(m.Fragment,{children:e})}const to={showToast:()=>"",dismissToast:()=>{}},dn=h.createContext(to);function ro(){return`toast-${Math.random().toString(36).slice(2,10)}`}function no({toast:e,onDismiss:t}){const{id:r,title:n,description:a,tone:i,durationMs:o,action:c}=e;return h.useEffect(()=>{if(o===null)return;const l=window.setTimeout(()=>{t(r)},o);return()=>{window.clearTimeout(l)}},[o,r,t,n,a,i]),m.jsxs("article",{className:"toast-card","data-tone":i,role:i==="error"?"alert":"status",children:[m.jsxs("div",{className:"toast-body",children:[m.jsx("strong",{className:"toast-title",children:n}),a?m.jsx("p",{className:"toast-description",children:a}):null]}),m.jsxs("div",{className:"toast-actions",children:[c?m.jsx("button",{className:"toast-action",type:"button",onClick:()=>{c.onClick(),t(r)},children:c.label}):null,m.jsx("button",{className:"toast-dismiss",type:"button","aria-label":"关闭通知",onClick:()=>t(r),children:"×"})]})]})}function ao({children:e}){const[t,r]=h.useState([]),n=h.useCallback(o=>{r(c=>c.filter(l=>l.id!==o))},[]),a=h.useCallback(o=>{const c=o.id??ro(),l={id:c,title:o.title,description:o.description,tone:o.tone??"info",durationMs:o.durationMs===void 0?4200:o.durationMs,action:o.action};return r(d=>{const p=d.findIndex(b=>b.id===c);if(p===-1)return[...d,l];const v=[...d];return v[p]=l,v}),c},[]),i=h.useMemo(()=>({showToast:a,dismissToast:n}),[n,a]);return m.jsxs(dn.Provider,{value:i,children:[e,m.jsx("div",{className:"toast-viewport","aria-live":"polite","aria-atomic":"false",children:t.map(o=>m.jsx(no,{toast:o,onDismiss:n},o.id))})]})}function Jo(){return h.useContext(dn)}const _t="0.6.1",fn=h.createContext(_t);function io({children:e}){const t=pt(),[r,n]=h.useState(_t);return h.useEffect(()=>{let a=!1;return t.isDesktop?(t.bridge.getRuntimeInfo().then(i=>{var c,l;if(a)return;const o=i.ok?(l=(c=i.value)==null?void 0:c.version)==null?void 0:l.trim():"";n(o||_t)}),()=>{a=!0}):(n(_t),()=>{a=!0})},[t]),m.jsx(fn.Provider,{value:r,children:e})}function oo(){return h.useContext(fn)}const kr={latestState:null,lastNotifiedVersion:null,pendingRestartVersion:null};class so{constructor(){Se(this,"state",kr);Se(this,"listeners",new Set);Se(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Se(this,"getState",()=>this.state)}recordState(t){const r=zt(this.state.pendingRestartVersion),n=zt(t.currentVersion);this.state={latestState:t,lastNotifiedVersion:t.hasUpdate?this.state.lastNotifiedVersion:null,pendingRestartVersion:r&&r===n?null:this.state.pendingRestartVersion},this.emit()}markVersionNotified(t){this.state.lastNotifiedVersion!==t&&(this.state={...this.state,lastNotifiedVersion:t},this.emit())}markRestartPending(t){const r=zt(t);!r||this.state.pendingRestartVersion===r||(this.state={...this.state,pendingRestartVersion:r},this.emit())}reset(){this.state=kr,this.emit()}emit(){for(const t of this.listeners)t()}}const Qe=new so;function zt(e){const t=e==null?void 0:e.trim();return t||null}function lo(e){return h.useSyncExternalStore(Qe.subscribe,()=>e(Qe.getState()))}function co(){return Qe.getState()}function uo(e){Qe.recordState(e)}function fo(e){Qe.markVersionNotified(e)}function ho(e){Qe.markRestartPending(e)}async function mo(){const e=ct(),t=ye.getState(),r=await e.bridge.checkForUpdate(t.releaseChannel);if(!r.ok||!r.value)throw new Error(r.detail??"更新检查失败。");return r.value}async function po(e={}){const t=e.notify??"never",r=await mo();return uo(r),await vo(r,t),r}async function Xo(){const e=ct(),t=ye.getState();return e.bridge.installUpdate(t.releaseChannel)}function qo(e){ho(e)}async function Qo(){var e;if(typeof window>"u"||typeof((e=window.__TAURI_INTERNALS__)==null?void 0:e.invoke)!="function")throw new Error("当前运行环境不支持桌面应用重启。");try{await window.__TAURI_INTERNALS__.invoke("restart_application")}catch(t){throw new Error(t instanceof Error?t.message:"重启应用失败。")}}async function vo(e,t){var i,o,c;if(!e.hasUpdate||t==="never")return;const r=((o=(i=e.manifest)==null?void 0:i.version)==null?void 0:o.trim())||e.currentVersion.trim();if(!r)return;const n=co().lastNotifiedVersion;if(t==="always"||n!==r)try{(await ct().bridge.showNotification(Re("settings.releaseUpdateReady"),((c=e.manifest)==null?void 0:c.version)??e.currentVersion)).ok&&fo(r)}catch{}}const go=3600*1e3;function yo(){const e=Xe(a=>a.platform),t=Xe(a=>a.autoCheckUpdate),r=Xe(a=>a.releaseChannel),n=lo(a=>a.pendingRestartVersion);return h.useEffect(()=>{if(e!=="desktop"||!t||n)return;async function a(){try{await po({notify:"if-new"})}catch{}}a();const i=window.setInterval(()=>{a()},go);return()=>{window.clearInterval(i)}},[t,n,e,r]),null}const hn="codingns.server.base-url.history",rr=6,mn="__custom__";function pn(){return typeof window<"u"&&typeof window.localStorage<"u"}function vn(){return typeof window>"u"||!window.location.origin?null:window.location.origin}function nr(e){if(!e)return null;try{return zr(e)}catch{return null}}function gn(){if(!pn())return[];const e=window.localStorage.getItem(hn);if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(r=>typeof r=="string"?nr(r):null).filter(r=>!!r):[]}catch{return[]}}function bo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n)||(t.add(n),r.push(n));return r}function wo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n.value)||(t.add(n.value),r.push(n));return r}function xo(e,t){const r=gn();return bo([e,...t,...r,nr(vn())]).slice(0,rr)}function Eo(e){const t=Ct(e),r=gn().map(c=>({value:c,source:"history"})),n=nr(vn()),a=e.hosts.map(c=>({value:c.baseUrl,source:"saved"})),i=zn(e).map(c=>({value:c.baseUrl,source:"discovered"})),o=t?{value:t.baseUrl,source:Br(t)?"discovered":"saved"}:null;return wo([o,...a,...i,...r,n?{value:n,source:"origin"}:null]).slice(0,rr)}function So(e){pn()&&window.localStorage.setItem(hn,JSON.stringify(e.slice(0,rr)))}class Ro{constructor(){Se(this,"state",this.createState(ye.getState()));Se(this,"listeners",new Set);Se(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Se(this,"getState",()=>this.state);ye.subscribe(()=>{const t=this.createState(ye.getState());t.baseUrl===this.state.baseUrl&&t.options.length===this.state.options.length&&t.options.every((r,n)=>r===this.state.options[n])&&t.presetOptions.length===this.state.presetOptions.length&&t.presetOptions.every((r,n)=>{const a=this.state.presetOptions[n];return(a==null?void 0:a.value)===r.value&&(a==null?void 0:a.source)===r.source})||(this.state=t,this.emit())})}setBaseUrl(t){const r=ye.getState(),n=Ct(r);if(!n)return!1;const a=zr(t),i=a!==n.baseUrl,o=To(a,n);if(Br(n))return ye.updateRuntime({discoveredHosts:r.discoveredHosts.map(l=>l.id===n.id?{...l,baseUrl:a,name:new URL(a).host,relayTunnel:o,updatedAt:new Date().toISOString()}:l)}),this.state=this.createState(ye.getState()),this.emit(),i;const c=r.hosts.map(l=>l.id===n.id?{...l,baseUrl:a,name:new URL(a).host,relayTunnel:o,updatedAt:new Date().toISOString()}:l);return this.state=this.createState({...r,hosts:c}),this.emit(),ye.update({hosts:c}),i}reset(){this.state=this.createState(ye.getState()),this.emit()}createState(t){const r=Ct(t),n=(r==null?void 0:r.baseUrl)??"",a=Eo(t),i=xo(n,a.map(o=>o.value));return So(i),{baseUrl:n,options:i,presetOptions:a}}emit(){for(const t of this.listeners)t()}}const Yt=new Ro;function Po(e){return h.useSyncExternalStore(Yt.subscribe,()=>e(Yt.getState()))}function Zo(e,t){return t.includes(e)?e:mn}function es(){return mn}function To(e,t){const r=Vn(e);if(!r)return null;const n=t==null?void 0:t.relayTunnel,a=(n==null?void 0:n.provider)==="codingns_relay"&&n.tunnelDomain===r.tunnelDomain&&n.controlBaseUrl===r.controlBaseUrl,i=((n==null?void 0:n.candidateEndpoints)??[]).filter(o=>o.kind!=="relay");return{provider:"codingns_relay",enabled:!0,tunnelDomain:r.tunnelDomain,controlBaseUrl:r.controlBaseUrl,bindingId:a?(n==null?void 0:n.bindingId)??null:null,hostFingerprint:a?(n==null?void 0:n.hostFingerprint)??null:null,candidateEndpoints:[{endpointId:`relay-entry:${r.relayBaseUrl}`,kind:"relay",url:r.relayBaseUrl,priority:0,expiresAt:null,source:"user_saved"},...i]}}const _o={login(e,t){return Rt.login(e,t)},bootstrap(e,t,r){return Rt.bootstrap(e,t,r)},refresh(){return Rt.refresh()},logout(){Rt.clear()}},Co=h.lazy(async()=>({default:(await Y(()=>import("./ServerSettingsModal-CFul__z1.js"),__vite__mapDeps([2,3,4,5,6]))).ServerSettingsModal})),Fr="width=device-width, initial-scale=1.0, viewport-fit=cover",Do="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover";function Lo(){const e=h.useRef(null);return h.useEffect(()=>{const t=e.current;if(!t)return;const r=t.getContext("2d");if(!r)return;let n;const a=()=>{o(),c()};let i=[];const o=()=>{t.width=window.innerWidth,t.height=window.innerHeight},c=()=>{i=[];const d=Math.min(50,Math.floor(t.width*t.height/25e3));for(let p=0;p<d;p++)i.push({x:Math.random()*t.width,y:Math.random()*t.height,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.5,size:Math.random()*2+1,opacity:Math.random()*.5+.2})},l=()=>{r.clearRect(0,0,t.width,t.height),i.forEach((d,p)=>{d.x+=d.vx,d.y+=d.vy,d.x<0&&(d.x=t.width),d.x>t.width&&(d.x=0),d.y<0&&(d.y=t.height),d.y>t.height&&(d.y=0),r.beginPath(),r.arc(d.x,d.y,d.size,0,Math.PI*2),r.fillStyle=`rgba(10, 132, 255, ${d.opacity})`,r.fill(),i.slice(p+1).forEach(v=>{const b=d.x-v.x,w=d.y-v.y,T=Math.sqrt(b*b+w*w);T<150&&(r.beginPath(),r.moveTo(d.x,d.y),r.lineTo(v.x,v.y),r.strokeStyle=`rgba(10, 132, 255, ${.1*(1-T/150)})`,r.stroke())})}),n=requestAnimationFrame(l)};return o(),c(),l(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),cancelAnimationFrame(n)}},[]),m.jsx("canvas",{ref:e,className:"particle-canvas"})}function jo({text:e}){return m.jsx("span",{className:"glitch-text","data-text":e,children:e})}function No({text:e}){const[t,r]=h.useState(""),[n,a]=h.useState(!0);return h.useEffect(()=>{let i=0,o=null;const c=setInterval(()=>{i<=e.length?(r(e.slice(0,i)),i++):(clearInterval(c),o=window.setTimeout(()=>a(!1),1e3))},50);return()=>{clearInterval(c),o!==null&&window.clearTimeout(o)}},[e]),m.jsxs("span",{className:"typewriter-text",children:[t,n&&m.jsx("span",{className:"typewriter-cursor",children:"_"})]})}function Mo(e){const t=e==null?void 0:e.captcha;if(typeof t!="object"||t===null)return null;const r=t.captchaId,n=t.imageDataUrl;return typeof r!="string"||typeof n!="string"?null:{captchaId:r,imageDataUrl:n}}function Io(){const e=tr(),t=Bn(),[r]=Ii(),n=pt(),a=oo(),i=Xe(V=>Hn(V)),o=Wn(n.platform),c=h.useMemo(()=>$n(n),[n]),l=h.useMemo(()=>c?Kn(i):{credentials:null,legacyServerBaseUrl:null},[i,c]),d=l.credentials,p=l.legacyServerBaseUrl,[v,b]=h.useState(()=>(d==null?void 0:d.username)??"admin"),[w,T]=h.useState(()=>(d==null?void 0:d.password)??""),[E,D]=h.useState(null),[k,L]=h.useState(""),[K,te]=h.useState(()=>!!d),$=Po(V=>V.baseUrl),[he,g]=h.useState($),[N,F]=h.useState(null),[I,re]=h.useState(!1),[J,oe]=h.useState(!1),[ae,se]=h.useState(null),[We,$e]=h.useState(!1),Q=Hr(V=>V.session),Te=h.useMemo(()=>r.get("returnTo")??"/",[r]),{theme:_e}=Qi(),be=h.useRef(!1),ce=n.isNativeMobile,Ce=h.useMemo(()=>_e==="light"?"light":"dark",[_e]);h.useEffect(()=>{b((d==null?void 0:d.username)??"admin"),T((d==null?void 0:d.password)??""),D(null),L(""),te(!!d)},[d]),h.useEffect(()=>{if(typeof document>"u")return;const V=document.querySelector('meta[name="viewport"]');if(!(V instanceof HTMLMetaElement))return;const de=V.getAttribute("content")??Fr;return ce?V.setAttribute("content",Do):V.setAttribute("content",Fr),()=>{V.setAttribute("content",de)}},[ce]),h.useEffect(()=>{be.current||(be.current=!0,!(!c||!p||p===$)&&(Yt.setBaseUrl(p),g(p)))},[$,c,p]),h.useEffect(()=>{if(Q){e(Te,{replace:!0});return}if(!he)return;let V=!1;const de=window.setTimeout(()=>{Y(async()=>{const{probeHost:H}=await import("./index-C-0oeG_5.js").then(ve=>ve.$);return{probeHost:H}},__vite__mapDeps([3,4])).then(({probeHost:H})=>H(he)).then(H=>{V||(H.demoMode&&($e(!0),Yn()&&F(t("auth.demoSessionExpired"))),H.reachable&&!H.initialized&&e("/bootstrap",{replace:!0}))}).catch(()=>{V||F(t("auth.authUnavailable"))})},0);return()=>{V=!0,window.clearTimeout(de)}},[Q,e,he,Te,t]);async function Ue(V){V.preventDefault(),re(!0),F(null),g($),c&&!K&&i&&Gn(i);try{const de=E?{username:v,password:w,captchaId:E.captchaId,captchaCode:k}:{username:v,password:w};await _o.login(de,$),D(null),L("");const{userPreferenceStore:H}=await Y(async()=>{const{userPreferenceStore:ve}=await import("./index-C-0oeG_5.js").then(gt=>gt.Z);return{userPreferenceStore:ve}},__vite__mapDeps([3,4]));await H.refreshForAuthenticatedUser(),c&&K&&i&&Jn({hostId:i,username:v,password:w}),e(Te,{replace:!0})}catch(de){if(de instanceof Xn){if(de.errorCode==="BOOTSTRAP_REQUIRED"){e("/bootstrap",{replace:!0});return}const H=Mo(de.data);H?(D(H),L("")):de.errorCode==="INVALID_CREDENTIALS"&&(D(null),L("")),F(de.message)}else F(t("auth.authUnavailable"))}finally{re(!1)}}function ue(V){b(V),E&&(D(null),L(""))}function we(V){g(V),F(null)}const pe="login-username",Oe="login-password",vt="login-captcha";return m.jsxs("main",{className:"cyber-login-page","data-theme":Ce,"data-native-mobile":ce?"true":"false",children:[m.jsxs("div",{className:"cyber-bg",children:[m.jsx("div",{className:"cyber-grid"}),m.jsx("div",{className:"cyber-glow cyber-glow-1"}),m.jsx("div",{className:"cyber-glow cyber-glow-2"}),m.jsx(Lo,{})]}),m.jsx("div",{className:"scanlines"}),m.jsxs("div",{className:"cyber-login-container",children:[m.jsx("div",{className:"cyber-login-toolbar",children:m.jsx(ta,{variant:"compact"})}),m.jsxs("div",{className:"cyber-login-content",children:[m.jsxs("div",{className:"cyber-brand",children:[m.jsx("div",{className:"cyber-logo",children:m.jsx("img",{src:"/logo.png",alt:"CodingNS",className:"cyber-logo-svg"})}),m.jsx("h1",{className:"cyber-brand-title",children:m.jsx(jo,{text:"CodingNS"})}),m.jsx("p",{className:"cyber-brand-subtitle",children:m.jsx(No,{text:t("auth.loginSubtitle")})})]}),m.jsxs("div",{className:"cyber-card",children:[m.jsx("div",{className:"cyber-corner corner-tl"}),m.jsx("div",{className:"cyber-corner corner-tr"}),m.jsx("div",{className:"cyber-corner corner-bl"}),m.jsx("div",{className:"cyber-corner corner-br"}),m.jsxs("div",{className:"cyber-card-header",children:[m.jsx("div",{className:"cyber-line"}),m.jsx("span",{className:"cyber-card-label",children:t("auth.loginTitle").toUpperCase()}),m.jsx("div",{className:"cyber-line"})]}),We?m.jsxs("div",{className:"cyber-demo-banner",children:[m.jsx("span",{className:"cyber-demo-icon",children:"⚠"}),m.jsx("span",{children:t("auth.demoBanner")})]}):null,m.jsxs("form",{className:"cyber-form",onSubmit:Ue,children:[m.jsxs("div",{className:`cyber-field ${ae==="username"?"focused":""}`,children:[m.jsx("div",{className:"cyber-field-border",children:m.jsx("div",{className:"cyber-field-border-glow"})}),m.jsxs("label",{className:"cyber-field-label",htmlFor:pe,children:[m.jsx("span",{className:"cyber-field-icon",children:"❯"}),t("auth.username")]}),m.jsx("input",{id:pe,"aria-label":t("auth.username"),className:"cyber-input",value:v,onChange:V=>ue(V.target.value),onFocus:()=>se("username"),onBlur:()=>se(null),autoComplete:"username"})]}),m.jsxs("div",{className:`cyber-field ${ae==="password"?"focused":""}`,children:[m.jsx("div",{className:"cyber-field-border",children:m.jsx("div",{className:"cyber-field-border-glow"})}),m.jsxs("label",{className:"cyber-field-label",htmlFor:Oe,children:[m.jsx("span",{className:"cyber-field-icon",children:"⚷"}),t("auth.password")]}),m.jsx("input",{id:Oe,"aria-label":t("auth.password"),className:"cyber-input",type:"password",value:w,onChange:V=>T(V.target.value),onFocus:()=>se("password"),onBlur:()=>se(null),autoComplete:"current-password"})]}),E?m.jsxs("div",{className:"cyber-captcha-panel",children:[m.jsx("img",{alt:t("auth.captchaImageAlt"),className:"cyber-captcha-image",draggable:!1,src:E.imageDataUrl}),m.jsx("p",{className:"cyber-captcha-hint",children:t("auth.captchaHint")}),m.jsxs("div",{className:`cyber-field ${ae==="captcha"?"focused":""}`,children:[m.jsx("div",{className:"cyber-field-border",children:m.jsx("div",{className:"cyber-field-border-glow"})}),m.jsxs("label",{className:"cyber-field-label",htmlFor:vt,children:[m.jsx("span",{className:"cyber-field-icon",children:"#"}),t("auth.captcha")]}),m.jsx("input",{id:vt,"aria-label":t("auth.captcha"),className:"cyber-input",placeholder:t("auth.captchaPlaceholder"),value:k,onChange:V=>L(V.target.value),onFocus:()=>se("captcha"),onBlur:()=>se(null),autoComplete:"one-time-code"})]})]}):null,c?m.jsxs("label",{className:"cyber-remember-toggle",children:[m.jsx("input",{"aria-label":t("auth.rememberPassword"),type:"checkbox",checked:K,onChange:V=>te(V.target.checked)}),m.jsx("span",{children:t("auth.rememberPassword")})]}):null,N?m.jsxs("div",{className:"cyber-status","data-tone":"error",children:[m.jsx("span",{className:"cyber-status-icon",children:"⚠"}),m.jsx("span",{children:N})]}):null,m.jsxs("button",{className:`cyber-submit ${I?"loading":""}`,type:"submit",disabled:I,children:[m.jsx("span",{className:"cyber-submit-glow"}),m.jsx("span",{className:"cyber-submit-border"}),m.jsx("span",{className:"cyber-submit-text",children:I?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"cyber-spinner"}),t("common.loading")]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"cyber-submit-icon",children:"➤"}),t("auth.submitLogin")]})})]})]}),o?m.jsxs("div",{className:"cyber-footer",children:[m.jsxs("div",{className:"cyber-divider",children:[m.jsx("span",{className:"cyber-divider-line"}),m.jsx("span",{className:"cyber-divider-text",children:"//"}),m.jsx("span",{className:"cyber-divider-line"})]}),m.jsxs("button",{className:"cyber-server-btn",onClick:()=>oe(!0),type:"button",children:[m.jsx("span",{className:"cyber-server-icon",children:"⚙"}),m.jsx("span",{className:"cyber-server-text",children:t("auth.serverSettings")}),m.jsx("span",{className:"cyber-server-current",children:$})]})]}):null]})]}),m.jsxs("div",{className:"cyber-version",children:[m.jsxs("span",{className:"cyber-version-text",children:["v",a]}),m.jsx("span",{className:"cyber-version-divider",children:"|"}),m.jsx("span",{className:"cyber-version-text",children:"SYSTEM READY"})]})]}),o&&J?m.jsx(h.Suspense,{fallback:null,children:m.jsx(Co,{isOpen:J,onClose:()=>oe(!1),onSave:we})}):null]})}function yn(){return m.jsx("main",{className:"page-center app-shell",children:m.jsxs("section",{className:"auth-card surface-card",children:[m.jsx("h1",{children:Re("auth.trustedEntryOnlyTitle")}),m.jsx("p",{className:"status-text",children:Re("auth.trustedEntryOnlyDescription")}),m.jsxs("div",{className:"field-group",children:[m.jsx("span",{children:Re("auth.trustedEntryOnlyHintTitle")}),m.jsx("span",{className:"auth-server-value",children:Re("auth.trustedEntryOnlyHint")})]})]})})}function Uo({isDesktop:e,viewportClass:t}){return e||t==="expanded"?"desktop":"mobile"}function Oo(){return!1}function bn(e,t,r=Oo()){var i,o;if(!r||t!=="web")return!1;const n=Ct(e),a=n==null?void 0:n.relayTunnel;return!(a!=null&&a.enabled&&((i=a.tunnelDomain)!=null&&i.trim())&&((o=a.controlBaseUrl)!=null&&o.trim()))}function Ao({runtimeKey:e,children:t}){return m.jsx("div",{children:t},e)}function ko(){const e=qn();return m.jsx(Ao,{runtimeKey:e,children:m.jsx(gi,{})})}function Fo(){const e=Xe(a=>a),t=pt(),r=Hr(a=>a.session),n=mt();if(bn(e,t.platform))return m.jsx(yn,{});if(!r){const a=`${n.pathname}${n.search}`;return m.jsx(sn,{to:`/login?returnTo=${encodeURIComponent(a)}`,replace:!0})}return m.jsx(ko,{})}function Vo(){const e=Xe(r=>r),t=pt();return bn(e,t.platform)?m.jsx(yn,{}):m.jsx(Io,{})}function Vr(){const e=pt(),t=Uo(e);return m.jsx(sn,{to:t==="mobile"?"/workspaces":"/landing",replace:!0})}function ne(e,t){return async()=>({Component:(await e())[t]})}const zo=[{path:"/bootstrap",lazy:ne(()=>Y(()=>import("./BootstrapPage-CE0m1qSR.js"),__vite__mapDeps([7,3,4])),"BootstrapPage")},{path:"/login",element:m.jsx(Vo,{})},{path:"/connect/:tunnelDomain",lazy:ne(()=>Y(()=>import("./RelayConnectEntryPage-CgMvVZwa.js"),__vite__mapDeps([8,3,4,5])),"RelayConnectEntryPage")},{path:"/desktop-window-preview",lazy:ne(()=>Y(()=>import("./DesktopDetachPreviewPage-Dxarr_Wf.js"),__vite__mapDeps([9,3,4])),"DesktopDetachPreviewPage")},{path:"/",element:m.jsx(Fo,{}),children:[{path:"desktop-window/:windowId",lazy:ne(()=>Y(()=>import("./DesktopWindowPage-VytPwJ4c.js"),__vite__mapDeps([10,3,4,11,12,13,0,1,6,5,14,15,16,17,18,19,20,21,22])),"DesktopWindowPage")},{lazy:ne(()=>Y(()=>import("./WorkbenchShellRoute-C0_h4lP6.js"),__vite__mapDeps([23,3,4,13,11,0,1,6,5,24])),"WorkbenchShellRoute"),children:[{index:!0,element:m.jsx(Vr,{})},{path:"landing",lazy:ne(()=>Y(()=>import("./WorkbenchLandingPage-CchkAC75.js"),__vite__mapDeps([25,3,4,13,11,0,1,6,5])),"WorkbenchLandingPage")},{path:"workspaces",lazy:ne(()=>Y(()=>import("./WorkspaceHomePage-Dsyvqyk1.js"),__vite__mapDeps([26,3,4,13,11,0,1,6,5,27,20,21,28])),"WorkspaceHomePage")},{path:"workspaces/:workspaceId",lazy:ne(()=>Y(()=>import("./WorkspaceDetailPage-Cvf-ZdlB.js"),__vite__mapDeps([29,3,4,13,11,0,1,6,5,30,17,20,21,28])),"WorkspaceDetailPage")},{path:"workspaces/:workspaceId/debug",lazy:ne(()=>Y(()=>import("./WorkspaceDebugDetailPage-Deqy2_pO.js"),__vite__mapDeps([31,3,4,30,11,17,13,0,1,6,5])),"WorkspaceDebugDetailPage")},{path:"workspaces/:workspaceId/sessions",lazy:ne(()=>Y(()=>import("./SessionIndexPage-B-tRhBXC.js"),__vite__mapDeps([32,3,4,11,13,0,1,6,5,20,21,28,33,34])),"SessionIndexPage")},{path:"workspaces/:workspaceId/sessions/:sessionId",lazy:ne(()=>Y(()=>import("./ConversationPage-8wOY7SX-.js"),__vite__mapDeps([35,3,4,6,11,13,0,1,5,36,14,12,15,16,17,18,19,20,21,22,33,34])),"ConversationPage")},{path:"workspaces/:workspaceId/tools",lazy:ne(()=>Y(()=>import("./ToolsHomePage-CX05Pe_4.js"),__vite__mapDeps([37,3,4,13,11,0,1,6,5])),"ToolsHomePage")},{path:"workspaces/:workspaceId/tools/files",lazy:ne(()=>Y(()=>import("./ToolFilesPage-Dx9cv9hu.js"),__vite__mapDeps([38,3,4,13,11,0,1,6,5])),"ToolFilesPage")},{path:"workspaces/:workspaceId/tools/git",lazy:ne(()=>Y(()=>import("./ToolGitPage-D7H3vAia.js"),__vite__mapDeps([39,3,4,13,11,0,1,6,5])),"ToolGitPage")},{path:"workspaces/:workspaceId/tools/processes",lazy:ne(()=>Y(()=>import("./ToolProcessesPage-PqQWxsy-.js"),__vite__mapDeps([40,3,4,13,11,0,1,6,5])),"ToolProcessesPage")},{path:"workspaces/:workspaceId/terminals",lazy:ne(()=>Y(()=>import("./TerminalPage-DWHv6mlu.js"),__vite__mapDeps([19,3,4,11,13,0,1,6,5,20,21,17,18,22])),"TerminalPage")},{path:"workspaces/:workspaceId/butler",lazy:ne(()=>Y(()=>import("./AdaptiveButlerPage-Dw72U3hG.js"),__vite__mapDeps([41,3,4,13,11,0,1,6,5,36,14,12,27,20,21,42])),"AdaptiveButlerPage")},{path:"settings",lazy:ne(()=>Y(()=>import("./SettingsPage-C9LGxSQZ.js"),__vite__mapDeps([43,3,4,11,6,21])),"SettingsPage")},{path:"settings/:section",lazy:ne(()=>Y(()=>import("./SettingsPage-C9LGxSQZ.js"),__vite__mapDeps([43,3,4,11,6,21])),"SettingsPage")},{path:"*",element:m.jsx(Vr,{})}]}]}];function Bo(){return Ei(zo)}function Ho(){const e=qe(r=>r.profile.language),t=h.useMemo(()=>Bo(),[]);return m.jsx(Yi,{children:m.jsx(io,{children:m.jsx(Qn,{language:e,children:m.jsx(eo,{children:m.jsxs(ao,{children:[m.jsx(yo,{}),m.jsx(ji,{router:t})]})})})})})}const ts=Object.freeze(Object.defineProperty({__proto__:null,App:Ho},Symbol.toStringTag,{value:"Module"}));export{ts as A,ta as L,sn as N,gi as O,Yo as T,Po as a,_o as b,Ko as c,Ii as d,pt as e,Jo as f,Wr as g,mt as h,lo as i,Qi as j,po as k,Xo as l,yr as m,qo as n,Qo as o,oo as p,Go as q,Uo as r,Zo as s,es as t,tr as u,Yt as v};
|
|
30
|
+
*/function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nt.apply(this,arguments)}function Kt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function wi(e,t){let r=Kt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const xi="6";try{window.__reactRouterVersion=xi}catch{}function Ei(e,t){return Ua({basename:void 0,future:Nt({},void 0,{v7_prependBasename:!0}),history:aa({window:void 0}),hydrationData:Si(),routes:e,mapRouteProperties:bi,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Si(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Nt({},t,{errors:Ri(t.errors)})),t}function Ri(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new Lt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let o=new i(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let i=new Error(a.message);i.stack="",r[n]=i}}else r[n]=a;return r}const Pi=h.createContext({isTransitioning:!1}),Ti=h.createContext(new Map),_i="startTransition",Ur=kn[_i],Ci="flushSync",Or=na[Ci];function Di(e){Ur?Ur(e):e()}function it(e){Or?Or(e):e()}class Li{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function ji(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=h.useState(r.state),[o,c]=h.useState(),[l,d]=h.useState({isTransitioning:!1}),[p,v]=h.useState(),[b,w]=h.useState(),[T,E]=h.useState(),D=h.useRef(new Map),{v7_startTransition:k}=n||{},L=h.useCallback(N=>{k?Di(N):N()},[k]),K=h.useCallback((N,F)=>{let{deletedFetchers:I,flushSync:re,viewTransitionOpts:J}=F;N.fetchers.forEach((ae,se)=>{ae.data!==void 0&&D.current.set(se,ae.data)}),I.forEach(ae=>D.current.delete(ae));let oe=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!J||oe){re?it(()=>i(N)):L(()=>i(N));return}if(re){it(()=>{b&&(p&&p.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:J.currentLocation,nextLocation:J.nextLocation})});let ae=r.window.document.startViewTransition(()=>{it(()=>i(N))});ae.finished.finally(()=>{it(()=>{v(void 0),w(void 0),c(void 0),d({isTransitioning:!1})})}),it(()=>w(ae));return}b?(p&&p.resolve(),b.skipTransition(),E({state:N,currentLocation:J.currentLocation,nextLocation:J.nextLocation})):(c(N),d({isTransitioning:!0,flushSync:!1,currentLocation:J.currentLocation,nextLocation:J.nextLocation}))},[r.window,b,p,D,L]);h.useLayoutEffect(()=>r.subscribe(K),[r,K]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&v(new Li)},[l]),h.useEffect(()=>{if(p&&o&&r.window){let N=o,F=p.promise,I=r.window.document.startViewTransition(async()=>{L(()=>i(N)),await F});I.finished.finally(()=>{v(void 0),w(void 0),c(void 0),d({isTransitioning:!1})}),w(I)}},[L,o,p,r.window]),h.useEffect(()=>{p&&o&&a.location.key===o.location.key&&p.resolve()},[p,b,a.location,o]),h.useEffect(()=>{!l.isTransitioning&&T&&(c(T.state),d({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),E(void 0))},[l.isTransitioning,T]),h.useEffect(()=>{},[]);let te=h.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:N=>r.navigate(N),push:(N,F,I)=>r.navigate(N,{state:F,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(N,F,I)=>r.navigate(N,{replace:!0,state:F,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[r]),$=r.basename||"/",he=h.useMemo(()=>({router:r,navigator:te,static:!1,basename:$}),[r,te,$]),g=h.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return h.useEffect(()=>vi(n,r.future),[n,r.future]),h.createElement(h.Fragment,null,h.createElement(Mt.Provider,{value:he},h.createElement(en.Provider,{value:a},h.createElement(Ti.Provider,{value:D.current},h.createElement(Pi.Provider,{value:l},h.createElement(yi,{basename:$,location:a.location,navigationType:a.historyAction,navigator:te,future:g},a.initialized||r.future.v7_partialHydration?h.createElement(Ni,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Ni=h.memo(Mi);function Mi(e){let{routes:t,future:r,state:n}=e;return ai(t,void 0,n,r)}var Ar;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ar||(Ar={}));var kr;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kr||(kr={}));function Ii(e){let t=h.useRef(Kt(e)),r=h.useRef(!1),n=mt(),a=h.useMemo(()=>wi(n.search,r.current?null:t.current),[n.search]),i=rr(),o=h.useCallback((c,l)=>{const d=Kt(typeof c=="function"?c(a):c);r.current=!0,i("?"+d,l)},[i,a]);return[a,o]}const Ui="desktop://window-lifecycle",Oi=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function Ai(e){return e instanceof HTMLInputElement?!Oi.has(e.type.toLowerCase()):!1}function ki(e){const t=e.activeElement;if(Ai(t)||t instanceof HTMLTextAreaElement){const r=t.selectionStart??0,n=t.selectionEnd??r;return n<=r?null:t.value.slice(r,n)}return null}function Fi(e){const t=ki(e);if(t!==null)return t;const r=e.getSelection();if(!r||r.isCollapsed)return null;const n=r.toString();return n.length>0?n:null}function Vi(e,t){var a;const r=(a=e.execCommand)==null?void 0:a.bind(e);if(typeof r!="function")return!1;const n=e.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.top="-9999px",n.style.opacity="0",e.body.append(n),n.select();try{return r("copy")}catch{return!1}finally{n.remove()}}async function zi(e,t,r){var a,i;try{if(await r(t))return}catch{}const n=(a=e.defaultView)==null?void 0:a.navigator;if((i=n==null?void 0:n.clipboard)!=null&&i.writeText)try{await n.clipboard.writeText(t);return}catch{}Vi(e,t)}function Bi(e){const{window:t,document:r,writeClipboardText:n}=e;function a(i){if(i.defaultPrevented||!i.metaKey||i.ctrlKey||i.altKey||i.key.toLowerCase()!=="c")return;const o=Fi(r);o&&(i.preventDefault(),zi(r,o,n))}return t.addEventListener("keydown",a,!0),()=>{t.removeEventListener("keydown",a,!0)}}const ln=h.createContext(null),Hi=["--desktop-macos-traffic-light-center-y","--desktop-macos-traffic-light-leading-inset","--desktop-macos-traffic-light-safe-zone-width","--desktop-macos-titlebar-height","--desktop-macos-traffic-light-button-diameter"];function Wi(e){if(typeof document>"u")return;const{documentElement:t,body:r}=document;t.dataset.runtimePlatform=e.platform,t.dataset.osFamily=e.ui.osFamily,t.dataset.windowControls=e.ui.windowControlsStyle,t.dataset.viewportClass=e.viewportClass,t.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar),r&&(r.dataset.runtimePlatform=e.platform,r.dataset.osFamily=e.ui.osFamily,r.dataset.windowControls=e.ui.windowControlsStyle,r.dataset.viewportClass=e.viewportClass,r.dataset.overlayTitlebar=String(e.ui.prefersOverlayTitlebar))}function Yt(){var e;if(!(typeof document>"u"))for(const t of Hi)document.documentElement.style.removeProperty(t),(e=document.body)==null||e.style.removeProperty(t)}function $i(e){if(typeof document>"u")return;if(!e){Yt();return}const t=[document.documentElement,document.body].filter(n=>!!n),r=[["--desktop-macos-traffic-light-center-y",`${e.trafficLightCenterY}px`],["--desktop-macos-traffic-light-leading-inset",`${e.trafficLightLeadingInset}px`],["--desktop-macos-traffic-light-safe-zone-width",`${e.trafficLightSafeZoneWidth}px`],["--desktop-macos-titlebar-height",`${e.titlebarHeight}px`],["--desktop-macos-traffic-light-button-diameter",`${e.trafficLightButtonDiameter}px`]];for(const n of t)for(const[a,i]of r)n.style.setProperty(a,i)}function Ki(){if(!(typeof window>"u"))return window.innerWidth}function Yi({children:e}){const[t,r]=h.useState(()=>Ki()),n=h.useMemo(()=>ct({viewportWidth:t}),[t]);return h.useEffect(()=>{if(typeof window>"u")return;function a(){r(window.innerWidth)}return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[]),h.useEffect(()=>{Wi(n)},[n]),h.useEffect(()=>{if(!(typeof window>"u"||typeof document>"u")&&!(!n.isDesktop||n.ui.osFamily!=="macos"||!n.bridge.supported))return Bi({window,document,writeClipboardText:async a=>(await n.bridge.writeClipboardText(a)).ok})},[n]),h.useEffect(()=>()=>{Yt()},[]),h.useEffect(()=>{let a=!1,i=null;return!n.isDesktop||!n.bridge.supported?()=>{a=!0}:(Y(()=>import("./event-DvH9tcej.js").then(o=>o.c),[]).then(async({listen:o})=>{const c=await o(Ui,l=>{const d=l.payload,p=d==null?void 0:d.descriptor;p!=null&&p.windowId&&(n.windows.registerDescriptor(p),d.isOpen?n.windows.markWindowOpen(p.windowId):n.windows.markWindowClosed(p.windowId))});if(a){c();return}i=c}).catch(()=>{}),()=>{a=!0,i==null||i()})},[n]),h.useEffect(()=>{let a=!1,i=null;async function o(){var l,d;const c=await n.bridge.getRuntimeInfo();a||$i(c.ok?(d=(l=c.value)==null?void 0:l.windowChrome)==null?void 0:d.macosTitlebar:null)}return!n.isDesktop||n.ui.osFamily!=="macos"||!n.ui.prefersOverlayTitlebar?(Yt(),()=>{a=!0}):(o(),Y(()=>import("./window-BVUB8gMK.js").then(c=>c.w),__vite__mapDeps([0,1])).then(async({getCurrentWindow:c})=>{const l=await c().onScaleChanged(()=>{o()});if(a){l();return}i=l}).catch(()=>{}),()=>{a=!0,i==null||i()})},[n]),m.jsx(ln.Provider,{value:n,children:e})}function pt(){return h.useContext(ln)??ct()}const Yo=[{id:"light",labelKey:"theme.light",color:"#f6f4ef"},{id:"dark",labelKey:"theme.dark",color:"#1b1b1b"},{id:"sky-blue",labelKey:"theme.skyBlue",color:"#00f0ff"},{id:"eye-green",labelKey:"theme.eyeGreen",color:"#16a34a"}];function Go(e){return be(e.labelKey)}function Gi(){return typeof window>"u"||typeof window.matchMedia!="function"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function cn(e,t){return t?Gi():e}function Ji(){const{theme:e,autoTheme:t}=Fn.getState().profile;return cn(e,t)}function Xi(e){Jt({theme:e,autoTheme:!1}).catch(()=>{})}function qi(e){Jt({autoTheme:e}).catch(()=>{})}function un(e){typeof window>"u"||document.documentElement.setAttribute("data-theme",e)}function Qi(){const e=qe(n=>n.profile.theme),t=qe(n=>n.profile.autoTheme);return{theme:cn(e,t),selectedTheme:e,autoTheme:t,setTheme:Xi,setAutoTheme:qi}}function Zi(){un(Ji())}function eo({children:e}){const t=qe(n=>n.profile.theme),r=qe(n=>n.profile.autoTheme);return h.useEffect(()=>{Zi()},[t,r]),h.useEffect(()=>{if(!r||typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{un(n.matches?"dark":"light")};return a(),typeof n.addEventListener=="function"?(n.addEventListener("change",a),()=>n.removeEventListener("change",a)):(n.addListener(a),()=>n.removeListener(a))},[r]),m.jsx(m.Fragment,{children:e})}const to={showToast:()=>"",dismissToast:()=>{}},dn=h.createContext(to);function ro(){return`toast-${Math.random().toString(36).slice(2,10)}`}function no({toast:e,onDismiss:t}){const{id:r,title:n,description:a,tone:i,durationMs:o,action:c}=e;return h.useEffect(()=>{if(o===null)return;const l=window.setTimeout(()=>{t(r)},o);return()=>{window.clearTimeout(l)}},[o,r,t,n,a,i]),m.jsxs("article",{className:"toast-card","data-tone":i,role:i==="error"?"alert":"status",children:[m.jsxs("div",{className:"toast-body",children:[m.jsx("strong",{className:"toast-title",children:n}),a?m.jsx("p",{className:"toast-description",children:a}):null]}),m.jsxs("div",{className:"toast-actions",children:[c?m.jsx("button",{className:"toast-action",type:"button",onClick:()=>{c.onClick(),t(r)},children:c.label}):null,m.jsx("button",{className:"toast-dismiss",type:"button","aria-label":"关闭通知",onClick:()=>t(r),children:"×"})]})]})}function ao({children:e}){const[t,r]=h.useState([]),n=h.useCallback(o=>{r(c=>c.filter(l=>l.id!==o))},[]),a=h.useCallback(o=>{const c=o.id??ro(),l={id:c,title:o.title,description:o.description,tone:o.tone??"info",durationMs:o.durationMs===void 0?4200:o.durationMs,action:o.action};return r(d=>{const p=d.findIndex(b=>b.id===c);if(p===-1)return[...d,l];const v=[...d];return v[p]=l,v}),c},[]),i=h.useMemo(()=>({showToast:a,dismissToast:n}),[n,a]);return m.jsxs(dn.Provider,{value:i,children:[e,m.jsx("div",{className:"toast-viewport","aria-live":"polite","aria-atomic":"false",children:t.map(o=>m.jsx(no,{toast:o,onDismiss:n},o.id))})]})}function Jo(){return h.useContext(dn)}const _t="0.7.0",fn=h.createContext(_t);function io({children:e}){const t=pt(),[r,n]=h.useState(_t);return h.useEffect(()=>{let a=!1;return t.isDesktop?(t.bridge.getRuntimeInfo().then(i=>{var c,l;if(a)return;const o=i.ok?(l=(c=i.value)==null?void 0:c.version)==null?void 0:l.trim():"";n(o||_t)}),()=>{a=!0}):(n(_t),()=>{a=!0})},[t]),m.jsx(fn.Provider,{value:r,children:e})}function oo(){return h.useContext(fn)}const Fr={latestState:null,lastNotifiedVersion:null,pendingRestartVersion:null};class so{constructor(){Re(this,"state",Fr);Re(this,"listeners",new Set);Re(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Re(this,"getState",()=>this.state)}recordState(t){const r=zt(this.state.pendingRestartVersion),n=zt(t.currentVersion);this.state={latestState:t,lastNotifiedVersion:t.hasUpdate?this.state.lastNotifiedVersion:null,pendingRestartVersion:r&&r===n?null:this.state.pendingRestartVersion},this.emit()}markVersionNotified(t){this.state.lastNotifiedVersion!==t&&(this.state={...this.state,lastNotifiedVersion:t},this.emit())}markRestartPending(t){const r=zt(t);!r||this.state.pendingRestartVersion===r||(this.state={...this.state,pendingRestartVersion:r},this.emit())}reset(){this.state=Fr,this.emit()}emit(){for(const t of this.listeners)t()}}const Qe=new so;function zt(e){const t=e==null?void 0:e.trim();return t||null}function lo(e){return h.useSyncExternalStore(Qe.subscribe,()=>e(Qe.getState()))}function co(){return Qe.getState()}function uo(e){Qe.recordState(e)}function fo(e){Qe.markVersionNotified(e)}function ho(e){Qe.markRestartPending(e)}async function mo(){const e=ct(),t=ye.getState(),r=await e.bridge.checkForUpdate(t.releaseChannel);if(!r.ok||!r.value)throw new Error(r.detail??"更新检查失败。");return r.value}async function po(e={}){const t=e.notify??"never",r=await mo();return uo(r),await vo(r,t),r}async function Xo(){const e=ct(),t=ye.getState();return e.bridge.installUpdate(t.releaseChannel)}function qo(e){ho(e)}async function Qo(){var e;if(typeof window>"u"||typeof((e=window.__TAURI_INTERNALS__)==null?void 0:e.invoke)!="function")throw new Error("当前运行环境不支持桌面应用重启。");try{await window.__TAURI_INTERNALS__.invoke("restart_application")}catch(t){throw new Error(t instanceof Error?t.message:"重启应用失败。")}}async function vo(e,t){var i,o,c;if(!e.hasUpdate||t==="never")return;const r=((o=(i=e.manifest)==null?void 0:i.version)==null?void 0:o.trim())||e.currentVersion.trim();if(!r)return;const n=co().lastNotifiedVersion;if(t==="always"||n!==r)try{(await ct().bridge.showNotification(be("settings.releaseUpdateReady"),((c=e.manifest)==null?void 0:c.version)??e.currentVersion)).ok&&fo(r)}catch{}}const go=3600*1e3;function yo(){const e=Xe(a=>a.platform),t=Xe(a=>a.autoCheckUpdate),r=Xe(a=>a.releaseChannel),n=lo(a=>a.pendingRestartVersion);return h.useEffect(()=>{if(e!=="desktop"||!t||n)return;async function a(){try{await po({notify:"if-new"})}catch{}}a();const i=window.setInterval(()=>{a()},go);return()=>{window.clearInterval(i)}},[t,n,e,r]),null}const hn="codingns.server.base-url.history",nr=6,mn="__custom__";function pn(){return typeof window<"u"&&typeof window.localStorage<"u"}function vn(){return typeof window>"u"||!window.location.origin?null:window.location.origin}function ar(e){if(!e)return null;try{return Br(e)}catch{return null}}function gn(){if(!pn())return[];const e=window.localStorage.getItem(hn);if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.map(r=>typeof r=="string"?ar(r):null).filter(r=>!!r):[]}catch{return[]}}function bo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n)||(t.add(n),r.push(n));return r}function wo(e){const t=new Set,r=[];for(const n of e)!n||t.has(n.value)||(t.add(n.value),r.push(n));return r}function xo(e,t){const r=gn();return bo([e,...t,...r,ar(vn())]).slice(0,nr)}function Eo(e){const t=Ct(e),r=gn().map(c=>({value:c,source:"history"})),n=ar(vn()),a=e.hosts.map(c=>({value:c.baseUrl,source:"saved"})),i=zn(e).map(c=>({value:c.baseUrl,source:"discovered"})),o=t?{value:t.baseUrl,source:Hr(t)?"discovered":"saved"}:null;return wo([o,...a,...i,...r,n?{value:n,source:"origin"}:null]).slice(0,nr)}function So(e){pn()&&window.localStorage.setItem(hn,JSON.stringify(e.slice(0,nr)))}class Ro{constructor(){Re(this,"state",this.createState(ye.getState()));Re(this,"listeners",new Set);Re(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Re(this,"getState",()=>this.state);ye.subscribe(()=>{const t=this.createState(ye.getState());t.baseUrl===this.state.baseUrl&&t.options.length===this.state.options.length&&t.options.every((r,n)=>r===this.state.options[n])&&t.presetOptions.length===this.state.presetOptions.length&&t.presetOptions.every((r,n)=>{const a=this.state.presetOptions[n];return(a==null?void 0:a.value)===r.value&&(a==null?void 0:a.source)===r.source})||(this.state=t,this.emit())})}setBaseUrl(t){const r=ye.getState(),n=Ct(r);if(!n)return!1;const a=Br(t),i=a!==n.baseUrl,o=To(a,n);if(Hr(n))return ye.updateRuntime({discoveredHosts:r.discoveredHosts.map(l=>l.id===n.id?{...l,baseUrl:a,name:new URL(a).host,relayTunnel:o,updatedAt:new Date().toISOString()}:l)}),this.state=this.createState(ye.getState()),this.emit(),i;const c=r.hosts.map(l=>l.id===n.id?{...l,baseUrl:a,name:new URL(a).host,relayTunnel:o,updatedAt:new Date().toISOString()}:l);return this.state=this.createState({...r,hosts:c}),this.emit(),ye.update({hosts:c}),i}reset(){this.state=this.createState(ye.getState()),this.emit()}createState(t){const r=Ct(t),n=(r==null?void 0:r.baseUrl)??"",a=Eo(t),i=xo(n,a.map(o=>o.value));return So(i),{baseUrl:n,options:i,presetOptions:a}}emit(){for(const t of this.listeners)t()}}const Gt=new Ro;function Po(e){return h.useSyncExternalStore(Gt.subscribe,()=>e(Gt.getState()))}function Zo(e,t){return t.includes(e)?e:mn}function es(){return mn}function To(e,t){const r=Vn(e);if(!r)return null;const n=t==null?void 0:t.relayTunnel,a=(n==null?void 0:n.provider)==="codingns_relay"&&n.tunnelDomain===r.tunnelDomain&&n.controlBaseUrl===r.controlBaseUrl,i=((n==null?void 0:n.candidateEndpoints)??[]).filter(o=>o.kind!=="relay");return{provider:"codingns_relay",enabled:!0,tunnelDomain:r.tunnelDomain,controlBaseUrl:r.controlBaseUrl,bindingId:a?(n==null?void 0:n.bindingId)??null:null,hostFingerprint:a?(n==null?void 0:n.hostFingerprint)??null:null,candidateEndpoints:[{endpointId:`relay-entry:${r.relayBaseUrl}`,kind:"relay",url:r.relayBaseUrl,priority:0,expiresAt:null,source:"user_saved"},...i]}}const _o={login(e,t){return Rt.login(e,t)},bootstrap(e,t,r){return Rt.bootstrap(e,t,r)},refresh(){return Rt.refresh()},logout(){Rt.clear()}},Co=h.lazy(async()=>({default:(await Y(()=>import("./ServerSettingsModal-BdTxbRbU.js"),__vite__mapDeps([2,3,4,5,6]))).ServerSettingsModal})),Vr="width=device-width, initial-scale=1.0, viewport-fit=cover",Do="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover";function Lo(){const e=h.useRef(null);return h.useEffect(()=>{const t=e.current;if(!t)return;const r=t.getContext("2d");if(!r)return;let n;const a=()=>{o(),c()};let i=[];const o=()=>{t.width=window.innerWidth,t.height=window.innerHeight},c=()=>{i=[];const d=Math.min(50,Math.floor(t.width*t.height/25e3));for(let p=0;p<d;p++)i.push({x:Math.random()*t.width,y:Math.random()*t.height,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.5,size:Math.random()*2+1,opacity:Math.random()*.5+.2})},l=()=>{r.clearRect(0,0,t.width,t.height),i.forEach((d,p)=>{d.x+=d.vx,d.y+=d.vy,d.x<0&&(d.x=t.width),d.x>t.width&&(d.x=0),d.y<0&&(d.y=t.height),d.y>t.height&&(d.y=0),r.beginPath(),r.arc(d.x,d.y,d.size,0,Math.PI*2),r.fillStyle=`rgba(10, 132, 255, ${d.opacity})`,r.fill(),i.slice(p+1).forEach(v=>{const b=d.x-v.x,w=d.y-v.y,T=Math.sqrt(b*b+w*w);T<150&&(r.beginPath(),r.moveTo(d.x,d.y),r.lineTo(v.x,v.y),r.strokeStyle=`rgba(10, 132, 255, ${.1*(1-T/150)})`,r.stroke())})}),n=requestAnimationFrame(l)};return o(),c(),l(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),cancelAnimationFrame(n)}},[]),m.jsx("canvas",{ref:e,className:"particle-canvas"})}function jo({text:e}){return m.jsx("span",{className:"glitch-text","data-text":e,children:e})}function No({text:e}){const[t,r]=h.useState(""),[n,a]=h.useState(!0);return h.useEffect(()=>{let i=0,o=null;const c=setInterval(()=>{i<=e.length?(r(e.slice(0,i)),i++):(clearInterval(c),o=window.setTimeout(()=>a(!1),1e3))},50);return()=>{clearInterval(c),o!==null&&window.clearTimeout(o)}},[e]),m.jsxs("span",{className:"typewriter-text",children:[t,n&&m.jsx("span",{className:"typewriter-cursor",children:"_"})]})}function Mo(e){const t=e==null?void 0:e.captcha;if(typeof t!="object"||t===null)return null;const r=t.captchaId,n=t.imageDataUrl;return typeof r!="string"||typeof n!="string"?null:{captchaId:r,imageDataUrl:n}}function Io(){const e=rr(),t=Bn(),[r]=Ii(),n=pt(),a=oo(),i=Xe(V=>Hn(V)),o=Wn(n.platform),c=h.useMemo(()=>$n(n),[n]),l=h.useMemo(()=>c?Kn(i):{credentials:null,legacyServerBaseUrl:null},[i,c]),d=l.credentials,p=l.legacyServerBaseUrl,[v,b]=h.useState(()=>(d==null?void 0:d.username)??"admin"),[w,T]=h.useState(()=>(d==null?void 0:d.password)??""),[E,D]=h.useState(null),[k,L]=h.useState(""),[K,te]=h.useState(()=>!!d),$=Po(V=>V.baseUrl),[he,g]=h.useState($),[N,F]=h.useState(null),[I,re]=h.useState(!1),[J,oe]=h.useState(!1),[ae,se]=h.useState(null),[We,$e]=h.useState(!1),Q=Bt(V=>V.session),Te=h.useMemo(()=>r.get("returnTo")??"/",[r]),{theme:_e}=Qi(),we=h.useRef(!1),ce=n.isNativeMobile,Ce=h.useMemo(()=>_e==="light"?"light":"dark",[_e]);h.useEffect(()=>{b((d==null?void 0:d.username)??"admin"),T((d==null?void 0:d.password)??""),D(null),L(""),te(!!d)},[d]),h.useEffect(()=>{if(typeof document>"u")return;const V=document.querySelector('meta[name="viewport"]');if(!(V instanceof HTMLMetaElement))return;const de=V.getAttribute("content")??Vr;return ce?V.setAttribute("content",Do):V.setAttribute("content",Vr),()=>{V.setAttribute("content",de)}},[ce]),h.useEffect(()=>{we.current||(we.current=!0,!(!c||!p||p===$)&&(Gt.setBaseUrl(p),g(p)))},[$,c,p]),h.useEffect(()=>{if(Q){e(Te,{replace:!0});return}if(!he)return;let V=!1;const de=window.setTimeout(()=>{Y(async()=>{const{probeHost:H}=await import("./index-oGylLBIX.js").then(ve=>ve.$);return{probeHost:H}},__vite__mapDeps([3,4])).then(({probeHost:H})=>H(he)).then(H=>{V||(H.demoMode&&($e(!0),Yn()&&F(t("auth.demoSessionExpired"))),H.reachable&&!H.initialized&&e("/bootstrap",{replace:!0}))}).catch(()=>{V||F(t("auth.authUnavailable"))})},0);return()=>{V=!0,window.clearTimeout(de)}},[Q,e,he,Te,t]);async function Ue(V){V.preventDefault(),re(!0),F(null),g($),c&&!K&&i&&Gn(i);try{const de=E?{username:v,password:w,captchaId:E.captchaId,captchaCode:k}:{username:v,password:w};await _o.login(de,$),D(null),L("");const{userPreferenceStore:H}=await Y(async()=>{const{userPreferenceStore:ve}=await import("./index-oGylLBIX.js").then(gt=>gt.Z);return{userPreferenceStore:ve}},__vite__mapDeps([3,4]));await H.refreshForAuthenticatedUser(),c&&K&&i&&Jn({hostId:i,username:v,password:w}),e(Te,{replace:!0})}catch(de){if(de instanceof Xn){if(de.errorCode==="BOOTSTRAP_REQUIRED"){e("/bootstrap",{replace:!0});return}const H=Mo(de.data);H?(D(H),L("")):de.errorCode==="INVALID_CREDENTIALS"&&(D(null),L("")),F(de.message)}else F(t("auth.authUnavailable"))}finally{re(!1)}}function ue(V){b(V),E&&(D(null),L(""))}function xe(V){g(V),F(null)}const pe="login-username",Oe="login-password",vt="login-captcha";return m.jsxs("main",{className:"cyber-login-page","data-theme":Ce,"data-native-mobile":ce?"true":"false",children:[m.jsxs("div",{className:"cyber-bg",children:[m.jsx("div",{className:"cyber-grid"}),m.jsx("div",{className:"cyber-glow cyber-glow-1"}),m.jsx("div",{className:"cyber-glow cyber-glow-2"}),m.jsx(Lo,{})]}),m.jsx("div",{className:"scanlines"}),m.jsxs("div",{className:"cyber-login-container",children:[m.jsx("div",{className:"cyber-login-toolbar",children:m.jsx(ta,{variant:"compact"})}),m.jsxs("div",{className:"cyber-login-content",children:[m.jsxs("div",{className:"cyber-brand",children:[m.jsx("div",{className:"cyber-logo",children:m.jsx("img",{src:"/logo.png",alt:"CodingNS",className:"cyber-logo-svg"})}),m.jsx("h1",{className:"cyber-brand-title",children:m.jsx(jo,{text:"CodingNS"})}),m.jsx("p",{className:"cyber-brand-subtitle",children:m.jsx(No,{text:t("auth.loginSubtitle")})})]}),m.jsxs("div",{className:"cyber-card",children:[m.jsx("div",{className:"cyber-corner corner-tl"}),m.jsx("div",{className:"cyber-corner corner-tr"}),m.jsx("div",{className:"cyber-corner corner-bl"}),m.jsx("div",{className:"cyber-corner corner-br"}),m.jsxs("div",{className:"cyber-card-header",children:[m.jsx("div",{className:"cyber-line"}),m.jsx("span",{className:"cyber-card-label",children:t("auth.loginTitle").toUpperCase()}),m.jsx("div",{className:"cyber-line"})]}),We?m.jsxs("div",{className:"cyber-demo-banner",children:[m.jsx("span",{className:"cyber-demo-icon",children:"⚠"}),m.jsx("span",{children:t("auth.demoBanner")})]}):null,m.jsxs("form",{className:"cyber-form",onSubmit:Ue,children:[m.jsxs("div",{className:`cyber-field ${ae==="username"?"focused":""}`,children:[m.jsx("div",{className:"cyber-field-border",children:m.jsx("div",{className:"cyber-field-border-glow"})}),m.jsxs("label",{className:"cyber-field-label",htmlFor:pe,children:[m.jsx("span",{className:"cyber-field-icon",children:"❯"}),t("auth.username")]}),m.jsx("input",{id:pe,"aria-label":t("auth.username"),className:"cyber-input",value:v,onChange:V=>ue(V.target.value),onFocus:()=>se("username"),onBlur:()=>se(null),autoComplete:"username"})]}),m.jsxs("div",{className:`cyber-field ${ae==="password"?"focused":""}`,children:[m.jsx("div",{className:"cyber-field-border",children:m.jsx("div",{className:"cyber-field-border-glow"})}),m.jsxs("label",{className:"cyber-field-label",htmlFor:Oe,children:[m.jsx("span",{className:"cyber-field-icon",children:"⚷"}),t("auth.password")]}),m.jsx("input",{id:Oe,"aria-label":t("auth.password"),className:"cyber-input",type:"password",value:w,onChange:V=>T(V.target.value),onFocus:()=>se("password"),onBlur:()=>se(null),autoComplete:"current-password"})]}),E?m.jsxs("div",{className:"cyber-captcha-panel",children:[m.jsx("img",{alt:t("auth.captchaImageAlt"),className:"cyber-captcha-image",draggable:!1,src:E.imageDataUrl}),m.jsx("p",{className:"cyber-captcha-hint",children:t("auth.captchaHint")}),m.jsxs("div",{className:`cyber-field ${ae==="captcha"?"focused":""}`,children:[m.jsx("div",{className:"cyber-field-border",children:m.jsx("div",{className:"cyber-field-border-glow"})}),m.jsxs("label",{className:"cyber-field-label",htmlFor:vt,children:[m.jsx("span",{className:"cyber-field-icon",children:"#"}),t("auth.captcha")]}),m.jsx("input",{id:vt,"aria-label":t("auth.captcha"),className:"cyber-input",placeholder:t("auth.captchaPlaceholder"),value:k,onChange:V=>L(V.target.value),onFocus:()=>se("captcha"),onBlur:()=>se(null),autoComplete:"one-time-code"})]})]}):null,c?m.jsxs("label",{className:"cyber-remember-toggle",children:[m.jsx("input",{"aria-label":t("auth.rememberPassword"),type:"checkbox",checked:K,onChange:V=>te(V.target.checked)}),m.jsx("span",{children:t("auth.rememberPassword")})]}):null,N?m.jsxs("div",{className:"cyber-status","data-tone":"error",children:[m.jsx("span",{className:"cyber-status-icon",children:"⚠"}),m.jsx("span",{children:N})]}):null,m.jsxs("button",{className:`cyber-submit ${I?"loading":""}`,type:"submit",disabled:I,children:[m.jsx("span",{className:"cyber-submit-glow"}),m.jsx("span",{className:"cyber-submit-border"}),m.jsx("span",{className:"cyber-submit-text",children:I?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"cyber-spinner"}),t("common.loading")]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"cyber-submit-icon",children:"➤"}),t("auth.submitLogin")]})})]})]}),o?m.jsxs("div",{className:"cyber-footer",children:[m.jsxs("div",{className:"cyber-divider",children:[m.jsx("span",{className:"cyber-divider-line"}),m.jsx("span",{className:"cyber-divider-text",children:"//"}),m.jsx("span",{className:"cyber-divider-line"})]}),m.jsxs("button",{className:"cyber-server-btn",onClick:()=>oe(!0),type:"button",children:[m.jsx("span",{className:"cyber-server-icon",children:"⚙"}),m.jsx("span",{className:"cyber-server-text",children:t("auth.serverSettings")}),m.jsx("span",{className:"cyber-server-current",children:$})]})]}):null]})]}),m.jsxs("div",{className:"cyber-version",children:[m.jsxs("span",{className:"cyber-version-text",children:["v",a]}),m.jsx("span",{className:"cyber-version-divider",children:"|"}),m.jsx("span",{className:"cyber-version-text",children:"SYSTEM READY"})]})]}),o&&J?m.jsx(h.Suspense,{fallback:null,children:m.jsx(Co,{isOpen:J,onClose:()=>oe(!1),onSave:xe})}):null]})}function yn(){return m.jsx("main",{className:"page-center app-shell",children:m.jsxs("section",{className:"auth-card surface-card",children:[m.jsx("h1",{children:be("auth.trustedEntryOnlyTitle")}),m.jsx("p",{className:"status-text",children:be("auth.trustedEntryOnlyDescription")}),m.jsxs("div",{className:"field-group",children:[m.jsx("span",{children:be("auth.trustedEntryOnlyHintTitle")}),m.jsx("span",{className:"auth-server-value",children:be("auth.trustedEntryOnlyHint")})]})]})})}function Uo({isDesktop:e,viewportClass:t}){return e||t==="expanded"?"desktop":"mobile"}function Oo(){return!1}function bn(e,t,r=Oo()){var i,o;if(!r||t!=="web")return!1;const n=Ct(e),a=n==null?void 0:n.relayTunnel;return!(a!=null&&a.enabled&&((i=a.tunnelDomain)!=null&&i.trim())&&((o=a.controlBaseUrl)!=null&&o.trim()))}function Ao({runtimeKey:e,children:t}){return m.jsx("div",{children:t},e)}function ko(){const e=qn();return m.jsx(Ao,{runtimeKey:e,children:m.jsx(gi,{})})}function Fo(){const e=Xe(i=>i),t=pt(),r=Bt(i=>i.session),n=Bt(i=>i.sessionReady),a=mt();if(bn(e,t.platform))return m.jsx(yn,{});if(!r){const i=`${a.pathname}${a.search}`;return m.jsx(sn,{to:`/login?returnTo=${encodeURIComponent(i)}`,replace:!0})}return n?m.jsx(ko,{}):m.jsx("div",{children:be("common.loading")})}function Vo(){const e=Xe(r=>r),t=pt();return bn(e,t.platform)?m.jsx(yn,{}):m.jsx(Io,{})}function zr(){const e=pt(),t=Uo(e);return m.jsx(sn,{to:t==="mobile"?"/workspaces":"/landing",replace:!0})}function ne(e,t){return async()=>({Component:(await e())[t]})}const zo=[{path:"/bootstrap",lazy:ne(()=>Y(()=>import("./BootstrapPage-CAVA-a8h.js"),__vite__mapDeps([7,3,4])),"BootstrapPage")},{path:"/login",element:m.jsx(Vo,{})},{path:"/connect/:tunnelDomain",lazy:ne(()=>Y(()=>import("./RelayConnectEntryPage-D417tgWj.js"),__vite__mapDeps([8,3,4,5])),"RelayConnectEntryPage")},{path:"/desktop-window-preview",lazy:ne(()=>Y(()=>import("./DesktopDetachPreviewPage-B37DUL15.js"),__vite__mapDeps([9,3,4])),"DesktopDetachPreviewPage")},{path:"/",element:m.jsx(Fo,{}),children:[{path:"desktop-window/:windowId",lazy:ne(()=>Y(()=>import("./DesktopWindowPage-CDA6l7lm.js"),__vite__mapDeps([10,3,4,11,12,13,0,1,6,5,14,15,16,17,18,19,20,21,22])),"DesktopWindowPage")},{lazy:ne(()=>Y(()=>import("./WorkbenchShellRoute-Cy4WBbzq.js"),__vite__mapDeps([23,3,4,13,11,0,1,6,5,24])),"WorkbenchShellRoute"),children:[{index:!0,element:m.jsx(zr,{})},{path:"landing",lazy:ne(()=>Y(()=>import("./WorkbenchLandingPage-BudM2C69.js"),__vite__mapDeps([25,3,4,13,11,0,1,6,5])),"WorkbenchLandingPage")},{path:"workspaces",lazy:ne(()=>Y(()=>import("./WorkspaceHomePage-CfuPVITd.js"),__vite__mapDeps([26,3,4,13,11,0,1,6,5,27,20,21,28])),"WorkspaceHomePage")},{path:"workspaces/:workspaceId",lazy:ne(()=>Y(()=>import("./WorkspaceDetailPage-CGkAH1W-.js"),__vite__mapDeps([29,3,4,13,11,0,1,6,5,30,17,20,21,28])),"WorkspaceDetailPage")},{path:"workspaces/:workspaceId/debug",lazy:ne(()=>Y(()=>import("./WorkspaceDebugDetailPage-CHqo-uDf.js"),__vite__mapDeps([31,3,4,30,11,17,13,0,1,6,5])),"WorkspaceDebugDetailPage")},{path:"workspaces/:workspaceId/sessions",lazy:ne(()=>Y(()=>import("./SessionIndexPage-D5iefVcc.js"),__vite__mapDeps([32,3,4,11,13,0,1,6,5,20,21,28,33,34])),"SessionIndexPage")},{path:"workspaces/:workspaceId/sessions/:sessionId",lazy:ne(()=>Y(()=>import("./ConversationPage-B6BGOX4C.js"),__vite__mapDeps([35,3,4,6,11,13,0,1,5,36,12,14,15,16,17,18,19,20,21,22,33,34])),"ConversationPage")},{path:"workspaces/:workspaceId/tools",lazy:ne(()=>Y(()=>import("./ToolsHomePage-rU3V8mmh.js"),__vite__mapDeps([37,3,4,13,11,0,1,6,5])),"ToolsHomePage")},{path:"workspaces/:workspaceId/tools/files",lazy:ne(()=>Y(()=>import("./ToolFilesPage-D7thcDEv.js"),__vite__mapDeps([38,3,4,13,11,0,1,6,5])),"ToolFilesPage")},{path:"workspaces/:workspaceId/tools/git",lazy:ne(()=>Y(()=>import("./ToolGitPage-uPRsxdcn.js"),__vite__mapDeps([39,3,4,13,11,0,1,6,5])),"ToolGitPage")},{path:"workspaces/:workspaceId/tools/processes",lazy:ne(()=>Y(()=>import("./ToolProcessesPage-B1uOk0Ef.js"),__vite__mapDeps([40,3,4,13,11,0,1,6,5])),"ToolProcessesPage")},{path:"workspaces/:workspaceId/terminals",lazy:ne(()=>Y(()=>import("./TerminalPage-DAzQTmQC.js"),__vite__mapDeps([19,3,4,11,13,0,1,6,5,20,21,17,18,22])),"TerminalPage")},{path:"workspaces/:workspaceId/butler",lazy:ne(()=>Y(()=>import("./AdaptiveButlerPage-B8mg25ze.js"),__vite__mapDeps([41,3,4,13,11,0,1,6,5,36,12,14,27,20,21,42])),"AdaptiveButlerPage")},{path:"settings",lazy:ne(()=>Y(()=>import("./SettingsPage-iCFe_DHP.js"),__vite__mapDeps([43,3,4,11,6,21])),"SettingsPage")},{path:"settings/:section",lazy:ne(()=>Y(()=>import("./SettingsPage-iCFe_DHP.js"),__vite__mapDeps([43,3,4,11,6,21])),"SettingsPage")},{path:"*",element:m.jsx(zr,{})}]}]}];function Bo(){return Ei(zo)}function Ho(){const e=qe(r=>r.profile.language),t=h.useMemo(()=>Bo(),[]);return m.jsx(Yi,{children:m.jsx(io,{children:m.jsx(Qn,{language:e,children:m.jsx(eo,{children:m.jsxs(ao,{children:[m.jsx(yo,{}),m.jsx(ji,{router:t})]})})})})})}const ts=Object.freeze(Object.defineProperty({__proto__:null,App:Ho},Symbol.toStringTag,{value:"Module"}));export{ts as A,ta as L,sn as N,gi as O,Yo as T,Po as a,_o as b,Ko as c,Ii as d,pt as e,Jo as f,Wr as g,mt as h,lo as i,Qi as j,po as k,Xo as l,br as m,qo as n,Qo as o,oo as p,Go as q,Uo as r,Zo as s,es as t,rr as u,Gt as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,j as s,t as e,A as v}from"./index-
|
|
1
|
+
import{b as t,j as s,t as e,A as v}from"./index-oGylLBIX.js";import{u as S,a as w,b as N}from"./App-C2lNmeKL.js";function T(){const h=S(),m=w(a=>a.baseUrl),[l,x]=t.useState("admin"),[n,f]=t.useState(""),[u,j]=t.useState(""),[i,r]=t.useState(null),[b,o]=t.useState("error"),[c,d]=t.useState(!1);async function g(a){if(a.preventDefault(),n!==u){o("error"),r(e("auth.bootstrapMismatch"));return}d(!0),r(null);try{await N.bootstrap(l,n),o("success"),r(e("auth.bootstrapSuccess")),window.setTimeout(()=>h("/login",{replace:!0}),500)}catch(p){o("error"),p instanceof v?r(p.message):r(e("auth.authUnavailable"))}finally{d(!1)}}return s.jsx("main",{className:"page-center app-shell",children:s.jsxs("section",{className:"auth-card surface-card",children:[s.jsx("h1",{children:e("auth.bootstrapTitle")}),s.jsx("p",{className:"status-text",children:e("auth.bootstrapSubtitle")}),s.jsxs("div",{className:"field-group",children:[s.jsx("span",{children:e("auth.serverCurrent")}),s.jsx("span",{className:"auth-server-value",children:m})]}),s.jsxs("form",{className:"auth-form",onSubmit:g,children:[s.jsxs("label",{className:"field-group",children:[s.jsx("span",{children:e("auth.username")}),s.jsx("input",{value:l,onChange:a=>x(a.target.value)})]}),s.jsxs("label",{className:"field-group",children:[s.jsx("span",{children:e("auth.password")}),s.jsx("input",{type:"password",value:n,onChange:a=>f(a.target.value)})]}),s.jsxs("label",{className:"field-group",children:[s.jsx("span",{children:e("auth.confirmPassword")}),s.jsx("input",{type:"password",value:u,onChange:a=>j(a.target.value)})]}),i?s.jsx("p",{className:"status-text","data-tone":b,children:i}):null,s.jsx("button",{className:"primary-button",type:"submit",disabled:c,children:c?e("common.loading"):e("auth.submitBootstrap")})]})]})})}export{T as BootstrapPage};
|