From 83233587820518d6aa732ce6d4a4915941f63923 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 16:23:47 +0800 Subject: [PATCH 01/78] docs: add moonbridge console frontend design --- .gitignore | 1 + .../2026-05-24-moonbridge-console-design.md | 334 ++++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 docs/superpowers/specs/2026-05-24-moonbridge-console-design.md diff --git a/.gitignore b/.gitignore index 5da6bd33..dfaec113 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Agent / AI assistant local files .planning/ +.superpowers/ helloagents/ AGENTS.md CLAUDE.md diff --git a/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md b/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md new file mode 100644 index 00000000..c5ef32db --- /dev/null +++ b/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md @@ -0,0 +1,334 @@ +# Moon Bridge Console Frontend Integration Design + +Date: 2026-05-24 +Status: Approved direction, pending implementation plan + +## Summary + +Moon Bridge is a Go HTTP proxy and protocol conversion server. It exposes OpenAI-compatible endpoints such as `/v1/responses` and `/v1/models`, and, when persistence is enabled, a management API under `/api/v1/`. + +This design adds an embedded Web frontend at `/console/`. The frontend is an operations console, not a chat product or marketing page. Its primary job is to make Moon Bridge's runtime configuration visible and editable: status, providers, models, offers, routes, extensions, pending changes, import/export, and a small RPC smoke-test panel. + +Confirmed product direction: + +- Product focus: operations console first. +- Integration form: embedded SPA served by the Go binary. +- Frontend stack: Vite + React + TypeScript, Material Design 3 visual language, TanStack Query for RPC state, Motion for React for UI motion. +- Theme: primary color `#7AA7A2`, support dark and light mode switching, default to dark mode. + +## Current Project Architecture + +The existing codebase is backend-first and already has most API boundaries needed by a console: + +- Entry points: `cmd/moonbridge/main.go` loads config, initializes logging, handles CLI flags, and starts `app.RunServer`. +- Application lifecycle: `internal/service/app/app.go` builds provider managers, protocol adapters, extension registry, persistence, runtime snapshots, stats, trace, session management, and HTTP server wiring. +- HTTP server: `internal/service/server/server.go` registers `/v1/responses`, `/responses`, `/v1/models`, `/models`, plugin routes, and `/api/v1/` when runtime and store are available. +- Management API: `internal/service/api/router.go` registers providers, offers, models, routes, settings, config import/export/validate, pending changes, status, sessions, stats, logs, and version endpoints. +- Runtime model: `internal/service/runtime/runtime.go` exposes atomic config snapshots and reloads them after validation. +- Persistence: `internal/service/store` and DB extensions support staged changes and `ApplyPendingChanges`. +- Protocol conversion: `internal/format` plus `internal/protocol/{openai,anthropic,google,chat}` map OpenAI Responses to upstream provider protocols. +- Extensions: `internal/extension` includes DeepSeek V4 adaptation, visual delegation, web search, metrics, DB providers, Codex catalog support, and tool proxy logic. + +The console should respect this shape: it should consume existing API boundaries instead of adding a parallel configuration mechanism. + +## Primary User Workflows + +1. View current runtime state. + - Read mode, address, version, provider count, route count, active sessions, stats summary, and provider statuses. + - Show a clear setup state when the management API is absent or returns `store_unavailable` because persistence/store is not active. + +2. Understand and edit the configuration graph. + - Models define metadata and capability hints. + - Providers define upstream base URL, protocol, auth, user agent, web search, and offers. + - Offers link providers to model slugs with pricing and upstream names. + - Routes expose aliases that map to provider/model pairs. + - The UI should make these relationships visible, not just expose isolated forms. + +3. Stage, review, apply, or discard changes. + - All mutations call existing API endpoints that create pending changes. + - A persistent change queue shows resource, target, action, before/after summary, and creation time. + - Apply calls `POST /api/v1/changes/apply`; discard calls `POST /api/v1/changes/discard`. + - After apply/discard, invalidate status, providers, models, routes, defaults, web search, extensions, and changes queries. + +4. Import/export configuration. + - Import YAML through `POST /api/v1/config/import`, then review generated staged changes. + - Validate YAML through `POST /api/v1/config/validate`. + - Export masked or secret-including YAML through `GET /api/v1/config/export`, with the required `X-Confirm-Secrets: true` confirmation for secret export. + +5. Run a lightweight RPC smoke test. + - Select a route/model and send a minimal `POST /v1/responses` request. + - Support non-streaming first. + - Add streaming SSE inspection after the basic console is stable. + - This panel is for route verification and debugging, not a full chat UI. + +## Frontend Information Architecture + +The first version should use a dense operational layout: + +- Top app bar: product name, connection target, runtime mode, auth/session indicator. +- Navigation rail: + - Overview + - Models + - Providers + - Routes + - Extensions + - Changes + - Config + - RPC Test +- Global change queue indicator: visible in the app bar and as a right-side drawer on edit pages. +- Snackbar/toast area: mutation accepted, apply succeeded, validation failed, auth failed, store unavailable. + +### Overview + +Shows: + +- Status from `GET /api/v1/status`. +- Provider health summary from `GET /api/v1/status/providers`. +- Usage summary from `GET /api/v1/stats/summary`. +- Recent sessions from `GET /api/v1/sessions`. +- Pending changes from `GET /api/v1/changes`. +- Setup warning when `/api/v1/*` returns 404, 503, or `store_unavailable`. + +### Models + +Shows paginated model table from `GET /api/v1/models`. + +Key controls: + +- Create/update model metadata through `PUT /api/v1/models/{slug}`. +- Delete model through `DELETE /api/v1/models/{slug}`. +- Link to provider offers for the selected model. + +### Providers + +Shows paginated provider list from `GET /api/v1/providers`. + +Key controls: + +- View provider detail from `GET /api/v1/providers/{key}`. +- Create/update provider through `PUT/PATCH /api/v1/providers/{key}`. +- Delete provider through `DELETE /api/v1/providers/{key}`. +- Test provider through `POST /api/v1/providers/{key}/test` only when the provider is Anthropic-compatible. The current backend probe constructs an Anthropic Messages request and should not be presented as protocol-neutral. +- Manage offers under `POST/PATCH/DELETE /api/v1/providers/{key}/offers`. + +### Routes + +Shows routes from `GET /api/v1/routes`. + +Key controls: + +- Create/update alias through `PUT /api/v1/routes/{alias}`. +- Delete alias through `DELETE /api/v1/routes/{alias}`. +- Show route graph: alias -> model -> provider -> upstream base URL/protocol. + +### Extensions + +Shows extension names from `GET /api/v1/extensions` and details from `GET /api/v1/extensions/{name}`. + +First version should provide safe JSON editing for extension config through `PUT /api/v1/extensions/{name}`. Typed forms can be added later when extension config specs are exposed through an API. + +### Changes + +Shows pending rows from `GET /api/v1/changes`. + +Controls: + +- Apply all pending changes. +- Discard all pending changes. +- Show normalized before/after diff for JSON payloads. +- Warn when route/provider/model deletions may affect visible aliases. + +### Config + +Controls: + +- Effective masked config from `GET /api/v1/config/effective`. +- YAML import and validation. +- YAML export, with explicit confirmation for secret export. + +### RPC Test + +Controls: + +- Select route/model from `/v1/models` or management route data. +- Send a short `POST /v1/responses`. +- Show request JSON, response JSON, latency, error object, and selected model/provider. +- Stream mode is optional for v1. If included, show SSE events in an append-only event list. + +## Technical Architecture + +### Repository Layout + +Add: + +```text +webui/ + package.json + vite.config.ts + tsconfig.json + index.html + src/ + app/ + components/ + features/ + rpc/ + theme/ + test/ +internal/service/webui/ + embed.go +``` + +The Go server should serve the built SPA under `/console/`. In development, the Vite dev server can proxy API calls to Moon Bridge. + +### Go Integration + +Use `go:embed` for production assets: + +- Embed `webui/dist`. +- Register `/console/` to serve static assets. +- Return `index.html` for unknown `/console/*` paths so client-side routing works. +- Keep `/api/v1/`, `/v1/responses`, and `/v1/models` unchanged. +- Prefer adding a small `internal/service/webui` package so `server.go` stays focused on HTTP API registration. + +Required backend additions: + +- Serve `/console/` static assets. +- Optionally add `GET /api/v1/capabilities` or include capability flags in `GET /api/v1/status`, so the UI can show whether persistence, metrics, logs, and RPC test are available. +- Implement a real recent log buffer before making `/api/v1/logs` prominent; the current handler returns an empty list. +- Consider broadening `POST /api/v1/providers/{key}/test` beyond Anthropic-only probing before presenting it as protocol-neutral. Until then, hide or label it for non-Anthropic protocols. + +### Frontend Stack + +Use: + +- Vite + React + TypeScript for the SPA. +- Material Web components and Material 3 design tokens for core controls and visual language. Material Web is Google's Material Web Components library and follows Material Design guidelines; its docs also describe Material 3 tokens as CSS custom properties. +- TanStack Query for server-state fetching, caching, mutations, invalidation, and async state. Its docs describe it as async/server-state and data-fetching utilities for TS/JS applications. +- Motion for React for layout transitions, enter/exit animations, drawer/dialog animation, list reordering, and pending-change feedback. +- TanStack Table for dense resource tables unless Material Web table coverage is enough during implementation. +- React Router or TanStack Router for client-side routing. Choose the one that minimizes setup after dependency installation. + +Rationale: + +- Material Web gives the closest Material Design 3 base. +- MUI is mature and production-ready, but its own docs currently state Material UI adopts Material Design 2, so it should be a fallback for complex admin widgets rather than the default visual foundation. +- TanStack Query fits this app because nearly all state is remote runtime/config state. +- Motion fits the animation requirement while staying React-native and TypeScript-friendly. + +References: + +- Material Web intro: https://material-web.dev/about/intro/ +- MUI Material UI overview and MD2 note: https://mui.com/material-ui/ +- TanStack Query overview: https://tanstack.com/query/latest +- Motion for React docs: https://motion.dev/docs/react + +## RPC Client Design + +Create a typed API client in `webui/src/rpc/`. + +Recommended modules: + +- `http.ts`: base URL resolution, auth header injection, JSON parsing, error normalization. +- `management.ts`: `/api/v1` endpoints. +- `responses.ts`: `/v1/responses` smoke-test client, including optional SSE reader. +- `types.ts`: DTOs for status, providers, models, offers, routes, changes, settings, stats, sessions, and OpenAI error shape. + +Error handling: + +- Normalize `{ error: { code, message } }` from management endpoints. +- Normalize OpenAI-style errors from `/v1/responses`. +- Show auth failures as a global blocking state. +- Show store unavailable as a setup state explaining that persistence must be enabled for the console. + +Auth handling: + +- If `auth_token` is configured, the same Bearer token protects all server routes. +- The UI cannot discover the token. It should show a token entry screen when a protected API call returns 401. +- Store the token in session storage by default, with an explicit "remember on this device" option for local storage. + +## Visual and Interaction Design + +Material 3 direction: + +- Use `#7AA7A2` as the default primary seed color. +- Default to dark mode on first load. +- Support explicit dark/light mode switching from the app shell. +- Persist the user's selected mode locally, and fall back to default dark mode when no preference is stored. +- Generate separate light and dark Material 3 token sets from the same primary seed color so surfaces, outlines, and state layers remain coherent in both modes. +- Use navigation rail on desktop and modal navigation drawer on narrow screens. +- Use surface levels, tonal buttons, outlined text fields, chips, dialogs, switches, segmented buttons, and snackbars. +- Keep cards to repeated resources and panels; avoid nested cards. +- Use compact dashboard typography, not landing-page hero typography. +- Use clear status colors: healthy, unknown, pending, error, disabled. + +Motion: + +- Page transitions: subtle fade/slide, 120-180ms. +- Change queue: animate item entry/exit and apply/discard collapse. +- Dialogs and drawers: use spring only where it helps, otherwise short easing. +- Resource tables: animate row insertion/removal only, not every hover. +- Respect `prefers-reduced-motion`. + +## Data Consistency Rules + +- Treat runtime configuration as server-owned. +- All write operations produce staged changes. The UI must not pretend a staged change is active. +- After any staged mutation, invalidate only `changes` plus the affected resource detail if needed. +- After apply/discard, invalidate all config-derived queries. +- For forms editing masked secrets, preserve `"******"` semantics where existing APIs support it. +- Never display plaintext secrets after masked reads. + +## Testing Strategy + +Frontend: + +- Unit test RPC client error normalization and query key builders. +- Component test forms for provider, model, route, offers, and change queue. +- E2E smoke tests with a mock Moon Bridge server: + - overview loads + - provider edit stages a change + - apply refreshes status/resources + - auth prompt appears on 401 + - store unavailable state appears on 503 + +Backend: + +- Add tests for `/console/` serving: + - index served at `/console/` + - assets served with correct content type + - nested routes fallback to index + - existing API routes unaffected +- Add tests for any new capability/status endpoint fields. + +Manual verification: + +- `go test ./...` +- `pnpm --dir webui test` +- `pnpm --dir webui build` +- Start Moon Bridge with `config.example.yml` style SQLite persistence and open `/console/`. + +## Open Questions + +- Should the console be enabled by default, or behind a config flag such as `server.console_enabled`? +- Should `/console/` be served in Capture modes, where the management API may not be meaningful? +- Should the first implementation include streaming SSE inspection, or defer it after CRUD/config flows? +- Should extension config specs be exposed over API to support generated typed forms? + +## Non-Goals for v1 + +- Full chat application. +- Multi-user RBAC. +- Remote workspace/project management. +- Real-time websocket dashboard. +- Editing raw SQLite/D1 state directly. +- Replacing existing CLI config generation commands. + +## Recommended Implementation Slices + +1. Add embedded static serving and a minimal Vite React app at `/console/`. +2. Add typed RPC client and overview/status page. +3. Add provider/model/route read-only pages. +4. Add staged mutations and change queue apply/discard. +5. Add config import/export and validation. +6. Add RPC smoke-test panel. +7. Add animation polish and responsive navigation. From 5e7e6d0aa1cfd5e9a952d2a1820be359904b7e8a Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 16:29:01 +0800 Subject: [PATCH 02/78] docs: expand console config workflows --- .../2026-05-24-moonbridge-console-design.md | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md b/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md index c5ef32db..3959c822 100644 --- a/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md +++ b/docs/superpowers/specs/2026-05-24-moonbridge-console-design.md @@ -7,7 +7,7 @@ Status: Approved direction, pending implementation plan Moon Bridge is a Go HTTP proxy and protocol conversion server. It exposes OpenAI-compatible endpoints such as `/v1/responses` and `/v1/models`, and, when persistence is enabled, a management API under `/api/v1/`. -This design adds an embedded Web frontend at `/console/`. The frontend is an operations console, not a chat product or marketing page. Its primary job is to make Moon Bridge's runtime configuration visible and editable: status, providers, models, offers, routes, extensions, pending changes, import/export, and a small RPC smoke-test panel. +This design adds an embedded Web frontend at `/console/`. The frontend is an operations console, not a chat product or marketing page. Its primary job is to make Moon Bridge's runtime configuration visible and editable: status, providers, models, offers, routes, extensions, pending changes, config generation/import/apply, visual config editing, and a small RPC smoke-test panel. Confirmed product direction: @@ -51,11 +51,18 @@ The console should respect this shape: it should consume existing API boundaries - After apply/discard, invalidate status, providers, models, routes, defaults, web search, extensions, and changes queries. 4. Import/export configuration. + - Generate a valid Moon Bridge YAML config from a guided visual form. - Import YAML through `POST /api/v1/config/import`, then review generated staged changes. - Validate YAML through `POST /api/v1/config/validate`. - Export masked or secret-including YAML through `GET /api/v1/config/export`, with the required `X-Confirm-Secrets: true` confirmation for secret export. + - Apply an imported/generated config by staging its changes first, then using the existing change queue apply flow. -5. Run a lightweight RPC smoke test. +5. Visually edit configuration. + - Provide visual CRUD screens for models, providers, offers, routes, defaults, web search, and selected extension settings. + - Treat visual edits and YAML import/generation as equivalent sources of staged changes. + - Always show the active runtime config separately from the pending staged config. + +6. Run a lightweight RPC smoke test. - Select a route/model and send a minimal `POST /v1/responses` request. - Support non-streaming first. - Add streaming SSE inspection after the basic console is stable. @@ -143,8 +150,18 @@ Controls: Controls: - Effective masked config from `GET /api/v1/config/effective`. +- Guided config generator: + - choose mode + - set server address/auth + - add provider credentials and protocol + - add model metadata + - create offers and route aliases + - configure persistence, cache, web search, and common extensions + - preview generated YAML before staging - YAML import and validation. +- YAML apply flow: generate or paste YAML, validate it, stage changes through `POST /api/v1/config/import`, review pending changes, then apply through `POST /api/v1/changes/apply`. - YAML export, with explicit confirmation for secret export. +- Visual editor entry points for the same resources. The Config page should not become a separate raw-only editor; it should link to Models, Providers, Routes, Extensions, Defaults, and Web Search visual forms. ### RPC Test @@ -196,6 +213,7 @@ Required backend additions: - Optionally add `GET /api/v1/capabilities` or include capability flags in `GET /api/v1/status`, so the UI can show whether persistence, metrics, logs, and RPC test are available. - Implement a real recent log buffer before making `/api/v1/logs` prominent; the current handler returns an empty list. - Consider broadening `POST /api/v1/providers/{key}/test` beyond Anthropic-only probing before presenting it as protocol-neutral. Until then, hide or label it for non-Anthropic protocols. +- Consider adding a non-mutating config generation/normalization endpoint later if frontend-only YAML generation becomes hard to keep aligned with Go config serialization. v1 can generate YAML in the frontend and rely on `POST /api/v1/config/validate` plus `POST /api/v1/config/import` as the source of truth. ### Frontend Stack @@ -231,6 +249,7 @@ Recommended modules: - `http.ts`: base URL resolution, auth header injection, JSON parsing, error normalization. - `management.ts`: `/api/v1` endpoints. - `responses.ts`: `/v1/responses` smoke-test client, including optional SSE reader. +- `config-generator.ts`: convert visual generator state into Moon Bridge YAML. - `types.ts`: DTOs for status, providers, models, offers, routes, changes, settings, stats, sessions, and OpenAI error shape. Error handling: @@ -273,6 +292,8 @@ Motion: - Treat runtime configuration as server-owned. - All write operations produce staged changes. The UI must not pretend a staged change is active. +- Generated YAML is not active configuration until it has been validated, imported into pending changes, reviewed, and applied. +- Visual edits, YAML import, and generated YAML must all converge on the same pending-change queue. - After any staged mutation, invalidate only `changes` plus the affected resource detail if needed. - After apply/discard, invalidate all config-derived queries. - For forms editing masked secrets, preserve `"******"` semantics where existing APIs support it. @@ -283,10 +304,13 @@ Motion: Frontend: - Unit test RPC client error normalization and query key builders. +- Unit test config generator output for representative Transform, CaptureResponse, and CaptureAnthropic configs. - Component test forms for provider, model, route, offers, and change queue. +- Component test the config generation/apply flow: fill wizard, preview YAML, validate, import, review changes, apply. - E2E smoke tests with a mock Moon Bridge server: - overview loads - provider edit stages a change + - generated config validates and creates staged changes - apply refreshes status/resources - auth prompt appears on 401 - store unavailable state appears on 503 @@ -313,6 +337,7 @@ Manual verification: - Should `/console/` be served in Capture modes, where the management API may not be meaningful? - Should the first implementation include streaming SSE inspection, or defer it after CRUD/config flows? - Should extension config specs be exposed over API to support generated typed forms? +- Should config generation initially support only common Transform-mode provider/model/route setups, or also full CaptureResponse/CaptureAnthropic proxy setups? ## Non-Goals for v1 @@ -329,6 +354,7 @@ Manual verification: 2. Add typed RPC client and overview/status page. 3. Add provider/model/route read-only pages. 4. Add staged mutations and change queue apply/discard. -5. Add config import/export and validation. -6. Add RPC smoke-test panel. -7. Add animation polish and responsive navigation. +5. Add visual config generator, YAML preview, validation, import, and apply flow. +6. Add config export and effective-config viewer. +7. Add RPC smoke-test panel. +8. Add animation polish and responsive navigation. From 7299bea60064ce824da7bb1e563f7d17873d9230 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 16:34:02 +0800 Subject: [PATCH 03/78] docs: add console implementation plan --- ...05-24-moonbridge-console-implementation.md | 1113 +++++++++++++++++ 1 file changed, 1113 insertions(+) create mode 100644 docs/superpowers/plans/2026-05-24-moonbridge-console-implementation.md diff --git a/docs/superpowers/plans/2026-05-24-moonbridge-console-implementation.md b/docs/superpowers/plans/2026-05-24-moonbridge-console-implementation.md new file mode 100644 index 00000000..595bb065 --- /dev/null +++ b/docs/superpowers/plans/2026-05-24-moonbridge-console-implementation.md @@ -0,0 +1,1113 @@ +# Moon Bridge Console Implementation Plan + +> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Build an embedded `/console/` Web operations console for Moon Bridge with Material Design 3 styling, default primary color `#7AA7A2`, default dark mode, RPC-backed config management, visual config editing, config generation/import/apply, and a lightweight Responses smoke-test panel. + +**Architecture:** Add a Vite + React + TypeScript SPA in `webui/`, serve its production build from Go via `go:embed`, and keep the existing `/api/v1` and `/v1/responses` HTTP contracts as the RPC boundary. Frontend state is server-owned via TanStack Query; all mutations create staged changes and converge on the existing `POST /api/v1/changes/apply` flow. + +**Tech Stack:** Go 1.25, `net/http`, `go:embed`, Vite, React, TypeScript, Material Web, TanStack Query, TanStack Table, Motion for React, Vitest, Playwright. + +--- + +## Reference Documents + +- Spec: `docs/superpowers/specs/2026-05-24-moonbridge-console-design.md` +- Existing API docs: `docs/api.md` +- Existing architecture docs: `docs/architecture.md` +- Go config file types: `internal/config/config_loader.go` +- Go config YAML conversion: `internal/config/convert.go` +- API route registration: `internal/service/api/router.go` +- HTTP server route registration: `internal/service/server/server.go` + +## File Structure + +Create: + +- `internal/service/webui/embed.go` — embedded static file handler for built SPA assets. +- `internal/service/webui/embed_test.go` — static serving and SPA fallback tests. +- `webui/package.json` — frontend scripts and dependencies. +- `webui/vite.config.ts` — Vite config with `/console/` base and dev proxy. +- `webui/tsconfig.json`, `webui/tsconfig.node.json` — TypeScript configs. +- `webui/index.html` — SPA HTML shell. +- `webui/src/main.tsx` — React bootstrap. +- `webui/src/app/App.tsx` — app shell and route layout. +- `webui/src/app/routes.tsx` — client route definitions. +- `webui/src/app/queryClient.ts` — TanStack Query client. +- `webui/src/theme/tokens.ts` — Material 3 token values derived from `#7AA7A2`. +- `webui/src/theme/ThemeProvider.tsx` — dark/light mode state, persistence, CSS variable application. +- `webui/src/rpc/http.ts` — fetch wrapper, auth handling, error normalization. +- `webui/src/rpc/types.ts` — API DTOs aligned with existing Go responses. +- `webui/src/rpc/management.ts` — `/api/v1` typed client. +- `webui/src/rpc/responses.ts` — `/v1/responses` smoke-test client. +- `webui/src/rpc/configGenerator.ts` — visual generator state to YAML string. +- `webui/src/features/overview/OverviewPage.tsx` +- `webui/src/features/models/ModelsPage.tsx` +- `webui/src/features/providers/ProvidersPage.tsx` +- `webui/src/features/routes/RoutesPage.tsx` +- `webui/src/features/extensions/ExtensionsPage.tsx` +- `webui/src/features/changes/ChangesPage.tsx` +- `webui/src/features/config/ConfigPage.tsx` +- `webui/src/features/config/ConfigGenerator.tsx` +- `webui/src/features/rpcTest/RpcTestPage.tsx` +- `webui/src/components/AppShell.tsx` +- `webui/src/components/AuthGate.tsx` +- `webui/src/components/ChangeQueueDrawer.tsx` +- `webui/src/components/ErrorState.tsx` +- `webui/src/components/LoadingState.tsx` +- `webui/src/components/ResourceTable.tsx` +- `webui/src/test/server.ts` — MSW or fetch-mock fixtures for component tests. +- `webui/src/**/*.test.ts(x)` — Vitest tests beside modules. +- `webui/e2e/console.spec.ts` — Playwright smoke tests. + +Modify: + +- `internal/service/server/server.go` — register `/console/` handler. +- `internal/service/server/server_test.go` or new focused tests — assert API routes remain unaffected. +- `Makefile` — add `webui-install`, `webui-test`, `webui-build`, and include frontend build in an explicit target. +- `.gitignore` — ignore `webui/dist`, `webui/node_modules`, and Playwright artifacts if not already covered. +- `package.json` at repo root — either leave Cloudflare worker scripts untouched or add workspace scripts only if they do not break existing `wrangler` flow. +- `docs/DEVELOPMENT.md` — document frontend development commands. +- `docs/api.md` — document `/console/` and console-related setup notes. + +Do not modify: + +- Existing protocol adapters unless a test proves the console exposed a real backend bug. +- Existing config storage semantics. Frontend writes must use existing staged-change APIs. + +--- + +## Task 1: Serve Embedded Console Assets From Go + +**Files:** + +- Create: `internal/service/webui/embed.go` +- Create: `internal/service/webui/embed_test.go` +- Modify: `internal/service/server/server.go` +- Test: `internal/service/webui/embed_test.go` + +- [ ] **Step 1: Write failing tests for SPA static serving** + +Create `internal/service/webui/embed_test.go`: + +```go +package webui_test + +import ( + "io/fs" + "net/http" + "net/http/httptest" + "strings" + "testing" + "testing/fstest" + + "moonbridge/internal/service/webui" +) + +func TestHandlerServesIndexAtConsoleRoot(t *testing.T) { + files := fstest.MapFS{ + "dist/index.html": {Data: []byte(`
`)}, + "dist/assets/app.js": {Data: []byte(`console.log("ok")`)}, + } + sub, err := fs.Sub(files, "dist") + if err != nil { + t.Fatal(err) + } + handler := webui.NewHandler(sub) + + req := httptest.NewRequest(http.MethodGet, "/console/", nil) + rec := httptest.NewRecorder() + handler.ServeHTTP(rec, req) + + if rec.Code != http.StatusOK { + t.Fatalf("status = %d", rec.Code) + } + if !strings.Contains(rec.Body.String(), `id="root"`) { + t.Fatalf("body = %s", rec.Body.String()) + } +} + +func TestHandlerFallsBackToIndexForClientRoute(t *testing.T) { + files := fstest.MapFS{ + "dist/index.html": {Data: []byte(`
`)}, + } + sub, err := fs.Sub(files, "dist") + if err != nil { + t.Fatal(err) + } + handler := webui.NewHandler(sub) + + req := httptest.NewRequest(http.MethodGet, "/console/routes/moonbridge", nil) + rec := httptest.NewRecorder() + handler.ServeHTTP(rec, req) + + if rec.Code != http.StatusOK { + t.Fatalf("status = %d", rec.Code) + } + if !strings.Contains(rec.Body.String(), `id="root"`) { + t.Fatalf("body = %s", rec.Body.String()) + } +} + +func TestHandlerServesAssets(t *testing.T) { + files := fstest.MapFS{ + "dist/index.html": {Data: []byte(`
`)}, + "dist/assets/app.js": {Data: []byte(`console.log("ok")`)}, + } + sub, err := fs.Sub(files, "dist") + if err != nil { + t.Fatal(err) + } + handler := webui.NewHandler(sub) + + req := httptest.NewRequest(http.MethodGet, "/console/assets/app.js", nil) + rec := httptest.NewRecorder() + handler.ServeHTTP(rec, req) + + if rec.Code != http.StatusOK { + t.Fatalf("status = %d", rec.Code) + } + if strings.TrimSpace(rec.Body.String()) != `console.log("ok")` { + t.Fatalf("body = %s", rec.Body.String()) + } +} +``` + +- [ ] **Step 2: Run test to verify it fails** + +Run: + +```bash +env GOCACHE=/tmp/moonbridge-go-build GOMODCACHE=/tmp/moonbridge-go-mod go test ./internal/service/webui +``` + +Expected: FAIL because `internal/service/webui` does not exist. + +- [ ] **Step 3: Implement embedded handler** + +Create `internal/service/webui/embed.go`: + +```go +package webui + +import ( + "embed" + "io/fs" + "net/http" + "path" + "strings" +) + +//go:embed dist +var embeddedDist embed.FS + +// Embedded returns the production console handler backed by embedded dist files. +func Embedded() http.Handler { + sub, err := fs.Sub(embeddedDist, "dist") + if err != nil { + return http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + http.Error(w, "console assets unavailable", http.StatusInternalServerError) + }) + } + return NewHandler(sub) +} + +func NewHandler(files fs.FS) http.Handler { + fileServer := http.FileServer(http.FS(files)) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + clean := strings.TrimPrefix(path.Clean("/"+strings.TrimPrefix(r.URL.Path, "/console/")), "/") + if clean == "." || clean == "" { + serveIndex(w, r, files) + return + } + if _, err := fs.Stat(files, clean); err == nil { + r2 := r.Clone(r.Context()) + r2.URL.Path = "/" + clean + fileServer.ServeHTTP(w, r2) + return + } + serveIndex(w, r, files) + }) +} + +func serveIndex(w http.ResponseWriter, r *http.Request, files fs.FS) { + data, err := fs.ReadFile(files, "index.html") + if err != nil { + http.NotFound(w, r) + return + } + w.Header().Set("Content-Type", "text/html; charset=utf-8") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(data) +} +``` + +- [ ] **Step 4: Add temporary placeholder dist for Go tests** + +Create `internal/service/webui/dist/index.html`: + +```html +
+``` + +This file is only a development placeholder so `go:embed dist` compiles before the real Vite build exists. Later tasks replace production assets via `webui/dist` sync or an embed path decision. + +- [ ] **Step 5: Register `/console/` in server** + +Modify `internal/service/server/server.go` imports: + +```go +import "moonbridge/internal/service/webui" +``` + +In `New`, after core API routes and before plugin routes: + +```go +s.mux.Handle("/console/", webui.Embedded()) +``` + +- [ ] **Step 6: Run tests** + +Run: + +```bash +env GOCACHE=/tmp/moonbridge-go-build GOMODCACHE=/tmp/moonbridge-go-mod go test ./internal/service/webui ./internal/service/server +``` + +Expected: PASS. + +- [ ] **Step 7: Commit** + +```bash +git add internal/service/webui internal/service/server/server.go +git commit -m "feat: serve embedded console assets" +``` + +--- + +## Task 2: Scaffold Vite React App With Theme Shell + +**Files:** + +- Create: `webui/package.json` +- Create: `webui/vite.config.ts` +- Create: `webui/tsconfig.json` +- Create: `webui/tsconfig.node.json` +- Create: `webui/index.html` +- Create: `webui/src/main.tsx` +- Create: `webui/src/app/App.tsx` +- Create: `webui/src/app/routes.tsx` +- Create: `webui/src/app/queryClient.ts` +- Create: `webui/src/theme/tokens.ts` +- Create: `webui/src/theme/ThemeProvider.tsx` +- Modify: `.gitignore` +- Test: `webui/src/theme/ThemeProvider.test.tsx` + +- [ ] **Step 1: Create frontend package metadata** + +Create `webui/package.json`: + +```json +{ + "name": "moonbridge-console", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --host 127.0.0.1", + "build": "tsc -b && vite build", + "preview": "vite preview --host 127.0.0.1", + "test": "vitest run", + "test:watch": "vitest", + "e2e": "playwright test" + }, + "dependencies": { + "@material/web": "^2.4.0", + "@tanstack/react-query": "^5.90.0", + "@tanstack/react-table": "^8.21.0", + "motion": "^12.0.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.0" + }, + "devDependencies": { + "@playwright/test": "^1.56.0", + "@testing-library/jest-dom": "^6.6.0", + "@testing-library/react": "^16.0.0", + "@types/node": "^24.0.0", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "@vitejs/plugin-react": "^5.0.0", + "typescript": "^5.9.0", + "vite": "^7.0.0", + "vitest": "^4.0.0", + "yaml": "^2.8.0" + } +} +``` + +Before installing, verify current package versions with `pnpm view` if network is available. If the repo's lockfile forces different versions, prefer the lockfile-compatible version. + +- [ ] **Step 2: Add Vite config** + +Create `webui/vite.config.ts`: + +```ts +import react from '@vitejs/plugin-react'; +import { defineConfig } from 'vite'; + +export default defineConfig({ + base: '/console/', + plugins: [react()], + server: { + port: 5173, + proxy: { + '/api': 'http://127.0.0.1:38440', + '/v1': 'http://127.0.0.1:38440', + '/models': 'http://127.0.0.1:38440', + '/responses': 'http://127.0.0.1:38440' + } + }, + test: { + environment: 'jsdom', + setupFiles: ['./src/test/setup.ts'] + } +}); +``` + +- [ ] **Step 3: Add TypeScript config and HTML** + +Create standard strict TS configs. `webui/index.html` should include: + +```html +
+ +``` + +- [ ] **Step 4: Write failing theme test** + +Create `webui/src/theme/ThemeProvider.test.tsx`: + +```tsx +import { render, screen } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; +import { ThemeProvider, useThemeMode } from './ThemeProvider'; + +function Probe() { + const { mode } = useThemeMode(); + return mode:{mode}; +} + +describe('ThemeProvider', () => { + it('defaults to dark mode', () => { + localStorage.clear(); + render(); + expect(screen.getByText('mode:dark')).toBeInTheDocument(); + }); +}); +``` + +- [ ] **Step 5: Run test to verify it fails** + +Run: + +```bash +pnpm --dir webui test -- ThemeProvider.test.tsx +``` + +Expected: FAIL because provider is not implemented. + +- [ ] **Step 6: Implement theme provider** + +`ThemeProvider` requirements: + +- Default mode is `dark`. +- Persist mode to `localStorage` key `moonbridge.console.theme`. +- Expose `mode`, `setMode`, and `toggleMode`. +- Apply `data-theme="dark|light"` to `document.documentElement`. +- Apply CSS variables from `tokens.ts`. +- Include primary seed `#7AA7A2`. +- Respect `prefers-reduced-motion` in CSS, not in JS state. + +- [ ] **Step 7: Implement app shell placeholder** + +`App.tsx` should render: + +- Top app bar. +- Navigation rail. +- Theme toggle. +- Placeholder route outlet. +- Default dark surfaces using CSS variables. + +- [ ] **Step 8: Run frontend tests and build** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +``` + +Expected: PASS and `webui/dist` produced. + +- [ ] **Step 9: Commit** + +```bash +git add webui .gitignore +git commit -m "feat: scaffold console web app" +``` + +--- + +## Task 3: Build Typed RPC Client and Auth Gate + +**Files:** + +- Create: `webui/src/rpc/http.ts` +- Create: `webui/src/rpc/types.ts` +- Create: `webui/src/rpc/management.ts` +- Create: `webui/src/components/AuthGate.tsx` +- Create: `webui/src/components/ErrorState.tsx` +- Create: `webui/src/components/LoadingState.tsx` +- Test: `webui/src/rpc/http.test.ts` +- Test: `webui/src/rpc/management.test.ts` + +- [ ] **Step 1: Write failing error normalization tests** + +Create `webui/src/rpc/http.test.ts`: + +```ts +import { describe, expect, it, vi } from 'vitest'; +import { apiFetch, ApiError } from './http'; + +describe('apiFetch', () => { + it('normalizes management API errors', async () => { + vi.stubGlobal('fetch', vi.fn(async () => new Response( + JSON.stringify({ error: { code: 'store_unavailable', message: '配置存储不可用' } }), + { status: 503, headers: { 'Content-Type': 'application/json' } } + ))); + + await expect(apiFetch('/api/v1/status')).rejects.toMatchObject({ + code: 'store_unavailable', + message: '配置存储不可用', + status: 503 + } satisfies Partial); + }); +}); +``` + +- [ ] **Step 2: Implement `http.ts`** + +Requirements: + +- Read bearer token from session storage key `moonbridge.console.token`, fallback local storage only when user opted in. +- Add `Authorization: Bearer ` when token exists. +- Parse JSON response. +- Normalize errors from `{ error: { code, message } }`. +- Normalize OpenAI-style `{ error: { type, code, message } }`. +- Throw `ApiError` with `status`, `code`, `message`, and raw body. + +- [ ] **Step 3: Define DTOs** + +In `types.ts`, define types for: + +- `Paginated` +- `StatusResponse` +- `ProviderSummary`, `ProviderDetail`, `Offer` +- `ModelSummary`, `ModelDetail` +- `RouteSummary`, `RouteDetail` +- `ChangeRow` +- `StatsSummary` +- `SessionInfo` +- `DefaultsSettings` +- `WebSearchSettings` + +Match field names from `internal/service/api/*.go`. + +- [ ] **Step 4: Implement management client** + +In `management.ts`, export functions: + +- `getStatus` +- `listProviders`, `getProvider`, `putProvider`, `patchProvider`, `deleteProvider`, `testProvider` +- `listModels`, `getModel`, `putModel`, `deleteModel` +- `listRoutes`, `getRoute`, `putRoute`, `deleteRoute` +- `getChanges`, `applyChanges`, `discardChanges` +- `getEffectiveConfig`, `validateConfig`, `importConfig`, `exportConfig` +- `getDefaults`, `putDefaults` +- `getWebSearch`, `putWebSearch` +- `listExtensions`, `getExtension`, `putExtension` +- `getStatsSummary`, `getSessions` + +- [ ] **Step 5: Implement AuthGate** + +`AuthGate` should: + +- Render children normally until a query reports 401. +- Show token entry form on 401. +- Store token in session storage by default. +- Provide explicit remember checkbox for local storage. +- Retry queries after saving token. + +- [ ] **Step 6: Run tests** + +Run: + +```bash +pnpm --dir webui test +``` + +Expected: PASS. + +- [ ] **Step 7: Commit** + +```bash +git add webui/src/rpc webui/src/components +git commit -m "feat: add console rpc client and auth gate" +``` + +--- + +## Task 4: Implement Overview and Read-Only Resource Pages + +**Files:** + +- Create: `webui/src/features/overview/OverviewPage.tsx` +- Create: `webui/src/features/models/ModelsPage.tsx` +- Create: `webui/src/features/providers/ProvidersPage.tsx` +- Create: `webui/src/features/routes/RoutesPage.tsx` +- Create: `webui/src/components/ResourceTable.tsx` +- Modify: `webui/src/app/routes.tsx` +- Test: feature tests beside each page + +- [ ] **Step 1: Write failing overview test** + +Test expected cards: + +- mode +- provider count +- route count +- pending changes +- store unavailable state on 503 `store_unavailable` + +- [ ] **Step 2: Implement reusable query keys** + +Create `webui/src/rpc/queryKeys.ts` with stable keys: + +```ts +export const queryKeys = { + status: ['status'] as const, + providers: (page: { limit: number; offset: number }) => ['providers', page] as const, + models: (page: { limit: number; offset: number }) => ['models', page] as const, + routes: (page: { limit: number; offset: number }) => ['routes', page] as const, + changes: ['changes'] as const, + statsSummary: ['stats', 'summary'] as const, + sessions: ['sessions'] as const +}; +``` + +- [ ] **Step 3: Implement OverviewPage** + +Use TanStack Query for: + +- `getStatus` +- `getStatsSummary` +- `getSessions` +- `getChanges` + +Use Motion for card entrance and change-count updates. + +- [ ] **Step 4: Implement read-only tables** + +Use `ResourceTable` for: + +- Models list. +- Providers list. +- Routes list. + +Providers table should label protocol and show test action only for `anthropic`. + +- [ ] **Step 5: Wire routes** + +Routes: + +- `/console/` +- `/console/models` +- `/console/providers` +- `/console/routes` + +- [ ] **Step 6: Run tests and build** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +``` + +Expected: PASS. + +- [ ] **Step 7: Commit** + +```bash +git add webui/src +git commit -m "feat: add console overview and resource tables" +``` + +--- + +## Task 5: Add Visual CRUD Forms and Change Queue + +**Files:** + +- Create: `webui/src/components/ChangeQueueDrawer.tsx` +- Create: `webui/src/features/changes/ChangesPage.tsx` +- Modify: `webui/src/features/models/ModelsPage.tsx` +- Modify: `webui/src/features/providers/ProvidersPage.tsx` +- Modify: `webui/src/features/routes/RoutesPage.tsx` +- Modify: `webui/src/app/App.tsx` +- Test: form and change queue tests + +- [ ] **Step 1: Write failing change queue test** + +Expected behavior: + +- Lists pending changes from `GET /api/v1/changes`. +- Apply calls `POST /api/v1/changes/apply`. +- Discard calls `POST /api/v1/changes/discard`. +- After apply/discard, invalidates config-derived queries. + +- [ ] **Step 2: Implement ChangeQueueDrawer** + +Requirements: + +- Visible from app shell with pending count badge. +- Shows resource, action, target, before/after summary. +- Apply and discard buttons. +- Motion entry/exit animation. +- Snackbar feedback. + +- [ ] **Step 3: Add visual model form** + +Model fields: + +- slug +- display name +- description +- context window +- max output tokens + +Submit: + +- `PUT /api/v1/models/{slug}` +- Show "staged, not active" message. + +- [ ] **Step 4: Add visual provider form** + +Provider fields: + +- key +- base_url +- api_key +- version +- protocol +- user_agent + +Submit: + +- new provider: `PUT /api/v1/providers/{key}` +- edit provider: `PATCH /api/v1/providers/{key}` +- preserve `"******"` for masked secrets. + +- [ ] **Step 5: Add offer editor inside provider detail** + +Offer fields: + +- model +- upstream_name +- priority +- input_price +- output_price +- cache_write +- cache_read + +Use `POST/PATCH/DELETE /api/v1/providers/{key}/offers`. + +- [ ] **Step 6: Add route form** + +Route fields: + +- alias +- model +- provider +- display_name +- context_window + +Use `PUT /api/v1/routes/{alias}`. + +- [ ] **Step 7: Run tests and build** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +``` + +Expected: PASS. + +- [ ] **Step 8: Commit** + +```bash +git add webui/src +git commit -m "feat: add visual config editing and change queue" +``` + +--- + +## Task 6: Add Config Generator, YAML Preview, Import, Apply, and Export + +**Files:** + +- Create: `webui/src/rpc/configGenerator.ts` +- Create: `webui/src/rpc/configGenerator.test.ts` +- Create: `webui/src/features/config/ConfigPage.tsx` +- Create: `webui/src/features/config/ConfigGenerator.tsx` +- Modify: `webui/src/app/routes.tsx` +- Test: config feature tests + +- [ ] **Step 1: Write failing config generator tests** + +Create tests for: + +- Transform mode with one provider, one model, one offer, one route, SQLite persistence. +- CaptureResponse mode with proxy response base URL/API key/model. +- CaptureAnthropic mode with proxy anthropic base URL/API key/version/model. + +Each test should: + +1. Generate YAML. +2. Assert key YAML sections exist. +3. Send generated YAML to a mocked `validateConfig` call in component tests. + +- [ ] **Step 2: Implement generator state types** + +Define: + +- `GeneratedConfigDraft` +- `GeneratedProvider` +- `GeneratedModel` +- `GeneratedOffer` +- `GeneratedRoute` +- `GeneratedExtension` + +Keep names close to `internal/config/config_loader.go` YAML fields. + +- [ ] **Step 3: Implement YAML generation** + +Use the `yaml` npm package. + +Output rules: + +- Omit empty optional fields. +- Include `mode`, `server`, `persistence`, `defaults`, `cache`, `models`, `providers`, `routes`, and `proxy` as appropriate. +- Default persistence active provider to `db_sqlite`. +- Default cache to the same practical defaults from `config.example.yml`. +- Preserve user-entered secrets in generated YAML preview until validation/import. + +- [ ] **Step 4: Implement ConfigGenerator UI** + +Wizard sections: + +- Mode +- Server and auth +- Persistence +- Providers +- Models +- Offers +- Routes +- Cache and web search +- Extensions +- Preview and validate + +Use visual controls, not raw YAML as the primary input. + +- [ ] **Step 5: Implement YAML apply flow** + +In `ConfigPage`: + +- Preview generated YAML. +- Validate with `POST /api/v1/config/validate`. +- Import with `POST /api/v1/config/import`. +- Show generated pending changes. +- Link to change queue. +- Apply via existing `applyChanges`. + +- [ ] **Step 6: Implement raw YAML import/export** + +Raw import: + +- Textarea for YAML. +- Validate. +- Import to staged changes. + +Export: + +- Masked export by default. +- Secret export requires explicit checkbox and sends `X-Confirm-Secrets: true`. + +- [ ] **Step 7: Run tests and build** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +``` + +Expected: PASS. + +- [ ] **Step 8: Commit** + +```bash +git add webui/src +git commit -m "feat: add config generation and apply flow" +``` + +--- + +## Task 7: Add Extensions, Settings, and RPC Smoke Test Pages + +**Files:** + +- Create: `webui/src/features/extensions/ExtensionsPage.tsx` +- Create: `webui/src/features/rpcTest/RpcTestPage.tsx` +- Create: `webui/src/rpc/responses.ts` +- Modify: `webui/src/app/routes.tsx` +- Test: extensions and RPC tests + +- [ ] **Step 1: Implement Extensions page** + +Requirements: + +- List extensions. +- Show extension detail JSON. +- Safe JSON editor for `PUT /api/v1/extensions/{name}`. +- Make clear that changes are staged. + +- [ ] **Step 2: Implement Defaults/Web Search settings** + +Either add a Settings page or sections inside Config: + +- `GET/PUT /api/v1/defaults` +- `GET/PUT /api/v1/web-search` + +- [ ] **Step 3: Implement Responses RPC client** + +`responses.ts`: + +- `createResponse(request)` +- optional `streamResponse(request, onEvent)` +- Normalize OpenAI-style errors. + +- [ ] **Step 4: Implement RPC Test page** + +Fields: + +- model/route select +- input text +- max output tokens +- temperature +- stream toggle + +Output: + +- request JSON +- response JSON +- latency +- error object +- event list for stream mode if implemented + +- [ ] **Step 5: Run tests and build** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +``` + +Expected: PASS. + +- [ ] **Step 6: Commit** + +```bash +git add webui/src +git commit -m "feat: add extensions settings and rpc test" +``` + +--- + +## Task 8: Wire Frontend Build Into Go Embed and Developer Commands + +**Files:** + +- Modify: `Makefile` +- Modify: `internal/service/webui/embed.go` +- Modify: `internal/service/webui/dist/index.html` or replace placeholder strategy +- Modify: `.gitignore` +- Modify: `docs/DEVELOPMENT.md` +- Modify: `docs/api.md` + +- [ ] **Step 1: Decide final embed artifact flow** + +Use one of these: + +- Preferred: copy `webui/dist` into `internal/service/webui/dist` during `make webui-embed`. +- Alternative: embed `../../webui/dist` is not allowed by `go:embed`, so do not use it. + +- [ ] **Step 2: Add Makefile targets** + +Add: + +```make +webui-install: + pnpm --dir webui install + +webui-test: + pnpm --dir webui test + +webui-build: + pnpm --dir webui build + rm -rf internal/service/webui/dist + mkdir -p internal/service/webui/dist + cp -R webui/dist/. internal/service/webui/dist/ + +build: webui-build + CGO_ENABLED=0 go build ./... +``` + +If changing `build` is too disruptive, add `build-with-webui` and document it. Preserve existing Cloudflare worker `package.json` behavior. + +- [ ] **Step 3: Update `.gitignore`** + +Ignore: + +- `webui/node_modules/` +- `webui/dist/` +- `webui/playwright-report/` +- `webui/test-results/` + +Do not ignore `internal/service/webui/dist` if embedded assets are committed. + +- [ ] **Step 4: Update docs** + +`docs/DEVELOPMENT.md`: + +- install dependencies +- run frontend dev server +- run backend +- build embedded console +- test commands + +`docs/api.md`: + +- mention `/console/` +- explain management API requires persistence/store +- explain generated/imported config must be applied through change queue + +- [ ] **Step 5: Run full verification** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +env GOCACHE=/tmp/moonbridge-go-build GOMODCACHE=/tmp/moonbridge-go-mod go test ./... +``` + +Expected: all PASS. + +- [ ] **Step 6: Commit** + +```bash +git add Makefile .gitignore docs webui internal/service/webui +git commit -m "build: wire console frontend into moonbridge" +``` + +--- + +## Task 9: End-to-End Verification and Polish + +**Files:** + +- Create: `webui/e2e/console.spec.ts` +- Create: `webui/playwright.config.ts` +- Modify: `webui/src/**/*.tsx` as needed for accessibility and responsive fixes + +- [ ] **Step 1: Add Playwright smoke test** + +Test: + +- Console loads at `/console/`. +- Default dark mode is active. +- Theme toggle switches to light mode. +- Overview cards render from mocked or test backend data. +- Config generator can produce YAML and call validate/import. +- Change queue apply button calls apply endpoint. + +- [ ] **Step 2: Run Playwright** + +Run: + +```bash +pnpm --dir webui e2e +``` + +Expected: PASS. + +- [ ] **Step 3: Manual responsive check** + +Run frontend dev server and inspect: + +- desktop 1440px +- tablet 900px +- mobile 390px + +Check: + +- no text overlap +- navigation rail becomes drawer/bottom-friendly layout +- tables scroll instead of breaking layout +- dialogs fit small screens + +- [ ] **Step 4: Final full verification** + +Run: + +```bash +pnpm --dir webui test +pnpm --dir webui build +env GOCACHE=/tmp/moonbridge-go-build GOMODCACHE=/tmp/moonbridge-go-mod go test ./... +``` + +Expected: all PASS. + +- [ ] **Step 5: Commit** + +```bash +git add webui docs internal/service/webui +git commit -m "test: add console e2e coverage" +``` + +--- + +## Implementation Notes + +- Use existing staged-change APIs. Do not introduce a separate frontend-only config state that bypasses `store.StageChange`. +- Provider test is currently Anthropic-specific. Hide or label it for other protocols. +- `/api/v1/logs` currently returns an empty array. Do not build a prominent logs page until backend log buffering exists. +- Generated config must not become active until validate -> import -> review changes -> apply completes. +- The frontend should distinguish active config from pending config in all screens. +- Keep frontend files focused. If a page exceeds roughly 250-300 lines, split forms, table columns, and hooks into sibling files. +- Avoid a one-hue UI. `#7AA7A2` is the primary seed, but status, warning, error, and neutral surfaces need distinct token colors. From 1cb845ea4cef6e270a009fd1e0771e2eda7ed2e7 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 16:48:54 +0800 Subject: [PATCH 04/78] chore: ignore local worktrees --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dfaec113..5b4bf274 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ __pycache__/ # Agent / AI assistant local files .planning/ .superpowers/ +.worktrees/ helloagents/ AGENTS.md CLAUDE.md From 12ef2004027ead66f9bda56367a8ed534ad937f5 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 16:57:38 +0800 Subject: [PATCH 05/78] feat: serve embedded console assets --- internal/service/server/server.go | 2 + internal/service/server/server_test.go | 30 +++++++- internal/service/webui/dist/assets/app.js | 1 + internal/service/webui/dist/index.html | 12 ++++ internal/service/webui/embed.go | 70 ++++++++++++++++++ internal/service/webui/embed_test.go | 86 +++++++++++++++++++++++ 6 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 internal/service/webui/dist/assets/app.js create mode 100644 internal/service/webui/dist/index.html create mode 100644 internal/service/webui/embed.go create mode 100644 internal/service/webui/embed_test.go diff --git a/internal/service/server/server.go b/internal/service/server/server.go index 4c792212..a0d43420 100644 --- a/internal/service/server/server.go +++ b/internal/service/server/server.go @@ -21,6 +21,7 @@ import ( "moonbridge/internal/service/runtime" "moonbridge/internal/service/stats" "moonbridge/internal/service/store" + "moonbridge/internal/service/webui" "moonbridge/internal/service/server/session" "moonbridge/internal/service/server/trace" @@ -153,6 +154,7 @@ func New(cfg Config) *Server { s.mux.HandleFunc("/responses", s.handleResponses) s.mux.HandleFunc("/v1/models", s.handleModels) s.mux.HandleFunc("/models", s.handleModels) + s.mux.Handle("/console/", webui.Embedded()) s.registerPluginRoutes() if cfg.Runtime != nil && cfg.Store != nil { apiRouter := api.NewRouter(s.store, s.runtime, s.stats, s.pluginRegistry, s) diff --git a/internal/service/server/server_test.go b/internal/service/server/server_test.go index bd6cd39c..89340722 100644 --- a/internal/service/server/server_test.go +++ b/internal/service/server/server_test.go @@ -13,13 +13,13 @@ import ( "strings" "testing" + "moonbridge/internal/config" "moonbridge/internal/extension/codex" deepseekv4 "moonbridge/internal/extension/deepseek_v4" "moonbridge/internal/extension/plugin" - "moonbridge/internal/config" + "moonbridge/internal/format" "moonbridge/internal/logger" "moonbridge/internal/protocol/openai" - "moonbridge/internal/format" "moonbridge/internal/service/provider" "moonbridge/internal/service/server" "moonbridge/internal/service/stats" @@ -82,7 +82,6 @@ func (provider providerFunc) StreamMessage(ctx context.Context, req any) (<-chan return provider.stream(ctx, req) } - type roundTripFunc func(*http.Request) (*http.Response, error) func (fn roundTripFunc) RoundTrip(request *http.Request) (*http.Response, error) { @@ -111,6 +110,31 @@ func registryWithCompletionCapture(t *testing.T, p *captureCompletionPlugin) *pl return registry } +func TestServerServesConsoleWithoutReplacingOpenAIRoutes(t *testing.T) { + handler := server.New(server.Config{}) + + console := httptest.NewRecorder() + handler.ServeHTTP(console, httptest.NewRequest(http.MethodGet, "/console/providers/openai", nil)) + if console.Code != http.StatusOK { + t.Fatalf("/console status = %d, body = %s", console.Code, console.Body.String()) + } + if body := console.Body.String(); !strings.Contains(body, `
`) { + t.Fatalf("/console body does not contain placeholder index: %s", body) + } + + models := httptest.NewRecorder() + handler.ServeHTTP(models, httptest.NewRequest(http.MethodPost, "/v1/models", nil)) + if models.Code != http.StatusMethodNotAllowed { + t.Fatalf("/v1/models POST status = %d, body = %s", models.Code, models.Body.String()) + } + + responses := httptest.NewRecorder() + handler.ServeHTTP(responses, httptest.NewRequest(http.MethodGet, "/v1/responses", nil)) + if responses.Code != http.StatusMethodNotAllowed { + t.Fatalf("/v1/responses GET status = %d, body = %s", responses.Code, responses.Body.String()) + } +} + func TestResponsesHandlerReturnsOpenAIResponse(t *testing.T) { t.Skip("needs adapter to new dispatch architecture: requires ProviderMgr config") provider := &fakeProvider{} diff --git a/internal/service/webui/dist/assets/app.js b/internal/service/webui/dist/assets/app.js new file mode 100644 index 00000000..ed06975b --- /dev/null +++ b/internal/service/webui/dist/assets/app.js @@ -0,0 +1 @@ +console.log("Moon Bridge console placeholder"); diff --git a/internal/service/webui/dist/index.html b/internal/service/webui/dist/index.html new file mode 100644 index 00000000..90a388f0 --- /dev/null +++ b/internal/service/webui/dist/index.html @@ -0,0 +1,12 @@ + + + + + + Moon Bridge Console + + +
+ + + diff --git a/internal/service/webui/embed.go b/internal/service/webui/embed.go new file mode 100644 index 00000000..09b17a4e --- /dev/null +++ b/internal/service/webui/embed.go @@ -0,0 +1,70 @@ +package webui + +import ( + "embed" + "io/fs" + "mime" + "net/http" + "path" + "strings" +) + +//go:embed dist +var embedded embed.FS + +// Embedded returns the production console handler backed by embedded assets. +func Embedded() http.Handler { + dist, err := fs.Sub(embedded, "dist") + if err != nil { + panic(err) + } + return NewHandler(dist) +} + +// NewHandler serves a console SPA rooted at /console/. +func NewHandler(content fs.FS) http.Handler { + return &handler{content: content} +} + +type handler struct { + content fs.FS +} + +func (h *handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { + name := strings.TrimPrefix(request.URL.Path, "/console/") + name = strings.TrimPrefix(name, "/") + if name == "" { + h.serveFile(writer, request, "index.html") + return + } + + name = path.Clean(name) + if name == "." || strings.HasPrefix(name, "../") || !fs.ValidPath(name) { + http.NotFound(writer, request) + return + } + + if info, err := fs.Stat(h.content, name); err == nil && !info.IsDir() { + h.serveFile(writer, request, name) + return + } + + h.serveFile(writer, request, "index.html") +} + +func (h *handler) serveFile(writer http.ResponseWriter, request *http.Request, name string) { + data, err := fs.ReadFile(h.content, name) + if err != nil { + http.NotFound(writer, request) + return + } + if contentType := mime.TypeByExtension(path.Ext(name)); contentType != "" { + writer.Header().Set("Content-Type", contentType) + } else { + writer.Header().Set("Content-Type", http.DetectContentType(data)) + } + if request.Method == http.MethodHead { + return + } + _, _ = writer.Write(data) +} diff --git a/internal/service/webui/embed_test.go b/internal/service/webui/embed_test.go new file mode 100644 index 00000000..57aa1792 --- /dev/null +++ b/internal/service/webui/embed_test.go @@ -0,0 +1,86 @@ +package webui_test + +import ( + "io/fs" + "net/http" + "net/http/httptest" + "strings" + "testing" + "testing/fstest" + + "moonbridge/internal/service/webui" +) + +func TestHandlerServesConsoleIndex(t *testing.T) { + handler := webui.NewHandler(testFS()) + + recorder := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, "/console/", nil) + handler.ServeHTTP(recorder, request) + + if recorder.Code != http.StatusOK { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + if body := recorder.Body.String(); !strings.Contains(body, `
`) { + t.Fatalf("body does not contain index marker: %s", body) + } + if contentType := recorder.Header().Get("Content-Type"); !strings.Contains(contentType, "text/html") { + t.Fatalf("Content-Type = %q, want text/html", contentType) + } +} + +func TestHandlerFallsBackToIndexForClientRoute(t *testing.T) { + handler := webui.NewHandler(testFS()) + + recorder := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, "/console/providers/openai", nil) + handler.ServeHTTP(recorder, request) + + if recorder.Code != http.StatusOK { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + if body := recorder.Body.String(); !strings.Contains(body, "Moon Bridge Console") { + t.Fatalf("body does not contain index title: %s", body) + } +} + +func TestHandlerServesStaticAsset(t *testing.T) { + handler := webui.NewHandler(testFS()) + + recorder := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, "/console/assets/app.js", nil) + handler.ServeHTTP(recorder, request) + + if recorder.Code != http.StatusOK { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + if body := recorder.Body.String(); body != `console.log("console asset");` { + t.Fatalf("body = %q", body) + } + if contentType := recorder.Header().Get("Content-Type"); !strings.Contains(contentType, "javascript") { + t.Fatalf("Content-Type = %q, want javascript", contentType) + } +} + +func TestEmbeddedReturnsHandler(t *testing.T) { + handler := webui.Embedded() + + recorder := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, "/console/", nil) + handler.ServeHTTP(recorder, request) + + if recorder.Code != http.StatusOK { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } +} + +func testFS() fs.FS { + return fstest.MapFS{ + "index.html": &fstest.MapFile{ + Data: []byte(`Moon Bridge Console
`), + }, + "assets/app.js": &fstest.MapFile{ + Data: []byte(`console.log("console asset");`), + }, + } +} From 31d01a6b0c8cf14e75e2e58ff23808c92c569018 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 17:19:53 +0800 Subject: [PATCH 06/78] feat: scaffold console web app --- .gitignore | 8 + webui/index.html | 12 + webui/package-lock.json | 3372 ++++++++++++++++++++++++ webui/package.json | 37 + webui/src/app/App.tsx | 307 +++ webui/src/app/queryClient.ts | 11 + webui/src/app/routes.tsx | 44 + webui/src/main.tsx | 23 + webui/src/test/setup.ts | 26 + webui/src/theme/ThemeProvider.test.tsx | 72 + webui/src/theme/ThemeProvider.tsx | 77 + webui/src/theme/tokens.ts | 46 + webui/tsconfig.json | 22 + webui/tsconfig.node.json | 11 + webui/vite.config.ts | 25 + 15 files changed, 4093 insertions(+) create mode 100644 webui/index.html create mode 100644 webui/package-lock.json create mode 100644 webui/package.json create mode 100644 webui/src/app/App.tsx create mode 100644 webui/src/app/queryClient.ts create mode 100644 webui/src/app/routes.tsx create mode 100644 webui/src/main.tsx create mode 100644 webui/src/test/setup.ts create mode 100644 webui/src/theme/ThemeProvider.test.tsx create mode 100644 webui/src/theme/ThemeProvider.tsx create mode 100644 webui/src/theme/tokens.ts create mode 100644 webui/tsconfig.json create mode 100644 webui/tsconfig.node.json create mode 100644 webui/vite.config.ts diff --git a/.gitignore b/.gitignore index 5b4bf274..06180df9 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,14 @@ node_modules/ build/ .wrangler/ # WebUI build artifacts (source in webui/) +webui/node_modules/ +webui/dist/ +webui/coverage/ +webui/.vite/ +webui/.vitest/ +webui/*.tsbuildinfo +webui/test-results/ +webui/playwright-report/ # Wrangler dev vars .dev.vars diff --git a/webui/index.html b/webui/index.html new file mode 100644 index 00000000..372f4251 --- /dev/null +++ b/webui/index.html @@ -0,0 +1,12 @@ + + + + + + Moon Bridge Console + + +
+ + + diff --git a/webui/package-lock.json b/webui/package-lock.json new file mode 100644 index 00000000..cc4934fe --- /dev/null +++ b/webui/package-lock.json @@ -0,0 +1,3372 @@ +{ + "name": "@moonbridge/console", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@moonbridge/console", + "version": "0.1.0", + "dependencies": { + "@material/web": "^2.4.0", + "@tanstack/react-query": "^5.83.0", + "@tanstack/react-table": "^8.21.3", + "motion": "^12.23.6", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "react-router-dom": "^7.7.0", + "yaml": "^2.8.0" + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.3.0", + "@testing-library/user-event": "^14.6.1", + "@types/node": "^24.0.15", + "@types/react": "^19.1.8", + "@types/react-dom": "^19.1.6", + "@vitejs/plugin-react": "^4.6.0", + "jsdom": "^26.1.0", + "typescript": "^5.8.3", + "vite": "^7.0.5", + "vitest": "^3.2.4" + } + }, + "node_modules/@adobe/css-tools": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz", + "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.3.tgz", + "integrity": "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", + "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", + "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.6.0.tgz", + "integrity": "sha512-VHb0ALPMTlgKjM6yIxxoQNnpKyUKLD04VzeQdsiXkMqkvYlAHxq9glGLmgbb889/1GsohSOAjvQYoiBppXFqrQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@lit/reactive-element": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.1.2.tgz", + "integrity": "sha512-pbCDiVMnne1lYUIaYNN5wrwQXDtHaYtg7YEFPeW+hws6U47WeFvISGUWekPGKWOP1ygrs0ef0o1VJMk1exos5A==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.5.0" + } + }, + "node_modules/@material/web": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@material/web/-/web-2.4.1.tgz", + "integrity": "sha512-0sk9t25acJ72Qv3r0n9r0lgDbPaAKnpm0p+QmEAAwYyZomHxuVbgrrAdtNXaRm7jFyGh+WsTr8bhtvCnpPRFjw==", + "license": "Apache-2.0", + "workspaces": [ + "catalog" + ], + "dependencies": { + "lit": "^2.8.0 || ^3.0.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.4.tgz", + "integrity": "sha512-F5QXMSiFebS9hKZj02XhWLLnRpJ3B3AROP0tWbFBSj+6kCbg5m9j5JoHKd4mmSVy5mS/IMQloYgYxCuJC0fxEQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.4.tgz", + "integrity": "sha512-GxxTKApUpzRhof7poWvCJHRF51C67u1R7D6DiluBE8wKU1u5GWE8t+v81JvJYtbawoBFX1hLv5Ei4eVjkWokaw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.4.tgz", + "integrity": "sha512-tua0TaJxMOB1R0V0RS1jFZ/RpURFDJIOR2A6jWwQeawuFyS4gBW+rntLRaQd0EQ4bd6Vp44Z2rXW+YYDBsj6IA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.4.tgz", + "integrity": "sha512-CSKq7MsP+5PFIcydhAiR1K0UhEI1A2jWXVKHPCBZ151yOutENwvnPocgVHkivu2kviURtCEB6zUQw0vs8RrhMg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.4.tgz", + "integrity": "sha512-+O8OkVdyvXMtJEciu2wS/pzm1IxntEEQx3z5TAVy4l32G0etZn+RsA48ARRrFm6Ri8fvqPQfgrvNxSjKAbnd3g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.4.tgz", + "integrity": "sha512-Iw3oMskH3AfNuhU0MSN7vNbdi4me/NiYo2azqPz/Le16zHSa+3RRmliCMWWQmh4lcndccU40xcJuTYJZxNo/lw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.4.tgz", + "integrity": "sha512-EIPRXTVQpHyF8WOo219AD2yEltPehLTcTMz2fn6JsatLYSzQf00hj3rulF+yauOlF9/FtM2WpkT/hJh/KJFGhA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.4.tgz", + "integrity": "sha512-J3Yh9PzzF1Ovah2At+lHiGQdsYgArxBbXv/zHfSyaiFQEqvNv7DcW98pCrmdjCZBrqBiKrKKe2V+aaSGWuBe/w==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.4.tgz", + "integrity": "sha512-BFDEZMYfUvLn37ONE1yMBojPxnMlTFsdyNoqncT0qFq1mAfllL+ATMMJd8TeuVMiX84s1KbcxcZbXInmcO2mRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.4.tgz", + "integrity": "sha512-pc9EYOSlOgdQ2uPl1o9PF6/kLSgaUosia7gOuS8mB69IxJvlclko1MECXysjs5ryez1/5zjYqx3+xYU0TU6R1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.4.tgz", + "integrity": "sha512-NxnomyxYerDh5n4iLrNa+sH+Z+U4BMEE46V2PgQ/hoB909i8gV1M5wPojWg9fk1jWpO3IQnOs20K4wyZuFLEFQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.4.tgz", + "integrity": "sha512-nbJnQ8a3z1mtmrwImCYhc6BGpThAyYVRQxw9uKSKG4wR6aAYno9sVjJ0zaZcW9BPJX1GbrDPf+SvdWjgTuDmnw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.4.tgz", + "integrity": "sha512-2EU6acNrQLd8tYvo/LXW535wupT3m6fo7HKo6lr7ktQoItxTyOL1ZCR/GfGCuXl2vR+zmfI6eRXkSemafv+iVg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.4.tgz", + "integrity": "sha512-WeBtoMuaMxiiIrO2IYP3xs6GMWkJP2C0EoT8beTLkUPmzV1i/UcOSVw1d5r9KBODtHKilG5yFxsGRnBbK3wJ4A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.4.tgz", + "integrity": "sha512-FJHFfqpKUI3A10WrWKiFbBZ7yVbGT4q4B5o1qKFFojqpaYoh9LrQgqWCmmcxQzVSXYtyB5bzkXrYzlHTs21MYA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.4.tgz", + "integrity": "sha512-mcEl6CUT5IAUmQf1m9FYSmVqCJlpQ8r8eyftFUHG8i9OhY7BkBXSUdnLH5DOf0wCOjcP9v/QO93zpmF1SptCCw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.4.tgz", + "integrity": "sha512-ynt3JxVd2w2buzoKDWIyiV1pJW93xlQic1THVLXilz429oijRpSHivZAgp65KBu+cMcgf1eVVjdnTLvPxgCuoQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.4.tgz", + "integrity": "sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.4.tgz", + "integrity": "sha512-+qfSY27qIrFfI/Hom04KYFw3GKZSGU4lXus51wsb5EuySfFlWRwjkKWoE9emgRw/ukoT4Udsj4W/+xxG8VbPKg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.4.tgz", + "integrity": "sha512-VpTfOPHgVXEBeeR8hZ2O0F3aSso+JDWqTWmTmzcQKted54IAdUVbxE+j/MVxUsKa8L20HJhv3vUezVPoquqWjA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.4.tgz", + "integrity": "sha512-IPOsh5aRYuLv/nkU51X10Bf75Bsf6+gZdx1X+QP5QM6lIJFHHqbHLG0uJn/hWthzo13UAc2umiUorqZy3axoZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.4.tgz", + "integrity": "sha512-4QzE9E81OohJ/HKzHhsqU+zcYYojVOXlFMs1DdyMT6qXl/niOH7AVElmmEdUNHHS/oRkc++d5k6Vy85zFs0DEw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.4.tgz", + "integrity": "sha512-zTPgT1YuHHcd+Tmx7h8aml0FWFVelV5N54oHow9SLj+GfoDy/huQ+UV396N/C7KpMDMiPspRktzM1/0r1usYEA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.4.tgz", + "integrity": "sha512-DRS4G7mi9lJxqEDezIkKCaUIKCrLUUDCUaCsTPCi/rtqaC6D/jjwslMQyiDU50Ka0JKpeXeRBFBAXwArY52vBw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.4.tgz", + "integrity": "sha512-QVTUovf40zgTqlFVrKA1uXMVvU2QWEFWfAH8Wdc48IxLvrJMQVMBRjuQyUpzZCDkakImib9eVazbWlC6ksWtJw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tanstack/query-core": { + "version": "5.100.14", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.100.14.tgz", + "integrity": "sha512-5X41dGpxgeaHISCRW2oYwcSycZeULZzAunaudXT9ov1KOTj9xwt0CH6hbwqP1/z74ZWF7rYFnDpyYH07XFcZew==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.100.14", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.100.14.tgz", + "integrity": "sha512-oOr6aRdSFEwWhzxEkD/9ZcItM3+LjBSkeVmadWKwUssAHTsqd/7bOjWrX4AbvEkoEhgAxzN0Xk6H/aYzXiYBAw==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.100.14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/@tanstack/react-table": { + "version": "8.21.3", + "resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.21.3.tgz", + "integrity": "sha512-5nNMTSETP4ykGegmVkhjcS8tTLW6Vl4axfEGQN3v0zdHYbK4UfoqfPChclTrJ4EoK9QynqAu9oUf8VEmrpZ5Ww==", + "license": "MIT", + "dependencies": { + "@tanstack/table-core": "8.21.3" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/@tanstack/table-core": { + "version": "8.21.3", + "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.21.3.tgz", + "integrity": "sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@testing-library/dom": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz", + "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "picocolors": "1.1.1", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/react": { + "version": "16.3.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.2.tgz", + "integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.6.1", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz", + "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.12.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.4.tgz", + "integrity": "sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.15", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.15.tgz", + "integrity": "sha512-eRwcGNHve+E8qtEQSSRl6urh+rFop4v8gm6O8rGv25CodbvFdLjA1vVQ1KkiFE0w0UPOnb8tDiFKL5lp0rtY5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/@vitest/expect": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", + "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.4", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", + "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.4", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.32", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.32.tgz", + "integrity": "sha512-wbPvpyjJPC0zdfdKXxqEL3Ea+bOMD/87X4lftiJkkaBiuG6ALQy1SLmEd7BSmVCuwCQsBrCamgBoLyfFDD1EPg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001793", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz", + "integrity": "sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/electron-to-chromium": { + "version": "1.5.361", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.361.tgz", + "integrity": "sha512-Q6Hts7N9FnJc5LeGRINFvLhCI9xZmNtTDe5ZbcVezQz7cU4a8Aua3GH1b8J2XY8Al9PF+OCwYqhgsOOheMdvkA==", + "dev": true, + "license": "ISC" + }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/framer-motion": { + "version": "12.40.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.40.0.tgz", + "integrity": "sha512-uaBd3qC1v3KQqBEjwTUd183K6PbS+j0yR9w9VmEOLWA/tnUcSn8Xa3uck7t4dgpDoUss8xQTcj8W2L07lrnLFg==", + "license": "MIT", + "dependencies": { + "motion-dom": "^12.40.0", + "motion-utils": "^12.39.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lit": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.3.3.tgz", + "integrity": "sha512-fycuvZg/hkpozL00lm1pEJH5nN/lr9ZXd6mJI2HSN4+Bzc+LDNdEApJ6HFbPkdFNHLvOplIIuJvxkS4XUxqirw==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit/reactive-element": "^2.1.0", + "lit-element": "^4.2.0", + "lit-html": "^3.3.0" + } + }, + "node_modules/lit-element": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.2.2.tgz", + "integrity": "sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.5.0", + "@lit/reactive-element": "^2.1.0", + "lit-html": "^3.3.0" + } + }, + "node_modules/lit-html": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.3.3.tgz", + "integrity": "sha512-el8M6jK2o3RXBnrSHX3ZKrsN8zEV63pSExTO1wYJz7QndGYZ8353e2a5PPX+qHe2aGayfnchQmkAojaWAREOIA==", + "license": "BSD-3-Clause", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/motion": { + "version": "12.40.0", + "resolved": "https://registry.npmjs.org/motion/-/motion-12.40.0.tgz", + "integrity": "sha512-yjrHUrBFW6kQvjJwRsoiPSAhC5tRwRqNGJWmiJ4CrGnbKp0V88AdzkhBmDoqIsIPfarOe0Uddd37Xq43/gIocA==", + "license": "MIT", + "dependencies": { + "framer-motion": "^12.40.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion-dom": { + "version": "12.40.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.40.0.tgz", + "integrity": "sha512-HxU3ZaBwNPVQUBQf1xxgq+7JrPNZvjLVxgbpEZL7RrWJnsxOf0/OM+yrHG9ogLQ31Do/r57Oz2gQWPK+6q62mg==", + "license": "MIT", + "dependencies": { + "motion-utils": "^12.39.0" + } + }, + "node_modules/motion-utils": { + "version": "12.39.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.39.0.tgz", + "integrity": "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.46", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.46.tgz", + "integrity": "sha512-GYVXHE2KnrzAfsAjl4uP++evGFCrAU1jta4ubEjIG7YWt/64Gqv66a30yKwWczVjA6j3bM4nBwH7Pk1JmDHaxQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/nwsapi": { + "version": "2.2.23", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", + "integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", + "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.6.tgz", + "integrity": "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.6" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-router": { + "version": "7.15.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.15.1.tgz", + "integrity": "sha512-R8rl9HhgikFYoPJymnUtPXWbnDb3oget6lQnfIoupbt61aT9aOhRkDsY2XRhZRyX1Z/8a5sL74fXmFNm3NRK5A==", + "license": "MIT", + "dependencies": { + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.15.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.15.1.tgz", + "integrity": "sha512-AzF62gjY6U9rkMq4RfP/r2EVtQ7DMfNMjyOp/flLTCrtRylLiK4wT4pSq6O8rOXZ2eXdZYJPEYe+ifomiv+Igg==", + "license": "MIT", + "dependencies": { + "react-router": "7.15.1" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup": { + "version": "4.60.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.4.tgz", + "integrity": "sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.4", + "@rollup/rollup-android-arm64": "4.60.4", + "@rollup/rollup-darwin-arm64": "4.60.4", + "@rollup/rollup-darwin-x64": "4.60.4", + "@rollup/rollup-freebsd-arm64": "4.60.4", + "@rollup/rollup-freebsd-x64": "4.60.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.4", + "@rollup/rollup-linux-arm-musleabihf": "4.60.4", + "@rollup/rollup-linux-arm64-gnu": "4.60.4", + "@rollup/rollup-linux-arm64-musl": "4.60.4", + "@rollup/rollup-linux-loong64-gnu": "4.60.4", + "@rollup/rollup-linux-loong64-musl": "4.60.4", + "@rollup/rollup-linux-ppc64-gnu": "4.60.4", + "@rollup/rollup-linux-ppc64-musl": "4.60.4", + "@rollup/rollup-linux-riscv64-gnu": "4.60.4", + "@rollup/rollup-linux-riscv64-musl": "4.60.4", + "@rollup/rollup-linux-s390x-gnu": "4.60.4", + "@rollup/rollup-linux-x64-gnu": "4.60.4", + "@rollup/rollup-linux-x64-musl": "4.60.4", + "@rollup/rollup-openbsd-x64": "4.60.4", + "@rollup/rollup-openharmony-arm64": "4.60.4", + "@rollup/rollup-win32-arm64-msvc": "4.60.4", + "@rollup/rollup-win32-ia32-msvc": "4.60.4", + "@rollup/rollup-win32-x64-gnu": "4.60.4", + "@rollup/rollup-win32-x64-msvc": "4.60.4", + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", + "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.3.tgz", + "integrity": "sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", + "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.4", + "@vitest/mocker": "3.2.4", + "@vitest/pretty-format": "^3.2.4", + "@vitest/runner": "3.2.4", + "@vitest/snapshot": "3.2.4", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.4", + "@vitest/ui": "3.2.4", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + } + } +} diff --git a/webui/package.json b/webui/package.json new file mode 100644 index 00000000..e55b7948 --- /dev/null +++ b/webui/package.json @@ -0,0 +1,37 @@ +{ + "name": "@moonbridge/console", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --host 127.0.0.1", + "build": "tsc -p tsconfig.json --noEmit && vite build", + "preview": "vite preview --host 127.0.0.1", + "test": "vitest run", + "test:watch": "vitest", + "e2e": "vitest run --config vite.config.ts --dir src/e2e" + }, + "dependencies": { + "@material/web": "^2.4.0", + "@tanstack/react-query": "^5.83.0", + "@tanstack/react-table": "^8.21.3", + "motion": "^12.23.6", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "react-router-dom": "^7.7.0", + "yaml": "^2.8.0" + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.3.0", + "@testing-library/user-event": "^14.6.1", + "@types/node": "^24.0.15", + "@types/react": "^19.1.8", + "@types/react-dom": "^19.1.6", + "@vitejs/plugin-react": "^4.6.0", + "jsdom": "^26.1.0", + "typescript": "^5.8.3", + "vite": "^7.0.5", + "vitest": "^3.2.4" + } +} diff --git a/webui/src/app/App.tsx b/webui/src/app/App.tsx new file mode 100644 index 00000000..d8121b3e --- /dev/null +++ b/webui/src/app/App.tsx @@ -0,0 +1,307 @@ +import "@material/web/button/text-button.js"; +import "@material/web/icon/icon.js"; +import "@material/web/iconbutton/icon-button.js"; +import "@material/web/ripple/ripple.js"; +import { createElement } from "react"; +import { NavLink, Outlet } from "react-router-dom"; +import { motion } from "motion/react"; +import { useConsoleTheme } from "../theme/ThemeProvider"; + +const navItems = [ + { to: "/overview", icon: "dashboard", label: "Overview" }, + { to: "/models", icon: "view_module", label: "Models" }, + { to: "/providers", icon: "lan", label: "Providers" }, + { to: "/routes", icon: "alt_route", label: "Routes" }, + { to: "/extensions", icon: "extension", label: "Extensions" }, + { to: "/changes", icon: "pending_actions", label: "Changes" }, + { to: "/config", icon: "tune", label: "Config" }, + { to: "/rpc-test", icon: "science", label: "RPC Test" } +]; + +export function App() { + const { theme, toggleTheme } = useConsoleTheme(); + const nextTheme = theme === "dark" ? "light" : "dark"; + const themeIcon = theme === "dark" ? "light_mode" : "dark_mode"; + + return ( +
+ +
+
+

Moon Bridge

+ Console +
+
+ 127.0.0.1:38440 + Runtime API + {createElement( + "md-icon-button", + { + "aria-label": `Switch to ${nextTheme} theme`, + onClick: toggleTheme + }, + createElement("md-icon", null, themeIcon) + )} +
+
+ +
+ + + + + +
+
+ ); +} + +const shellStyles = ` + :root { + color-scheme: dark; + font-family: + Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, + "Segoe UI", sans-serif; + background: var(--mb-color-surface); + color: var(--mb-color-on-surface); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + } + + :root[data-theme="light"] { + color-scheme: light; + } + + * { + box-sizing: border-box; + } + + body { + margin: 0; + min-width: 320px; + min-height: 100vh; + background: var(--mb-color-surface); + } + + .app-shell { + min-height: 100vh; + background: + linear-gradient(180deg, rgba(122, 167, 162, 0.08), transparent 260px), + var(--mb-color-surface); + } + + .top-app-bar { + position: sticky; + top: 0; + z-index: 2; + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; + min-height: 72px; + padding: 12px 24px; + border-bottom: 1px solid color-mix(in srgb, var(--mb-color-outline) 36%, transparent); + background: color-mix(in srgb, var(--mb-color-surface) 92%, transparent); + backdrop-filter: blur(16px); + } + + .top-app-bar p, + .top-app-bar strong { + margin: 0; + } + + .top-app-bar p { + color: var(--mb-color-on-surface-variant); + font-size: 0.75rem; + line-height: 1.2; + } + + .top-app-bar strong { + display: block; + font-size: 1.25rem; + line-height: 1.2; + font-weight: 650; + } + + .top-app-bar__meta { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 10px; + color: var(--mb-color-on-surface-variant); + font-size: 0.875rem; + white-space: nowrap; + } + + .top-app-bar__meta span { + min-height: 32px; + display: inline-flex; + align-items: center; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 42%, transparent); + border-radius: 8px; + padding: 0 10px; + background: var(--mb-color-surface-container); + } + + md-icon-button { + --md-icon-button-icon-color: var(--mb-color-on-surface); + --md-icon-button-hover-icon-color: var(--mb-color-primary); + --md-icon-button-pressed-icon-color: var(--mb-color-primary); + } + + .workspace { + display: grid; + grid-template-columns: 96px minmax(0, 1fr); + min-height: calc(100vh - 72px); + } + + .navigation-rail { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + padding: 16px 10px; + border-right: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + background: var(--mb-color-surface); + } + + .nav-item { + position: relative; + overflow: hidden; + width: 76px; + min-height: 64px; + display: grid; + place-items: center; + gap: 3px; + padding: 8px 4px; + border-radius: 8px; + color: var(--mb-color-on-surface-variant); + text-decoration: none; + transition: + background var(--mb-motion-standard), + color var(--mb-motion-standard); + } + + .nav-item span { + max-width: 68px; + overflow: hidden; + text-overflow: ellipsis; + font-size: 0.6875rem; + line-height: 1.1; + text-align: center; + white-space: nowrap; + } + + .nav-item--active { + color: var(--mb-color-on-primary-container); + background: var(--mb-color-primary-container); + } + + .content-surface { + min-width: 0; + padding: 24px; + } + + .placeholder-panel { + min-height: calc(100vh - 120px); + display: flex; + align-items: center; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + border-radius: 8px; + padding: 32px; + background: var(--mb-color-surface-container); + box-shadow: 0 20px 60px color-mix(in srgb, var(--mb-color-shadow) 22%, transparent); + } + + .placeholder-panel > div { + max-width: 760px; + } + + .eyebrow { + margin: 0 0 10px; + color: var(--mb-color-primary); + font-size: 0.75rem; + font-weight: 700; + text-transform: uppercase; + } + + h1 { + margin: 0; + font-size: clamp(2rem, 4vw, 3.5rem); + line-height: 1.05; + font-weight: 650; + } + + .placeholder-panel p:last-child { + margin: 18px 0 0; + max-width: 620px; + color: var(--mb-color-on-surface-variant); + font-size: 1rem; + line-height: 1.6; + } + + @media (max-width: 760px) { + .top-app-bar { + align-items: flex-start; + flex-direction: column; + padding: 14px 16px; + } + + .top-app-bar__meta { + width: 100%; + flex-wrap: wrap; + justify-content: flex-start; + white-space: normal; + } + + .workspace { + grid-template-columns: 1fr; + } + + .navigation-rail { + position: sticky; + top: 103px; + z-index: 1; + flex-direction: row; + align-items: stretch; + justify-content: flex-start; + overflow-x: auto; + padding: 10px 12px; + border-right: 0; + border-bottom: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + } + + .nav-item { + flex: 0 0 76px; + } + + .content-surface { + padding: 16px; + } + + .placeholder-panel { + min-height: 440px; + padding: 24px; + } + } +`; diff --git a/webui/src/app/queryClient.ts b/webui/src/app/queryClient.ts new file mode 100644 index 00000000..f22e754a --- /dev/null +++ b/webui/src/app/queryClient.ts @@ -0,0 +1,11 @@ +import { QueryClient } from "@tanstack/react-query"; + +export const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: 1, + staleTime: 15_000, + refetchOnWindowFocus: false + } + } +}); diff --git a/webui/src/app/routes.tsx b/webui/src/app/routes.tsx new file mode 100644 index 00000000..d9e1cfe5 --- /dev/null +++ b/webui/src/app/routes.tsx @@ -0,0 +1,44 @@ +import { Navigate, Outlet, createBrowserRouter } from "react-router-dom"; +import { App } from "./App"; + +function PlaceholderPage({ title }: { title: string }) { + return ( +
+
+

Console workspace

+

{title}

+

+ This surface is ready for Moon Bridge API data, staged changes, and + operational controls. +

+
+
+ ); +} + +export function RouteOutlet() { + return ; +} + +export const routes = [ + { index: true, element: }, + { path: "overview", element: }, + { path: "models", element: }, + { path: "providers", element: }, + { path: "routes", element: }, + { path: "extensions", element: }, + { path: "changes", element: }, + { path: "config", element: }, + { path: "rpc-test", element: } +]; + +export const router = createBrowserRouter( + [ + { + path: "/", + element: , + children: routes + } + ], + { basename: "/console" } +); diff --git a/webui/src/main.tsx b/webui/src/main.tsx new file mode 100644 index 00000000..6ed4df56 --- /dev/null +++ b/webui/src/main.tsx @@ -0,0 +1,23 @@ +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import { QueryClientProvider } from "@tanstack/react-query"; +import { RouterProvider } from "react-router-dom"; +import { router } from "./app/routes"; +import { queryClient } from "./app/queryClient"; +import { ThemeProvider } from "./theme/ThemeProvider"; + +const rootElement = document.getElementById("root"); + +if (!rootElement) { + throw new Error("Root element #root was not found"); +} + +createRoot(rootElement).render( + + + + + + + +); diff --git a/webui/src/test/setup.ts b/webui/src/test/setup.ts new file mode 100644 index 00000000..7c2e34ca --- /dev/null +++ b/webui/src/test/setup.ts @@ -0,0 +1,26 @@ +import "@testing-library/jest-dom/vitest"; + +if (!globalThis.localStorage) { + const store = new Map(); + + const storage: Storage = { + get length() { + return store.size; + }, + clear: () => store.clear(), + getItem: (key) => store.get(key) ?? null, + key: (index) => Array.from(store.keys())[index] ?? null, + removeItem: (key) => store.delete(key), + setItem: (key, value) => store.set(key, value) + }; + + Object.defineProperty(globalThis, "localStorage", { + configurable: true, + value: storage + }); + + Object.defineProperty(window, "localStorage", { + configurable: true, + value: storage + }); +} diff --git a/webui/src/theme/ThemeProvider.test.tsx b/webui/src/theme/ThemeProvider.test.tsx new file mode 100644 index 00000000..60598868 --- /dev/null +++ b/webui/src/theme/ThemeProvider.test.tsx @@ -0,0 +1,72 @@ +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, it } from "vitest"; +import { + CONSOLE_THEME_STORAGE_KEY, + ThemeProvider, + useConsoleTheme +} from "./ThemeProvider"; + +function ThemeProbe() { + const { theme, setTheme, toggleTheme } = useConsoleTheme(); + + return ( +
+

{theme}

+ + +
+ ); +} + +describe("ThemeProvider", () => { + afterEach(() => { + localStorage.clear(); + document.documentElement.removeAttribute("data-theme"); + document.documentElement.removeAttribute("style"); + }); + + it("defaults to the dark theme", () => { + render( + + + + ); + + expect(screen.getByTestId("theme-value")).toHaveTextContent("dark"); + expect(document.documentElement).toHaveAttribute("data-theme", "dark"); + }); + + it("switches to light theme", async () => { + const user = userEvent.setup(); + + render( + + + + ); + + await user.click(screen.getByRole("button", { name: "Set light" })); + + expect(screen.getByTestId("theme-value")).toHaveTextContent("light"); + expect(document.documentElement).toHaveAttribute("data-theme", "light"); + }); + + it("persists the selected theme in localStorage", async () => { + const user = userEvent.setup(); + + render( + + + + ); + + await user.click(screen.getByRole("button", { name: "Toggle" })); + + expect(localStorage.getItem(CONSOLE_THEME_STORAGE_KEY)).toBe("light"); + }); +}); diff --git a/webui/src/theme/ThemeProvider.tsx b/webui/src/theme/ThemeProvider.tsx new file mode 100644 index 00000000..da8bbd20 --- /dev/null +++ b/webui/src/theme/ThemeProvider.tsx @@ -0,0 +1,77 @@ +import { + createContext, + type ReactNode, + useCallback, + useContext, + useEffect, + useMemo, + useState +} from "react"; +import { applyThemeTokens, type ConsoleTheme } from "./tokens"; + +export const CONSOLE_THEME_STORAGE_KEY = "moonbridge.console.theme"; + +type ConsoleThemeContextValue = { + theme: ConsoleTheme; + setTheme: (theme: ConsoleTheme) => void; + toggleTheme: () => void; +}; + +const ConsoleThemeContext = createContext( + undefined +); + +function readStoredTheme(): ConsoleTheme { + if (typeof window === "undefined" || !window.localStorage) { + return "dark"; + } + + try { + const stored = window.localStorage.getItem(CONSOLE_THEME_STORAGE_KEY); + return stored === "light" || stored === "dark" ? stored : "dark"; + } catch { + return "dark"; + } +} + +export function ThemeProvider({ children }: { children: ReactNode }) { + const [theme, setThemeState] = useState(readStoredTheme); + + const setTheme = useCallback((nextTheme: ConsoleTheme) => { + setThemeState(nextTheme); + }, []); + + const toggleTheme = useCallback(() => { + setThemeState((current) => (current === "dark" ? "light" : "dark")); + }, []); + + useEffect(() => { + const root = document.documentElement; + root.dataset.theme = theme; + applyThemeTokens(theme, root); + try { + window.localStorage?.setItem(CONSOLE_THEME_STORAGE_KEY, theme); + } catch { + // Storage may be disabled in hardened browser contexts. + } + }, [theme]); + + const value = useMemo( + () => ({ theme, setTheme, toggleTheme }), + [theme, setTheme, toggleTheme] + ); + + return ( + + {children} + + ); +} + +export function useConsoleTheme(): ConsoleThemeContextValue { + const context = useContext(ConsoleThemeContext); + if (!context) { + throw new Error("useConsoleTheme must be used within ThemeProvider"); + } + return context; +} diff --git a/webui/src/theme/tokens.ts b/webui/src/theme/tokens.ts new file mode 100644 index 00000000..2119d143 --- /dev/null +++ b/webui/src/theme/tokens.ts @@ -0,0 +1,46 @@ +export type ConsoleTheme = "dark" | "light"; + +export const primarySeed = "#7AA7A2"; + +type ThemeTokens = Record; + +export const themeTokens: Record = { + dark: { + "--mb-color-primary": primarySeed, + "--mb-color-on-primary": "#08201d", + "--mb-color-primary-container": "#274e4a", + "--mb-color-on-primary-container": "#d4f3ee", + "--mb-color-secondary": "#bbc8c5", + "--mb-color-surface": "#101414", + "--mb-color-surface-container": "#1b2020", + "--mb-color-surface-container-high": "#252b2b", + "--mb-color-on-surface": "#e0e3e1", + "--mb-color-on-surface-variant": "#bec9c6", + "--mb-color-outline": "#899390", + "--mb-color-shadow": "#000000", + "--mb-color-error": "#ffb4ab", + "--mb-motion-standard": "180ms cubic-bezier(0.2, 0, 0, 1)" + }, + light: { + "--mb-color-primary": "#466965", + "--mb-color-on-primary": "#ffffff", + "--mb-color-primary-container": "#c9f0ea", + "--mb-color-on-primary-container": "#00201d", + "--mb-color-secondary": "#52615e", + "--mb-color-surface": "#f7fbf8", + "--mb-color-surface-container": "#e9efec", + "--mb-color-surface-container-high": "#dde5e2", + "--mb-color-on-surface": "#191c1b", + "--mb-color-on-surface-variant": "#424947", + "--mb-color-outline": "#727c79", + "--mb-color-shadow": "#000000", + "--mb-color-error": "#ba1a1a", + "--mb-motion-standard": "180ms cubic-bezier(0.2, 0, 0, 1)" + } +}; + +export function applyThemeTokens(theme: ConsoleTheme, root: HTMLElement): void { + Object.entries(themeTokens[theme]).forEach(([name, value]) => { + root.style.setProperty(name, value); + }); +} diff --git a/webui/tsconfig.json b/webui/tsconfig.json new file mode 100644 index 00000000..ef7e5ed6 --- /dev/null +++ b/webui/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "incremental": false, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "types": ["vitest/globals", "@testing-library/jest-dom"] + }, + "include": ["src", "vite.config.ts"] +} diff --git a/webui/tsconfig.node.json b/webui/tsconfig.node.json new file mode 100644 index 00000000..cbd2a63d --- /dev/null +++ b/webui/tsconfig.node.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "allowSyntheticDefaultImports": true, + "strict": true + }, + "include": ["vite.config.ts"] +} diff --git a/webui/vite.config.ts b/webui/vite.config.ts new file mode 100644 index 00000000..73f50429 --- /dev/null +++ b/webui/vite.config.ts @@ -0,0 +1,25 @@ +import { defineConfig } from "vitest/config"; +import react from "@vitejs/plugin-react"; + +export default defineConfig({ + base: "/console/", + plugins: [react()], + server: { + proxy: { + "/api": "http://127.0.0.1:38440", + "/v1": "http://127.0.0.1:38440", + "/responses": "http://127.0.0.1:38440", + "/models": "http://127.0.0.1:38440" + } + }, + test: { + environment: "jsdom", + environmentOptions: { + jsdom: { + url: "http://127.0.0.1:5173/console/" + } + }, + globals: true, + setupFiles: "./src/test/setup.ts" + } +}); From 9b8a901a6298e7480e7ea3087f315716ae5ccde9 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 17:27:40 +0800 Subject: [PATCH 07/78] fix: harden console theme storage fallback --- webui/src/theme/ThemeProvider.test.tsx | 22 ++++++++++++++++++++++ webui/src/theme/ThemeProvider.tsx | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/webui/src/theme/ThemeProvider.test.tsx b/webui/src/theme/ThemeProvider.test.tsx index 60598868..fc23ace2 100644 --- a/webui/src/theme/ThemeProvider.test.tsx +++ b/webui/src/theme/ThemeProvider.test.tsx @@ -69,4 +69,26 @@ describe("ThemeProvider", () => { expect(localStorage.getItem(CONSOLE_THEME_STORAGE_KEY)).toBe("light"); }); + + it("falls back to dark when localStorage is unavailable", () => { + const original = Object.getOwnPropertyDescriptor(window, "localStorage"); + Object.defineProperty(window, "localStorage", { + configurable: true, + get() { + throw new DOMException("blocked", "SecurityError"); + } + }); + + render( + + + + ); + + expect(screen.getByTestId("theme-value")).toHaveTextContent("dark"); + + if (original) { + Object.defineProperty(window, "localStorage", original); + } + }); }); diff --git a/webui/src/theme/ThemeProvider.tsx b/webui/src/theme/ThemeProvider.tsx index da8bbd20..2cde2384 100644 --- a/webui/src/theme/ThemeProvider.tsx +++ b/webui/src/theme/ThemeProvider.tsx @@ -22,11 +22,14 @@ const ConsoleThemeContext = createContext( ); function readStoredTheme(): ConsoleTheme { - if (typeof window === "undefined" || !window.localStorage) { + if (typeof window === "undefined") { return "dark"; } try { + if (!window.localStorage) { + return "dark"; + } const stored = window.localStorage.getItem(CONSOLE_THEME_STORAGE_KEY); return stored === "light" || stored === "dark" ? stored : "dark"; } catch { From 14fa74e8480e7408063a4ab95dd37e9ca15d5943 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 17:46:36 +0800 Subject: [PATCH 08/78] feat: add console rpc client and auth gate --- webui/src/components/AuthGate.test.tsx | 66 +++++++++++ webui/src/components/AuthGate.tsx | 60 ++++++++++ webui/src/components/ErrorState.tsx | 9 ++ webui/src/components/LoadingState.tsx | 8 ++ webui/src/rpc/http.test.ts | 107 +++++++++++++++++ webui/src/rpc/http.ts | 157 +++++++++++++++++++++++++ webui/src/rpc/management.test.ts | 85 +++++++++++++ webui/src/rpc/management.ts | 117 ++++++++++++++++++ webui/src/rpc/types.ts | 153 ++++++++++++++++++++++++ 9 files changed, 762 insertions(+) create mode 100644 webui/src/components/AuthGate.test.tsx create mode 100644 webui/src/components/AuthGate.tsx create mode 100644 webui/src/components/ErrorState.tsx create mode 100644 webui/src/components/LoadingState.tsx create mode 100644 webui/src/rpc/http.test.ts create mode 100644 webui/src/rpc/http.ts create mode 100644 webui/src/rpc/management.test.ts create mode 100644 webui/src/rpc/management.ts create mode 100644 webui/src/rpc/types.ts diff --git a/webui/src/components/AuthGate.test.tsx b/webui/src/components/AuthGate.test.tsx new file mode 100644 index 00000000..17b2b86d --- /dev/null +++ b/webui/src/components/AuthGate.test.tsx @@ -0,0 +1,66 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import { + REMEMBER_TOKEN_STORAGE_KEY, + TOKEN_STORAGE_KEY, + ApiError +} from "../rpc/http"; +import { AuthGate } from "./AuthGate"; + +function renderWithQueryClient(ui: React.ReactElement) { + const client = new QueryClient(); + return render({ui}); +} + +describe("AuthGate", () => { + afterEach(() => { + sessionStorage.clear(); + localStorage.clear(); + vi.restoreAllMocks(); + }); + + test("renders children when there is no auth error", () => { + renderWithQueryClient(Console content); + + expect(screen.getByText("Console content")).toBeInTheDocument(); + }); + + test("saves token to session storage by default", async () => { + const onTokenSaved = vi.fn(); + + renderWithQueryClient( + + Console content + + ); + + await userEvent.type(screen.getByLabelText(/^token$/i), "secret-token"); + await userEvent.click(screen.getByRole("button", { name: /save/i })); + + expect(sessionStorage.getItem(TOKEN_STORAGE_KEY)).toBe("secret-token"); + expect(localStorage.getItem(REMEMBER_TOKEN_STORAGE_KEY)).toBeNull(); + expect(onTokenSaved).toHaveBeenCalledTimes(1); + }); + + test("saves remembered token to local storage", async () => { + renderWithQueryClient( + + Console content + + ); + + await userEvent.type(screen.getByLabelText(/^token$/i), "remembered-token"); + await userEvent.click(screen.getByLabelText(/remember/i)); + await userEvent.click(screen.getByRole("button", { name: /save/i })); + + expect(sessionStorage.getItem(TOKEN_STORAGE_KEY)).toBe("remembered-token"); + expect(localStorage.getItem(REMEMBER_TOKEN_STORAGE_KEY)).toBe( + "remembered-token" + ); + }); +}); diff --git a/webui/src/components/AuthGate.tsx b/webui/src/components/AuthGate.tsx new file mode 100644 index 00000000..66e24c23 --- /dev/null +++ b/webui/src/components/AuthGate.tsx @@ -0,0 +1,60 @@ +import { useQueryClient } from "@tanstack/react-query"; +import { type FormEvent, type ReactNode, useState } from "react"; +import { type ApiError, isAuthError, saveToken } from "../rpc/http"; + +type AuthGateProps = { + children: ReactNode; + error?: unknown; + onTokenSaved?: () => void; +}; + +export function AuthGate({ children, error, onTokenSaved }: AuthGateProps) { + const queryClient = useQueryClient(); + const [token, setToken] = useState(""); + const [remember, setRemember] = useState(false); + + if (!isAuthError(error)) { + return <>{children}; + } + + function submit(event: FormEvent) { + event.preventDefault(); + const value = token.trim(); + if (!value) { + return; + } + saveToken(value, remember); + queryClient.invalidateQueries(); + onTokenSaved?.(); + } + + const apiError = error as ApiError; + + return ( +
+
+

Authentication required

+

输入 Moon Bridge Token

+

{apiError.message}

+ + + +
+
+ ); +} diff --git a/webui/src/components/ErrorState.tsx b/webui/src/components/ErrorState.tsx new file mode 100644 index 00000000..27379f21 --- /dev/null +++ b/webui/src/components/ErrorState.tsx @@ -0,0 +1,9 @@ +export function ErrorState({ title = "请求失败", message }: { title?: string; message: string }) { + return ( +
+

Error

+

{title}

+

{message}

+
+ ); +} diff --git a/webui/src/components/LoadingState.tsx b/webui/src/components/LoadingState.tsx new file mode 100644 index 00000000..9c2f1acc --- /dev/null +++ b/webui/src/components/LoadingState.tsx @@ -0,0 +1,8 @@ +export function LoadingState({ label = "加载中" }: { label?: string }) { + return ( +
+

Loading

+

{label}

+
+ ); +} diff --git a/webui/src/rpc/http.test.ts b/webui/src/rpc/http.test.ts new file mode 100644 index 00000000..1654d3eb --- /dev/null +++ b/webui/src/rpc/http.test.ts @@ -0,0 +1,107 @@ +import { afterEach, describe, expect, test, vi } from "vitest"; +import { + ApiError, + REMEMBER_TOKEN_STORAGE_KEY, + TOKEN_STORAGE_KEY, + apiFetch +} from "./http"; + +function jsonResponse(body: unknown, init?: ResponseInit) { + return new Response(JSON.stringify(body), { + headers: { "Content-Type": "application/json" }, + ...init + }); +} + +describe("apiFetch", () => { + afterEach(() => { + vi.restoreAllMocks(); + sessionStorage.clear(); + localStorage.clear(); + }); + + test("sends JSON requests and bearer token from session storage", async () => { + sessionStorage.setItem(TOKEN_STORAGE_KEY, "session-token"); + const fetchMock = vi + .spyOn(globalThis, "fetch") + .mockResolvedValue(jsonResponse({ ok: true })); + + const result = await apiFetch<{ ok: boolean }>("/providers", { + method: "POST", + body: { name: "anthropic" } + }); + + expect(result).toEqual({ ok: true }); + const [url, init] = fetchMock.mock.calls[0]; + expect(url).toBe("/api/v1/providers"); + expect(init?.headers).toMatchObject({ + Authorization: "Bearer session-token", + "Content-Type": "application/json" + }); + expect(init?.body).toBe(JSON.stringify({ name: "anthropic" })); + }); + + test("falls back to remembered local storage token", async () => { + localStorage.setItem(REMEMBER_TOKEN_STORAGE_KEY, "local-token"); + const fetchMock = vi + .spyOn(globalThis, "fetch") + .mockResolvedValue(jsonResponse({ ok: true })); + + await apiFetch("/status"); + + expect(fetchMock.mock.calls[0][1]?.headers).toMatchObject({ + Authorization: "Bearer local-token" + }); + }); + + test("normalizes management error responses", async () => { + vi.spyOn(globalThis, "fetch").mockResolvedValue( + jsonResponse( + { error: { code: "invalid_auth", message: "missing token" } }, + { status: 401 } + ) + ); + + await expect(apiFetch("/status")).rejects.toMatchObject({ + status: 401, + code: "invalid_auth", + message: "missing token", + raw: { error: { code: "invalid_auth", message: "missing token" } } + }); + }); + + test("normalizes OpenAI-style error responses", async () => { + vi.spyOn(globalThis, "fetch").mockResolvedValue( + jsonResponse( + { + error: { + type: "invalid_request_error", + code: "bad_request", + message: "bad request" + } + }, + { status: 400 } + ) + ); + + const promise = apiFetch("/responses"); + await expect(promise).rejects.toBeInstanceOf(ApiError); + await expect(promise).rejects.toMatchObject({ + status: 400, + code: "bad_request", + message: "bad request" + }); + }); + + test("continues when storage is unavailable", async () => { + vi.spyOn(Storage.prototype, "getItem").mockImplementation(() => { + throw new Error("blocked"); + }); + const fetchMock = vi + .spyOn(globalThis, "fetch") + .mockResolvedValue(jsonResponse({ ok: true })); + + await expect(apiFetch("/status")).resolves.toEqual({ ok: true }); + expect(fetchMock.mock.calls[0][1]?.headers).not.toHaveProperty("Authorization"); + }); +}); diff --git a/webui/src/rpc/http.ts b/webui/src/rpc/http.ts new file mode 100644 index 00000000..bc4182f2 --- /dev/null +++ b/webui/src/rpc/http.ts @@ -0,0 +1,157 @@ +export const API_BASE = "/api/v1"; +export const TOKEN_STORAGE_KEY = "moonbridge.console.token"; +export const REMEMBER_TOKEN_STORAGE_KEY = "moonbridge.console.rememberedToken"; + +export type ApiFetchOptions = Omit & { + body?: unknown; + headers?: HeadersInit; + rawBody?: BodyInit | null; +}; + +export class ApiError extends Error { + status: number; + code: string; + raw: unknown; + + constructor(status: number, code: string, message: string, raw?: unknown) { + super(message); + this.name = "ApiError"; + this.status = status; + this.code = code; + this.raw = raw; + } +} + +export function isAuthError(error: unknown): error is ApiError { + return error instanceof ApiError && error.status === 401; +} + +export function readStoredToken(): string { + const sessionToken = safeGetStorage(getStorage("sessionStorage"), TOKEN_STORAGE_KEY); + if (sessionToken) { + return sessionToken; + } + return safeGetStorage(getStorage("localStorage"), REMEMBER_TOKEN_STORAGE_KEY) ?? ""; +} + +export function saveToken(token: string, remember: boolean) { + safeSetStorage(getStorage("sessionStorage"), TOKEN_STORAGE_KEY, token); + if (remember) { + safeSetStorage(getStorage("localStorage"), REMEMBER_TOKEN_STORAGE_KEY, token); + } else { + safeRemoveStorage(getStorage("localStorage"), REMEMBER_TOKEN_STORAGE_KEY); + } +} + +export async function apiFetch(path: string, options: ApiFetchOptions = {}): Promise { + const url = normalizeURL(path); + const headers = headersToRecord(options.headers); + const token = readStoredToken(); + if (token) { + headers.Authorization = `Bearer ${token}`; + } + + let body: BodyInit | null | undefined = options.rawBody; + if (options.body !== undefined) { + headers["Content-Type"] = "application/json"; + body = JSON.stringify(options.body); + } + + const response = await fetch(url, { + ...options, + headers, + body + }); + + const payload = await readPayload(response); + if (!response.ok) { + throw normalizeError(response.status, payload); + } + return payload as T; +} + +export function normalizeURL(path: string): string { + if (/^https?:\/\//.test(path)) { + return path; + } + if (path.startsWith("/api/v1/") || path === "/api/v1") { + return path; + } + if (path.startsWith("/")) { + return `${API_BASE}${path}`; + } + return `${API_BASE}/${path}`; +} + +async function readPayload(response: Response): Promise { + const contentType = response.headers.get("Content-Type") ?? ""; + if (contentType.includes("application/json")) { + return response.json(); + } + return response.text(); +} + +function normalizeError(status: number, raw: unknown): ApiError { + if (isObject(raw) && isObject(raw.error)) { + const code = stringValue(raw.error.code) ?? stringValue(raw.error.type) ?? "request_error"; + const message = stringValue(raw.error.message) ?? `Request failed with status ${status}`; + return new ApiError(status, code, message, raw); + } + return new ApiError(status, "request_error", `Request failed with status ${status}`, raw); +} + +function safeGetStorage(storage: Storage | undefined, key: string): string | null { + try { + return storage?.getItem(key) ?? null; + } catch { + return null; + } +} + +function getStorage(name: "sessionStorage" | "localStorage"): Storage | undefined { + if (typeof window === "undefined") { + return undefined; + } + try { + return window[name]; + } catch { + return undefined; + } +} + +function headersToRecord(headers?: HeadersInit): Record { + if (!headers) { + return {}; + } + if (headers instanceof Headers) { + return Object.fromEntries(headers.entries()); + } + if (Array.isArray(headers)) { + return Object.fromEntries(headers); + } + return { ...headers }; +} + +function safeSetStorage(storage: Storage | undefined, key: string, value: string) { + try { + storage?.setItem(key, value); + } catch { + // Storage may be disabled in hardened browser contexts. + } +} + +function safeRemoveStorage(storage: Storage | undefined, key: string) { + try { + storage?.removeItem(key); + } catch { + // Storage may be disabled in hardened browser contexts. + } +} + +function isObject(value: unknown): value is Record { + return typeof value === "object" && value !== null; +} + +function stringValue(value: unknown): string | undefined { + return typeof value === "string" && value ? value : undefined; +} diff --git a/webui/src/rpc/management.test.ts b/webui/src/rpc/management.test.ts new file mode 100644 index 00000000..60d9d224 --- /dev/null +++ b/webui/src/rpc/management.test.ts @@ -0,0 +1,85 @@ +import { afterEach, describe, expect, test, vi } from "vitest"; +import { + exportConfig, + importConfig, + listProviders, + validateConfig +} from "./management"; + +function response(body: unknown, init?: ResponseInit) { + return new Response(typeof body === "string" ? body : JSON.stringify(body), { + headers: { + "Content-Type": + typeof body === "string" ? "application/x-yaml" : "application/json" + }, + ...init + }); +} + +describe("management RPC client", () => { + afterEach(() => { + vi.restoreAllMocks(); + sessionStorage.clear(); + localStorage.clear(); + }); + + test("listProviders encodes pagination query params", async () => { + const fetchMock = vi.spyOn(globalThis, "fetch").mockResolvedValue( + response({ + data: [], + total: 0, + limit: 10, + offset: 20 + }) + ); + + await listProviders({ limit: 10, offset: 20 }); + + expect(fetchMock.mock.calls[0][0]).toBe( + "/api/v1/providers?limit=10&offset=20" + ); + }); + + test("validateConfig posts config payload", async () => { + const fetchMock = vi + .spyOn(globalThis, "fetch") + .mockResolvedValue(response({ valid: true })); + + await validateConfig("providers: {}"); + + expect(fetchMock.mock.calls[0][0]).toBe("/api/v1/config/validate"); + expect(fetchMock.mock.calls[0][1]).toMatchObject({ + method: "POST", + body: JSON.stringify({ config: "providers: {}" }) + }); + }); + + test("importConfig posts yaml payload", async () => { + const fetchMock = vi + .spyOn(globalThis, "fetch") + .mockResolvedValue(response({ changes: [], count: 0 })); + + await importConfig("providers: {}"); + + expect(fetchMock.mock.calls[0][0]).toBe("/api/v1/config/import"); + expect(fetchMock.mock.calls[0][1]).toMatchObject({ + method: "POST", + body: JSON.stringify({ yaml: "providers: {}" }) + }); + }); + + test("exportConfig adds include_secrets query and confirmation header", async () => { + const fetchMock = vi + .spyOn(globalThis, "fetch") + .mockResolvedValue(response("providers: {}\n")); + + await exportConfig({ includeSecrets: true }); + + expect(fetchMock.mock.calls[0][0]).toBe( + "/api/v1/config/export?include_secrets=true" + ); + expect(fetchMock.mock.calls[0][1]?.headers).toMatchObject({ + "X-Confirm-Secrets": "true" + }); + }); +}); diff --git a/webui/src/rpc/management.ts b/webui/src/rpc/management.ts new file mode 100644 index 00000000..9208fe83 --- /dev/null +++ b/webui/src/rpc/management.ts @@ -0,0 +1,117 @@ +import { apiFetch } from "./http"; +import type { + ApplyResult, + ChangeRow, + DefaultsSettings, + ImportResult, + ModelDetail, + ModelSummary, + ModelUpsert, + MutationAccepted, + Paginated, + ProviderDetail, + ProviderSummary, + ProviderUpsert, + RouteDetail, + RouteSummary, + RouteUpsert, + SessionInfo, + StatsSummary, + StatusResponse, + ValidationResult, + WebSearchSettings +} from "./types"; + +type Page = { + limit?: number; + offset?: number; +}; + +function pageQuery(page: Page = {}) { + const params = new URLSearchParams(); + if (page.limit !== undefined) { + params.set("limit", String(page.limit)); + } + if (page.offset !== undefined) { + params.set("offset", String(page.offset)); + } + const query = params.toString(); + return query ? `?${query}` : ""; +} + +export const getStatus = () => apiFetch("/status"); + +export const listProviders = (page?: Page) => + apiFetch>(`/providers${pageQuery(page)}`); +export const getProvider = (key: string) => apiFetch(`/providers/${encodeURIComponent(key)}`); +export const putProvider = (key: string, body: ProviderUpsert) => + apiFetch(`/providers/${encodeURIComponent(key)}`, { method: "PUT", body }); +export const patchProvider = (key: string, body: Partial) => + apiFetch(`/providers/${encodeURIComponent(key)}`, { method: "PATCH", body }); +export const deleteProvider = (key: string) => + apiFetch(`/providers/${encodeURIComponent(key)}`, { method: "DELETE" }); +export const testProvider = (key: string) => + apiFetch>(`/providers/${encodeURIComponent(key)}/test`, { method: "POST" }); + +export const createOffer = (providerKey: string, body: Record) => + apiFetch(`/providers/${encodeURIComponent(providerKey)}/offers`, { + method: "POST", + body + }); +export const updateOffer = (providerKey: string, model: string, body: Record) => + apiFetch( + `/providers/${encodeURIComponent(providerKey)}/offers/${encodeURIComponent(model)}`, + { method: "PATCH", body } + ); +export const deleteOffer = (providerKey: string, model: string) => + apiFetch( + `/providers/${encodeURIComponent(providerKey)}/offers/${encodeURIComponent(model)}`, + { method: "DELETE" } + ); + +export const listModels = (page?: Page) => + apiFetch>(`/models${pageQuery(page)}`); +export const getModel = (slug: string) => apiFetch(`/models/${encodeURIComponent(slug)}`); +export const putModel = (slug: string, body: ModelUpsert) => + apiFetch(`/models/${encodeURIComponent(slug)}`, { method: "PUT", body }); +export const deleteModel = (slug: string) => + apiFetch(`/models/${encodeURIComponent(slug)}`, { method: "DELETE" }); + +export const listRoutes = (page?: Page) => + apiFetch>(`/routes${pageQuery(page)}`); +export const getRoute = (alias: string) => apiFetch(`/routes/${encodeURIComponent(alias)}`); +export const putRoute = (alias: string, body: RouteUpsert) => + apiFetch(`/routes/${encodeURIComponent(alias)}`, { method: "PUT", body }); +export const deleteRoute = (alias: string) => + apiFetch(`/routes/${encodeURIComponent(alias)}`, { method: "DELETE" }); + +export const getChanges = () => apiFetch("/changes"); +export const applyChanges = () => apiFetch("/changes/apply", { method: "POST" }); +export const discardChanges = () => apiFetch("/changes/discard", { method: "POST" }); + +export const getEffectiveConfig = () => apiFetch>("/config/effective"); +export const validateConfig = (config: string) => + apiFetch("/config/validate", { method: "POST", body: { config } }); +export const importConfig = (yaml: string) => + apiFetch("/config/import", { method: "POST", body: { yaml } }); +export const exportConfig = ({ includeSecrets = false }: { includeSecrets?: boolean } = {}) => + apiFetch(`/config/export?include_secrets=${includeSecrets ? "true" : "false"}`, { + headers: includeSecrets ? { "X-Confirm-Secrets": "true" } : undefined + }); + +export const getDefaults = () => apiFetch("/defaults"); +export const putDefaults = (body: DefaultsSettings) => + apiFetch("/defaults", { method: "PUT", body }); + +export const getWebSearch = () => apiFetch("/web-search"); +export const putWebSearch = (body: WebSearchSettings) => + apiFetch("/web-search", { method: "PUT", body }); + +export const listExtensions = () => apiFetch("/extensions"); +export const getExtension = (name: string) => + apiFetch>(`/extensions/${encodeURIComponent(name)}`); +export const putExtension = (name: string, body: Record) => + apiFetch(`/extensions/${encodeURIComponent(name)}`, { method: "PUT", body }); + +export const getStatsSummary = () => apiFetch("/stats/summary"); +export const getSessions = () => apiFetch("/sessions"); diff --git a/webui/src/rpc/types.ts b/webui/src/rpc/types.ts new file mode 100644 index 00000000..db399b03 --- /dev/null +++ b/webui/src/rpc/types.ts @@ -0,0 +1,153 @@ +export type Paginated = { + data: T[]; + total: number; + limit: number; + offset: number; +}; + +export type StatusResponse = { + uptime: string; + version: string; + mode: string; + provider_count: number; + route_count: number; + addr: string; + timestamp: string; +}; + +export type Offer = { + model: string; + upstream_name?: string; + priority: number; + input_price: number; + output_price: number; + cache_write: number; + cache_read: number; +}; + +export type ProviderSummary = { + key: string; + protocol: string; + offer_count: number; + base_url: string; + health_status: string; +}; + +export type ProviderDetail = ProviderSummary & { + api_key: string; + version: string; + user_agent: string; + offers: Offer[]; + web_search: string; + web_search_max_uses: number; +}; + +export type ProviderUpsert = { + base_url: string; + api_key: string; + version?: string; + protocol?: string; + user_agent?: string; +}; + +export type ModelSummary = { + slug: string; + display_name?: string; + context_window: number; + providers: string[]; +}; + +export type ModelDetail = ModelSummary & { + description: string; + max_output_tokens: number; + input_modalities: string[]; +}; + +export type ModelUpsert = { + display_name?: string; + description?: string; + context_window?: number; + max_output_tokens?: number; +}; + +export type RouteSummary = { + alias: string; + model: string; + provider: string; + display_name?: string; +}; + +export type RouteDetail = RouteSummary & { + context_window: number; +}; + +export type RouteUpsert = { + model: string; + provider?: string; + display_name?: string; + context_window?: number; +}; + +export type ChangeRow = { + id?: number; + change_id?: number; + action: string; + resource: string; + target_key?: string; + target?: string; + before?: string; + after?: string; + created_at?: string; +}; + +export type StatsSummary = { + requests: number; + input_tokens: number; + output_tokens: number; + cache_hit_rate: number; + total_cost: number; + duration: string; +}; + +export type SessionInfo = { + key: string; + model?: string; + created_at: string; + last_used: string; +}; + +export type DefaultsSettings = { + model: string; + max_tokens: number; + system_prompt: string; +}; + +export type WebSearchSettings = { + support: string; + max_uses: number; + tavily_api_key: string; + firecrawl_api_key: string; + search_max_rounds: number; +}; + +export type ValidationResult = { + valid: boolean; + errors?: string[]; +}; + +export type ImportResult = { + changes: Array<{ change_id: number; resource: string; target: string }>; + count: number; + message: string; +}; + +export type MutationAccepted = { + change_id: number; + status: string; + message?: string; +}; + +export type ApplyResult = { + status: string; + message: string; +}; From fbc54c65f8c773c2bb1291a9fcebd8c381b02ea6 Mon Sep 17 00:00:00 2001 From: Hikari_Nova <3044344887@qq.com> Date: Sun, 24 May 2026 18:40:15 +0800 Subject: [PATCH 09/78] feat: build moonbridge console workflows --- Makefile | 17 +- docs/DEVELOPMENT.md | 27 + docs/api.md | 55 +- internal/service/app/app.go | 1 + internal/service/webui/dist/assets/app.js | 1 - .../webui/dist/assets/index-DunuJL0K.js | 779 ++++++++++++++++++ internal/service/webui/dist/index.html | 2 +- webui/src/app/App.tsx | 408 ++++++++- webui/src/app/PlaceholderPage.tsx | 14 + webui/src/app/routes.tsx | 40 +- .../src/components/ChangeQueueDrawer.test.tsx | 72 ++ webui/src/components/ChangeQueueDrawer.tsx | 137 +++ webui/src/components/ResourceTable.tsx | 71 ++ webui/src/e2e/console.test.tsx | 87 ++ .../src/features/changes/ChangesPage.test.tsx | 43 + webui/src/features/changes/ChangesPage.tsx | 28 + webui/src/features/config/ConfigGenerator.tsx | 124 +++ webui/src/features/config/ConfigPage.test.tsx | 121 +++ webui/src/features/config/ConfigPage.tsx | 258 ++++++ .../extensions/ExtensionsPage.test.tsx | 46 ++ .../features/extensions/ExtensionsPage.tsx | 87 ++ webui/src/features/models/ModelsPage.test.tsx | 77 ++ webui/src/features/models/ModelsPage.tsx | 120 +++ .../features/overview/OverviewPage.test.tsx | 90 ++ webui/src/features/overview/OverviewPage.tsx | 97 +++ .../features/providers/ProvidersPage.test.tsx | 96 +++ .../src/features/providers/ProvidersPage.tsx | 218 +++++ webui/src/features/routes/RoutesPage.test.tsx | 76 ++ webui/src/features/routes/RoutesPage.tsx | 113 +++ .../src/features/rpcTest/RpcTestPage.test.tsx | 51 ++ webui/src/features/rpcTest/RpcTestPage.tsx | 111 +++ webui/src/features/shared.tsx | 44 + webui/src/rpc/configGenerator.test.ts | 100 +++ webui/src/rpc/configGenerator.ts | 215 +++++ webui/src/rpc/http.test.ts | 47 +- webui/src/rpc/http.ts | 24 +- webui/src/rpc/queryKeys.ts | 9 + webui/src/rpc/responses.test.ts | 49 ++ webui/src/rpc/responses.ts | 42 + webui/src/rpc/types.ts | 19 +- webui/vite.config.ts | 10 +- 41 files changed, 3981 insertions(+), 45 deletions(-) delete mode 100644 internal/service/webui/dist/assets/app.js create mode 100644 internal/service/webui/dist/assets/index-DunuJL0K.js create mode 100644 webui/src/app/PlaceholderPage.tsx create mode 100644 webui/src/components/ChangeQueueDrawer.test.tsx create mode 100644 webui/src/components/ChangeQueueDrawer.tsx create mode 100644 webui/src/components/ResourceTable.tsx create mode 100644 webui/src/e2e/console.test.tsx create mode 100644 webui/src/features/changes/ChangesPage.test.tsx create mode 100644 webui/src/features/changes/ChangesPage.tsx create mode 100644 webui/src/features/config/ConfigGenerator.tsx create mode 100644 webui/src/features/config/ConfigPage.test.tsx create mode 100644 webui/src/features/config/ConfigPage.tsx create mode 100644 webui/src/features/extensions/ExtensionsPage.test.tsx create mode 100644 webui/src/features/extensions/ExtensionsPage.tsx create mode 100644 webui/src/features/models/ModelsPage.test.tsx create mode 100644 webui/src/features/models/ModelsPage.tsx create mode 100644 webui/src/features/overview/OverviewPage.test.tsx create mode 100644 webui/src/features/overview/OverviewPage.tsx create mode 100644 webui/src/features/providers/ProvidersPage.test.tsx create mode 100644 webui/src/features/providers/ProvidersPage.tsx create mode 100644 webui/src/features/routes/RoutesPage.test.tsx create mode 100644 webui/src/features/routes/RoutesPage.tsx create mode 100644 webui/src/features/rpcTest/RpcTestPage.test.tsx create mode 100644 webui/src/features/rpcTest/RpcTestPage.tsx create mode 100644 webui/src/features/shared.tsx create mode 100644 webui/src/rpc/configGenerator.test.ts create mode 100644 webui/src/rpc/configGenerator.ts create mode 100644 webui/src/rpc/queryKeys.ts create mode 100644 webui/src/rpc/responses.test.ts create mode 100644 webui/src/rpc/responses.ts diff --git a/Makefile b/Makefile index 7a275008..a52b895e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: test cover cover-html cover-check build +.PHONY: test cover cover-html cover-check build webui-install webui-test webui-build build-with-webui COVERAGE_THRESHOLD := 95 COVER_PROFILE := /tmp/moonbridge-coverage.out @@ -6,6 +6,21 @@ COVER_PROFILE := /tmp/moonbridge-coverage.out build: CGO_ENABLED=0 go build ./... +webui-install: + npm --prefix webui install + +webui-test: + npm --prefix webui test + +webui-build: + npm --prefix webui run build + rm -rf internal/service/webui/dist + mkdir -p internal/service/webui/dist + cp -R webui/dist/. internal/service/webui/dist/ + +build-with-webui: webui-build + CGO_ENABLED=0 go build ./... + test: CGO_ENABLED=0 go test ./... diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 1943504e..cc3faa6e 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -61,6 +61,32 @@ go build -o moonbridge ./cmd/moonbridge go build -o worker.wasm ./cmd/cloudflare ``` +## Web Console 开发 + +Moon Bridge Console 是嵌入到 Go 二进制中的 Vite/React 前端,生产路径为 `/console/`。 + +```bash +# 安装前端依赖 +npm --prefix webui install + +# 启动前端开发服务器,访问 http://127.0.0.1:5173/console/ +npm --prefix webui run dev + +# 前端单元测试和生产构建 +npm --prefix webui test +npm --prefix webui run build + +# 构建并同步到 Go embed 目录 +make webui-build + +# 构建带嵌入式 Console 的 Go 二进制 +make build-with-webui +``` + +开发服务器会将 `/api`、`/v1`、`/responses`、`/models` 代理到 `127.0.0.1:38440`。运行预览后端时,需要使用启用了 `persistence.active_provider` 的配置,否则 `/api/v1/` 管理 API 不会注册,Console 会显示 setup/unavailable 状态。 + +生产构建产物不会直接提交 `webui/dist/`;`make webui-build` 会把它复制到 `internal/service/webui/dist/`,该目录由 `go:embed` 打包。 + ## 运行 ```bash @@ -87,6 +113,7 @@ cd internal/e2e && PROVIDER=gemini go test -v -count=1 -run TestGoogleGenAIE2E # 使用 Makefile 构建与测试 make build +make build-with-webui make test ``` diff --git a/docs/api.md b/docs/api.md index 2f3257f0..667925fb 100644 --- a/docs/api.md +++ b/docs/api.md @@ -8,6 +8,15 @@ Moon Bridge 对外暴露 OpenAI Responses 兼容端点、模型列表端点和 - **认证**:通过 `auth_token` 配置启用 Bearer Token - **内容类型**:`application/json` +## Web Console + +生产二进制会在 `/console/` 提供嵌入式 Web Console。Console 使用同源 RPC: + +- `/api/v1/*`:管理 API,用于状态、Provider/Model/Route、配置导入导出、待应用变更等。 +- `/v1/models`、`/v1/responses`:RPC smoke test 面板使用的 OpenAI-compatible 端点。 + +管理 API 只有在配置启用 `persistence.active_provider` 且配置存储初始化成功时可用;否则 `/api/v1/*` 可能返回 404 或 `store_unavailable`。Console 中生成或导入的配置不会立即成为运行态配置,必须先 stage pending changes,再通过 `/api/v1/changes/apply` 应用。 + ## 核心端点 ### POST /v1/responses @@ -60,16 +69,52 @@ data: {"response": {...}} 列出所有可用模型列表。 +响应为 Moon Bridge 目录形态: + +```json +{ + "models": [ + {"slug": "moonbridge", "name": "Moon Bridge", "provider": "route", "model": "claude-sonnet"} + ] +} +``` + ## 管理 API -当 `persistence.active_provider` 启用时,管理 API 在 `/api/v1/` 下可用。 +当 `persistence.active_provider` 启用时,管理 API 在 `/api/v1/` 下可用。写操作会创建待应用变更,通常返回 `202` 和 `change_id`,不会绕过变更队列直接修改运行态。 | 端点 | 方法 | 功能 | |------|------|------| -| `/api/v1/config` | GET/PUT | 获取/更新运行时配置 | -| `/api/v1/codex/config` | GET | 生成 Codex TOML 配置 | -| `/api/v1/providers` | GET/POST/DELETE | 管理 Provider | -| `/api/v1/sessions/{id}` | GET | 获取会话用量统计 | +| `/api/v1/status` | GET | 运行态状态 | +| `/api/v1/providers` | GET | 分页列出 Provider | +| `/api/v1/providers/{key}` | GET/PUT/PATCH/DELETE | 查看、创建、更新、删除 Provider | +| `/api/v1/providers/{key}/offers` | POST | 新增 Provider offer | +| `/api/v1/providers/{key}/offers/{model}` | PATCH/DELETE | 更新或删除 Provider offer | +| `/api/v1/models` | GET | 分页列出模型定义 | +| `/api/v1/models/{slug}` | GET/PUT/DELETE | 查看、创建、删除模型定义 | +| `/api/v1/routes` | GET | 分页列出路由别名 | +| `/api/v1/routes/{alias}` | GET/PUT/DELETE | 查看、创建、删除路由别名 | +| `/api/v1/defaults` | GET/PUT | 查看和 stage 默认模型设置 | +| `/api/v1/web-search` | GET/PUT | 查看和 stage Web Search 设置 | +| `/api/v1/extensions` | GET | 列出扩展名 | +| `/api/v1/extensions/{name}` | GET/PUT | 查看和 stage 扩展 JSON 配置 | +| `/api/v1/config/effective` | GET | 获取 masked 有效配置 | +| `/api/v1/config/export` | GET | 导出 YAML 配置 | +| `/api/v1/config/import` | POST | 导入 YAML 并 stage 变更 | +| `/api/v1/config/validate` | POST | 校验 YAML | +| `/api/v1/changes` | GET | 列出待应用变更 | +| `/api/v1/changes/apply` | POST | 应用待变更并 reload | +| `/api/v1/changes/discard` | POST | 丢弃待变更 | +| `/api/v1/sessions` | GET | 获取会话用量统计 | + +导出带 secrets 的配置时必须使用: + +```http +GET /api/v1/config/export?include_secrets=true +X-Confirm-Secrets: true +``` + +`POST /api/v1/config/validate` 请求字段名为 `config`,内容是 YAML 字符串;校验失败时可能返回 `200` 且 `{"valid":false,"errors":[...]}`。 ## 错误处理 diff --git a/internal/service/app/app.go b/internal/service/app/app.go index bccf2b6a..bc3cf8f6 100644 --- a/internal/service/app/app.go +++ b/internal/service/app/app.go @@ -282,6 +282,7 @@ func runTransform(ctx context.Context, cfg config.Config, errors io.Writer) erro PluginRegistry: plugins, AppConfig: serverCfg, Runtime: rt, + Store: cs, AdapterRegistry: adapterReg, SessionManager: sessMgr, UsageTracker: usageTrk, diff --git a/internal/service/webui/dist/assets/app.js b/internal/service/webui/dist/assets/app.js deleted file mode 100644 index ed06975b..00000000 --- a/internal/service/webui/dist/assets/app.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Moon Bridge console placeholder"); diff --git a/internal/service/webui/dist/assets/index-DunuJL0K.js b/internal/service/webui/dist/assets/index-DunuJL0K.js new file mode 100644 index 00000000..692af563 --- /dev/null +++ b/internal/service/webui/dist/assets/index-DunuJL0K.js @@ -0,0 +1,779 @@ +function tT(e,t){for(var i=0;ir[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();function nT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jh={exports:{}},Fo={};var xb;function iT(){if(xb)return Fo;xb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(r,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:u}}return Fo.Fragment=t,Fo.jsx=i,Fo.jsxs=i,Fo}var wb;function aT(){return wb||(wb=1,jh.exports=iT()),jh.exports}var E=aT(),Nh={exports:{}},Te={};var Cb;function rT(){if(Cb)return Te;Cb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function A(D,I,te){this.props=D,this.context=I,this.refs=R,this.updater=te||x}A.prototype.isReactComponent={},A.prototype.setState=function(D,I){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,I,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function j(){}j.prototype=A.prototype;function L(D,I,te){this.props=D,this.context=I,this.refs=R,this.updater=te||x}var V=L.prototype=new j;V.constructor=L,C(V,A.prototype),V.isPureReactComponent=!0;var q=Array.isArray;function W(){}var K={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ne(D,I,te){var re=te.ref;return{$$typeof:e,type:D,key:I,ref:re!==void 0?re:null,props:te}}function ee(D,I){return ne(D.type,I,D.props)}function he(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function ae(D){var I={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(te){return I[te]})}var Le=/\/+/g;function Re(D,I){return typeof D=="object"&&D!==null&&D.key!=null?ae(""+D.key):I.toString(36)}function je(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(W,W):(D.status="pending",D.then(function(I){D.status==="pending"&&(D.status="fulfilled",D.value=I)},function(I){D.status==="pending"&&(D.status="rejected",D.reason=I)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function P(D,I,te,re,me){var Se=typeof D;(Se==="undefined"||Se==="boolean")&&(D=null);var ze=!1;if(D===null)ze=!0;else switch(Se){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(D.$$typeof){case e:case t:ze=!0;break;case g:return ze=D._init,P(ze(D._payload),I,te,re,me)}}if(ze)return me=me(D),ze=re===""?"."+Re(D,0):re,q(me)?(te="",ze!=null&&(te=ze.replace(Le,"$&/")+"/"),P(me,I,te,"",function(qa){return qa})):me!=null&&(he(me)&&(me=ee(me,te+(me.key==null||D&&D.key===me.key?"":(""+me.key).replace(Le,"$&/")+"/")+ze)),I.push(me)),1;ze=0;var wt=re===""?".":re+":";if(q(D))for(var it=0;it>>1,ye=P[oe];if(0>>1;oeo(te,ie))reo(me,te)?(P[oe]=me,P[re]=ie,oe=re):(P[oe]=te,P[I]=ie,oe=I);else if(reo(me,ie))P[oe]=me,P[re]=ie,oe=re;else break e}}return J}function o(P,J){var ie=P.sortIndex-J.sortIndex;return ie!==0?ie:P.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],m=[],g=1,y=null,b=3,S=!1,x=!1,C=!1,R=!1,A=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function V(P){for(var J=i(m);J!==null;){if(J.callback===null)r(m);else if(J.startTime<=P)r(m),J.sortIndex=J.expirationTime,t(h,J);else break;J=i(m)}}function q(P){if(C=!1,V(P),!x)if(i(h)!==null)x=!0,W||(W=!0,ae());else{var J=i(m);J!==null&&je(q,J.startTime-P)}}var W=!1,K=-1,T=5,ne=-1;function ee(){return R?!0:!(e.unstable_now()-neP&&ee());){var oe=y.callback;if(typeof oe=="function"){y.callback=null,b=y.priorityLevel;var ye=oe(y.expirationTime<=P);if(P=e.unstable_now(),typeof ye=="function"){y.callback=ye,V(P),J=!0;break t}y===i(h)&&r(h),V(P)}else r(h);y=i(h)}if(y!==null)J=!0;else{var D=i(m);D!==null&&je(q,D.startTime-P),J=!1}}break e}finally{y=null,b=ie,S=!1}J=void 0}}finally{J?ae():W=!1}}}var ae;if(typeof L=="function")ae=function(){L(he)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,Re=Le.port2;Le.port1.onmessage=he,ae=function(){Re.postMessage(null)}}else ae=function(){A(he,0)};function je(P,J){K=A(function(){P(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125oe?(P.sortIndex=ie,t(m,P),i(h)===null&&P===i(m)&&(C?(j(K),K=-1):C=!0,je(q,ie-oe))):(P.sortIndex=ye,t(h,P),x||S||(x=!0,W||(W=!0,ae()))),P},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(P){var J=b;return function(){var ie=b;b=J;try{return P.apply(this,arguments)}finally{b=ie}}}})(Vh)),Vh}var _b;function uT(){return _b||(_b=1,zh.exports=lT()),zh.exports}var $h={exports:{}},Gt={};var Tb;function cT(){if(Tb)return Gt;Tb=1;var e=gm();function t(h){var m="https://react.dev/errors/"+h;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$h.exports=cT(),$h.exports}var Mb;function fT(){if(Mb)return ko;Mb=1;var e=uT(),t=gm(),i=cw();function r(n){var a="https://react.dev/errors/"+n;if(1ye||(n.current=oe[ye],oe[ye]=null,ye--)}function te(n,a){ye++,oe[ye]=n.current,n.current=a}var re=D(null),me=D(null),Se=D(null),ze=D(null);function wt(n,a){switch(te(Se,a),te(me,n),te(re,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?q0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=q0(a),n=G0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}I(re),te(re,n)}function it(){I(re),I(me),I(Se)}function qa(n){n.memoizedState!==null&&te(ze,n);var a=re.current,s=G0(a,n.type);a!==s&&(te(me,n),te(re,s))}function Ar(n){me.current===n&&(I(re),I(me)),ze.current===n&&(I(ze),Po._currentValue=ie)}var Ys,Ot;function on(n){if(Ys===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Ys=a&&a[1]||"",Ot=-1)":-1d||M[l]!==B[d]){var G=` +`+M[l].replace(" at new "," at ");return n.displayName&&G.includes("")&&(G=G.replace("",n.displayName)),G}while(1<=l&&0<=d);break}}}finally{Mr=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?on(s):""}function Ei(n,a){switch(n.tag){case 26:case 27:case 5:return on(n.type);case 16:return on("Lazy");case 13:return n.child!==a&&a!==null?on("Suspense Fallback"):on("Suspense");case 19:return on("SuspenseList");case 0:case 15:return Ks(n.type,!1);case 11:return Ks(n.type.render,!1);case 1:return Ks(n.type,!0);case 31:return on("Activity");default:return""}}function Bl(n){try{var a="",s=null;do a+=Ei(n,s),s=n,n=n.return;while(n);return a}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var Qs=Object.prototype.hasOwnProperty,Or=e.unstable_scheduleCallback,Xs=e.unstable_cancelCallback,xf=e.unstable_shouldYield,wf=e.unstable_requestPaint,Qt=e.unstable_now,Ri=e.unstable_getCurrentPriorityLevel,ea=e.unstable_ImmediatePriority,Zs=e.unstable_UserBlockingPriority,ta=e.unstable_NormalPriority,Qn=e.unstable_LowPriority,On=e.unstable_IdlePriority,Cf=e.log,Ef=e.unstable_setDisableYieldValue,_i=null,Xt=null;function zt(n){if(typeof Cf=="function"&&Ef(n),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(_i,n)}catch{}}var qt=Math.clz32?Math.clz32:Rf,Hl=Math.log,Fl=Math.LN2;function Rf(n){return n>>>=0,n===0?32:31-(Hl(n)/Fl|0)|0}var Ga=256,Ti=262144,Ia=4194304;function Xn(n){var a=n&42;if(a!==0)return a;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Dr(n,a,s){var l=n.pendingLanes;if(l===0)return 0;var d=0,p=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var w=l&134217727;return w!==0?(l=w&~p,l!==0?d=Xn(l):(v&=w,v!==0?d=Xn(v):s||(s=w&~n,s!==0&&(d=Xn(s))))):(w=l&~p,w!==0?d=Xn(w):v!==0?d=Xn(v):s||(s=l&~n,s!==0&&(d=Xn(s)))),d===0?0:a!==0&&a!==d&&(a&p)===0&&(p=d&-d,s=a&-a,p>=s||p===32&&(s&4194048)!==0)?a:d}function na(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function _f(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Js(){var n=Ia;return Ia<<=1,(Ia&62914560)===0&&(Ia=4194304),n}function ia(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function ci(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function kl(n,a,s,l,d,p){var v=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var w=n.entanglements,M=n.expirationTimes,B=n.hiddenUpdates;for(s=v&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Oi=/[\n"\\]/g;function Jt(n){return n.replace(Oi,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Ws(n,a,s,l,d,p,v,w){n.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?n.type=v:n.removeAttribute("type"),a!=null?v==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+at(a)):n.value!==""+at(a)&&(n.value=""+at(a)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),a!=null?Tf(n,v,at(a)):s!=null?Tf(n,v,at(s)):l!=null&&n.removeAttribute("value"),d==null&&p!=null&&(n.defaultChecked=!!p),d!=null&&(n.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.name=""+at(w):n.removeAttribute("name")}function Pg(n,a,s,l,d,p,v,w){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(n.type=p),a!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||a!=null)){Lr(n);return}s=s!=null?""+at(s):"",a=a!=null?""+at(a):s,w||a===n.value||(n.value=a),n.defaultValue=a}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=w?n.checked:!!l,n.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.name=v),Lr(n)}function Tf(n,a,s){a==="number"&&Ze(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Vr(n,a,s,l){if(n=n.options,a){a={};for(var d=0;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jf=!1;if(ji)try{var to={};Object.defineProperty(to,"passive",{get:function(){jf=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{jf=!1}var ra=null,Nf=null,Yl=null;function Gg(){if(Yl)return Yl;var n,a=Nf,s=a.length,l,d="value"in ra?ra.value:ra.textContent,p=d.length;for(n=0;n=ao),Zg=" ",Jg=!1;function Wg(n,a){switch(n){case"keyup":return CR.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ey(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Br=!1;function RR(n,a){switch(n){case"compositionend":return ey(a);case"keypress":return a.which!==32?null:(Jg=!0,Zg);case"textInput":return n=a.data,n===Zg&&Jg?null:n;default:return null}}function _R(n,a){if(Br)return n==="compositionend"||!Pf&&Wg(n,a)?(n=Gg(),Yl=Nf=ra=null,Br=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:s,offset:a-n};n=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=ly(s)}}function cy(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?cy(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function fy(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Ze(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=Ze(n.document)}return a}function Hf(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var LR=ji&&"documentMode"in document&&11>=document.documentMode,Hr=null,Ff=null,lo=null,kf=!1;function dy(n,a,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;kf||Hr==null||Hr!==Ze(l)||(l=Hr,"selectionStart"in l&&Hf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),lo&&oo(lo,l)||(lo=l,l=Bu(Ff,"onSelect"),0>=v,d-=v,fi=1<<32-qt(a)+d|s<De?(Be=pe,pe=null):Be=pe.sibling;var Ke=F($,pe,U[De],Y);if(Ke===null){pe===null&&(pe=Be);break}n&&pe&&Ke.alternate===null&&a($,pe),N=p(Ke,N,De),Ye===null?ge=Ke:Ye.sibling=Ke,Ye=Ke,pe=Be}if(De===U.length)return s($,pe),He&&Li($,De),ge;if(pe===null){for(;DeDe?(Be=pe,pe=null):Be=pe.sibling;var Ta=F($,pe,Ke.value,Y);if(Ta===null){pe===null&&(pe=Be);break}n&&pe&&Ta.alternate===null&&a($,pe),N=p(Ta,N,De),Ye===null?ge=Ta:Ye.sibling=Ta,Ye=Ta,pe=Be}if(Ke.done)return s($,pe),He&&Li($,De),ge;if(pe===null){for(;!Ke.done;De++,Ke=U.next())Ke=Q($,Ke.value,Y),Ke!==null&&(N=p(Ke,N,De),Ye===null?ge=Ke:Ye.sibling=Ke,Ye=Ke);return He&&Li($,De),ge}for(pe=l(pe);!Ke.done;De++,Ke=U.next())Ke=k(pe,$,De,Ke.value,Y),Ke!==null&&(n&&Ke.alternate!==null&&pe.delete(Ke.key===null?De:Ke.key),N=p(Ke,N,De),Ye===null?ge=Ke:Ye.sibling=Ke,Ye=Ke);return n&&pe.forEach(function(eT){return a($,eT)}),He&&Li($,De),ge}function nt($,N,U,Y){if(typeof U=="object"&&U!==null&&U.type===C&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case S:e:{for(var ge=U.key;N!==null;){if(N.key===ge){if(ge=U.type,ge===C){if(N.tag===7){s($,N.sibling),Y=d(N,U.props.children),Y.return=$,$=Y;break e}}else if(N.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===T&&nr(ge)===N.type){s($,N.sibling),Y=d(N,U.props),mo(Y,U),Y.return=$,$=Y;break e}s($,N);break}else a($,N);N=N.sibling}U.type===C?(Y=Za(U.props.children,$.mode,Y,U.key),Y.return=$,$=Y):(Y=iu(U.type,U.key,U.props,null,$.mode,Y),mo(Y,U),Y.return=$,$=Y)}return v($);case x:e:{for(ge=U.key;N!==null;){if(N.key===ge)if(N.tag===4&&N.stateNode.containerInfo===U.containerInfo&&N.stateNode.implementation===U.implementation){s($,N.sibling),Y=d(N,U.children||[]),Y.return=$,$=Y;break e}else{s($,N);break}else a($,N);N=N.sibling}Y=Xf(U,$.mode,Y),Y.return=$,$=Y}return v($);case T:return U=nr(U),nt($,N,U,Y)}if(je(U))return fe($,N,U,Y);if(ae(U)){if(ge=ae(U),typeof ge!="function")throw Error(r(150));return U=ge.call(U),xe($,N,U,Y)}if(typeof U.then=="function")return nt($,N,cu(U),Y);if(U.$$typeof===L)return nt($,N,su($,U),Y);fu($,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,N!==null&&N.tag===6?(s($,N.sibling),Y=d(N,U),Y.return=$,$=Y):(s($,N),Y=Qf(U,$.mode,Y),Y.return=$,$=Y),v($)):s($,N)}return function($,N,U,Y){try{po=0;var ge=nt($,N,U,Y);return Jr=null,ge}catch(pe){if(pe===Zr||pe===lu)throw pe;var Ye=bn(29,pe,null,$.mode);return Ye.lanes=Y,Ye.return=$,Ye}}}var ar=zy(!0),Vy=zy(!1),ca=!1;function ld(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ud(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function fa(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function da(n,a,s){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Qe&2)!==0){var d=l.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a,a=nu(n),by(n,null,s),a}return tu(n,l,a,s),nu(n)}function go(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var l=a.lanes;l&=n.pendingLanes,s|=l,a.lanes=s,Gl(n,s)}}function cd(n,a){var s=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var d=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var v={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?d=p=v:p=p.next=v,s=s.next}while(s!==null);p===null?d=p=a:p=p.next=a}else d=p=a;s={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,callbacks:l.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var fd=!1;function yo(){if(fd){var n=Xr;if(n!==null)throw n}}function vo(n,a,s,l){fd=!1;var d=n.updateQueue;ca=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var M=w,B=M.next;M.next=null,v===null?p=B:v.next=B,v=M;var G=n.alternate;G!==null&&(G=G.updateQueue,w=G.lastBaseUpdate,w!==v&&(w===null?G.firstBaseUpdate=B:w.next=B,G.lastBaseUpdate=M))}if(p!==null){var Q=d.baseState;v=0,G=B=M=null,w=p;do{var F=w.lane&-536870913,k=F!==w.lane;if(k?(Ue&F)===F:(l&F)===F){F!==0&&F===Qr&&(fd=!0),G!==null&&(G=G.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var fe=n,xe=w;F=a;var nt=s;switch(xe.tag){case 1:if(fe=xe.payload,typeof fe=="function"){Q=fe.call(nt,Q,F);break e}Q=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=xe.payload,F=typeof fe=="function"?fe.call(nt,Q,F):fe,F==null)break e;Q=y({},Q,F);break e;case 2:ca=!0}}F=w.callback,F!==null&&(n.flags|=64,k&&(n.flags|=8192),k=d.callbacks,k===null?d.callbacks=[F]:k.push(F))}else k={lane:F,tag:w.tag,payload:w.payload,callback:w.callback,next:null},G===null?(B=G=k,M=Q):G=G.next=k,v|=F;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;k=w,w=k.next,k.next=null,d.lastBaseUpdate=k,d.shared.pending=null}}while(!0);G===null&&(M=Q),d.baseState=M,d.firstBaseUpdate=B,d.lastBaseUpdate=G,p===null&&(d.shared.lanes=0),ya|=v,n.lanes=v,n.memoizedState=Q}}function $y(n,a){if(typeof n!="function")throw Error(r(191,n));n.call(a)}function Py(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;np?p:8;var v=P.T,w={};P.T=w,Od(n,!1,a,s);try{var M=d(),B=P.S;if(B!==null&&B(w,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var G=kR(M,l);xo(n,a,G,En(n))}else xo(n,a,l,En(n))}catch(Q){xo(n,a,{then:function(){},status:"rejected",reason:Q},En())}finally{J.p=p,v!==null&&w.types!==null&&(v.types=w.types),P.T=v}}function QR(){}function Ad(n,a,s,l){if(n.tag!==5)throw Error(r(476));var d=gv(n).queue;mv(n,d,a,ie,s===null?QR:function(){return yv(n),s(l)})}function gv(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:ie},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function yv(n){var a=gv(n);a.next===null&&(a=n.alternate.memoizedState),xo(n,a.next.queue,{},En())}function Md(){return Ut(Po)}function vv(){return St().memoizedState}function bv(){return St().memoizedState}function XR(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=En();n=fa(s);var l=da(a,n,s);l!==null&&(pn(l,a,s),go(l,a,s)),a={cache:ad()},n.payload=a;return}a=a.return}}function ZR(n,a,s){var l=En();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},xu(n)?xv(a,s):(s=Yf(n,a,s,l),s!==null&&(pn(s,n,l),wv(s,a,l)))}function Sv(n,a,s){var l=En();xo(n,a,s,l)}function xo(n,a,s,l){var d={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(xu(n))xv(a,d);else{var p=n.alternate;if(n.lanes===0&&(p===null||p.lanes===0)&&(p=a.lastRenderedReducer,p!==null))try{var v=a.lastRenderedState,w=p(v,s);if(d.hasEagerState=!0,d.eagerState=w,vn(w,v))return tu(n,a,d,0),rt===null&&eu(),!1}catch{}if(s=Yf(n,a,d,l),s!==null)return pn(s,n,l),wv(s,a,l),!0}return!1}function Od(n,a,s,l){if(l={lane:2,revertLane:lh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},xu(n)){if(a)throw Error(r(479))}else a=Yf(n,s,l,2),a!==null&&pn(a,n,2)}function xu(n){var a=n.alternate;return n===Oe||a!==null&&a===Oe}function xv(n,a){es=pu=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function wv(n,a,s){if((s&4194048)!==0){var l=a.lanes;l&=n.pendingLanes,s|=l,a.lanes=s,Gl(n,s)}}var wo={readContext:Ut,use:yu,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};wo.useEffectEvent=pt;var Cv={readContext:Ut,use:yu,useCallback:function(n,a){return Wt().memoizedState=[n,a===void 0?null:a],n},useContext:Ut,useEffect:sv,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,bu(4194308,4,cv.bind(null,a,n),s)},useLayoutEffect:function(n,a){return bu(4194308,4,n,a)},useInsertionEffect:function(n,a){bu(4,2,n,a)},useMemo:function(n,a){var s=Wt();a=a===void 0?null:a;var l=n();if(rr){zt(!0);try{n()}finally{zt(!1)}}return s.memoizedState=[l,a],l},useReducer:function(n,a,s){var l=Wt();if(s!==void 0){var d=s(a);if(rr){zt(!0);try{s(a)}finally{zt(!1)}}}else d=a;return l.memoizedState=l.baseState=d,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:d},l.queue=n,n=n.dispatch=ZR.bind(null,Oe,n),[l.memoizedState,n]},useRef:function(n){var a=Wt();return n={current:n},a.memoizedState=n},useState:function(n){n=Cd(n);var a=n.queue,s=Sv.bind(null,Oe,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:_d,useDeferredValue:function(n,a){var s=Wt();return Td(s,n,a)},useTransition:function(){var n=Cd(!1);return n=mv.bind(null,Oe,n.queue,!0,!1),Wt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var l=Oe,d=Wt();if(He){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),rt===null)throw Error(r(349));(Ue&127)!==0||qy(l,a,s)}d.memoizedState=s;var p={value:s,getSnapshot:a};return d.queue=p,sv(Iy.bind(null,l,p,n),[n]),l.flags|=2048,ns(9,{destroy:void 0},Gy.bind(null,l,p,s,a),null),s},useId:function(){var n=Wt(),a=rt.identifierPrefix;if(He){var s=di,l=fi;s=(l&~(1<<32-qt(l)-1)).toString(32)+s,a="_"+a+"R_"+s,s=mu++,0<\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?p.multiple=!0:l.size&&(p.size=l.size);break;default:p=typeof l.is=="string"?v.createElement(d,{is:l.is}):v.createElement(d)}}p[se]=a,p[ue]=l;e:for(v=a.child;v!==null;){if(v.tag===5||v.tag===6)p.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===a)break e;for(;v.sibling===null;){if(v.return===null||v.return===a)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}a.stateNode=p;e:switch(Ht(p,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Bi(a)}}return ft(a),qd(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,s),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==l&&Bi(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(r(166));if(n=Se.current,Yr(a)){if(n=a.stateNode,s=a.memoizedProps,l=null,d=Pt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}n[se]=a,n=!!(n.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||F0(n.nodeValue,s)),n||la(a,!0)}else n=Hu(n).createTextNode(l),n[se]=a,a.stateNode=n}return ft(a),null;case 31:if(s=a.memoizedState,n===null||n.memoizedState!==null){if(l=Yr(a),s!==null){if(n===null){if(!l)throw Error(r(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[se]=a}else Ja(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ft(a),n=!1}else s=ed(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return a.flags&256?(xn(a),a):(xn(a),null);if((a.flags&128)!==0)throw Error(r(558))}return ft(a),null;case 13:if(l=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(d=Yr(a),l!==null&&l.dehydrated!==null){if(n===null){if(!d)throw Error(r(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[se]=a}else Ja(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ft(a),d=!1}else d=ed(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(xn(a),a):(xn(a),null)}return xn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=l!==null,n=n!==null&&n.memoizedState!==null,s&&(l=a.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048)),s!==n&&s&&(a.child.flags|=8192),_u(a,a.updateQueue),ft(a),null);case 4:return it(),n===null&&dh(a.stateNode.containerInfo),ft(a),null;case 10:return Vi(a.type),ft(a),null;case 19:if(I(bt),l=a.memoizedState,l===null)return ft(a),null;if(d=(a.flags&128)!==0,p=l.rendering,p===null)if(d)Eo(l,!1);else{if(mt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(p=hu(n),p!==null){for(a.flags|=128,Eo(l,!1),n=p.updateQueue,a.updateQueue=n,_u(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)Sy(s,n),s=s.sibling;return te(bt,bt.current&1|2),He&&Li(a,l.treeForkCount),a.child}n=n.sibling}l.tail!==null&&Qt()>Du&&(a.flags|=128,d=!0,Eo(l,!1),a.lanes=4194304)}else{if(!d)if(n=hu(p),n!==null){if(a.flags|=128,d=!0,n=n.updateQueue,a.updateQueue=n,_u(a,n),Eo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!He)return ft(a),null}else 2*Qt()-l.renderingStartTime>Du&&s!==536870912&&(a.flags|=128,d=!0,Eo(l,!1),a.lanes=4194304);l.isBackwards?(p.sibling=a.child,a.child=p):(n=l.last,n!==null?n.sibling=p:a.child=p,l.last=p)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Qt(),n.sibling=null,s=bt.current,te(bt,d?s&1|2:s&1),He&&Li(a,l.treeForkCount),n):(ft(a),null);case 22:case 23:return xn(a),hd(),l=a.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(a.flags|=8192):l&&(a.flags|=8192),l?(s&536870912)!==0&&(a.flags&128)===0&&(ft(a),a.subtreeFlags&6&&(a.flags|=8192)):ft(a),s=a.updateQueue,s!==null&&_u(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==s&&(a.flags|=2048),n!==null&&I(tr),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Vi(Ct),ft(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function n_(n,a){switch(Jf(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Vi(Ct),it(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Ar(a),null;case 31:if(a.memoizedState!==null){if(xn(a),a.alternate===null)throw Error(r(340));Ja()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(xn(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ja()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return I(bt),null;case 4:return it(),null;case 10:return Vi(a.type),null;case 22:case 23:return xn(a),hd(),n!==null&&I(tr),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Vi(Ct),null;case 25:return null;default:return null}}function Yv(n,a){switch(Jf(a),a.tag){case 3:Vi(Ct),it();break;case 26:case 27:case 5:Ar(a);break;case 4:it();break;case 31:a.memoizedState!==null&&xn(a);break;case 13:xn(a);break;case 19:I(bt);break;case 10:Vi(a.type);break;case 22:case 23:xn(a),hd(),n!==null&&I(tr);break;case 24:Vi(Ct)}}function Ro(n,a){try{var s=a.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var d=l.next;s=d;do{if((s.tag&n)===n){l=void 0;var p=s.create,v=s.inst;l=p(),v.destroy=l}s=s.next}while(s!==d)}}catch(w){We(a,a.return,w)}}function ma(n,a,s){try{var l=a.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&n)===n){var v=l.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,d=a;var M=s,B=w;try{B()}catch(G){We(d,M,G)}}}l=l.next}while(l!==p)}}catch(G){We(a,a.return,G)}}function Kv(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{Py(a,s)}catch(l){We(n,n.return,l)}}}function Qv(n,a,s){s.props=sr(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(l){We(n,a,l)}}function _o(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof s=="function"?n.refCleanup=s(l):s.current=l}}catch(d){We(n,a,d)}}function hi(n,a){var s=n.ref,l=n.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(d){We(n,a,d)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){We(n,a,d)}else s.current=null}function Xv(n){var a=n.type,s=n.memoizedProps,l=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(d){We(n,n.return,d)}}function Gd(n,a,s){try{var l=n.stateNode;E_(l,n.type,s,a),l[ue]=a}catch(d){We(n,n.return,d)}}function Zv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&wa(n.type)||n.tag===4}function Id(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Zv(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&wa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Yd(n,a,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Di));else if(l!==4&&(l===27&&wa(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for(Yd(n,a,s),n=n.sibling;n!==null;)Yd(n,a,s),n=n.sibling}function Tu(n,a,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(l!==4&&(l===27&&wa(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(Tu(n,a,s),n=n.sibling;n!==null;)Tu(n,a,s),n=n.sibling}function Jv(n){var a=n.stateNode,s=n.memoizedProps;try{for(var l=n.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Ht(a,l,s),a[se]=n,a[ue]=s}catch(p){We(n,n.return,p)}}var Hi=!1,_t=!1,Kd=!1,Wv=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function i_(n,a){if(n=n.containerInfo,mh=Ku,n=fy(n),Hf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var v=0,w=-1,M=-1,B=0,G=0,Q=n,F=null;t:for(;;){for(var k;Q!==s||d!==0&&Q.nodeType!==3||(w=v+d),Q!==p||l!==0&&Q.nodeType!==3||(M=v+l),Q.nodeType===3&&(v+=Q.nodeValue.length),(k=Q.firstChild)!==null;)F=Q,Q=k;for(;;){if(Q===n)break t;if(F===s&&++B===d&&(w=v),F===p&&++G===l&&(M=v),(k=Q.nextSibling)!==null)break;Q=F,F=Q.parentNode}Q=k}s=w===-1||M===-1?null:{start:w,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(gh={focusedElem:n,selectionRange:s},Ku=!1,Vt=a;Vt!==null;)if(a=Vt,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Vt=n;else for(;Vt!==null;){switch(a=Vt,p=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),Ht(p,l,s),p[se]=n,Ge(p),l=p;break e;case"link":var v=rb("link","href",d).get(l+(s.href||""));if(v){for(var w=0;wnt&&(v=nt,nt=xe,xe=v);var $=uy(w,xe),N=uy(w,nt);if($&&N&&(k.rangeCount!==1||k.anchorNode!==$.node||k.anchorOffset!==$.offset||k.focusNode!==N.node||k.focusOffset!==N.offset)){var U=Q.createRange();U.setStart($.node,$.offset),k.removeAllRanges(),xe>nt?(k.addRange(U),k.extend(N.node,N.offset)):(U.setEnd(N.node,N.offset),k.addRange(U))}}}}for(Q=[],k=w;k=k.parentNode;)k.nodeType===1&&Q.push({element:k,left:k.scrollLeft,top:k.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;ws?32:s,P.T=null,s=th,th=null;var p=ba,v=Ii;if(Dt=0,os=ba=null,Ii=0,(Qe&6)!==0)throw Error(r(331));var w=Qe;if(Qe|=4,c0(p.current),o0(p,p.current,v,s),Qe=w,jo(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(_i,p)}catch{}return!0}finally{J.p=d,P.T=l,A0(n,a)}}function O0(n,a,s){a=Nn(s,a),a=Ld(n.stateNode,a,2),n=da(n,a,2),n!==null&&(ci(n,2),pi(n))}function We(n,a,s){if(n.tag===3)O0(n,n,s);else for(;a!==null;){if(a.tag===3){O0(a,n,s);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(va===null||!va.has(l))){n=Nn(s,n),s=Dv(2),l=da(a,s,2),l!==null&&(jv(s,l,a,n),ci(l,2),pi(l));break}}a=a.return}}function rh(n,a,s){var l=n.pingCache;if(l===null){l=n.pingCache=new s_;var d=new Set;l.set(a,d)}else d=l.get(a),d===void 0&&(d=new Set,l.set(a,d));d.has(s)||(Zd=!0,d.add(s),n=f_.bind(null,n,a,s),a.then(n,n))}function f_(n,a,s){var l=n.pingCache;l!==null&&l.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,rt===n&&(Ue&s)===s&&(mt===4||mt===3&&(Ue&62914560)===Ue&&300>Qt()-Ou?(Qe&2)===0&&ls(n,0):Jd|=s,ss===Ue&&(ss=0)),pi(n)}function D0(n,a){a===0&&(a=Js()),n=Xa(n,a),n!==null&&(ci(n,a),pi(n))}function d_(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),D0(n,s)}function h_(n,a){var s=0;switch(n.tag){case 31:case 13:var l=n.stateNode,d=n.memoizedState;d!==null&&(s=d.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(a),D0(n,s)}function p_(n,a){return Or(n,a)}var $u=null,cs=null,sh=!1,Pu=!1,oh=!1,xa=0;function pi(n){n!==cs&&n.next===null&&(cs===null?$u=cs=n:cs=cs.next=n),Pu=!0,sh||(sh=!0,g_())}function jo(n,a){if(!oh&&Pu){oh=!0;do for(var s=!1,l=$u;l!==null;){if(n!==0){var d=l.pendingLanes;if(d===0)var p=0;else{var v=l.suspendedLanes,w=l.pingedLanes;p=(1<<31-qt(42|n)+1)-1,p&=d&~(v&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,z0(l,p))}else p=Ue,p=Dr(l,l===rt?p:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(p&3)===0||na(l,p)||(s=!0,z0(l,p));l=l.next}while(s);oh=!1}}function m_(){j0()}function j0(){Pu=sh=!1;var n=0;xa!==0&&__()&&(n=xa);for(var a=Qt(),s=null,l=$u;l!==null;){var d=l.next,p=N0(l,a);p===0?(l.next=null,s===null?$u=d:s.next=d,d===null&&(cs=s)):(s=l,(n!==0||(p&3)!==0)&&(Pu=!0)),l=d}Dt!==0&&Dt!==5||jo(n),xa!==0&&(xa=0)}function N0(n,a){for(var s=n.suspendedLanes,l=n.pingedLanes,d=n.expirationTimes,p=n.pendingLanes&-62914561;0w)break;var G=M.transferSize,Q=M.initiatorType;G&&k0(Q)&&(M=M.responseEnd,v+=G*(M"u"?null:document;function tb(n,a,s){var l=fs;if(l&&typeof a=="string"&&a){var d=Jt(a);d='link[rel="'+n+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),eb.has(d)||(eb.add(d),n={rel:n,crossOrigin:s,href:a},l.querySelector(d)===null&&(a=l.createElement("link"),Ht(a,"link",n),Ge(a),l.head.appendChild(a)))}}function z_(n){Yi.D(n),tb("dns-prefetch",n,null)}function V_(n,a){Yi.C(n,a),tb("preconnect",n,a)}function $_(n,a,s){Yi.L(n,a,s);var l=fs;if(l&&n&&a){var d='link[rel="preload"][as="'+Jt(a)+'"]';a==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+Jt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+Jt(s.imageSizes)+'"]')):d+='[href="'+Jt(n)+'"]';var p=d;switch(a){case"style":p=ds(n);break;case"script":p=hs(n)}Un.has(p)||(n=y({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),Un.set(p,n),l.querySelector(d)!==null||a==="style"&&l.querySelector(Vo(p))||a==="script"&&l.querySelector($o(p))||(a=l.createElement("link"),Ht(a,"link",n),Ge(a),l.head.appendChild(a)))}}function P_(n,a){Yi.m(n,a);var s=fs;if(s&&n){var l=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+Jt(l)+'"][href="'+Jt(n)+'"]',p=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=hs(n)}if(!Un.has(p)&&(n=y({rel:"modulepreload",href:n},a),Un.set(p,n),s.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector($o(p)))return}l=s.createElement("link"),Ht(l,"link",n),Ge(l),s.head.appendChild(l)}}}function U_(n,a,s){Yi.S(n,a,s);var l=fs;if(l&&n){var d=vt(l).hoistableStyles,p=ds(n);a=a||"default";var v=d.get(p);if(!v){var w={loading:0,preload:null};if(v=l.querySelector(Vo(p)))w.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":a},s),(s=Un.get(p))&&Ch(n,s);var M=v=l.createElement("link");Ge(M),Ht(M,"link",n),M._p=new Promise(function(B,G){M.onload=B,M.onerror=G}),M.addEventListener("load",function(){w.loading|=1}),M.addEventListener("error",function(){w.loading|=2}),w.loading|=4,ku(v,a,l)}v={type:"stylesheet",instance:v,count:1,state:w},d.set(p,v)}}}function B_(n,a){Yi.X(n,a);var s=fs;if(s&&n){var l=vt(s).hoistableScripts,d=hs(n),p=l.get(d);p||(p=s.querySelector($o(d)),p||(n=y({src:n,async:!0},a),(a=Un.get(d))&&Eh(n,a),p=s.createElement("script"),Ge(p),Ht(p,"link",n),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(d,p))}}function H_(n,a){Yi.M(n,a);var s=fs;if(s&&n){var l=vt(s).hoistableScripts,d=hs(n),p=l.get(d);p||(p=s.querySelector($o(d)),p||(n=y({src:n,async:!0,type:"module"},a),(a=Un.get(d))&&Eh(n,a),p=s.createElement("script"),Ge(p),Ht(p,"link",n),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(d,p))}}function nb(n,a,s,l){var d=(d=Se.current)?Fu(d):null;if(!d)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=ds(s.href),s=vt(d).hoistableStyles,l=s.get(a),l||(l={type:"style",instance:null,count:0,state:null},s.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=ds(s.href);var p=vt(d).hoistableStyles,v=p.get(n);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(n,v),(p=d.querySelector(Vo(n)))&&!p._p&&(v.instance=p,v.state.loading=5),Un.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Un.set(n,s),p||F_(d,n,s,v.state))),a&&l===null)throw Error(r(528,""));return v}if(a&&l!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=hs(s),s=vt(d).hoistableScripts,l=s.get(a),l||(l={type:"script",instance:null,count:0,state:null},s.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function ds(n){return'href="'+Jt(n)+'"'}function Vo(n){return'link[rel="stylesheet"]['+n+"]"}function ib(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function F_(n,a,s,l){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=n.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),Ht(a,"link",s),Ge(a),n.head.appendChild(a))}function hs(n){return'[src="'+Jt(n)+'"]'}function $o(n){return"script[async]"+n}function ab(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var l=n.querySelector('style[data-href~="'+Jt(s.href)+'"]');if(l)return a.instance=l,Ge(l),l;var d=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),Ge(l),Ht(l,"style",d),ku(l,s.precedence,n),a.instance=l;case"stylesheet":d=ds(s.href);var p=n.querySelector(Vo(d));if(p)return a.state.loading|=4,a.instance=p,Ge(p),p;l=ib(s),(d=Un.get(d))&&Ch(l,d),p=(n.ownerDocument||n).createElement("link"),Ge(p);var v=p;return v._p=new Promise(function(w,M){v.onload=w,v.onerror=M}),Ht(p,"link",l),a.state.loading|=4,ku(p,s.precedence,n),a.instance=p;case"script":return p=hs(s.src),(d=n.querySelector($o(p)))?(a.instance=d,Ge(d),d):(l=s,(d=Un.get(p))&&(l=y({},s),Eh(l,d)),n=n.ownerDocument||n,d=n.createElement("script"),Ge(d),Ht(d,"link",l),n.head.appendChild(d),a.instance=d);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(l=a.instance,a.state.loading|=4,ku(l,s.precedence,n));return a.instance}function ku(n,a,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,p=d,v=0;v title"):null)}function k_(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(n=a.disabled,typeof a.precedence=="string"&&n==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function ob(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function q_(n,a,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=ds(l.href),p=a.querySelector(Vo(d));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=Gu.bind(n),a.then(n,n)),s.state.loading|=4,s.instance=p,Ge(p);return}p=a.ownerDocument||a,l=ib(l),(d=Un.get(d))&&Ch(l,d),p=p.createElement("link"),Ge(p);var v=p;v._p=new Promise(function(w,M){v.onload=w,v.onerror=M}),Ht(p,"link",l),s.instance=p}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Gu.bind(n),a.addEventListener("load",s),a.addEventListener("error",s))}}var Rh=0;function G_(n,a){return n.stylesheets&&n.count===0&&Yu(n,n.stylesheets),0Rh?50:800)+a);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Iu=null;function Yu(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Iu=new Map,a.forEach(I_,n),Iu=null,Gu.call(n))}function I_(n,a){if(!(a.state.loading&4)){var s=Iu.get(n);if(s)var l=s.get(null);else{s=new Map,Iu.set(n,s);for(var d=n.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Lh.exports=fT(),Lh.exports}var hT=dT(),$s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pT=class extends $s{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ym=new pT,mT={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gT=class{#e=mT;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},pr=new gT;function yT(e){setTimeout(e,0)}var vT=typeof window>"u"||"Deno"in globalThis;function tn(){}function bT(e,t){return typeof e=="function"?e(t):e}function vp(e){return typeof e=="number"&&e>=0&&e!==1/0}function fw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function za(e,t){return typeof e=="function"?e(t):e}function Rn(e,t){return typeof e=="function"?e(t):e}function Db(e,t){const{type:i="all",exact:r,fetchStatus:o,predicate:u,queryKey:c,stale:f}=e;if(c){if(r){if(t.queryHash!==vm(c,t.options))return!1}else if(!cl(t.queryKey,c))return!1}if(i!=="all"){const h=t.isActive();if(i==="active"&&!h||i==="inactive"&&h)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||u&&!u(t))}function jb(e,t){const{exact:i,status:r,predicate:o,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(i){if(Cr(t.options.mutationKey)!==Cr(u))return!1}else if(!cl(t.options.mutationKey,u))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function vm(e,t){return(t?.queryKeyHashFn||Cr)(e)}function Cr(e){return JSON.stringify(e,(t,i)=>bp(i)?Object.keys(i).sort().reduce((r,o)=>(r[o]=i[o],r),{}):i)}function cl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(i=>cl(e[i],t[i])):!1}var ST=Object.prototype.hasOwnProperty;function dw(e,t,i=0){if(e===t)return e;if(i>500)return t;const r=Nb(e)&&Nb(t);if(!r&&!(bp(e)&&bp(t)))return t;const u=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),f=c.length,h=r?new Array(f):{};let m=0;for(let g=0;g{pr.setTimeout(t,e)})}function Sp(e,t,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,t):i.structuralSharing!==!1?dw(e,t):t}function wT(e,t,i=0){const r=[...e,t];return i&&r.length>i?r.slice(1):r}function CT(e,t,i=0){const r=[t,...e];return i&&r.length>i?r.slice(0,-1):r}var bm=Symbol();function hw(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===bm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Sm(e,t){return typeof e=="function"?e(...t):!!e}function ET(e,t,i){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),r||(r=!0,o.aborted?i():o.addEventListener("abort",i,{once:!0})),o)}),e}var fl=(()=>{let e=()=>vT;return{isServer(){return e()},setIsServer(t){e=t}}})();function xp(){let e,t;const i=new Promise((o,u)=>{e=o,t=u});i.status="pending",i.catch(()=>{});function r(o){Object.assign(i,o),delete i.resolve,delete i.reject}return i.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},i.reject=o=>{r({status:"rejected",reason:o}),t(o)},i}var RT=yT;function _T(){let e=[],t=0,i=f=>{f()},r=f=>{f()},o=RT;const u=f=>{t?e.push(f):o(()=>{i(f)})},c=()=>{const f=e;e=[],f.length&&o(()=>{r(()=>{f.forEach(h=>{i(h)})})})};return{batch:f=>{let h;t++;try{h=f()}finally{t--,t||c()}return h},batchCalls:f=>(...h)=>{u(()=>{f(...h)})},schedule:u,setNotifyFunction:f=>{i=f},setBatchNotifyFunction:f=>{r=f},setScheduler:f=>{o=f}}}var Nt=_T(),TT=class extends $s{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Vc=new TT;function AT(e){return Math.min(1e3*2**e,3e4)}function pw(e){return(e??"online")==="online"?Vc.isOnline():!0}var wp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function mw(e){let t=!1,i=0,r;const o=xp(),u=()=>o.status!=="pending",c=C=>{if(!u()){const R=new wp(C);b(R),e.onCancel?.(R)}},f=()=>{t=!0},h=()=>{t=!1},m=()=>ym.isFocused()&&(e.networkMode==="always"||Vc.isOnline())&&e.canRun(),g=()=>pw(e.networkMode)&&e.canRun(),y=C=>{u()||(r?.(),o.resolve(C))},b=C=>{u()||(r?.(),o.reject(C))},S=()=>new Promise(C=>{r=R=>{(u()||m())&&C(R)},e.onPause?.()}).then(()=>{r=void 0,u()||e.onContinue?.()}),x=()=>{if(u())return;let C;const R=i===0?e.initialPromise:void 0;try{C=R??e.fn()}catch(A){C=Promise.reject(A)}Promise.resolve(C).then(y).catch(A=>{if(u())return;const j=e.retry??(fl.isServer()?0:3),L=e.retryDelay??AT,V=typeof L=="function"?L(i,A):L,q=j===!0||typeof j=="number"&&im()?void 0:S()).then(()=>{t?b(A):x()})})};return{promise:o,status:()=>o.status,cancel:c,continue:()=>(r?.(),o),cancelRetry:f,continueRetry:h,canStart:g,start:()=>(g()?x():S().then(x),o)}}var gw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vp(this.gcTime)&&(this.#e=pr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(pr.clearTimeout(this.#e),this.#e=void 0)}};function MT(e){return{onFetch:(t,i)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const m=async()=>{let g=!1;const y=x=>{ET(x,()=>t.signal,()=>g=!0)},b=hw(t.options,t.fetchOptions),S=async(x,C,R)=>{if(g)return Promise.reject(t.signal.reason);if(C==null&&x.pages.length)return Promise.resolve(x);const j=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:C,direction:R?"backward":"forward",meta:t.options.meta};return y(W),W})(),L=await b(j),{maxPages:V}=t.options,q=R?CT:wT;return{pages:q(x.pages,L,V),pageParams:q(x.pageParams,C,V)}};if(o&&u.length){const x=o==="backward",C=x?OT:zb,R={pages:u,pageParams:c},A=C(r,R);f=await S(R,A,x)}else{const x=e??u.length;do{const C=h===0?c[0]??r.initialPageParam:zb(r,f);if(h>0&&C==null)break;f=await S(f,C),h++}while(ht.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},i):t.fetchFn=m}}}function zb(e,{pages:t,pageParams:i}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,i[r],i):void 0}function OT(e,{pages:t,pageParams:i}){return t.length>0?e.getPreviousPageParam?.(t[0],t,i[0],i):void 0}var DT=class extends gw{#e;#t;#n;#i;#r;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#i=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$b(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=$b(this.options);t.data!==void 0&&(this.setState(Vb(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(e,t){const i=Sp(this.state.data,e,this.options);return this.#l({data:i,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),i}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(tn).catch(tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Rn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>za(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!fw(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},o=()=>{const h=hw(this.options,t),g=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(y),y})();return this.#s=!1,this.options.persister?this.options.persister(h,g,this):h(g)},c=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return r(h),h})();(this.#e==="infinite"?MT(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#l({type:"fetch",meta:c.fetchOptions?.meta}),this.#a=mw({initialPromise:t?.initialPromise,fn:c.fetchFn,onCancel:h=>{h instanceof wp&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(h,m)=>{this.#l({type:"failed",failureCount:h,error:m})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#i.config.onSuccess?.(h,this),this.#i.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof wp){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#i.config.onError?.(h,this),this.#i.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const t=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...yw(i.data,this.options),fetchMeta:e.meta??null};case"success":const r={...i,...Vb(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const o=e.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=t(this.state),Nt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:e})})}};function yw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Vb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $b(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,i=t!==void 0,r=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var jT=class extends $s{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=xp(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#a;#o;#s;#c;#l;#p;#f;#d;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Pb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Cp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Cp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!zc(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Ub(this.#t,i,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==i||Rn(this.options.enabled,this.#t)!==Rn(t.enabled,this.#t)||za(this.options.staleTime,this.#t)!==za(t.staleTime,this.#t))&&this.#g();const o=this.#y();r&&(this.#t!==i||Rn(this.options.enabled,this.#t)!==Rn(t.enabled,this.#t)||o!==this.#u)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(t,e);return LT(this,i)&&(this.#i=i,this.#a=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(i,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,t);return i.fetch().then(()=>this.createResult(i,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(tn)),t}#g(){this.#S();const e=za(this.options.staleTime,this.#t);if(fl.isServer()||this.#i.isStale||!vp(e))return;const i=fw(this.#i.dataUpdatedAt,e)+1;this.#f=pr.setTimeout(()=>{this.#i.isStale||this.updateResult()},i)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#u=e,!(fl.isServer()||Rn(this.options.enabled,this.#t)===!1||!vp(this.#u)||this.#u===0)&&(this.#d=pr.setInterval(()=>{(this.options.refetchIntervalInBackground||ym.isFocused())&&this.#h()},this.#u))}#b(){this.#g(),this.#v(this.#y())}#S(){this.#f!==void 0&&(pr.clearTimeout(this.#f),this.#f=void 0)}#x(){this.#d!==void 0&&(pr.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const i=this.#t,r=this.options,o=this.#i,u=this.#r,c=this.#a,h=e!==i?e.state:this.#n,{state:m}=e;let g={...m},y=!1,b;if(t._optimisticResults){const T=this.hasListeners(),ne=!T&&Pb(e,t),ee=T&&Ub(e,i,t,r);(ne||ee)&&(g={...g,...yw(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:S,errorUpdatedAt:x,status:C}=g;b=g.data;let R=!1;if(t.placeholderData!==void 0&&b===void 0&&C==="pending"){let T;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(T=o.data,R=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,T!==void 0&&(C="success",b=Sp(o?.data,T,t),y=!0)}if(t.select&&b!==void 0&&!R)if(o&&b===u?.data&&t.select===this.#c)b=this.#l;else try{this.#c=t.select,b=t.select(b),b=Sp(o?.data,b,t),this.#l=b,this.#s=null}catch(T){this.#s=T}this.#s&&(S=this.#s,b=this.#l,x=Date.now(),C="error");const A=g.fetchStatus==="fetching",j=C==="pending",L=C==="error",V=j&&A,q=b!==void 0,K={status:C,fetchStatus:g.fetchStatus,isPending:j,isSuccess:C==="success",isError:L,isInitialLoading:V,isLoading:V,data:b,dataUpdatedAt:g.dataUpdatedAt,error:S,errorUpdatedAt:x,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!j,isLoadingError:L&&!q,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:L&&q,isStale:xm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Rn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=K.data!==void 0,ne=K.status==="error"&&!T,ee=Le=>{ne?Le.reject(K.error):T&&Le.resolve(K.data)},he=()=>{const Le=this.#o=K.promise=xp();ee(Le)},ae=this.#o;switch(ae.status){case"pending":e.queryHash===i.queryHash&&ee(ae);break;case"fulfilled":(ne||K.data!==ae.value)&&he();break;case"rejected":(!ne||K.error!==ae.reason)&&he();break}}return K}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#p=this.#t),zc(t,e))return;this.#i=t;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#m.size)return!0;const u=new Set(o??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#i).some(c=>{const f=c;return this.#i[f]!==e[f]&&u.has(f)})};this.#C({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(e){Nt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function NT(e,t){return Rn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Rn(t.retryOnMount,e)===!1)}function Pb(e,t){return NT(e,t)||e.state.data!==void 0&&Cp(e,t,t.refetchOnMount)}function Cp(e,t,i){if(Rn(t.enabled,e)!==!1&&za(t.staleTime,e)!=="static"){const r=typeof i=="function"?i(e):i;return r==="always"||r!==!1&&xm(e,t)}return!1}function Ub(e,t,i,r){return(e!==t||Rn(r.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&xm(e,i)}function xm(e,t){return Rn(t.enabled,e)!==!1&&e.isStaleByTime(za(t.staleTime,e))}function LT(e,t){return!zc(e.getCurrentResult(),t)}var zT=class extends gw{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||vw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=mw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#r({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const c=await this.options.onMutate?.(e,i);c!==this.state.context&&this.#r({type:"pending",context:c,variables:e,isPaused:o})}const u=await this.#i.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#r({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#r(e){const t=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Nt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function vw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var VT=class extends $s{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,i){const r=new zT({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:i});return this.add(r),r}add(e){this.#e.add(e);const t=tc(e);if(typeof t=="string"){const i=this.#t.get(t);i?i.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=tc(e);if(typeof t=="string"){const i=this.#t.get(t);if(i)if(i.length>1){const r=i.indexOf(e);r!==-1&&i.splice(r,1)}else i[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=tc(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=tc(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Nt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(i=>jb(t,i))}findAll(e={}){return this.getAll().filter(t=>jb(e,t))}notify(e){Nt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Nt.batch(()=>Promise.all(e.map(t=>t.continue().catch(tn))))}};function tc(e){return e.options.scope?.id}var $T=class extends $s{#e;#t=void 0;#n;#i;constructor(t,i){super(),this.#e=t,this.setOptions(i),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const i=this.options;this.options=this.#e.defaultMutationOptions(t),zc(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Cr(i.mutationKey)!==Cr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,i){return this.#i=i,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??vw();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Nt.batch(()=>{if(this.#i&&this.hasListeners()){const i=this.#t.variables,r=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,i,r,o)}catch(u){Promise.reject(u)}try{this.#i.onSettled?.(t.data,null,i,r,o)}catch(u){Promise.reject(u)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,i,r,o)}catch(u){Promise.reject(u)}try{this.#i.onSettled?.(void 0,t.error,i,r,o)}catch(u){Promise.reject(u)}}}this.listeners.forEach(i=>{i(this.#t)})})}},PT=class extends $s{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,i){const r=t.queryKey,o=t.queryHash??vm(r,t);let u=this.get(o);return u||(u=new DT({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Nt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(i=>Db(t,i))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(i=>Db(e,i)):t}notify(e){Nt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Nt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Nt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},UT=class{#e;#t;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new PT,this.#t=e.mutationCache||new VT,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ym.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Vc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),i=this.#e.build(this,t),r=i.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(za(t.staleTime,i))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:i})=>{const r=i.data;return[t,r]})}setQueryData(e,t,i){const r=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(r.queryHash)?.state.data,c=bT(t,u);if(c!==void 0)return this.#e.build(this,r).setData(c,{...i,manual:!0})}setQueriesData(e,t,i){return Nt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,i)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Nt.batch(()=>{t.findAll(e).forEach(i=>{t.remove(i)})})}resetQueries(e,t){const i=this.#e;return Nt.batch(()=>(i.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const i={revert:!0,...t},r=Nt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(i)));return Promise.all(r).then(tn).catch(tn)}invalidateQueries(e,t={}){return Nt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const i={...t,cancelRefetch:t.cancelRefetch??!0},r=Nt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let u=o.fetch(void 0,i);return i.throwOnError||(u=u.catch(tn)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(r).then(tn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const i=this.#e.build(this,t);return i.isStaleByTime(za(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(tn).catch(tn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(tn).catch(tn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Vc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Cr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],i={};return t.forEach(r=>{cl(e,r.queryKey)&&Object.assign(i,r.defaultOptions)}),i}setMutationDefaults(e,t){this.#r.set(Cr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],i={};return t.forEach(r=>{cl(e,r.mutationKey)&&Object.assign(i,r.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===bm&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},bw=_.createContext(void 0),wm=e=>{const t=_.useContext(bw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},BT=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(bw.Provider,{value:e,children:t})),Sw=_.createContext(!1),HT=()=>_.useContext(Sw);Sw.Provider;function FT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kT=_.createContext(FT()),qT=()=>_.useContext(kT),GT=(e,t,i)=>{const r=i?.state.error&&typeof e.throwOnError=="function"?Sm(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},IT=e=>{_.useEffect(()=>{e.clearReset()},[e])},YT=({result:e,errorResetBoundary:t,throwOnError:i,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Sm(i,[e.error,r])),KT=e=>{if(e.suspense){const i=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>i(r(...o)):i(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QT=(e,t)=>e.isLoading&&e.isFetching&&!t,XT=(e,t)=>e?.suspense&&t.isPending,Bb=(e,t,i)=>t.fetchOptimistic(e).catch(()=>{i.clearReset()});function ZT(e,t,i){const r=HT(),o=qT(),u=wm(),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const f=u.getQueryCache().get(c.queryHash),h=e.subscribed!==!1;c._optimisticResults=r?"isRestoring":h?"optimistic":void 0,KT(c),GT(c,o,f),IT(o);const m=!u.getQueryCache().get(c.queryHash),[g]=_.useState(()=>new t(u,c)),y=g.getOptimisticResult(c),b=!r&&h;if(_.useSyncExternalStore(_.useCallback(S=>{const x=b?g.subscribe(Nt.batchCalls(S)):tn;return g.updateResult(),x},[g,b]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),_.useEffect(()=>{g.setOptions(c)},[c,g]),XT(c,y))throw Bb(c,g,o);if(YT({result:y,errorResetBoundary:o,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(c,y),c.experimental_prefetchInRender&&!fl.isServer()&&QT(y,r)&&(m?Bb(c,g,o):f?.promise)?.catch(tn).finally(()=>{g.updateResult()}),c.notifyOnChangeProps?y:g.trackResult(y)}function nn(e,t){return ZT(e,jT)}function Hb(e,t){const i=wm(),[r]=_.useState(()=>new $T(i,e));_.useEffect(()=>{r.setOptions(e)},[r,e]);const o=_.useSyncExternalStore(_.useCallback(c=>r.subscribe(Nt.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),u=_.useCallback((c,f)=>{r.mutate(c,f).catch(tn)},[r]);if(o.error&&Sm(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}var xw=e=>{throw TypeError(e)},ww=(e,t,i)=>t.has(e)||xw("Cannot "+i),Bn=(e,t,i)=>(ww(e,t,"read from private field"),i?i.call(e):t.get(e)),Xo=(e,t,i)=>t.has(e)?xw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),mi=(e,t,i,r)=>(ww(e,t,"write to private field"),t.set(e,i),i),Fb="popstate";function kb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function JT(e={}){function t(r,o){let u=o.state?.masked,{pathname:c,search:f,hash:h}=u||r.location;return dl("",{pathname:c,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function i(r,o){return typeof o=="string"?o:Si(o)}return eA(t,i,null,e)}function Ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function WT(){return Math.random().toString(36).substring(2,10)}function qb(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dl(e,t,i=null,r,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?wi(t):t,state:i,key:t&&t.key||r||WT(),mask:o}}function Si({pathname:e="/",search:t="",hash:i=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function wi(e){let t={};if(e){let i=e.indexOf("#");i>=0&&(t.hash=e.substring(i),e=e.substring(0,i));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function eA(e,t,i,r={}){let{window:o=document.defaultView,v5Compat:u=!1}=r,c=o.history,f="POP",h=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function y(){f="POP";let R=g(),A=R==null?null:R-m;m=R,h&&h({action:f,location:C.location,delta:A})}function b(R,A){f="PUSH";let j=kb(R)?R:dl(C.location,R,A);m=g()+1;let L=qb(j,m),V=C.createHref(j.mask||j);try{c.pushState(L,"",V)}catch(q){if(q instanceof DOMException&&q.name==="DataCloneError")throw q;o.location.assign(V)}u&&h&&h({action:f,location:C.location,delta:1})}function S(R,A){f="REPLACE";let j=kb(R)?R:dl(C.location,R,A);m=g();let L=qb(j,m),V=C.createHref(j.mask||j);c.replaceState(L,"",V),u&&h&&h({action:f,location:C.location,delta:0})}function x(R){return Cw(R)}let C={get action(){return f},get location(){return e(o,c)},listen(R){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Fb,y),h=R,()=>{o.removeEventListener(Fb,y),h=null}},createHref(R){return t(o,R)},createURL:x,encodeLocation(R){let A=x(R);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:b,replace:S,go(R){return c.go(R)}};return C}function Cw(e,t=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ne(i,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Si(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=i+r),new URL(r,i)}var Zo,Gb=class{constructor(e){if(Xo(this,Zo,new Map),e)for(let[t,i]of e)this.set(t,i)}get(e){if(Bn(this,Zo).has(e))return Bn(this,Zo).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Bn(this,Zo).set(e,t)}};Zo=new WeakMap;var tA=new Set(["lazy","caseSensitive","path","id","index","children"]);function nA(e){return tA.has(e)}var iA=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function aA(e){return iA.has(e)}function rA(e){return e.index===!0}function hl(e,t,i=[],r={},o=!1){return e.map((u,c)=>{let f=[...i,String(c)],h=typeof u.id=="string"?u.id:f.join("-");if(Ne(u.index!==!0||!u.children,"Cannot specify children on an index route"),Ne(o||!r[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),rA(u)){let m={...u,id:h};return r[h]=Ib(m,t(m)),m}else{let m={...u,id:h,children:void 0};return r[h]=Ib(m,t(m)),u.children&&(m.children=hl(u.children,t,f,r,o)),m}})}function Ib(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ew(e,t,i="/"){return ai(e,t,i,!1)}function ai(e,t,i,r,o){let u=typeof t=="string"?wi(t):t,c=Yn(u.pathname||"/",i);if(c==null)return null;let f=o??vc(e),h=null,m=vA(c);for(let g=0;h==null&&g{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;Ne(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let y=kn([r,g.relativePath]),b=i.concat(g);c.children&&c.children.length>0&&(Ne(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Rw(c.children,t,b,y,h)),!(c.path==null&&!c.index)&&t.push({path:y,score:pA(y,c.index),routesMeta:b})};return e.forEach((c,f)=>{if(c.path===""||!c.path?.includes("?"))u(c,f);else for(let h of _w(c.path))u(c,f,!0,h)}),t}function _w(e){let t=e.split("/");if(t.length===0)return[];let[i,...r]=t,o=i.endsWith("?"),u=i.replace(/\?$/,"");if(r.length===0)return o?[u,""]:[u];let c=_w(r.join("/")),f=[];return f.push(...c.map(h=>h===""?u:[u,h].join("/"))),o&&f.push(...c),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function oA(e){e.sort((t,i)=>t.score!==i.score?i.score-t.score:mA(t.routesMeta.map(r=>r.childrenIndex),i.routesMeta.map(r=>r.childrenIndex)))}var lA=/^:[\w-]+$/,uA=3,cA=2,fA=1,dA=10,hA=-2,Yb=e=>e==="*";function pA(e,t){let i=e.split("/"),r=i.length;return i.some(Yb)&&(r+=hA),t&&(r+=cA),i.filter(o=>!Yb(o)).reduce((o,u)=>o+(lA.test(u)?uA:u===""?fA:dA),r)}function mA(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function gA(e,t,i=!1){let{routesMeta:r}=e,o={},u="/",c=[];for(let f=0;f{if(g==="*"){let x=f[b]||"";c=u.slice(0,u.length-x.length).replace(/(.)\/+$/,"$1")}const S=f[b];return y&&!S?m[g]=void 0:m[g]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:c,pattern:e}}function yA(e,t=!1,i=!0){xt(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 r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h,m,g)=>{if(r.push({paramName:f,isOptional:h!=null}),h){let y=g.charAt(m+c.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function vA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Yn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,r=e.charAt(i);return r&&r!=="/"?null:e.slice(i)||"/"}function bA({basename:e,pathname:t}){return t==="/"?e:kn([e,t])}var Tw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cm=e=>Tw.test(e);function SA(e,t="/"){let{pathname:i,search:r="",hash:o=""}=typeof e=="string"?wi(e):e,u;return i?(i=Em(i),i.startsWith("/")?u=Kb(i.substring(1),"/"):u=Kb(i,t)):u=t,{pathname:u,search:wA(r),hash:CA(o)}}function Kb(e,t){let i=Pc(t).split("/");return e.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function Ph(e,t,i,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Aw(e){return e.filter((t,i)=>i===0||t.route.path&&t.route.path.length>0)}function ef(e){let t=Aw(e);return t.map((i,r)=>r===t.length-1?i.pathname:i.pathnameBase)}function El(e,t,i,r=!1){let o;typeof e=="string"?o=wi(e):(o={...e},Ne(!o.pathname||!o.pathname.includes("?"),Ph("?","pathname","search",o)),Ne(!o.pathname||!o.pathname.includes("#"),Ph("#","pathname","hash",o)),Ne(!o.search||!o.search.includes("#"),Ph("#","search","hash",o)));let u=e===""||o.pathname==="",c=u?"/":o.pathname,f;if(c==null)f=i;else{let y=t.length-1;if(!r&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),y-=1;o.pathname=b.join("/")}f=y>=0?t[y]:"/"}let h=SA(o,f),m=c&&c!=="/"&&c.endsWith("/"),g=(u||c===".")&&i.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var Em=e=>e.replace(/\/\/+/g,"/"),kn=e=>Em(e.join("/")),Pc=e=>e.replace(/\/+$/,""),xA=e=>Pc(e).replace(/^\/*/,"/"),wA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Rl=class{constructor(e,t,i,r=!1){this.status=e,this.statusText=t||"",this.internal=r,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function pl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function _l(e){let t=e.map(i=>i.route.path).filter(Boolean);return kn(t)||"/"}var Mw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ow(e,t){let i=e;if(typeof i!="string"||!Tw.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let r=i,o=!1;if(Mw)try{let u=new URL(window.location.href),c=i.startsWith("//")?new URL(u.protocol+i):new URL(i),f=Yn(c.pathname,t);c.origin===u.origin&&f!=null?i=f+c.search+c.hash:o=!0}catch{xt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:i}}var ja=Symbol("Uninstrumented");function EA(e,t){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(u){let c=Object.keys(i);for(let f of c)u[f]&&i[f].push(u[f])}}));let r={};if(typeof t.lazy=="function"&&i.lazy.length>0){let o=ws(i.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(u=>{let c=o[u],f=i[`lazy.${u}`];if(typeof c=="function"&&f.length>0){let h=ws(f,c,()=>{});h&&(r.lazy=Object.assign(r.lazy||{},{[u]:h}))}})}return["loader","action"].forEach(o=>{let u=t[o];if(typeof u=="function"&&i[o].length>0){let c=u[ja]??u,f=ws(i[o],c,(...h)=>Qb(h[0]));f&&(o==="loader"&&c.hydrate===!0&&(f.hydrate=!0),f[ja]=c,r[o]=f)}}),t.middleware&&t.middleware.length>0&&i.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let u=o[ja]??o,c=ws(i.middleware,u,(...f)=>Qb(f[0]));return c?(c[ja]=u,c):o})),r}function RA(e,t){let i={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let u=Object.keys(o);for(let c of u)o[c]&&i[c].push(o[c])}})),i.navigate.length>0){let r=e.navigate[ja]??e.navigate,o=ws(i.navigate,r,(...u)=>{let[c,f]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?Si(c):".",...Xb(e,f??{})}});o&&(o[ja]=r,e.navigate=o)}if(i.fetch.length>0){let r=e.fetch[ja]??e.fetch,o=ws(i.fetch,r,(...u)=>{let[c,,f,h]=u;return{href:f??".",fetcherKey:c,...Xb(e,h??{})}});o&&(o[ja]=r,e.fetch=o)}return e}function ws(e,t,i){return e.length===0?null:async(...r)=>{let o=await Dw(e,i(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function Dw(e,t,i,r){let o=e[r],u;if(o){let c,f=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=Dw(e,t,i,r-1),u=await c,Ne(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(f,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await f(),await c}else try{u={type:"success",value:await i()}}catch(c){u={type:"error",value:c}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Qb(e){let{request:t,context:i,params:r,pattern:o}=e;return{request:_A(t),params:{...r},pattern:o,context:TA(i)}}function Xb(e,t){return{currentUrl:Si(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function _A(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function TA(e){if(MA(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var AA=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function MA(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===AA}var jw=["POST","PUT","PATCH","DELETE"],OA=new Set(jw),DA=["GET",...jw],jA=new Set(DA),Nw=new Set([301,302,303,307,308]),NA=new Set([307,308]),Uh={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},LA={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},zA=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Lw="remix-router-transitions",zw=Symbol("ResetLoaderData"),fr,ys,Aa,vs,VA=class{constructor(e){Xo(this,fr),Xo(this,ys),Xo(this,Aa),Xo(this,vs),mi(this,fr,e),mi(this,ys,vc(e))}get stableRoutes(){return Bn(this,fr)}get activeRoutes(){return Bn(this,Aa)??Bn(this,fr)}get branches(){return Bn(this,vs)??Bn(this,ys)}get hasHMRRoutes(){return Bn(this,Aa)!=null}setRoutes(e){mi(this,fr,e),mi(this,ys,vc(e))}setHmrRoutes(e){mi(this,Aa,e),mi(this,vs,vc(e))}commitHmrRoutes(){Bn(this,Aa)&&(mi(this,fr,Bn(this,Aa)),mi(this,ys,Bn(this,vs)),mi(this,Aa,void 0),mi(this,vs,void 0))}};fr=new WeakMap;ys=new WeakMap;Aa=new WeakMap;vs=new WeakMap;function $A(e){const t=e.window?e.window:typeof window<"u"?window:void 0,i=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Ne(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||zA,u=o;if(e.instrumentations){let O=e.instrumentations;u=z=>({...o(z),...EA(O.map(H=>H.route).filter(Boolean),z)})}let c={},f=new VA(hl(e.routes,u,void 0,c)),h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let m=e.dataStrategy||FA,g={...e.future},y=null,b=new Set,S=null,x=null,C=null,R=null,A=e.hydrationData!=null,j=ai(f.activeRoutes,e.history.location,h,!1,f.branches),L=!1,V=null,q,W;if(j==null&&!e.patchRoutesOnNavigation){let O=Hn(404,{pathname:e.history.location.pathname}),{matches:z,route:H}=nc(f.activeRoutes);q=!0,W=!q,j=z,V={[H.id]:O}}else if(j&&!e.hydrationData&&ia(j,f.activeRoutes,e.history.location.pathname).active&&(j=null),j)if(j.some(O=>O.route.lazy))q=!1,W=!q;else if(!j.some(O=>Rm(O.route)))q=!0,W=!q;else{let O=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,H=j;if(z){let X=j.findIndex(Z=>z[Z.route.id]!==void 0);H=H.slice(0,X+1)}W=!1,q=!0,H.forEach(X=>{let Z=Vw(X.route,O,z);W=W||Z.renderFallback,q=q&&!Z.shouldLoad})}else{q=!1,W=!q,j=[];let O=ia(null,f.activeRoutes,e.history.location.pathname);O.active&&O.matches&&(L=!0,j=O.matches)}let K,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:q,renderFallback:W,navigation:Uh,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||V,fetchers:new Map,blockers:new Map},ne="POP",ee=null,he=!1,ae,Le=!1,Re=new Map,je=null,P=!1,J=!1,ie=new Set,oe=new Map,ye=0,D=-1,I=new Map,te=new Set,re=new Map,me=new Map,Se=new Set,ze=new Map,wt,it=null;function qa(){if(y=e.history.listen(({action:O,location:z,delta:H})=>{if(wt){wt(),wt=void 0;return}xt(ze.size===0||H!=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=Ia({currentLocation:T.location,nextLocation:z,historyAction:O});if(X&&H!=null){let Z=new Promise(ce=>{wt=ce});e.history.go(H*-1),Ti(X,{state:"blocked",location:z,proceed(){Ti(X,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),Z.then(()=>e.history.go(H))},reset(){let ce=new Map(T.blockers);ce.set(X,qo),Ot({blockers:ce})}}),ee?.resolve(),ee=null;return}return Ei(O,z)}),i){sM(t,Re);let O=()=>oM(t,Re);t.addEventListener("pagehide",O),je=()=>t.removeEventListener("pagehide",O)}return T.initialized||Ei("POP",T.location,{initialHydration:!0}),K}function Ar(){y&&y(),je&&je(),b.clear(),ae&&ae.abort(),T.fetchers.forEach((O,z)=>_i(T.fetchers,z)),T.blockers.forEach((O,z)=>Ga(z))}function Ys(O){if(b.add(O),S){let{newErrors:z}=S;S=null,O(T,{deletedFetchers:[],newErrors:z,viewTransitionOpts:void 0,flushSync:!1})}return()=>b.delete(O)}function Ot(O,z={}){O.matches&&(O.matches=O.matches.map(Z=>{let ce=c[Z.route.id],se=Z.route;return se.element!==ce.element||se.errorElement!==ce.errorElement||se.hydrateFallbackElement!==ce.hydrateFallbackElement?{...Z,route:ce}:Z})),T={...T,...O};let H=[],X=[];T.fetchers.forEach((Z,ce)=>{Z.state==="idle"&&(Se.has(ce)?H.push(ce):X.push(ce))}),Se.forEach(Z=>{!T.fetchers.has(Z)&&!oe.has(Z)&&H.push(Z)}),b.size===0&&(S={newErrors:O.errors??null}),[...b].forEach(Z=>Z(T,{deletedFetchers:H,newErrors:O.errors??null,viewTransitionOpts:z.viewTransitionOpts,flushSync:z.flushSync===!0})),H.forEach(Z=>_i(T.fetchers,Z)),X.forEach(Z=>T.fetchers.delete(Z))}function on(O,z,{flushSync:H}={}){let X=T.actionData!=null&&T.navigation.formMethod!=null&&Yt(T.navigation.formMethod)&&T.navigation.state==="loading"&&O.state?._isRedirect!==!0,Z;z.actionData?Object.keys(z.actionData).length>0?Z=z.actionData:Z=null:X?Z=T.actionData:Z=null;let ce=z.loaderData?oS(T.loaderData,z.loaderData,z.matches||[],z.errors):T.loaderData,se=T.blockers;se.size>0&&(se=new Map(se),se.forEach((be,Me)=>se.set(Me,qo)));let ue=P?!1:Js(O,z.matches||T.matches),le=he===!0||T.navigation.formMethod!=null&&Yt(T.navigation.formMethod)&&O.state?._isRedirect!==!0;f.commitHmrRoutes(),P||ne==="POP"||(ne==="PUSH"?e.history.push(O,O.state):ne==="REPLACE"&&e.history.replace(O,O.state));let ve;if(ne==="POP"){let be=Re.get(T.location.pathname);be&&be.has(O.pathname)?ve={currentLocation:T.location,nextLocation:O}:Re.has(O.pathname)&&(ve={currentLocation:O,nextLocation:T.location})}else if(Le){let be=Re.get(T.location.pathname);be?be.add(O.pathname):(be=new Set([O.pathname]),Re.set(T.location.pathname,be)),ve={currentLocation:T.location,nextLocation:O}}Ot({...z,actionData:Z,loaderData:ce,historyAction:ne,location:O,initialized:!0,renderFallback:!1,navigation:Uh,revalidation:"idle",restoreScrollPosition:ue,preventScrollReset:le,blockers:se},{viewTransitionOpts:ve,flushSync:H===!0}),ne="POP",he=!1,Le=!1,P=!1,J=!1,ee?.resolve(),ee=null,it?.resolve(),it=null}async function Mr(O,z){if(ee?.resolve(),ee=null,typeof O=="number"){ee||(ee=fS());let Ie=ee.promise;return e.history.go(O),Ie}let H=Ep(T.location,T.matches,h,O,z?.fromRouteId,z?.relative),{path:X,submission:Z,error:ce}=Zb(!1,H,z),se;z?.mask&&(se={pathname:"",search:"",hash:"",...typeof z.mask=="string"?wi(z.mask):{...T.location.mask,...z.mask}});let ue=T.location,le=dl(ue,X,z&&z.state,void 0,se);le={...le,...e.history.encodeLocation(le)};let ve=z&&z.replace!=null?z.replace:void 0,be="PUSH";ve===!0?be="REPLACE":ve===!1||Z!=null&&Yt(Z.formMethod)&&Z.formAction===T.location.pathname+T.location.search&&(be="REPLACE");let Me=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,we=(z&&z.flushSync)===!0,Ve=Ia({currentLocation:ue,nextLocation:le,historyAction:be});if(Ve){Ti(Ve,{state:"blocked",location:le,proceed(){Ti(Ve,{state:"proceeding",proceed:void 0,reset:void 0,location:le}),Mr(O,z)},reset(){let Ie=new Map(T.blockers);Ie.set(Ve,qo),Ot({blockers:Ie})}});return}await Ei(be,le,{submission:Z,pendingError:ce,preventScrollReset:Me,replace:z&&z.replace,enableViewTransition:z&&z.viewTransition,flushSync:we,callSiteDefaultShouldRevalidate:z&&z.defaultShouldRevalidate})}function Ks(){it||(it=fS()),ta(),Ot({revalidation:"loading"});let O=it.promise;return T.navigation.state==="submitting"?O:T.navigation.state==="idle"?(Ei(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),O):(Ei(ne||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:Le===!0}),O)}async function Ei(O,z,H){ae&&ae.abort(),ae=null,ne=O,P=(H&&H.startUninterruptedRevalidation)===!0,_f(T.location,T.matches),he=(H&&H.preventScrollReset)===!0,Le=(H&&H.enableViewTransition)===!0;let X=f.activeRoutes,Z=H?.initialHydration&&T.matches&&T.matches.length>0&&!L?T.matches:ai(X,z,h,!1,f.branches),ce=(H&&H.flushSync)===!0;if(Z&&T.initialized&&!J&&XA(T.location,z)&&!(H&&H.submission&&Yt(H.submission.formMethod))){on(z,{matches:Z},{flushSync:ce});return}let se=ia(Z,X,z.pathname);if(se.active&&se.matches&&(Z=se.matches),!Z){let{error:Xe,notFoundMatches:qe,route:vt}=Xn(z.pathname);on(z,{matches:qe,loaderData:{},errors:{[vt.id]:Xe}},{flushSync:ce});return}let ue=H&&H.overrideNavigation?{...H.overrideNavigation,matches:Z,historyAction:O}:void 0;ae=new AbortController;let le=bs(e.history,z,ae.signal,H&&H.submission),ve=e.getContext?await e.getContext():new Gb,be;if(H&&H.pendingError)be=[Ma(Z).route.id,{type:"error",error:H.pendingError}];else if(H&&H.submission&&Yt(H.submission.formMethod)){let Xe=await Bl(le,z,H.submission,Z,O,ve,se.active,H&&H.initialHydration===!0,{replace:H.replace,flushSync:ce});if(Xe.shortCircuited)return;if(Xe.pendingActionResult){let[qe,vt]=Xe.pendingActionResult;if(_n(vt)&&pl(vt.error)&&vt.error.status===404){ae=null,on(z,{matches:Xe.matches,loaderData:{},errors:{[qe]:vt.error}});return}}Z=Xe.matches||Z,be=Xe.pendingActionResult,ue=Bh(z,Z,O,H.submission),ce=!1,se.active=!1,le=bs(e.history,le.url,le.signal)}let{shortCircuited:Me,matches:we,loaderData:Ve,errors:Ie,workingFetchers:ut}=await Qs(le,z,Z,O,ve,se.active,ue,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,ce,be,H&&H.callSiteDefaultShouldRevalidate);Me||(ae=null,on(z,{matches:we||Z,...lS(be),loaderData:Ve,errors:Ie,...ut?{fetchers:ut}:{}}))}async function Bl(O,z,H,X,Z,ce,se,ue,le={}){ta();let ve=aM(z,X,Z,H);if(Ot({navigation:ve},{flushSync:le.flushSync===!0}),se){let we=await ci(X,z.pathname,O.signal);if(we.type==="aborted")return{shortCircuited:!0};if(we.type==="error"){if(we.partialMatches.length===0){let{matches:Ie,route:ut}=nc(f.activeRoutes);return{matches:Ie,pendingActionResult:[ut.id,{type:"error",error:we.error}]}}let Ve=Ma(we.partialMatches).route.id;return{matches:we.partialMatches,pendingActionResult:[Ve,{type:"error",error:we.error}]}}else if(we.matches)X=we.matches;else{let{notFoundMatches:Ve,error:Ie,route:ut}=Xn(z.pathname);return{matches:Ve,pendingActionResult:[ut.id,{type:"error",error:Ie}]}}}let be,Me=bc(X,z);if(!Me.route.action&&!Me.route.lazy)be={type:"error",error:Hn(405,{method:O.method,pathname:z.pathname,routeId:Me.route.id})};else{let we=Ms(u,c,O,z,X,Me,ue?[]:r,ce),Ve=await ea(O,z,we,ce,null);if(be=Ve[Me.route.id],!be){for(let Ie of X)if(Ve[Ie.route.id]){be=Ve[Ie.route.id];break}}if(O.signal.aborted)return{shortCircuited:!0}}if(mr(be)){let we;return le&&le.replace!=null?we=le.replace:we=aS(be.response.headers.get("Location"),new URL(O.url),h,e.history)===T.location.pathname+T.location.search,await Ri(O,be,!0,{submission:H,replace:we}),{shortCircuited:!0}}if(_n(be)){let we=Ma(X,Me.route.id);return(le&&le.replace)!==!0&&(ne="PUSH"),{matches:X,pendingActionResult:[we.route.id,be,Me.route.id]}}return{matches:X,pendingActionResult:[Me.route.id,be]}}async function Qs(O,z,H,X,Z,ce,se,ue,le,ve,be,Me,we,Ve){let Ie=se||Bh(z,H,X,ue),ut=ue||le||cS(Ie),Xe=!P&&!be;if(ce){if(Xe){let at=Or(we);Ot({navigation:Ie,...at!==void 0?{actionData:at}:{}},{flushSync:Me})}let _e=await ci(H,z.pathname,O.signal);if(_e.type==="aborted")return{shortCircuited:!0};if(_e.type==="error"){if(_e.partialMatches.length===0){let{matches:yn,route:Wn}=nc(f.activeRoutes);return{matches:yn,loaderData:{},errors:{[Wn.id]:_e.error}}}let at=Ma(_e.partialMatches).route.id;return{matches:_e.partialMatches,loaderData:{},errors:{[at]:_e.error}}}else if(_e.matches)H=_e.matches;else{let{error:at,notFoundMatches:yn,route:Wn}=Xn(z.pathname);return{matches:yn,loaderData:{},errors:{[Wn.id]:at}}}}let qe=f.activeRoutes,{dsMatches:vt,revalidatingFetchers:Ge}=Jb(O,Z,u,c,e.history,T,H,ut,z,be?[]:r,be===!0,J,ie,Se,re,te,qe,h,e.patchRoutesOnNavigation!=null,f.branches,we,Ve);if(D=++ye,!e.dataStrategy&&!vt.some(_e=>_e.shouldLoad)&&!vt.some(_e=>_e.route.middleware&&_e.route.middleware.length>0)&&Ge.length===0){let _e=new Map(T.fetchers),at=Hl(_e);return on(z,{matches:H,loaderData:{},errors:we&&_n(we[1])?{[we[0]]:we[1].error}:null,...lS(we),...at?{fetchers:_e}:{}},{flushSync:Me}),{shortCircuited:!0}}if(Xe){let _e={};if(!ce){_e.navigation=Ie;let at=Or(we);at!==void 0&&(_e.actionData=at)}Ge.length>0&&(_e.fetchers=Xs(Ge)),Ot(_e,{flushSync:Me})}Ge.forEach(_e=>{zt(_e.key),_e.controller&&oe.set(_e.key,_e.controller)});let aa=()=>Ge.forEach(_e=>zt(_e.key));ae&&ae.signal.addEventListener("abort",aa);let{loaderResults:Zn,fetcherResults:ln}=await Zs(vt,Ge,O,z,Z);if(O.signal.aborted)return{shortCircuited:!0};ae&&ae.signal.removeEventListener("abort",aa),Ge.forEach(_e=>oe.delete(_e.key));let Zt=ic(Zn);if(Zt)return await Ri(O,Zt.result,!0,{replace:ve}),{shortCircuited:!0};if(Zt=ic(ln),Zt)return te.add(Zt.key),await Ri(O,Zt.result,!0,{replace:ve}),{shortCircuited:!0};let Dn=new Map(T.fetchers),{loaderData:jr,errors:Jn}=sS(T,H,Zn,we,Ge,ln,Dn);be&&T.errors&&(Jn={...T.errors,...Jn});let Nr=Hl(Dn),Ai=Fl(D,Dn),Mi=Nr||Ai||Ge.length>0;return{matches:H,loaderData:jr,errors:Jn,...Mi?{workingFetchers:Dn}:{}}}function Or(O){if(O&&!_n(O[1]))return{[O[0]]:O[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Xs(O){let z=new Map(T.fetchers);return O.forEach(H=>{let X=z.get(H.key),Z=Go(void 0,X?X.data:void 0);z.set(H.key,Z)}),z}async function xf(O,z,H,X){zt(O);let Z=(X&&X.flushSync)===!0,ce=f.activeRoutes,se=Ep(T.location,T.matches,h,H,z,X?.relative),ue=ai(ce,se,h,!1,f.branches),le=ia(ue,ce,se);if(le.active&&le.matches&&(ue=le.matches),!ue){On(O,z,Hn(404,{pathname:se}),{flushSync:Z});return}let{path:ve,submission:be,error:Me}=Zb(!0,se,X);if(Me){On(O,z,Me,{flushSync:Z});return}let we=e.getContext?await e.getContext():new Gb,Ve=(X&&X.preventScrollReset)===!0;if(be&&Yt(be.formMethod)){await wf(O,z,ve,ue,we,le.active,Z,Ve,be,X&&X.defaultShouldRevalidate);return}re.set(O,{routeId:z,path:ve}),await Qt(O,z,ve,ue,we,le.active,Z,Ve,be)}async function wf(O,z,H,X,Z,ce,se,ue,le,ve){ta(),re.delete(O);let be=T.fetchers.get(O);Qn(O,rM(le,be),{flushSync:se});let Me=new AbortController,we=bs(e.history,H,Me.signal,le);if(ce){let Ze=await ci(X,new URL(we.url).pathname,we.signal,O);if(Ze.type==="aborted")return;if(Ze.type==="error"){On(O,z,Ze.error,{flushSync:se});return}else if(Ze.matches)X=Ze.matches;else{On(O,z,Hn(404,{pathname:H}),{flushSync:se});return}}let Ve=bc(X,H);if(!Ve.route.action&&!Ve.route.lazy){let Ze=Hn(405,{method:le.formMethod,pathname:H,routeId:z});On(O,z,Ze,{flushSync:se});return}oe.set(O,Me);let Ie=ye,ut=Ms(u,c,we,H,X,Ve,r,Z),Xe=await ea(we,H,ut,Z,O),qe=Xe[Ve.route.id];if(!qe){for(let Ze of ut)if(Xe[Ze.route.id]){qe=Xe[Ze.route.id];break}}if(we.signal.aborted){oe.get(O)===Me&&oe.delete(O);return}if(Se.has(O)){if(mr(qe)||_n(qe)){Qn(O,gi(void 0));return}}else{if(mr(qe))if(oe.delete(O),D>Ie){Qn(O,gi(void 0));return}else return te.add(O),Qn(O,Go(le)),Ri(we,qe,!1,{fetcherSubmission:le,preventScrollReset:ue});if(_n(qe)){On(O,z,qe.error);return}}let vt=T.navigation.location||T.location,Ge=bs(e.history,vt,Me.signal),aa=f.activeRoutes,Zn=T.navigation.state!=="idle"?ai(aa,T.navigation.location,h,!1,f.branches):T.matches;Ne(Zn,"Didn't find any matches after fetcher action");let ln=++ye;I.set(O,ln);let{dsMatches:Zt,revalidatingFetchers:Dn}=Jb(Ge,Z,u,c,e.history,T,Zn,le,vt,r,!1,J,ie,Se,re,te,aa,h,e.patchRoutesOnNavigation!=null,f.branches,[Ve.route.id,qe],ve),jr=Go(le,qe.data),Jn=new Map(T.fetchers);Jn.set(O,jr),Dn.filter(Ze=>Ze.key!==O).forEach(Ze=>{let Oi=Ze.key,Jt=Jn.get(Oi),Ws=Go(void 0,Jt?Jt.data:void 0);Jn.set(Oi,Ws),zt(Oi),Ze.controller&&oe.set(Oi,Ze.controller)}),Ot({fetchers:Jn});let Nr=()=>Dn.forEach(Ze=>zt(Ze.key));Me.signal.addEventListener("abort",Nr);let{loaderResults:Ai,fetcherResults:Mi}=await Zs(Zt,Dn,Ge,vt,Z);if(Me.signal.aborted)return;Me.signal.removeEventListener("abort",Nr),I.delete(O),oe.delete(O),Dn.forEach(Ze=>oe.delete(Ze.key));let _e=T.fetchers.has(O),at=Ze=>{if(!_e)return Ze;let Oi=new Map(Ze.fetchers);return Oi.set(O,gi(qe.data)),{...Ze,fetchers:Oi}},yn=ic(Ai);if(yn)return T=at(T),Ri(Ge,yn.result,!1,{preventScrollReset:ue});if(yn=ic(Mi),yn)return te.add(yn.key),T=at(T),Ri(Ge,yn.result,!1,{preventScrollReset:ue});let Wn=new Map(T.fetchers);_e&&Wn.set(O,gi(qe.data));let{loaderData:Lr,errors:zr}=sS(T,Zn,Ai,void 0,Dn,Mi,Wn);Fl(ln,Wn),T.navigation.state==="loading"&&ln>D?(Ne(ne,"Expected pending action"),ae&&ae.abort(),on(T.navigation.location,{matches:Zn,loaderData:Lr,errors:zr,fetchers:Wn})):(Ot({errors:zr,loaderData:oS(T.loaderData,Lr,Zn,zr),fetchers:Wn}),J=!1)}async function Qt(O,z,H,X,Z,ce,se,ue,le){let ve=T.fetchers.get(O);Qn(O,Go(le,ve?ve.data:void 0),{flushSync:se});let be=new AbortController,Me=bs(e.history,H,be.signal);if(ce){let qe=await ci(X,new URL(Me.url).pathname,Me.signal,O);if(qe.type==="aborted")return;if(qe.type==="error"){On(O,z,qe.error,{flushSync:se});return}else if(qe.matches)X=qe.matches;else{On(O,z,Hn(404,{pathname:H}),{flushSync:se});return}}let we=bc(X,H);oe.set(O,be);let Ve=ye,Ie=Ms(u,c,Me,H,X,we,r,Z),ut=await ea(Me,H,Ie,Z,O),Xe=ut[we.route.id];if(!Xe){for(let qe of X)if(ut[qe.route.id]){Xe=ut[qe.route.id];break}}if(oe.get(O)===be&&oe.delete(O),!Me.signal.aborted){if(Se.has(O)){Qn(O,gi(void 0));return}if(mr(Xe))if(D>Ve){Qn(O,gi(void 0));return}else{te.add(O),await Ri(Me,Xe,!1,{preventScrollReset:ue});return}if(_n(Xe)){On(O,z,Xe.error);return}Qn(O,gi(Xe.data))}}async function Ri(O,z,H,{submission:X,fetcherSubmission:Z,preventScrollReset:ce,replace:se}={}){H||(ee?.resolve(),ee=null),z.response.headers.has("X-Remix-Revalidate")&&(J=!0);let ue=z.response.headers.get("Location");Ne(ue,"Expected a Location header on the redirect Response"),ue=aS(ue,new URL(O.url),h,e.history);let le=dl(T.location,ue,{_isRedirect:!0});if(i){let Ie=!1;if(z.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(Cm(ue)){const ut=Cw(ue,!0);Ie=ut.origin!==t.location.origin||Yn(ut.pathname,h)==null}if(Ie){se?t.location.replace(ue):t.location.assign(ue);return}}ae=null;let ve=se===!0||z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:be,formAction:Me,formEncType:we}=T.navigation;!X&&!Z&&be&&Me&&we&&(X=cS(T.navigation));let Ve=X||Z;if(NA.has(z.response.status)&&Ve&&Yt(Ve.formMethod))await Ei(ve,le,{submission:{...Ve,formAction:ue},preventScrollReset:ce||he,enableViewTransition:H?Le:void 0});else{let Ie=Bh(le,[],ve,X);await Ei(ve,le,{overrideNavigation:Ie,fetcherSubmission:Z,preventScrollReset:ce||he,enableViewTransition:H?Le:void 0})}}async function ea(O,z,H,X,Z){let ce,se={};try{ce=await qA(m,O,z,H,Z,X,!1)}catch(ue){return H.filter(le=>le.shouldLoad).forEach(le=>{se[le.route.id]={type:"error",error:ue}}),se}if(O.signal.aborted)return se;if(!Yt(O.method))for(let ue of H){if(ce[ue.route.id]?.type==="error")break;!ce.hasOwnProperty(ue.route.id)&&!T.loaderData.hasOwnProperty(ue.route.id)&&(!T.errors||!T.errors.hasOwnProperty(ue.route.id))&&ue.shouldCallHandler()&&(ce[ue.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ue.route.id}`)})}for(let[ue,le]of Object.entries(ce))if(eM(le)){let ve=le.result;se[ue]={type:"redirect",response:KA(ve,O,ue,H,h)}}else se[ue]=await YA(le);return se}async function Zs(O,z,H,X,Z){let ce=ea(H,X,O,Z,null),se=Promise.all(z.map(async ve=>{if(ve.matches&&ve.match&&ve.request&&ve.controller){let Me=(await ea(ve.request,ve.path,ve.matches,Z,ve.key))[ve.match.route.id];return{[ve.key]:Me}}else return Promise.resolve({[ve.key]:{type:"error",error:Hn(404,{pathname:ve.path})}})})),ue=await ce,le=(await se).reduce((ve,be)=>Object.assign(ve,be),{});return{loaderResults:ue,fetcherResults:le}}function ta(){J=!0,re.forEach((O,z)=>{oe.has(z)&&ie.add(z),zt(z)})}function Qn(O,z,H={}){let X=new Map(T.fetchers);X.set(O,z),Ot({fetchers:X},{flushSync:(H&&H.flushSync)===!0})}function On(O,z,H,X={}){let Z=Ma(T.matches,z),ce=new Map(T.fetchers);_i(ce,O),Ot({errors:{[Z.route.id]:H},fetchers:ce},{flushSync:(X&&X.flushSync)===!0})}function Cf(O){return me.set(O,(me.get(O)||0)+1),Se.has(O)&&Se.delete(O),T.fetchers.get(O)||LA}function Ef(O,z){zt(O,z?.reason),Qn(O,gi(null))}function _i(O,z){let H=T.fetchers.get(z);oe.has(z)&&!(H&&H.state==="loading"&&I.has(z))&&zt(z),re.delete(z),I.delete(z),te.delete(z),Se.delete(z),ie.delete(z),O.delete(z)}function Xt(O){let z=(me.get(O)||0)-1;z<=0?(me.delete(O),Se.add(O)):me.set(O,z),Ot({fetchers:new Map(T.fetchers)})}function zt(O,z){let H=oe.get(O);H&&(H.abort(z),oe.delete(O))}function qt(O,z){for(let H of O){let X=z.get(H);Ne(X,`Expected fetcher: ${H}`);let Z=gi(X.data);z.set(H,Z)}}function Hl(O){let z=[],H=!1;for(let X of te){let Z=O.get(X);Ne(Z,`Expected fetcher: ${X}`),Z.state==="loading"&&(te.delete(X),z.push(X),H=!0)}return qt(z,O),H}function Fl(O,z){let H=[];for(let[X,Z]of I)if(Z0}function Rf(O,z){let H=T.blockers.get(O)||qo;return ze.get(O)!==z&&ze.set(O,z),H}function Ga(O){T.blockers.delete(O),ze.delete(O)}function Ti(O,z){let H=T.blockers.get(O)||qo;Ne(H.state==="unblocked"&&z.state==="blocked"||H.state==="blocked"&&z.state==="blocked"||H.state==="blocked"&&z.state==="proceeding"||H.state==="blocked"&&z.state==="unblocked"||H.state==="proceeding"&&z.state==="unblocked",`Invalid blocker state transition: ${H.state} -> ${z.state}`);let X=new Map(T.blockers);X.set(O,z),Ot({blockers:X})}function Ia({currentLocation:O,nextLocation:z,historyAction:H}){if(ze.size===0)return;ze.size>1&&xt(!1,"A router only supports one blocker at a time");let X=Array.from(ze.entries()),[Z,ce]=X[X.length-1],se=T.blockers.get(Z);if(!(se&&se.state==="proceeding")&&ce({currentLocation:O,nextLocation:z,historyAction:H}))return Z}function Xn(O){let z=Hn(404,{pathname:O}),H=f.activeRoutes,{matches:X,route:Z}=nc(H);return{notFoundMatches:X,route:Z,error:z}}function Dr(O,z,H){if(x=O,R=z,C=H||null,!A&&T.navigation===Uh){A=!0;let X=Js(T.location,T.matches);X!=null&&Ot({restoreScrollPosition:X})}return()=>{x=null,R=null,C=null}}function na(O,z){return C&&C(O,z.map(X=>sA(X,T.loaderData)))||O.key}function _f(O,z){if(x&&R){let H=na(O,z);x[H]=R()}}function Js(O,z){if(x){let H=na(O,z),X=x[H];if(typeof X=="number")return X}return null}function ia(O,z,H){if(e.patchRoutesOnNavigation){let X=f.branches;if(O){if(Object.keys(O[0].params).length>0)return{active:!0,matches:ai(z,H,h,!0,X)}}else return{active:!0,matches:ai(z,H,h,!0,X)||[]}}return{active:!1,matches:null}}async function ci(O,z,H,X){if(!e.patchRoutesOnNavigation)return{type:"success",matches:O};let Z=O;for(;;){let ce=c;try{await e.patchRoutesOnNavigation({signal:H,path:z,matches:Z,fetcherKey:X,patch:(ve,be)=>{H.aborted||Wb(ve,be,f,ce,u,!1)}})}catch(ve){return{type:"error",error:ve,partialMatches:Z}}if(H.aborted)return{type:"aborted"};let se=f.branches,ue=ai(f.activeRoutes,z,h,!1,se),le=null;if(ue){if(Object.keys(ue[0].params).length===0)return{type:"success",matches:ue};if(le=ai(f.activeRoutes,z,h,!0,se),!(le&&Z.lengthH.route.id===z[X].route.id)}function ql(O){c={},f.setHmrRoutes(hl(O,u,void 0,c))}function Gl(O,z,H=!1){Wb(O,z,f,c,u,H),f.hasHMRRoutes||Ot({})}return K={get basename(){return h},get future(){return g},get state(){return T},get routes(){return f.stableRoutes},get branches(){return f.branches},get manifest(){return c},get window(){return t},initialize:qa,subscribe:Ys,enableScrollRestoration:Dr,navigate:Mr,fetch:xf,revalidate:Ks,createHref:O=>e.history.createHref(O),encodeLocation:O=>e.history.encodeLocation(O),getFetcher:Cf,resetFetcher:Ef,deleteFetcher:Xt,dispose:Ar,getBlocker:Rf,deleteBlocker:Ga,patchRoutes:Gl,_internalFetchControllers:oe,_internalSetRoutes:ql,_internalSetStateDoNotUseOrYouWillBreakYourApp(O){Ot(O)}},e.instrumentations&&(K=RA(K,e.instrumentations.map(O=>O.router).filter(Boolean))),K}function PA(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ep(e,t,i,r,o,u){let c,f;if(o){c=[];for(let m of t)if(c.push(m),m.route.id===o){f=m;break}}else c=t,f=t[t.length-1];let h=El(r||".",ef(c),Yn(e.pathname,i)||e.pathname,u==="path");if(r==null&&(h.search=e.search,h.hash=e.hash),(r==null||r===""||r===".")&&f){let m=Tm(h.search);if(f.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&m){let g=new URLSearchParams(h.search),y=g.getAll("index");g.delete("index"),y.filter(S=>S).forEach(S=>g.append("index",S));let b=g.toString();h.search=b?`?${b}`:""}}return i!=="/"&&(h.pathname=bA({basename:i,pathname:h.pathname})),Si(h)}function Zb(e,t,i){if(!i||!PA(i))return{path:t};if(i.formMethod&&!iM(i.formMethod))return{path:t,error:Hn(405,{method:i.formMethod})};let r=()=>({path:t,error:Hn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),c=kw(t);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Yt(u))return r();let y=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((b,[S,x])=>`${b}${S}=${x} +`,""):String(i.body);return{path:t,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:void 0,text:y}}}else if(i.formEncType==="application/json"){if(!Yt(u))return r();try{let y=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:t,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:y,text:void 0}}}catch{return r()}}}Ne(typeof FormData=="function","FormData is not available in this environment");let f,h;if(i.formData)f=_p(i.formData),h=i.formData;else if(i.body instanceof FormData)f=_p(i.body),h=i.body;else if(i.body instanceof URLSearchParams)f=i.body,h=rS(f);else if(i.body==null)f=new URLSearchParams,h=new FormData;else try{f=new URLSearchParams(i.body),h=rS(f)}catch{return r()}let m={formMethod:u,formAction:c,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Yt(m.formMethod))return{path:t,submission:m};let g=wi(t);return e&&g.search&&Tm(g.search)&&f.append("index",""),g.search=`?${f}`,{path:Si(g),submission:m}}function Jb(e,t,i,r,o,u,c,f,h,m,g,y,b,S,x,C,R,A,j,L,V,q){let W=V?_n(V[1])?V[1].error:V[1].data:void 0,K=o.createURL(u.location),T=o.createURL(h),ne;if(g&&u.errors){let P=Object.keys(u.errors)[0];ne=c.findIndex(J=>J.route.id===P)}else if(V&&_n(V[1])){let P=V[0];ne=c.findIndex(J=>J.route.id===P)-1}let ee=V?V[1].statusCode:void 0,he=ee&&ee>=400,ae={currentUrl:K,currentParams:u.matches[0]?.params||{},nextUrl:T,nextParams:c[0].params,...f,actionResult:W,actionStatus:ee},Le=_l(c),Re=c.map((P,J)=>{let{route:ie}=P,oe=null;if(ne!=null&&J>ne)oe=!1;else if(ie.lazy)oe=!0;else if(!Rm(ie))oe=!1;else if(g){let{shouldLoad:te}=Vw(ie,u.loaderData,u.errors);oe=te}else UA(u.loaderData,u.matches[J],P)&&(oe=!0);if(oe!==null)return Rp(i,r,e,h,Le,P,m,t,oe);let ye=!1;typeof q=="boolean"?ye=q:he?ye=!1:(y||K.pathname+K.search===T.pathname+T.search||K.search!==T.search||BA(u.matches[J],P))&&(ye=!0);let D={...ae,defaultShouldRevalidate:ye},I=el(P,D);return Rp(i,r,e,h,Le,P,m,t,I,D,q)}),je=[];return x.forEach((P,J)=>{if(g||!c.some(me=>me.route.id===P.routeId)||S.has(J))return;let ie=u.fetchers.get(J),oe=ie&&ie.state!=="idle"&&ie.data===void 0,ye=ai(R,P.path,A??"/",!1,L);if(!ye){if(j&&oe)return;je.push({key:J,routeId:P.routeId,path:P.path,matches:null,match:null,request:null,controller:null});return}if(C.has(J))return;let D=bc(ye,P.path),I=new AbortController,te=bs(o,P.path,I.signal),re=null;if(b.has(J))b.delete(J),re=Ms(i,r,te,P.path,ye,D,m,t);else if(oe)y&&(re=Ms(i,r,te,P.path,ye,D,m,t));else{let me;typeof q=="boolean"?me=q:he?me=!1:me=y;let Se={...ae,defaultShouldRevalidate:me};el(D,Se)&&(re=Ms(i,r,te,P.path,ye,D,m,t,Se))}re&&je.push({key:J,routeId:P.routeId,path:P.path,matches:re,match:D,request:te,controller:I})}),{dsMatches:Re,revalidatingFetchers:je}}function Rm(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Vw(e,t,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Rm(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,o=i!=null&&i[e.id]!==void 0;if(!r&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let u=!r&&!o;return{shouldLoad:u,renderFallback:u}}function UA(e,t,i){let r=!t||i.route.id!==t.route.id,o=!e.hasOwnProperty(i.route.id);return r||o}function BA(e,t){let i=e.route.path;return e.pathname!==t.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==t.params["*"]}function el(e,t){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(t);if(typeof i=="boolean")return i}return t.defaultShouldRevalidate}function Wb(e,t,i,r,o,u){let c;if(e){let m=r[e];Ne(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=i.activeRoutes;let f=[],h=[];if(t.forEach(m=>{let g=c.find(y=>$w(m,y));g?h.push({existingRoute:g,newRoute:m}):f.push(m)}),f.length>0){let m=hl(f,o,[e||"_","patch",String(c?.length||"0")],r);c.push(...m)}if(u&&h.length>0)for(let m=0;mt.children?.some(o=>$w(i,o)))??!1:!1}var eS=new WeakMap,Pw=({key:e,route:t,manifest:i,mapRouteProperties:r})=>{let o=i[t.id];if(Ne(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[e];if(!u)return;let c=eS.get(o);c||(c={},eS.set(o,c));let f=c[e];if(f)return f;let h=(async()=>{let m=nA(e),y=o[e]!==void 0&&e!=="hasErrorBoundary";if(m)xt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)xt(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await u();b!=null&&(Object.assign(o,{[e]:b}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(b=>b===void 0)&&(o.lazy=void 0))})();return c[e]=h,h},tS=new WeakMap;function HA(e,t,i,r,o){let u=i[e.id];if(Ne(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=tS.get(u);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let y=(async()=>{Ne(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),S={};for(let x in b){let C=b[x];if(C===void 0)continue;let R=aA(x),j=u[x]!==void 0&&x!=="hasErrorBoundary";R?xt(!R,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?xt(!j,`Route "${u.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):S[x]=C}Object.assign(u,S),Object.assign(u,{...r(u),lazy:void 0})})();return tS.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),f=[],h;for(let g of c){if(o&&o.includes(g))continue;let y=Pw({key:g,route:e,manifest:i,mapRouteProperties:r});y&&(f.push(y),g===t&&(h=y))}let m=f.length>0?Promise.all(f).then(()=>{}):void 0;return m?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:h}}async function nS(e){let t=e.matches.filter(o=>o.shouldLoad),i={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,u)=>{i[t[u].route.id]=o}),i}async function FA(e){return e.matches.some(t=>t.route.middleware)?Uw(e,()=>nS(e)):nS(e)}function Uw(e,t){return kA(e,t,r=>{if(nM(r))throw r;return r},JA,i);function i(r,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,f=Math.min(Math.max(c.findIndex(m=>m.route.id===o),0),Math.max(c.findIndex(m=>m.shouldCallHandler()),0)),h=Ma(c,c[f].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:r}})}}}async function kA(e,t,i,r,o){let{matches:u,...c}=e,f=u.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Bw(c,f,t,i,r,o)}async function Bw(e,t,i,r,o,u,c=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let h=t[c];if(!h)return await i();let[m,g]=h,y,b=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Bw(e,t,i,r,o,u,c+1)},y.value}catch(S){return y={value:await u(S,m,y)},y.value}};try{let S=await g(e,b),x=S!=null?r(S):void 0;return o(x)?x:y?x??y.value:(y={value:await b()},y.value)}catch(S){return await u(S,m,y)}}function Hw(e,t,i,r,o){let u=Pw({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=HA(r.route,Yt(i.method)?"action":"loader",t,e,o);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Rp(e,t,i,r,o,u,c,f,h,m=null,g){let y=!1,b=Hw(e,t,i,u,c);return{...u,_lazyPromises:b,shouldLoad:h,shouldRevalidateArgs:m,shouldCallHandler(S){return y=!0,m?typeof g=="boolean"?el(u,{...m,defaultShouldRevalidate:g}):typeof S=="boolean"?el(u,{...m,defaultShouldRevalidate:S}):el(u,m):h},resolve(S){let{lazy:x,loader:C,middleware:R}=u.route,A=y||h||S&&!Yt(i.method)&&(x||C),j=R&&R.length>0&&!C&&!x;return A&&(Yt(i.method)||!j)?GA({request:i,path:r,pattern:o,match:u,lazyHandlerPromise:b?.handler,lazyRoutePromise:b?.route,handlerOverride:S,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function Ms(e,t,i,r,o,u,c,f,h=null){return o.map(m=>m.route.id!==u.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:Hw(e,t,i,m,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Rp(e,t,i,r,_l(o),m,c,f,!0,h))}async function qA(e,t,i,r,o,u,c){r.some(g=>g._lazyPromises?.middleware)&&await Promise.all(r.map(g=>g._lazyPromises?.middleware));let f={request:t,url:Fw(t,i),pattern:_l(r),params:r[0].params,context:u,matches:r},m=await e({...f,fetcherKey:o,runClientMiddleware:g=>{let y=f;return Uw(y,()=>g({...y,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(g=>[g._lazyPromises?.handler,g._lazyPromises?.route]))}catch{}return m}async function GA({request:e,path:t,pattern:i,match:r,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:c,scopedContext:f}){let h,m,g=Yt(e.method),y=g?"action":"loader",b=S=>{let x,C=new Promise((j,L)=>x=L);m=()=>x(),e.signal.addEventListener("abort",m);let R=j=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${r.route.id}]`)):S({request:e,url:Fw(e,t),pattern:i,params:r.params,context:f},...j!==void 0?[j]:[]),A=(async()=>{try{return{type:"data",result:await(c?c(L=>R(L)):R())}}catch(j){return{type:"error",result:j}}})();return Promise.race([A,C])};try{let S=g?r.route.action:r.route.loader;if(o||u)if(S){let x,[C]=await Promise.all([b(S).catch(R=>{x=R}),o,u]);if(x!==void 0)throw x;h=C}else{await o;let x=g?r.route.action:r.route.loader;if(x)[h]=await Promise.all([b(x),u]);else if(y==="action"){let C=new URL(e.url),R=C.pathname+C.search;throw Hn(405,{method:e.method,pathname:R,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(S)h=await b(S);else{let x=new URL(e.url),C=x.pathname+x.search;throw Hn(404,{pathname:C})}}catch(S){return{type:"error",result:S}}finally{m&&e.signal.removeEventListener("abort",m)}return h}async function IA(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function YA(e){let{result:t,type:i}=e;if(_m(t)){let r;try{r=await IA(t)}catch(o){return{type:"error",error:o}}return i==="error"?{type:"error",error:new Rl(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return i==="error"?uS(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:ZA(t),statusCode:pl(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:pl(t)?t.status:void 0}:uS(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function KA(e,t,i,r,o){let u=e.headers.get("Location");if(Ne(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Cm(u)){let c=r.slice(0,r.findIndex(f=>f.route.id===i)+1);u=Ep(new URL(t.url),c,o,u),e.headers.set("Location",u)}return e}var iS=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function aS(e,t,i,r){if(Cm(e)){let o=e,u=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(iS.includes(u.protocol))throw new Error("Invalid redirect location");let c=Yn(u.pathname,i)!=null;if(u.origin===t.origin&&c)return Em(u.pathname)+u.search+u.hash}try{let o=r.createURL(e);if(iS.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function bs(e,t,i,r){let o=e.createURL(kw(t)).toString(),u={signal:i};if(r&&Yt(r.formMethod)){let{formMethod:c,formEncType:f}=r;u.method=c.toUpperCase(),f==="application/json"?(u.headers=new Headers({"Content-Type":f}),u.body=JSON.stringify(r.json)):f==="text/plain"?u.body=r.text:f==="application/x-www-form-urlencoded"&&r.formData?u.body=_p(r.formData):u.body=r.formData}return new Request(o,u)}function Fw(e,t){let i=new URL(e.url),r=typeof t=="string"?wi(t):t;if(i.pathname=r.pathname||"/",r.search){let o=new URLSearchParams(r.search),u=o.getAll("index");o.delete("index");for(let c of u.filter(Boolean))o.append("index",c);i.search=o.size?`?${o.toString()}`:""}else i.search="";return i.hash=r.hash||"",i}function _p(e){let t=new URLSearchParams;for(let[i,r]of e.entries())t.append(i,typeof r=="string"?r:r.name);return t}function rS(e){let t=new FormData;for(let[i,r]of e.entries())t.append(i,r);return t}function QA(e,t,i,r=!1,o=!1){let u={},c=null,f,h=!1,m={},g=i&&_n(i[1])?i[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let b=y.route.id,S=t[b];if(Ne(!mr(S),"Cannot handle redirect results in processLoaderData"),_n(S)){let x=S.error;if(g!==void 0&&(x=g,g=void 0),c=c||{},o)c[b]=x;else{let C=Ma(e,b);c[C.route.id]==null&&(c[C.route.id]=x)}r||(u[b]=zw),h||(h=!0,f=pl(S.error)?S.error.status:500),S.headers&&(m[b]=S.headers)}else u[b]=S.data,S.statusCode&&S.statusCode!==200&&!h&&(f=S.statusCode),S.headers&&(m[b]=S.headers)}),g!==void 0&&i&&(c={[i[0]]:g},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:c,statusCode:f||200,loaderHeaders:m}}function sS(e,t,i,r,o,u,c){let{loaderData:f,errors:h}=QA(t,i,r);return o.filter(m=>!m.matches||m.matches.some(g=>g.shouldLoad)).forEach(m=>{let{key:g,match:y,controller:b}=m;if(b&&b.signal.aborted)return;let S=u[g];if(Ne(S,"Did not find corresponding fetcher result"),_n(S)){let x=Ma(e.matches,y?.route.id);h&&h[x.route.id]||(h={...h,[x.route.id]:S.error}),c.delete(g)}else if(mr(S))Ne(!1,"Unhandled fetcher revalidation redirect");else{let x=gi(S.data);c.set(g,x)}}),{loaderData:f,errors:h}}function oS(e,t,i,r){let o=Object.entries(t).filter(([,u])=>u!==zw).reduce((u,[c,f])=>(u[c]=f,u),{});for(let u of i){let c=u.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&u.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function lS(e){return e?_n(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ma(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function nc(e){let t=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Hn(e,{pathname:t,routeId:i,method:r,type:o,message:u}={}){let c="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&i?f=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:o==="invalid-body"&&(f="Unable to encode submission body")):e===403?(c="Forbidden",f=`Route "${i}" does not match URL "${t}"`):e===404?(c="Not Found",f=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&i?f=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:r&&(f=`Invalid request method "${r.toUpperCase()}"`)),new Rl(e||500,c,new Error(f),!0)}function ic(e){let t=Object.entries(e);for(let i=t.length-1;i>=0;i--){let[r,o]=t[i];if(mr(o))return{key:r,result:o}}}function kw(e){let t=typeof e=="string"?wi(e):e;return Si({...t,hash:""})}function XA(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function ZA(e){return new Rl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function JA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,i])=>typeof t=="string"&&WA(i))}function WA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function eM(e){return _m(e.result)&&Nw.has(e.result.status)}function _n(e){return e.type==="error"}function mr(e){return(e&&e.type)==="redirect"}function uS(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function _m(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function tM(e){return Nw.has(e)}function nM(e){return _m(e)&&tM(e.status)&&e.headers.has("Location")}function iM(e){return jA.has(e.toUpperCase())}function Yt(e){return OA.has(e.toUpperCase())}function Tm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function bc(e,t){let i=typeof t=="string"?wi(t).search:t.search;if(e[e.length-1].route.index&&Tm(i||""))return e[e.length-1];let r=Aw(e);return r[r.length-1]}function cS(e){let{formMethod:t,formAction:i,formEncType:r,text:o,formData:u,json:c}=e;if(!(!t||!i||!r)){if(o!=null)return{formMethod:t,formAction:i,formEncType:r,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:t,formAction:i,formEncType:r,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:i,formEncType:r,formData:void 0,json:c,text:void 0}}}function Bh(e,t,i,r){return r?{state:"loading",location:e,matches:t,historyAction:i,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:e,matches:t,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function aM(e,t,i,r){return{state:"submitting",location:e,matches:t,historyAction:i,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Go(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 rM(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 gi(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 sM(e,t){try{let i=e.sessionStorage.getItem(Lw);if(i){let r=JSON.parse(i);for(let[o,u]of Object.entries(r||{}))u&&Array.isArray(u)&&t.set(o,new Set(u||[]))}}catch{}}function oM(e,t){if(t.size>0){let i={};for(let[r,o]of t)i[r]=[...o];try{e.sessionStorage.setItem(Lw,JSON.stringify(i))}catch(r){xt(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function fS(){let e,t,i=new Promise((r,o)=>{e=async u=>{r(u);try{await i}catch{}},t=async u=>{o(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:t}}var _r=_.createContext(null);_r.displayName="DataRouter";var Tl=_.createContext(null);Tl.displayName="DataRouterState";var qw=_.createContext(!1);function Gw(){return _.useContext(qw)}var Am=_.createContext({isTransitioning:!1});Am.displayName="ViewTransition";var Iw=_.createContext(new Map);Iw.displayName="Fetchers";var lM=_.createContext(null);lM.displayName="Await";var Mn=_.createContext(null);Mn.displayName="Navigation";var tf=_.createContext(null);tf.displayName="Location";var li=_.createContext({outlet:null,matches:[],isDataRoute:!1});li.displayName="Route";var Mm=_.createContext(null);Mm.displayName="RouteError";var Yw="REACT_ROUTER_ERROR",uM="REDIRECT",cM="ROUTE_ERROR_RESPONSE";function fM(e){if(e.startsWith(`${Yw}:${uM}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function dM(e){if(e.startsWith(`${Yw}:${cM}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Rl(t.status,t.statusText,t.data)}catch{}}function hM(e,{relative:t}={}){Ne(Ps(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:r}=_.useContext(Mn),{hash:o,pathname:u,search:c}=Al(e,{relative:t}),f=u;return i!=="/"&&(f=u==="/"?i:kn([i,u])),r.createHref({pathname:f,search:c,hash:o})}function Ps(){return _.useContext(tf)!=null}function Ci(){return Ne(Ps(),"useLocation() may be used only in the context of a component."),_.useContext(tf).location}var Kw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qw(e){_.useContext(Mn).static||_.useLayoutEffect(e)}function Xw(){let{isDataRoute:e}=_.useContext(li);return e?AM():pM()}function pM(){Ne(Ps(),"useNavigate() may be used only in the context of a component.");let e=_.useContext(_r),{basename:t,navigator:i}=_.useContext(Mn),{matches:r}=_.useContext(li),{pathname:o}=Ci(),u=JSON.stringify(ef(r)),c=_.useRef(!1);return Qw(()=>{c.current=!0}),_.useCallback((h,m={})=>{if(xt(c.current,Kw),!c.current)return;if(typeof h=="number"){i.go(h);return}let g=El(h,JSON.parse(u),o,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:kn([t,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[t,i,u,o,e])}var mM=_.createContext(null);function gM(e){let t=_.useContext(li).outlet;return _.useMemo(()=>t&&_.createElement(mM.Provider,{value:e},t),[t,e])}function Al(e,{relative:t}={}){let{matches:i}=_.useContext(li),{pathname:r}=Ci(),o=JSON.stringify(ef(i));return _.useMemo(()=>El(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function yM(e,t,i){Ne(Ps(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=_.useContext(Mn),{matches:o}=_.useContext(li),u=o[o.length-1],c=u?u.params:{},f=u?u.pathname:"/",h=u?u.pathnameBase:"/",m=u&&u.route;{let R=m&&m.path||"";Jw(f,!m||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let g=Ci(),y;y=g;let b=y.pathname||"/",S=b;if(h!=="/"){let R=h.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let x=i&&i.state.matches.length?i.state.matches.map(R=>Object.assign(R,{route:i.manifest[R.route.id]||R.route})):Ew(e,{pathname:S});return xt(m||x!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),xt(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),wM(x&&x.map(R=>Object.assign({},R,{params:Object.assign({},c,R.params),pathname:kn([h,r.encodeLocation?r.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?h:kn([h,r.encodeLocation?r.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,i)}function vM(){let e=TM(),t=pl(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},u={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:u},"ErrorBoundary")," or"," ",_.createElement("code",{style:u},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),i?_.createElement("pre",{style:o},i):null,c)}var bM=_.createElement(vM,null),Zw=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=dM(e.digest);i&&(e=i)}let t=e!==void 0?_.createElement(li.Provider,{value:this.props.routeContext},_.createElement(Mm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?_.createElement(SM,{error:e},t):t}};Zw.contextType=qw;var Hh=new WeakMap;function SM({children:e,error:t}){let{basename:i}=_.useContext(Mn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=fM(t.digest);if(r){let o=Hh.get(t);if(o)throw o;let u=Ow(r.location,i);if(Mw&&!Hh.get(t))if(u.isExternal||r.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:r.replace}));throw Hh.set(t,c),c}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function xM({routeContext:e,match:t,children:i}){let r=_.useContext(_r);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(li.Provider,{value:e},i)}function wM(e,t=[],i){let r=i?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,u=r?.errors;if(u!=null){let g=o.findIndex(y=>y.route.id&&u?.[y.route.id]!==void 0);Ne(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,g+1))}let c=!1,f=-1;if(i&&r){c=r.renderFallback;for(let g=0;g=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let h=i?.onError,m=r&&h?(g,y)=>{h(g,{location:r.location,params:r.matches?.[0]?.params??{},pattern:_l(r.matches),errorInfo:y})}:void 0;return o.reduceRight((g,y,b)=>{let S,x=!1,C=null,R=null;r&&(S=u&&y.route.id?u[y.route.id]:void 0,C=y.route.errorElement||bM,c&&(f<0&&b===0?(Jw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,R=null):f===b&&(x=!0,R=y.route.hydrateFallbackElement||null)));let A=t.concat(o.slice(0,b+1)),j=()=>{let L;return S?L=C:x?L=R:y.route.Component?L=_.createElement(y.route.Component,null):y.route.element?L=y.route.element:L=g,_.createElement(xM,{match:y,routeContext:{outlet:g,matches:A,isDataRoute:r!=null},children:L})};return r&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?_.createElement(Zw,{location:r.location,revalidation:r.revalidation,component:C,error:S,children:j(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:m}):j()},null)}function Om(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function CM(e){let t=_.useContext(_r);return Ne(t,Om(e)),t}function EM(e){let t=_.useContext(Tl);return Ne(t,Om(e)),t}function RM(e){let t=_.useContext(li);return Ne(t,Om(e)),t}function Dm(e){let t=RM(e),i=t.matches[t.matches.length-1];return Ne(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function _M(){return Dm("useRouteId")}function TM(){let e=_.useContext(Mm),t=EM("useRouteError"),i=Dm("useRouteError");return e!==void 0?e:t.errors?.[i]}function AM(){let{router:e}=CM("useNavigate"),t=Dm("useNavigate"),i=_.useRef(!1);return Qw(()=>{i.current=!0}),_.useCallback(async(o,u={})=>{xt(i.current,Kw),i.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...u}))},[e,t])}var dS={};function Jw(e,t,i){!t&&!dS[e]&&(dS[e]=!0,xt(!1,i))}var hS={};function pS(e,t){!e&&!hS[t]&&(hS[t]=!0,console.warn(t))}var MM="useOptimistic",mS=oT[MM],OM=()=>{};function DM(e){return mS?mS(e):[e,OM]}function jM(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&xt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&xt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&xt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var NM=["HydrateFallback","hydrateFallbackElement"],LM=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",t(i))}})}};function zM({router:e,flushSync:t,onError:i,useTransitions:r}){r=Gw()||r;let[u,c]=_.useState(e.state),[f,h]=DM(u),[m,g]=_.useState(),[y,b]=_.useState({isTransitioning:!1}),[S,x]=_.useState(),[C,R]=_.useState(),[A,j]=_.useState(),L=_.useRef(new Map),V=_.useCallback((T,{deletedFetchers:ne,newErrors:ee,flushSync:he,viewTransitionOpts:ae})=>{ee&&i&&Object.values(ee).forEach(Re=>i(Re,{location:T.location,params:T.matches[0]?.params??{},pattern:_l(T.matches)})),T.fetchers.forEach((Re,je)=>{Re.data!==void 0&&L.current.set(je,Re.data)}),ne.forEach(Re=>L.current.delete(Re)),pS(he===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Le=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(pS(ae==null||Le,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ae||!Le){t&&he?t(()=>c(T)):r===!1?c(T):_.startTransition(()=>{r===!0&&h(Re=>gS(Re,T)),c(T)});return}if(t&&he){t(()=>{C&&(S?.resolve(),C.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})});let Re=e.window.document.startViewTransition(()=>{t(()=>c(T))});Re.finished.finally(()=>{t(()=>{x(void 0),R(void 0),g(void 0),b({isTransitioning:!1})})}),t(()=>R(Re));return}C?(S?.resolve(),C.skipTransition(),j({state:T,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})):(g(T),b({isTransitioning:!0,flushSync:!1,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation}))},[e.window,t,C,S,r,h,i]);_.useLayoutEffect(()=>e.subscribe(V),[e,V]),_.useEffect(()=>{y.isTransitioning&&!y.flushSync&&x(new LM)},[y]),_.useEffect(()=>{if(S&&m&&e.window){let T=m,ne=S.promise,ee=e.window.document.startViewTransition(async()=>{r===!1?c(T):_.startTransition(()=>{r===!0&&h(he=>gS(he,T)),c(T)}),await ne});ee.finished.finally(()=>{x(void 0),R(void 0),g(void 0),b({isTransitioning:!1})}),R(ee)}},[m,S,e.window,r,h]),_.useEffect(()=>{S&&m&&f.location.key===m.location.key&&S.resolve()},[S,C,f.location,m]),_.useEffect(()=>{!y.isTransitioning&&A&&(g(A.state),b({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}),j(void 0))},[y.isTransitioning,A]);let q=_.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,ne,ee)=>e.navigate(T,{state:ne,preventScrollReset:ee?.preventScrollReset}),replace:(T,ne,ee)=>e.navigate(T,{replace:!0,state:ne,preventScrollReset:ee?.preventScrollReset})}),[e]),W=e.basename||"/",K=_.useMemo(()=>({router:e,navigator:q,static:!1,basename:W,onError:i}),[e,q,W,i]);return _.createElement(_.Fragment,null,_.createElement(_r.Provider,{value:K},_.createElement(Tl.Provider,{value:f},_.createElement(Iw.Provider,{value:L.current},_.createElement(Am.Provider,{value:y},_.createElement(BM,{basename:W,location:f.location,navigationType:f.historyAction,navigator:q,useTransitions:r},_.createElement(VM,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:i})))))),null)}function gS(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var VM=_.memo($M);function $M({routes:e,manifest:t,future:i,state:r,isStatic:o,onError:u}){return yM(e,void 0,{manifest:t,state:r,isStatic:o,onError:u})}function PM({to:e,replace:t,state:i,relative:r}){Ne(Ps()," may be used only in the context of a component.");let{static:o}=_.useContext(Mn);xt(!o," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=_.useContext(li),{pathname:c}=Ci(),f=Xw(),h=El(e,ef(u),c,r==="path"),m=JSON.stringify(h);return _.useEffect(()=>{f(JSON.parse(m),{replace:t,state:i,relative:r})},[f,m,r,t,i]),null}function UM(e){return gM(e.context)}function BM({basename:e="/",children:t=null,location:i,navigationType:r="POP",navigator:o,static:u=!1,useTransitions:c}){Ne(!Ps(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=_.useMemo(()=>({basename:f,navigator:o,static:u,useTransitions:c,future:{}}),[f,o,u,c]);typeof i=="string"&&(i=wi(i));let{pathname:m="/",search:g="",hash:y="",state:b=null,key:S="default",mask:x}=i,C=_.useMemo(()=>{let R=Yn(m,f);return R==null?null:{location:{pathname:R,search:g,hash:y,state:b,key:S,mask:x},navigationType:r}},[f,m,g,y,b,S,r,x]);return xt(C!=null,` is not able to match the URL "${m}${g}${y}" because it does not start with the basename, so the won't render anything.`),C==null?null:_.createElement(Mn.Provider,{value:h},_.createElement(tf.Provider,{children:t,value:C}))}var Sc="get",xc="application/x-www-form-urlencoded";function nf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function HM(e){return nf(e)&&e.tagName.toLowerCase()==="button"}function FM(e){return nf(e)&&e.tagName.toLowerCase()==="form"}function kM(e){return nf(e)&&e.tagName.toLowerCase()==="input"}function qM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GM(e,t){return e.button===0&&(!t||t==="_self")&&!qM(e)}var ac=null;function IM(){if(ac===null)try{new FormData(document.createElement("form"),0),ac=!1}catch{ac=!0}return ac}var YM=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fh(e){return e!=null&&!YM.has(e)?(xt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${xc}"`),null):e}function KM(e,t){let i,r,o,u,c;if(FM(e)){let f=e.getAttribute("action");r=f?Yn(f,t):null,i=e.getAttribute("method")||Sc,o=Fh(e.getAttribute("enctype"))||xc,u=new FormData(e)}else if(HM(e)||kM(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a `}renderLink(){const{ariaLabel:t,ariaHasPopup:i,ariaExpanded:r}=this;return gn`${this.renderContent()} + `}renderContent(){const t=gn``;return gn` + + ${this.trailingIcon?Ae:t} + + ${this.trailingIcon?t:Ae} + `}handleClick(t){if(this.softDisabled||this.disabled&&this.href){t.stopImmediatePropagation(),t.preventDefault();return}!m2(t)||!this.buttonElement||(this.focus(),p2(this.buttonElement))}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}}bC(sn);sn.formAssociated=!0;sn.shadowRootOptions={mode:"open",delegatesFocus:!0};ke([ht({type:Boolean,reflect:!0})],sn.prototype,"disabled",void 0);ke([ht({type:Boolean,attribute:"soft-disabled",reflect:!0})],sn.prototype,"softDisabled",void 0);ke([ht()],sn.prototype,"href",void 0);ke([ht()],sn.prototype,"download",void 0);ke([ht()],sn.prototype,"target",void 0);ke([ht({type:Boolean,attribute:"trailing-icon",reflect:!0})],sn.prototype,"trailingIcon",void 0);ke([ht({type:Boolean,attribute:"has-icon",reflect:!0})],sn.prototype,"hasIcon",void 0);ke([ht()],sn.prototype,"type",void 0);ke([ht({reflect:!0})],sn.prototype,"value",void 0);ke([sC(".button")],sn.prototype,"buttonElement",void 0);ke([zO({slot:"icon",flatten:!0})],sn.prototype,"assignedIcons",void 0);class b2 extends sn{}const S2=Tr`:host{--_container-height: var(--md-text-button-container-height, 40px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-text-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-text-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-text-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-text-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-text-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-text-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-text-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-text-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-text-button-icon-size, 18px);--_pressed-icon-color: var(--md-text-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-text-button-container-shape-start-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-text-button-container-shape-start-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-text-button-container-shape-end-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-text-button-container-shape-end-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-text-button-leading-space, 12px);--_trailing-space: var(--md-text-button-trailing-space, 12px);--_with-leading-icon-leading-space: var(--md-text-button-with-leading-icon-leading-space, 12px);--_with-leading-icon-trailing-space: var(--md-text-button-with-leading-icon-trailing-space, 16px);--_with-trailing-icon-leading-space: var(--md-text-button-with-trailing-icon-leading-space, 16px);--_with-trailing-icon-trailing-space: var(--md-text-button-with-trailing-icon-trailing-space, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0} +`;let jp=class extends b2{};jp.styles=[KO,S2];jp=ke([Ml("md-text-button")],jp);class x2 extends Ji{render(){return gn``}connectedCallback(){if(super.connectedCallback(),this.getAttribute("aria-hidden")==="false"){this.removeAttribute("aria-hidden");return}this.setAttribute("aria-hidden","true")}}const w2=Tr`:host{font-size:var(--md-icon-size, 24px);width:var(--md-icon-size, 24px);height:var(--md-icon-size, 24px);color:inherit;font-variation-settings:inherit;font-weight:400;font-family:var(--md-icon-font, Material Symbols Outlined);display:inline-flex;font-style:normal;place-items:center;place-content:center;line-height:1;overflow:hidden;letter-spacing:normal;text-transform:none;user-select:none;white-space:nowrap;word-wrap:normal;flex-shrink:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}::slotted(svg){fill:currentColor}::slotted(*){height:100%;width:100%} +`;let Np=class extends x2{};Np.styles=[w2];Np=ke([Ml("md-icon")],Np);const SC=Symbol.for(""),C2=e=>{if(e?.r===SC)return e?._$litStatic$},DS=(e,...t)=>({_$litStatic$:t.reduce((i,r,o)=>i+(u=>{if(u._$litStatic$!==void 0)return u._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${u}. Use 'unsafeStatic' to pass non-literal values, but + take care to ensure page security.`)})(r)+e[o+1],e[0]),r:SC}),jS=new Map,E2=e=>(t,...i)=>{const r=i.length;let o,u;const c=[],f=[];let h,m=0,g=!1;for(;m + ${this.renderFocusRing()} + ${this.renderRipple()} + ${this.selected?Ae:this.renderIcon()} + ${this.selected?this.renderSelectedIcon():Ae} + ${this.href?this.renderLink():this.renderTouchTarget()} + `}renderLink(){const{ariaLabel:t}=this;return gn` + + ${this.renderTouchTarget()} + + `}getRenderClasses(){return{"flip-icon":this.flipIcon,selected:this.toggle&&this.selected}}renderIcon(){return gn``}renderSelectedIcon(){return gn``}renderTouchTarget(){return gn``}renderFocusRing(){return gn``}renderRipple(){const t=!this.href&&(this.disabled||this.softDisabled);return gn``}connectedCallback(){this.flipIcon=NS(this,this.flipIconInRtl),super.connectedCallback()}handleClick(t){if(!this.href&&this.softDisabled){t.stopImmediatePropagation(),t.preventDefault();return}}async handleClickOnChild(t){await 0,!(!this.toggle||this.disabled||this.softDisabled||t.defaultPrevented)&&(this.selected=!this.selected,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}}bC(Kt);Kt.formAssociated=!0;Kt.shadowRootOptions={mode:"open",delegatesFocus:!0};ke([ht({type:Boolean,reflect:!0})],Kt.prototype,"disabled",void 0);ke([ht({type:Boolean,attribute:"soft-disabled",reflect:!0})],Kt.prototype,"softDisabled",void 0);ke([ht({type:Boolean,attribute:"flip-icon-in-rtl"})],Kt.prototype,"flipIconInRtl",void 0);ke([ht()],Kt.prototype,"href",void 0);ke([ht()],Kt.prototype,"download",void 0);ke([ht()],Kt.prototype,"target",void 0);ke([ht({attribute:"aria-label-selected"})],Kt.prototype,"ariaLabelSelected",void 0);ke([ht({type:Boolean})],Kt.prototype,"toggle",void 0);ke([ht({type:Boolean,reflect:!0})],Kt.prototype,"selected",void 0);ke([ht()],Kt.prototype,"type",void 0);ke([ht({reflect:!0})],Kt.prototype,"value",void 0);ke([Um()],Kt.prototype,"flipIcon",void 0);const T2=Tr`:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-height);width:var(--_container-width);justify-content:center}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) max(0px,(48px - var(--_container-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){pointer-events:none}.icon-button{place-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;place-content:center;outline:none;padding:0;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size);font-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.flip-icon .icon{transform:scaleX(-1)}.icon{display:inline-flex}.link{display:grid;height:100%;outline:none;place-items:center;position:absolute;width:100%}.touch{position:absolute;height:max(48px,100%);width:max(48px,100%)}:host([touch-target=none]) .touch{display:none}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1}} +`;const A2=Tr`:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-icon-button-disabled-icon-opacity, 0.38);--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-height: var(--md-icon-button-state-layer-height, 40px);--_state-layer-shape: var(--md-icon-button-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));--_state-layer-width: var(--md-icon-button-state-layer-width, 40px);--_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-icon-button-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: 0;--_container-shape-start-end: 0;--_container-shape-end-end: 0;--_container-shape-end-start: 0;--_container-height: 0;--_container-width: 0;height:var(--_state-layer-height);width:var(--_state-layer-width)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_state-layer-height))/2) max(0px,(48px - var(--_state-layer-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_state-layer-shape);--md-focus-ring-shape-start-end: var(--_state-layer-shape);--md-focus-ring-shape-end-end: var(--_state-layer-shape);--md-focus-ring-shape-end-start: var(--_state-layer-shape)}.standard{background-color:rgba(0,0,0,0);color:var(--_icon-color);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.standard:hover{color:var(--_hover-icon-color)}.standard:focus{color:var(--_focus-icon-color)}.standard:active{color:var(--_pressed-icon-color)}.standard:is(:disabled,[aria-disabled=true]){color:var(--_disabled-icon-color)}md-ripple{border-radius:var(--_state-layer-shape)}.standard:is(:disabled,[aria-disabled=true]){opacity:var(--_disabled-icon-opacity)}.selected:not(:disabled,[aria-disabled=true]){color:var(--_selected-icon-color)}.selected:not(:disabled,[aria-disabled=true]):hover{color:var(--_selected-hover-icon-color)}.selected:not(:disabled,[aria-disabled=true]):focus{color:var(--_selected-focus-icon-color)}.selected:not(:disabled,[aria-disabled=true]):active{color:var(--_selected-pressed-icon-color)}.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)} +`;let Lp=class extends Kt{getRenderClasses(){return{...super.getRenderClasses(),standard:!0}}};Lp.styles=[T2,A2];Lp=ke([Ml("md-icon-button")],Lp);const qm=_.createContext({});function Gm(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const M2=typeof window<"u",xC=M2?_.useLayoutEffect:_.useEffect,sf=_.createContext(null);function Im(e,t){e.indexOf(t)===-1&&e.push(t)}function Hc(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const xi=(e,t,i)=>i>t?t:i{};const $a={},wC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),CC=e=>typeof e=="object"&&e!==null,EC=e=>/^0[^.\s]+$/u.test(e);function RC(e){let t;return()=>(t===void 0&&(t=e()),t)}const qn=e=>e,jl=(...e)=>e.reduce((t,i)=>r=>i(t(r))),bl=(e,t,i)=>{const r=t-e;return r?(i-e)/r:1};class Km{constructor(){this.subscriptions=[]}add(t){return Im(this.subscriptions,t),()=>Hc(this.subscriptions,t)}notify(t,i,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,i,r);else for(let u=0;ue*1e3,Fn=e=>e/1e3,_C=(e,t)=>t?e*(1e3/t):0,TC=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,O2=1e-7,D2=12;function j2(e,t,i,r,o){let u,c,f=0;do c=t+(i-t)/2,u=TC(c,r,o)-e,u>0?i=c:t=c;while(Math.abs(u)>O2&&++fj2(u,0,1,e,i);return u=>u===0||u===1?u:TC(o(u),t,r)}const AC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,MC=e=>t=>1-e(1-t),OC=Nl(.33,1.53,.69,.99),Qm=MC(OC),DC=AC(Qm),jC=e=>e>=1?1:(e*=2)<1?.5*Qm(e):.5*(2-Math.pow(2,-10*(e-1))),Xm=e=>1-Math.sin(Math.acos(e)),NC=MC(Xm),LC=AC(Xm),N2=Nl(.42,0,1,1),L2=Nl(0,0,.58,1),zC=Nl(.42,0,.58,1),z2=e=>Array.isArray(e)&&typeof e[0]!="number",VC=e=>Array.isArray(e)&&typeof e[0]=="number",V2={linear:qn,easeIn:N2,easeInOut:zC,easeOut:L2,circIn:Xm,circInOut:LC,circOut:NC,backIn:Qm,backInOut:DC,backOut:OC,anticipate:jC},$2=e=>typeof e=="string",LS=e=>{if(VC(e)){Ym(e.length===4);const[t,i,r,o]=e;return Nl(t,i,r,o)}else if($2(e))return V2[e];return e},sc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function P2(e,t){let i=new Set,r=new Set,o=!1,u=!1;const c=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function h(g){c.has(g)&&(m.schedule(g),e()),g(f)}const m={schedule:(g,y=!1,b=!1)=>{const x=b&&o?i:r;return y&&c.add(g),x.add(g),g},cancel:g=>{r.delete(g),c.delete(g)},process:g=>{if(f=g,o){u=!0;return}o=!0;const y=i;i=r,r=y,i.forEach(h),i.clear(),o=!1,u&&(u=!1,m.process(g))}};return m}const U2=40;function $C(e,t){let i=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,c=sc.reduce((L,V)=>(L[V]=P2(u),L),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:g,update:y,preRender:b,render:S,postRender:x}=c,C=()=>{const L=$a.useManualTiming,V=L?o.timestamp:performance.now();i=!1,L||(o.delta=r?1e3/60:Math.max(Math.min(V-o.timestamp,U2),1)),o.timestamp=V,o.isProcessing=!0,f.process(o),h.process(o),m.process(o),g.process(o),y.process(o),b.process(o),S.process(o),x.process(o),o.isProcessing=!1,i&&t&&(r=!1,e(C))},R=()=>{i=!0,r=!0,o.isProcessing||e(C)};return{schedule:sc.reduce((L,V)=>{const q=c[V];return L[V]=(W,K=!1,T=!1)=>(i||R(),q.schedule(W,K,T)),L},{}),cancel:L=>{for(let V=0;V(Cc===void 0&&an.set(Ft.isProcessing||$a.useManualTiming?Ft.timestamp:performance.now()),Cc),set:e=>{Cc=e,queueMicrotask(B2)}},PC=e=>t=>typeof t=="string"&&t.startsWith(e),UC=PC("--"),H2=PC("var(--"),Zm=e=>H2(e)?F2.test(e.split("/*")[0].trim()):!1,F2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zS(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Us={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Sl={...Us,transform:e=>xi(0,1,e)},oc={...Us,default:1},nl=e=>Math.round(e*1e5)/1e5,Jm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function k2(e){return e==null}const q2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wm=(e,t)=>i=>!!(typeof i=="string"&&q2.test(i)&&i.startsWith(e)||t&&!k2(i)&&Object.prototype.hasOwnProperty.call(i,t)),BC=(e,t,i)=>r=>{if(typeof r!="string")return r;const[o,u,c,f]=r.match(Jm);return{[e]:parseFloat(o),[t]:parseFloat(u),[i]:parseFloat(c),alpha:f!==void 0?parseFloat(f):1}},G2=e=>xi(0,255,e),Yh={...Us,transform:e=>Math.round(G2(e))},yr={test:Wm("rgb","red"),parse:BC("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:r=1})=>"rgba("+Yh.transform(e)+", "+Yh.transform(t)+", "+Yh.transform(i)+", "+nl(Sl.transform(r))+")"};function I2(e){let t="",i="",r="",o="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,i+=i,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const zp={test:Wm("#"),parse:I2,transform:yr.transform},Ll=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ki=Ll("deg"),bi=Ll("%"),de=Ll("px"),Y2=Ll("vh"),K2=Ll("vw"),VS={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cs={test:Wm("hsl","hue"),parse:BC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:r=1})=>"hsla("+Math.round(e)+", "+bi.transform(nl(t))+", "+bi.transform(nl(i))+", "+nl(Sl.transform(r))+")"},Tt={test:e=>yr.test(e)||zp.test(e)||Cs.test(e),parse:e=>yr.test(e)?yr.parse(e):Cs.test(e)?Cs.parse(e):zp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?yr.transform(e):Cs.transform(e),getAnimatableNone:e=>{const t=Tt.parse(e);return t.alpha=0,Tt.transform(t)}},Q2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function X2(e){return isNaN(e)&&typeof e=="string"&&(e.match(Jm)?.length||0)+(e.match(Q2)?.length||0)>0}const HC="number",FC="color",Z2="var",J2="var(",$S="${}",W2=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ns(e){const t=e.toString(),i=[],r={color:[],number:[],var:[]},o=[];let u=0;const f=t.replace(W2,h=>(Tt.test(h)?(r.color.push(u),o.push(FC),i.push(Tt.parse(h))):h.startsWith(J2)?(r.var.push(u),o.push(Z2),i.push(h)):(r.number.push(u),o.push(HC),i.push(parseFloat(h))),++u,$S)).split($S);return{values:i,split:f,indexes:r,types:o}}function eD(e){return Ns(e).values}function kC({split:e,types:t}){const i=e.length;return r=>{let o="";for(let u=0;utypeof e=="number"?0:Tt.test(e)?Tt.getAnimatableNone(e):e,iD=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:nD(e);function aD(e){const t=Ns(e);return kC(t)(t.values.map((r,o)=>iD(r,t.split[o])))}const si={test:X2,parse:eD,createTransformer:tD,getAnimatableNone:aD};function Kh(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function rD({hue:e,saturation:t,lightness:i,alpha:r}){e/=360,t/=100,i/=100;let o=0,u=0,c=0;if(!t)o=u=c=i;else{const f=i<.5?i*(1+t):i+t-i*t,h=2*i-f;o=Kh(h,f,e+1/3),u=Kh(h,f,e),c=Kh(h,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:r}}function Fc(e,t){return i=>i>0?t:e}const st=(e,t,i)=>e+(t-e)*i,Qh=(e,t,i)=>{const r=e*e,o=i*(t*t-r)+r;return o<0?0:Math.sqrt(o)},sD=[zp,yr,Cs],oD=e=>sD.find(t=>t.test(e));function PS(e){const t=oD(e);if(!t)return!1;let i=t.parse(e);return t===Cs&&(i=rD(i)),i}const US=(e,t)=>{const i=PS(e),r=PS(t);if(!i||!r)return Fc(e,t);const o={...i};return u=>(o.red=Qh(i.red,r.red,u),o.green=Qh(i.green,r.green,u),o.blue=Qh(i.blue,r.blue,u),o.alpha=st(i.alpha,r.alpha,u),yr.transform(o))},Vp=new Set(["none","hidden"]);function lD(e,t){return Vp.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function uD(e,t){return i=>st(e,t,i)}function eg(e){return typeof e=="number"?uD:typeof e=="string"?Zm(e)?Fc:Tt.test(e)?US:dD:Array.isArray(e)?qC:typeof e=="object"?Tt.test(e)?US:cD:Fc}function qC(e,t){const i=[...e],r=i.length,o=e.map((u,c)=>eg(u)(u,t[c]));return u=>{for(let c=0;c{for(const u in r)i[u]=r[u](o);return i}}function fD(e,t){const i=[],r={color:0,var:0,number:0};for(let o=0;o{const i=si.createTransformer(t),r=Ns(e),o=Ns(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Vp.has(e)&&!o.values.length||Vp.has(t)&&!r.values.length?lD(e,t):jl(qC(fD(r,o),o.values),i):Fc(e,t)};function GC(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?st(e,t,i):eg(e)(e,t)}const hD=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>ot.update(t,i),stop:()=>Pa(t),now:()=>Ft.isProcessing?Ft.timestamp:an.now()}},IC=(e,t,i=10)=>{let r="";const o=Math.max(Math.round(t/i),2);for(let u=0;u=kc?1/0:t}function pD(e,t=100,i){const r=i({...e,keyframes:[0,t]}),o=Math.min(tg(r),kc);return{type:"keyframes",ease:u=>r.next(o*u).value/t,duration:Fn(o)}}const gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function $p(e,t){return e*Math.sqrt(1-t*t)}const mD=12;function gD(e,t,i){let r=i;for(let o=1;o{const g=m*c,y=g*e,b=g-i,S=$p(m,c),x=Math.exp(-y);return Xh-b/S*x},u=m=>{const y=m*c*e,b=y*i+i,S=Math.pow(c,2)*Math.pow(m,2)*e,x=Math.exp(-y),C=$p(Math.pow(m,2),c);return(-o(m)+Xh>0?-1:1)*((b-S)*x)/C}):(o=m=>{const g=Math.exp(-m*e),y=(m-i)*e+1;return-Xh+g*y},u=m=>{const g=Math.exp(-m*e),y=(i-m)*(e*e);return g*y});const f=5/e,h=gD(o,u,f);if(e=Tn(e),isNaN(h))return{stiffness:gt.stiffness,damping:gt.damping,duration:e};{const m=Math.pow(h,2)*r;return{stiffness:m,damping:c*2*Math.sqrt(r*m),duration:e}}}const vD=["duration","bounce"],bD=["stiffness","damping","mass"];function BS(e,t){return t.some(i=>e[i]!==void 0)}function SD(e){let t={velocity:gt.velocity,stiffness:gt.stiffness,damping:gt.damping,mass:gt.mass,isResolvedFromDuration:!1,...e};if(!BS(e,bD)&&BS(e,vD))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,r=2*Math.PI/(i*1.2),o=r*r,u=2*xi(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:gt.mass,stiffness:o,damping:u}}else{const i=yD({...e,velocity:0});t={...t,...i,mass:gt.mass},t.isResolvedFromDuration=!0}return t}function qc(e=gt.visualDuration,t=gt.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=i;const u=i.keyframes[0],c=i.keyframes[i.keyframes.length-1],f={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:y,velocity:b,isResolvedFromDuration:S}=SD({...i,velocity:-Fn(i.velocity||0)}),x=b||0,C=m/(2*Math.sqrt(h*g)),R=c-u,A=Fn(Math.sqrt(h/g)),j=Math.abs(R)<5;r||(r=j?gt.restSpeed.granular:gt.restSpeed.default),o||(o=j?gt.restDelta.granular:gt.restDelta.default);let L,V,q,W,K,T;if(C<1)q=$p(A,C),W=(x+C*A*R)/q,L=ee=>{const he=Math.exp(-C*A*ee);return c-he*(W*Math.sin(q*ee)+R*Math.cos(q*ee))},K=C*A*W+R*q,T=C*A*R-W*q,V=ee=>Math.exp(-C*A*ee)*(K*Math.sin(q*ee)+T*Math.cos(q*ee));else if(C===1){L=he=>c-Math.exp(-A*he)*(R+(x+A*R)*he);const ee=x+A*R;V=he=>Math.exp(-A*he)*(A*ee*he-x)}else{const ee=A*Math.sqrt(C*C-1);L=Re=>{const je=Math.exp(-C*A*Re),P=Math.min(ee*Re,300);return c-je*((x+C*A*R)*Math.sinh(P)+ee*R*Math.cosh(P))/ee};const he=(x+C*A*R)/ee,ae=C*A*he-R*ee,Le=C*A*R-he*ee;V=Re=>{const je=Math.exp(-C*A*Re),P=Math.min(ee*Re,300);return je*(ae*Math.sinh(P)+Le*Math.cosh(P))}}const ne={calculatedDuration:S&&y||null,velocity:ee=>Tn(V(ee)),next:ee=>{if(!S&&C<1){const ae=Math.exp(-C*A*ee),Le=Math.sin(q*ee),Re=Math.cos(q*ee),je=c-ae*(W*Le+R*Re),P=Tn(ae*(K*Le+T*Re));return f.done=Math.abs(P)<=r&&Math.abs(c-je)<=o,f.value=f.done?c:je,f}const he=L(ee);if(S)f.done=ee>=y;else{const ae=Tn(V(ee));f.done=Math.abs(ae)<=r&&Math.abs(c-he)<=o}return f.value=f.done?c:he,f},toString:()=>{const ee=Math.min(tg(ne),kc),he=IC(ae=>ne.next(ee*ae).value,ee,30);return ee+"ms "+he},toTransition:()=>{}};return ne}qc.applyToOptions=e=>{const t=pD(e,100,qc);return e.ease=t.ease,e.duration=Tn(t.duration),e.type="keyframes",e};const xD=5;function YC(e,t,i){const r=Math.max(t-xD,0);return _C(i-e(r),t-r)}function Pp({keyframes:e,velocity:t=0,power:i=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:u=500,modifyTarget:c,min:f,max:h,restDelta:m=.5,restSpeed:g}){const y=e[0],b={done:!1,value:y},S=T=>f!==void 0&&Th,x=T=>f===void 0?h:h===void 0||Math.abs(f-T)-C*Math.exp(-T/r),L=T=>A+j(T),V=T=>{const ne=j(T),ee=L(T);b.done=Math.abs(ne)<=m,b.value=b.done?A:ee};let q,W;const K=T=>{S(b.value)&&(q=T,W=qc({keyframes:[b.value,x(b.value)],velocity:YC(L,T,b.value),damping:o,stiffness:u,restDelta:m,restSpeed:g}))};return K(0),{calculatedDuration:null,next:T=>{let ne=!1;return!W&&q===void 0&&(ne=!0,V(T),K(T)),q!==void 0&&T>=q?W.next(T-q):(!ne&&V(T),b)}}}function wD(e,t,i){const r=[],o=i||$a.mix||GC,u=e.length-1;for(let c=0;ct[0];if(u===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=wD(t,r,o),h=f.length,m=g=>{if(c&&g1)for(;ym(xi(e[0],e[u-1],g)):m}function ED(e,t){const i=e[e.length-1];for(let r=1;r<=t;r++){const o=bl(0,t,r);e.push(st(i,1,o))}}function RD(e){const t=[0];return ED(t,e.length-1),t}function _D(e,t){return e.map(i=>i*t)}function TD(e,t){return e.map(()=>t||zC).splice(0,e.length-1)}function il({duration:e=300,keyframes:t,times:i,ease:r="easeInOut"}){const o=z2(r)?r.map(LS):LS(r),u={done:!1,value:t[0]},c=_D(i&&i.length===t.length?i:RD(t),e),f=CD(c,t,{ease:Array.isArray(o)?o:TD(t,o)});return{calculatedDuration:e,next:h=>(u.value=f(h),u.done=h>=e,u)}}const AD=e=>e!==null;function of(e,{repeat:t,repeatType:i="loop"},r,o=1){const u=e.filter(AD),f=o<0||t&&i!=="loop"&&t%2===1?0:u.length-1;return!f||r===void 0?u[f]:r}const MD={decay:Pp,inertia:Pp,tween:il,keyframes:il,spring:qc};function KC(e){typeof e.type=="string"&&(e.type=MD[e.type])}class ng{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const OD=e=>e/100;class Gc extends ng{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:i}=this.options;i&&i.updatedAt!==an.now()&&this.tick(an.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;KC(t);const{type:i=il,repeat:r=0,repeatDelay:o=0,repeatType:u,velocity:c=0}=t;let{keyframes:f}=t;const h=i||il;h!==il&&typeof f[0]!="number"&&(this.mixKeyframes=jl(OD,GC(f[0],f[1])),f=[0,100]);const m=h({...t,keyframes:f});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=tg(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=m}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:r,totalDuration:o,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:g,repeat:y,repeatType:b,repeatDelay:S,type:x,onUpdate:C,finalKeyframe:R}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const A=this.currentTime-m*(this.playbackSpeed>=0?1:-1),j=this.playbackSpeed>=0?A<0:A>o;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let L=this.currentTime,V=r;if(y){const T=Math.min(this.currentTime,o)/f;let ne=Math.floor(T),ee=T%1;!ee&&T>=1&&(ee=1),ee===1&&ne--,ne=Math.min(ne,y+1),ne%2&&(b==="reverse"?(ee=1-ee,S&&(ee-=S/f)):b==="mirror"&&(V=c)),L=xi(0,1,ee)*f}let q;j?(this.delayState.value=g[0],q=this.delayState):q=V.next(L),u&&!j&&(q.value=u(q.value));let{done:W}=q;!j&&h!==null&&(W=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const K=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&W);return K&&x!==Pp&&(q.value=of(g,this.options,R,this.speed)),C&&C(q.value),K&&this.finish(),q}then(t,i){return this.finished.then(t,i)}get duration(){return Fn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(this.currentTime)}set time(t){t=Tn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const i=this.generator.next(t).value;return YC(r=>this.generator.next(r).value,t,i)}get speed(){return this.playbackSpeed}set speed(t){const i=this.playbackSpeed!==t;i&&this.driver&&this.updateTime(an.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=Fn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=hD,startTime:i}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=i??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(an.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function DD(e){for(let t=1;te*180/Math.PI,Up=e=>{const t=vr(Math.atan2(e[1],e[0]));return Bp(t)},jD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Up,rotateZ:Up,skewX:e=>vr(Math.atan(e[1])),skewY:e=>vr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bp=e=>(e=e%360,e<0&&(e+=360),e),HS=Up,FS=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),kS=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ND={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:FS,scaleY:kS,scale:e=>(FS(e)+kS(e))/2,rotateX:e=>Bp(vr(Math.atan2(e[6],e[5]))),rotateY:e=>Bp(vr(Math.atan2(-e[2],e[0]))),rotateZ:HS,rotate:HS,skewX:e=>vr(Math.atan(e[4])),skewY:e=>vr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Hp(e){return e.includes("scale")?1:0}function Fp(e,t){if(!e||e==="none")return Hp(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(i)r=ND,o=i;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=jD,o=f}if(!o)return Hp(t);const u=r[t],c=o[1].split(",").map(zD);return typeof u=="function"?u(c):c[u]}const LD=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Fp(i,t)};function zD(e){return parseFloat(e.trim())}const Bs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Hs=new Set([...Bs,"pathRotation"]),qS=e=>e===Us||e===de,VD=new Set(["x","y","z"]),$D=Bs.filter(e=>!VD.has(e));function PD(e){const t=[];return $D.forEach(i=>{const r=e.getValue(i);r!==void 0&&(t.push([i,r.get()]),r.set(i.startsWith("scale")?1:0))}),t}const Na={width:({x:e},{paddingLeft:t="0",paddingRight:i="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(i)},height:({y:e},{paddingTop:t="0",paddingBottom:i="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(i)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Fp(t,"x"),y:(e,{transform:t})=>Fp(t,"y")};Na.translateX=Na.x;Na.translateY=Na.y;const xr=new Set;let kp=!1,qp=!1,Gp=!1;function QC(){if(qp){const e=Array.from(xr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),i=new Map;t.forEach(r=>{const o=PD(r);o.length&&(i.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=i.get(r);o&&o.forEach(([u,c])=>{r.getValue(u)?.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}qp=!1,kp=!1,xr.forEach(e=>e.complete(Gp)),xr.clear()}function XC(){xr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(qp=!0)})}function UD(){Gp=!0,XC(),QC(),Gp=!1}class ig{constructor(t,i,r,o,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=r,this.motionValue=o,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(xr.add(this),kp||(kp=!0,ot.read(XC),ot.resolveKeyframes(QC))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:r,motionValue:o}=this;if(t[0]===null){const u=o?.get(),c=t[t.length-1];if(u!==void 0)t[0]=u;else if(r&&i){const f=r.readValue(i,c);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=c),o&&u===void 0&&o.set(t[0])}DD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),xr.delete(this)}cancel(){this.state==="scheduled"&&(xr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const BD=e=>e.startsWith("--");function ZC(e,t,i){BD(t)?e.style.setProperty(t,i):e.style[t]=i}const HD={};function JC(e,t){const i=RC(e);return()=>HD[t]??i()}const FD=JC(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),WC=JC(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Jo=([e,t,i,r])=>`cubic-bezier(${e}, ${t}, ${i}, ${r})`,GS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jo([0,.65,.55,1]),circOut:Jo([.55,0,1,.45]),backIn:Jo([.31,.01,.66,-.59]),backOut:Jo([.33,1.53,.69,.99])};function e1(e,t){if(e)return typeof e=="function"?WC()?IC(e,t):"ease-out":VC(e)?Jo(e):Array.isArray(e)?e.map(i=>e1(i,t)||GS.easeOut):GS[e]}function kD(e,t,i,{delay:r=0,duration:o=300,repeat:u=0,repeatType:c="loop",ease:f="easeOut",times:h}={},m=void 0){const g={[t]:i};h&&(g.offset=h);const y=e1(f,o);Array.isArray(y)&&(g.easing=y);const b={delay:r,duration:o,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(g,b)}function t1(e){return typeof e=="function"&&"applyToOptions"in e}function qD({type:e,...t}){return t1(e)&&WC()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class n1 extends ng{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:r,keyframes:o,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:f,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=t,Ym(typeof t.type!="string");const m=qD(t);this.animation=kD(i,r,o,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=of(o,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(g),ZC(i,r,g),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Fn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fn(t)}get time(){return Fn(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Tn(t),i&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:i,rangeEnd:r,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&FD()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),r&&(this.animation.rangeEnd=r),qn):o(this)}}const i1={anticipate:jC,backInOut:DC,circInOut:LC};function GD(e){return e in i1}function ID(e){typeof e.ease=="string"&&GD(e.ease)&&(e.ease=i1[e.ease])}const Zh=10;class YD extends n1{constructor(t){ID(t),KC(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:r,onComplete:o,element:u,...c}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const f=new Gc({...c,autoplay:!1}),h=Math.max(Zh,an.now()-this.startTime),m=xi(0,Zh,h-Zh),g=f.sample(h).value,{name:y}=this.options;u&&y&&ZC(u,y,g),i.setWithVelocity(f.sample(Math.max(0,h-m)).value,g,m),f.stop()}}const IS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(si.test(e)||e==="0")&&!e.startsWith("url("));function KD(e){const t=e[0];if(e.length===1)return!0;for(let i=0;iObject.hasOwnProperty.call(Element.prototype,"animate"));function ej(e){const{motionValue:t,name:i,repeatDelay:r,repeatType:o,damping:u,type:c,keyframes:f}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=t.owner.getProps();return WD()&&i&&(a1.has(i)||JD.has(i)&&ZD(f))&&(i!=="transform"||!g)&&!m&&!r&&o!=="mirror"&&u!==0&&c!=="inertia"}const tj=40;class nj extends ng{constructor({autoplay:t=!0,delay:i=0,type:r="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:c="loop",keyframes:f,name:h,motionValue:m,element:g,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=an.now();const b={autoplay:t,delay:i,type:r,repeat:o,repeatDelay:u,repeatType:c,name:h,motionValue:m,element:g,...y},S=g?.KeyframeResolver||ig;this.keyframeResolver=new S(f,(x,C,R)=>this.onKeyframesResolved(x,C,b,!R),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,r,o){this.keyframeResolver=void 0;const{name:u,type:c,velocity:f,delay:h,isHandoff:m,onUpdate:g}=r;this.resolvedAt=an.now();let y=!0;QD(t,u,c,f)||(y=!1,($a.instantAnimations||!h)&&g?.(of(t,r,i)),t[0]=t[t.length-1],Ip(r),r.repeat=0);const S={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>tj?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...r,keyframes:t},x=y&&!m&&ej(S),C=S.motionValue?.owner?.current;let R;if(x)try{R=new YD({...S,element:C})}catch{R=new Gc(S)}else R=new Gc(S);R.finished.then(()=>{this.notifyFinished()}).catch(qn),this.pendingTimeline&&(this.stopTimeline=R.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=R}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),UD()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function r1(e,t,i,r=0,o=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),c=e.size,f=(c-1)*r;return typeof i=="function"?i(u,c):o===1?u*r:f-u*r}const YS=30,ij=e=>!isNaN(parseFloat(e));class aj{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=an.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=an.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ij(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new Km);const r=this.events[t].add(i);return t==="change"?()=>{r(),ot.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,r){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=an.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>YS)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,YS);return _C(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ls(e,t){return new aj(e,t)}function s1(e,t){if(e?.inherit&&t){const{inherit:i,...r}=e;return{...t,...r}}return e}function ag(e,t){const i=e?.[t]??e?.default??e;return i!==e?s1(i,e):i}const rj={type:"spring",stiffness:500,damping:25,restSpeed:10},sj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),oj={type:"keyframes",duration:.8},lj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uj=(e,{keyframes:t})=>t.length>2?oj:Hs.has(e)?e.startsWith("scale")?sj(t[1]):rj:lj,cj=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function fj(e){for(const t in e)if(!cj.has(t))return!0;return!1}const rg=(e,t,i,r={},o,u)=>c=>{const f=ag(r,e)||{},h=f.delay||r.delay||0;let{elapsed:m=0}=r;m=m-Tn(h);const g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:b=>{t.set(b),f.onUpdate&&f.onUpdate(b)},onComplete:()=>{c(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:u?void 0:o};fj(f)||Object.assign(g,uj(e,g)),g.duration&&(g.duration=Tn(g.duration)),g.repeatDelay&&(g.repeatDelay=Tn(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(Ip(g),g.delay===0&&(y=!0)),($a.instantAnimations||$a.skipAnimations||o?.shouldSkipAnimations||f.skipAnimations)&&(y=!0,Ip(g),g.delay=0),g.allowFlatten=!f.type&&!f.ease,y&&!u&&t.get()!==void 0){const b=of(g.keyframes,f);if(b!==void 0){ot.update(()=>{g.onUpdate(b),g.onComplete()});return}}return f.isSync?new Gc(g):new nj(g)},dj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hj(e){const t=dj.exec(e);if(!t)return[,];const[,i,r,o]=t;return[`--${i??r}`,o]}function o1(e,t,i=1){const[r,o]=hj(e);if(!r)return;const u=window.getComputedStyle(t).getPropertyValue(r);if(u){const c=u.trim();return wC(c)?parseFloat(c):c}return Zm(o)?o1(o,t,i+1):o}function KS(e){const t=[{},{}];return e?.values.forEach((i,r)=>{t[0][r]=i.get(),t[1][r]=i.getVelocity()}),t}function sg(e,t,i,r){if(typeof t=="function"){const[o,u]=KS(r);t=t(i!==void 0?i:e.custom,o,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,u]=KS(r);t=t(i!==void 0?i:e.custom,o,u)}return t}function wr(e,t,i){const r=e.getProps();return sg(r,t,i!==void 0?i:r.custom,e)}const l1=new Set(["width","height","top","left","right","bottom",...Bs]),Yp=e=>Array.isArray(e);function pj(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,Ls(i))}function mj(e){return Yp(e)?e[e.length-1]||0:e}function gj(e,t){const i=wr(e,t);let{transitionEnd:r={},transition:o={},...u}=i||{};u={...u,...r};for(const c in u){const f=mj(u[c]);pj(e,c,f)}}const kt=e=>!!(e&&e.getVelocity);function yj(e){return!!(kt(e)&&e.add)}function Kp(e,t){const i=e.getValue("willChange");if(yj(i))return i.add(t);if(!i&&$a.WillChange){const r=new $a.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function og(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const vj="framerAppearId",u1="data-"+og(vj);function c1(e){return e.props[u1]}function bj({protectedKeys:e,needsAnimating:t},i){const r=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,r}function f1(e,t,{delay:i=0,transitionOverride:r,type:o}={}){let{transition:u,transitionEnd:c,...f}=t;const h=e.getDefaultTransition();u=u?s1(u,h):h;const m=u?.reduceMotion,g=u?.skipAnimations;r&&(u=r);const y=[],b=o&&e.animationState&&e.animationState.getState()[o],S=u?.path;S&&S.animateVisualElement(e,f,u,i,y);for(const x in f){const C=e.getValue(x,e.latestValues[x]??null),R=f[x];if(R===void 0||b&&bj(b,x))continue;const A={delay:i,...ag(u||{},x)};g&&(A.skipAnimations=!0);const j=C.get();if(j!==void 0&&!C.isAnimating()&&!Array.isArray(R)&&R===j&&!A.velocity){ot.update(()=>C.set(R));continue}let L=!1;if(window.MotionHandoffAnimation){const W=c1(e);if(W){const K=window.MotionHandoffAnimation(W,x,ot);K!==null&&(A.startTime=K,L=!0)}}Kp(e,x);const V=m??e.shouldReduceMotion;C.start(rg(x,C,R,V&&l1.has(x)?{type:!1}:A,e,L));const q=C.animation;q&&y.push(q)}if(c){const x=()=>ot.update(()=>{c&&gj(e,c)});y.length?Promise.all(y).then(x):x()}return y}function Qp(e,t,i={}){const r=wr(e,t,i.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(o=i.transitionOverride);const u=r?()=>Promise.all(f1(e,r,i)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:y}=o;return Sj(e,t,h,m,g,y,i)}:()=>Promise.resolve(),{when:f}=o;if(f){const[h,m]=f==="beforeChildren"?[u,c]:[c,u];return h().then(()=>m())}else return Promise.all([u(),c(i.delay)])}function Sj(e,t,i=0,r=0,o=0,u=1,c){const f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.push(Qp(h,t,{...c,delay:i+(typeof r=="function"?0:r)+r1(e.variantChildren,h,r,o,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function xj(e,t,i={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(u=>Qp(e,u,i));r=Promise.all(o)}else if(typeof t=="string")r=Qp(e,t,i);else{const o=typeof t=="function"?wr(e,t,i.custom):t;r=Promise.all(f1(e,o,i))}return r.then(()=>{e.notify("AnimationComplete",t)})}const wj={test:e=>e==="auto",parse:e=>e},d1=e=>t=>t.test(e),h1=[Us,de,bi,Ki,K2,Y2,wj],QS=e=>h1.find(d1(e));function Cj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||EC(e):!0}const Ej=new Set(["brightness","contrast","saturate","opacity"]);function Rj(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=i.match(Jm)||[];if(!r)return e;const o=i.replace(r,"");let u=Ej.has(t)?1:0;return r!==i&&(u*=100),t+"("+u+o+")"}const _j=/\b([a-z-]*)\(.*?\)/gu,Xp={...si,getAnimatableNone:e=>{const t=e.match(_j);return t?t.map(Rj).join(" "):e}},Zp={...si,getAnimatableNone:e=>{const t=si.parse(e);return si.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},XS={...Us,transform:Math.round},Tj={rotate:Ki,pathRotation:Ki,rotateX:Ki,rotateY:Ki,rotateZ:Ki,scale:oc,scaleX:oc,scaleY:oc,scaleZ:oc,skew:Ki,skewX:Ki,skewY:Ki,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Sl,originX:VS,originY:VS,originZ:de},Ic={borderWidth:de,borderTopWidth:de,borderRightWidth:de,borderBottomWidth:de,borderLeftWidth:de,borderRadius:de,borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomRightRadius:de,borderBottomLeftRadius:de,width:de,maxWidth:de,height:de,maxHeight:de,top:de,right:de,bottom:de,left:de,inset:de,insetBlock:de,insetBlockStart:de,insetBlockEnd:de,insetInline:de,insetInlineStart:de,insetInlineEnd:de,padding:de,paddingTop:de,paddingRight:de,paddingBottom:de,paddingLeft:de,paddingBlock:de,paddingBlockStart:de,paddingBlockEnd:de,paddingInline:de,paddingInlineStart:de,paddingInlineEnd:de,margin:de,marginTop:de,marginRight:de,marginBottom:de,marginLeft:de,marginBlock:de,marginBlockStart:de,marginBlockEnd:de,marginInline:de,marginInlineStart:de,marginInlineEnd:de,fontSize:de,backgroundPositionX:de,backgroundPositionY:de,...Tj,zIndex:XS,fillOpacity:Sl,strokeOpacity:Sl,numOctaves:XS},Aj={...Ic,color:Tt,backgroundColor:Tt,outlineColor:Tt,fill:Tt,stroke:Tt,borderColor:Tt,borderTopColor:Tt,borderRightColor:Tt,borderBottomColor:Tt,borderLeftColor:Tt,filter:Xp,WebkitFilter:Xp,mask:Zp,WebkitMask:Zp},p1=e=>Aj[e],Mj=new Set([Xp,Zp]);function m1(e,t){let i=p1(e);return Mj.has(i)||(i=si),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const Oj=new Set(["auto","none","0"]);function Dj(e,t,i){let r=0,o;for(;r{t.getValue(f).set(h)}),this.resolveNoneKeyframes()}}function g1(e,t,i){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=i?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const Jp=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Ec(e){return CC(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:lg}=$C(queueMicrotask,!1),ri={x:!1,y:!1};function y1(){return ri.x||ri.y}function Nj(e){return e==="x"||e==="y"?ri[e]?null:(ri[e]=!0,()=>{ri[e]=!1}):ri.x||ri.y?null:(ri.x=ri.y=!0,()=>{ri.x=ri.y=!1})}function v1(e,t){const i=g1(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[i,o,()=>r.abort()]}function Lj(e){return!(e.pointerType==="touch"||y1())}function zj(e,t,i={}){const[r,o,u]=v1(e,i);return r.forEach(c=>{let f=!1,h=!1,m;const g=()=>{c.removeEventListener("pointerleave",x)},y=R=>{m&&(m(R),m=void 0),g()},b=R=>{f=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),h&&(h=!1,y(R))},S=()=>{f=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},x=R=>{if(R.pointerType!=="touch"){if(f){h=!0;return}y(R)}},C=R=>{if(!Lj(R))return;h=!1;const A=t(c,R);typeof A=="function"&&(m=A,c.addEventListener("pointerleave",x,o))};c.addEventListener("pointerenter",C,o),c.addEventListener("pointerdown",S,o)}),u}const b1=(e,t)=>t?e===t?!0:b1(e,t.parentElement):!1,ug=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Vj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $j(e){return Vj.has(e.tagName)||e.isContentEditable===!0}const Pj=new Set(["INPUT","SELECT","TEXTAREA"]);function Uj(e){return Pj.has(e.tagName)||e.isContentEditable===!0}const Rc=new WeakSet;function ZS(e){return t=>{t.key==="Enter"&&e(t)}}function Jh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Bj=(e,t)=>{const i=e.currentTarget;if(!i)return;const r=ZS(()=>{if(Rc.has(i))return;Jh(i,"down");const o=ZS(()=>{Jh(i,"up")}),u=()=>Jh(i,"cancel");i.addEventListener("keyup",o,t),i.addEventListener("blur",u,t)});i.addEventListener("keydown",r,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",r),t)};function JS(e){return ug(e)&&!y1()}const WS=new WeakSet;function Hj(e,t,i={}){const[r,o,u]=v1(e,i),c=f=>{const h=f.currentTarget;if(!JS(f)||WS.has(f))return;Rc.add(h),i.stopPropagation&&WS.add(f);const m=t(h,f),g=(S,x)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),Rc.has(h)&&Rc.delete(h),JS(S)&&typeof m=="function"&&m(S,{success:x})},y=S=>{g(S,h===window||h===document||i.useGlobalTarget||b1(h,S.target))},b=S=>{g(S,!1)};window.addEventListener("pointerup",y,o),window.addEventListener("pointercancel",b,o)};return r.forEach(f=>{(i.useGlobalTarget?window:f).addEventListener("pointerdown",c,o),Ec(f)&&(f.addEventListener("focus",m=>Bj(m,o)),!$j(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function cg(e){return CC(e)&&"ownerSVGElement"in e}const _c=new WeakMap;let Tc;const S1=(e,t,i)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:cg(r)&&"getBBox"in r?r.getBBox()[t]:r[i],Fj=S1("inline","width","offsetWidth"),kj=S1("block","height","offsetHeight");function qj({target:e,borderBoxSize:t}){_c.get(e)?.forEach(i=>{i(e,{get width(){return Fj(e,t)},get height(){return kj(e,t)}})})}function Gj(e){e.forEach(qj)}function Ij(){typeof ResizeObserver>"u"||(Tc=new ResizeObserver(Gj))}function Yj(e,t){Tc||Ij();const i=g1(e);return i.forEach(r=>{let o=_c.get(r);o||(o=new Set,_c.set(r,o)),o.add(t),Tc?.observe(r)}),()=>{i.forEach(r=>{const o=_c.get(r);o?.delete(t),o?.size||Tc?.unobserve(r)})}}const Ac=new Set;let Es;function Kj(){Es=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ac.forEach(t=>t(e))},window.addEventListener("resize",Es)}function Qj(e){return Ac.add(e),Es||Kj(),()=>{Ac.delete(e),!Ac.size&&typeof Es=="function"&&(window.removeEventListener("resize",Es),Es=void 0)}}function ex(e,t){return typeof e=="function"?Qj(e):Yj(e,t)}function Xj(e){return cg(e)&&e.tagName==="svg"}const Zj=[...h1,Tt,si],Jj=e=>Zj.find(d1(e)),tx=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rs=()=>({x:tx(),y:tx()}),nx=()=>({min:0,max:0}),jt=()=>({x:nx(),y:nx()}),Wj=new WeakMap;function lf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function xl(e){return typeof e=="string"||Array.isArray(e)}const fg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dg=["initial",...fg];function uf(e){return lf(e.animate)||dg.some(t=>xl(e[t]))}function x1(e){return!!(uf(e)||e.variants)}function eN(e,t,i){for(const r in t){const o=t[r],u=i[r];if(kt(o))e.addValue(r,o);else if(kt(u))e.addValue(r,Ls(o,{owner:e}));else if(u!==o)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(r);e.addValue(r,Ls(c!==void 0?c:o,{owner:e}))}}for(const r in i)t[r]===void 0&&e.removeValue(r);return t}const Wp={current:null},w1={current:!1},tN=typeof window<"u";function nN(){if(w1.current=!0,!!tN)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Wp.current=e.matches;e.addEventListener("change",t),t()}else Wp.current=!1}const ix=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Yc={};function C1(e){Yc=e}function iN(){return Yc}class aN{scrapeMotionValuesFromProps(t,i,r){return{}}constructor({parent:t,props:i,presenceContext:r,reducedMotionConfig:o,skipAnimations:u,blockInitialAnimation:c,visualState:f},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ig,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=an.now();this.renderScheduledAtthis.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(w1.current||nN(),this.shouldReduceMotion=Wp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Pa(this.notifyUpdate),Pa(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const i=this.features[t];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,i){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),i.accelerate&&a1.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:f,times:h,ease:m,duration:g}=i.accelerate,y=new n1({element:this.current,name:t,keyframes:f,times:h,ease:m,duration:Tn(g)}),b=c(y);this.valueSubscriptions.set(t,()=>{b(),y.cancel()});return}const r=Hs.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=i.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&ot.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{o(),u&&u()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Yc){const i=Yc[t];if(!i)continue;const{isEnabled:r,Feature:o}=i;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):jt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let r=0;ri.variantChildren.delete(t)}addValue(t,i){const r=this.values.get(t);i!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&i!==void 0&&(r=Ls(i===null?void 0:i,{owner:this}),this.addValue(t,r)),r}readValue(t,i){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(wC(r)||EC(r))?r=parseFloat(r):!Jj(r)&&si.test(i)&&(r=m1(t,i)),this.setBaseTarget(t,kt(r)?r.get():r)),kt(r)?r.get():r}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const u=sg(this.props,i,this.presenceContext?.custom);u&&(r=u[t])}if(i&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!kt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new Km),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){lg.render(this.render)}}class E1 extends aN{constructor(){super(...arguments),this.KeyframeResolver=jj}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){const r=t.style;return r?r[i]:void 0}removeValueFromRenderState(t,{vars:i,style:r}){delete i[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;kt(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Ba{constructor(t){this.isMounted=!1,this.node=t}update(){}}function R1({top:e,left:t,right:i,bottom:r}){return{x:{min:t,max:i},y:{min:e,max:r}}}function rN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function sN(e,t){if(!t)return e;const i=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:r.y,right:r.x}}function Wh(e){return e===void 0||e===1}function em({scale:e,scaleX:t,scaleY:i}){return!Wh(e)||!Wh(t)||!Wh(i)}function dr(e){return em(e)||_1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _1(e){return ax(e.x)||ax(e.y)}function ax(e){return e&&e!=="0%"}function Kc(e,t,i){const r=e-i,o=t*r;return i+o}function rx(e,t,i,r,o){return o!==void 0&&(e=Kc(e,o,r)),Kc(e,i,r)+t}function tm(e,t=0,i=1,r,o){e.min=rx(e.min,t,i,r,o),e.max=rx(e.max,t,i,r,o)}function T1(e,{x:t,y:i}){tm(e.x,t.translate,t.scale,t.originPoint),tm(e.y,i.translate,i.scale,i.originPoint)}const sx=.999999999999,ox=1.0000000000001;function oN(e,t,i,r=!1){const o=i.length;if(!o)return;t.x=t.y=1;let u,c;for(let f=0;fsx&&(t.x=1),t.ysx&&(t.y=1)}function vi(e,t){e.min+=t,e.max+=t}function lx(e,t,i,r,o=.5){const u=st(e.min,e.max,o);tm(e,t,i,u,r)}function ux(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Mc(e,t,i){const r=i??e;lx(e.x,ux(t.x,r.x),t.scaleX,t.scale,t.originX),lx(e.y,ux(t.y,r.y),t.scaleY,t.scale,t.originY)}function A1(e,t){return R1(sN(e.getBoundingClientRect(),t))}function lN(e,t,i){const r=A1(e,i),{scroll:o}=t;return o&&(vi(r.x,o.offset.x),vi(r.y,o.offset.y)),r}const uN={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},cN=Bs.length;function fN(e,t,i){let r="",o=!0;for(let c=0;c{if(!t.target)return e;if(typeof e=="string")if(de.test(e))e=parseFloat(e);else return e;const i=cx(e,t.target.x),r=cx(e,t.target.y);return`${i}% ${r}%`}},dN={correct:(e,{treeScale:t,projectionDelta:i})=>{const r=e,o=si.parse(e);if(o.length>5)return r;const u=si.createTransformer(e),c=typeof o[0]!="number"?1:0,f=i.x.scale*t.x,h=i.y.scale*t.y;o[0+c]/=f,o[1+c]/=h;const m=st(f,h,.5);return typeof o[2+c]=="number"&&(o[2+c]/=m),typeof o[3+c]=="number"&&(o[3+c]/=m),u(o)}},nm={borderRadius:{...Ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ko,borderTopRightRadius:Ko,borderBottomLeftRadius:Ko,borderBottomRightRadius:Ko,boxShadow:dN};function O1(e,{layout:t,layoutId:i}){return Hs.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!nm[e]||e==="opacity")}function pg(e,t,i){const r=e.style,o=t?.style,u={};if(!r)return u;for(const c in r)(kt(r[c])||o&&kt(o[c])||O1(c,e)||i?.getValue(c)?.liveStyle!==void 0)&&(u[c]=r[c]);return u}function hN(e){return window.getComputedStyle(e)}class pN extends E1{constructor(){super(...arguments),this.type="html",this.renderInstance=M1}readValueFromInstance(t,i){if(Hs.has(i))return this.projection?.isProjecting?Hp(i):LD(t,i);{const r=hN(t),o=(UC(i)?r.getPropertyValue(i):r[i])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:i}){return A1(t,i)}build(t,i,r){hg(t,i,r.transformTemplate)}scrapeMotionValuesFromProps(t,i,r){return pg(t,i,r)}}const mN={offset:"stroke-dashoffset",array:"stroke-dasharray"},gN={offset:"strokeDashoffset",array:"strokeDasharray"};function yN(e,t,i=1,r=0,o=!0){e.pathLength=1;const u=o?mN:gN;e[u.offset]=`${-r}`,e[u.array]=`${t} ${i}`}const vN=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function D1(e,{attrX:t,attrY:i,attrScale:r,pathLength:o,pathSpacing:u=1,pathOffset:c=0,...f},h,m,g){if(hg(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:b}=e;y.transform&&(b.transform=y.transform,delete y.transform),(b.transform||y.transformOrigin)&&(b.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),b.transform&&(b.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const S of vN)y[S]!==void 0&&(b[S]=y[S],delete y[S]);t!==void 0&&(y.x=t),i!==void 0&&(y.y=i),r!==void 0&&(y.scale=r),o!==void 0&&yN(y,o,u,c,!1)}const j1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),N1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bN(e,t,i,r){M1(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(j1.has(o)?o:og(o),t.attrs[o])}function L1(e,t,i){const r=pg(e,t,i);for(const o in e)if(kt(e[o])||kt(t[o])){const u=Bs.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[u]=e[o]}return r}class SN extends E1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=jt}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(Hs.has(i)){const r=p1(i);return r&&r.default||0}return i=j1.has(i)?i:og(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,r){return L1(t,i,r)}build(t,i,r){D1(t,i,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,i,r,o){bN(t,i,r,o)}mount(t){this.isSVGTag=N1(t.tagName),super.mount(t)}}const xN=dg.length;function z1(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?z1(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;iPromise.all(t.map(({animation:i,options:r})=>xj(e,i,r)))}function RN(e){let t=EN(e),i=fx(),r=!0,o=!1;const u=m=>(g,y)=>{const b=wr(e,y,m==="exit"?e.presenceContext?.custom:void 0);if(b){const{transition:S,transitionEnd:x,...C}=b;g={...g,...C,...x}}return g};function c(m){t=m(e)}function f(m){const{props:g}=e,y=z1(e.parent)||{},b=[],S=new Set;let x={},C=1/0;for(let A=0;AC&&q,ee=!1;const he=Array.isArray(V)?V:[V];let ae=he.reduce(u(j),{});W===!1&&(ae={});const{prevResolvedValues:Le={}}=L,Re={...Le,...ae},je=ie=>{ne=!0,S.has(ie)&&(ee=!0,S.delete(ie)),L.needsAnimating[ie]=!0;const oe=e.getValue(ie);oe&&(oe.liveStyle=!1)};for(const ie in Re){const oe=ae[ie],ye=Le[ie];if(x.hasOwnProperty(ie))continue;let D=!1;Yp(oe)&&Yp(ye)?D=!V1(oe,ye)||T:D=oe!==ye,D?oe!=null?je(ie):S.add(ie):oe!==void 0&&S.has(ie)?je(ie):L.protectedKeys[ie]=!0}L.prevProp=V,L.prevResolvedValues=ae,L.isActive&&(x={...x,...ae}),(r||o)&&e.blockInitialAnimation&&(ne=!1);const P=K&&T;ne&&(!P||ee)&&b.push(...he.map(ie=>{const oe={type:j};if(typeof ie=="string"&&(r||o)&&!P&&e.manuallyAnimateOnMount&&e.parent){const{parent:ye}=e,D=wr(ye,ie);if(ye.enteringChildren&&D){const{delayChildren:I}=D.transition||{};oe.delay=r1(ye.enteringChildren,e,I)}}return{animation:ie,options:oe}}))}if(S.size){const A={};if(typeof g.initial!="boolean"){const j=wr(e,Array.isArray(g.initial)?g.initial[0]:g.initial);j&&j.transition&&(A.transition=j.transition)}S.forEach(j=>{const L=e.getBaseTarget(j),V=e.getValue(j);V&&(V.liveStyle=!0),A[j]=L??null}),b.push({animation:A})}let R=!!b.length;return r&&(g.initial===!1||g.initial===g.animate)&&!e.manuallyAnimateOnMount&&(R=!1),r=!1,o=!1,R?t(b):Promise.resolve()}function h(m,g){if(i[m].isActive===g)return Promise.resolve();e.variantChildren?.forEach(b=>b.animationState?.setActive(m,g)),i[m].isActive=g;const y=f(m);for(const b in i)i[b].protectedKeys={};return y}return{animateChanges:f,setActive:h,setAnimateFunction:c,getState:()=>i,reset:()=>{i=fx(),o=!0}}}function _N(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!V1(t,e):!1}function cr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fx(){return{animate:cr(!0),whileInView:cr(),whileHover:cr(),whileTap:cr(),whileDrag:cr(),whileFocus:cr(),exit:cr()}}function im(e,t){e.min=t.min,e.max=t.max}function ii(e,t){im(e.x,t.x),im(e.y,t.y)}function dx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const $1=1e-4,TN=1-$1,AN=1+$1,P1=.01,MN=0-P1,ON=0+P1;function rn(e){return e.max-e.min}function DN(e,t,i){return Math.abs(e-t)<=i}function hx(e,t,i,r=.5){e.origin=r,e.originPoint=st(t.min,t.max,e.origin),e.scale=rn(i)/rn(t),e.translate=st(i.min,i.max,e.origin)-e.originPoint,(e.scale>=TN&&e.scale<=AN||isNaN(e.scale))&&(e.scale=1),(e.translate>=MN&&e.translate<=ON||isNaN(e.translate))&&(e.translate=0)}function al(e,t,i,r){hx(e.x,t.x,i.x,r?r.originX:void 0),hx(e.y,t.y,i.y,r?r.originY:void 0)}function px(e,t,i,r=0){const o=r?st(i.min,i.max,r):i.min;e.min=o+t.min,e.max=e.min+rn(t)}function jN(e,t,i,r){px(e.x,t.x,i.x,r?.x),px(e.y,t.y,i.y,r?.y)}function mx(e,t,i,r=0){const o=r?st(i.min,i.max,r):i.min;e.min=t.min-o,e.max=e.min+rn(t)}function Qc(e,t,i,r){mx(e.x,t.x,i.x,r?.x),mx(e.y,t.y,i.y,r?.y)}function gx(e,t,i,r,o){return e-=t,e=Kc(e,1/i,r),o!==void 0&&(e=Kc(e,1/o,r)),e}function NN(e,t=0,i=1,r=.5,o,u=e,c=e){if(bi.test(t)&&(t=parseFloat(t),t=st(c.min,c.max,t/100)-c.min),typeof t!="number")return;let f=st(u.min,u.max,r);e===u&&(f-=t),e.min=gx(e.min,t,i,f,o),e.max=gx(e.max,t,i,f,o)}function yx(e,t,[i,r,o],u,c){NN(e,t[i],t[r],t[o],t.scale,u,c)}const LN=["x","scaleX","originX"],zN=["y","scaleY","originY"];function vx(e,t,i,r){yx(e.x,t,LN,i?i.x:void 0,r?r.x:void 0),yx(e.y,t,zN,i?i.y:void 0,r?r.y:void 0)}function bx(e){return e.translate===0&&e.scale===1}function U1(e){return bx(e.x)&&bx(e.y)}function Sx(e,t){return e.min===t.min&&e.max===t.max}function VN(e,t){return Sx(e.x,t.x)&&Sx(e.y,t.y)}function xx(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function B1(e,t){return xx(e.x,t.x)&&xx(e.y,t.y)}function wx(e){return rn(e.x)/rn(e.y)}function Cx(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function yi(e){return[e("x"),e("y")]}function $N(e,t,i){let r="";const o=e.x.translate/t.x,u=e.y.translate/t.y,c=i?.z||0;if((o||u||c)&&(r=`translate3d(${o}px, ${u}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:m,rotate:g,pathRotation:y,rotateX:b,rotateY:S,skewX:x,skewY:C}=i;m&&(r=`perspective(${m}px) ${r}`),g&&(r+=`rotate(${g}deg) `),y&&(r+=`rotate(${y}deg) `),b&&(r+=`rotateX(${b}deg) `),S&&(r+=`rotateY(${S}deg) `),x&&(r+=`skewX(${x}deg) `),C&&(r+=`skewY(${C}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(r+=`scale(${f}, ${h})`),r||"none"}const H1=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],PN=H1.length,Ex=e=>typeof e=="string"?parseFloat(e):e,Rx=e=>typeof e=="number"||de.test(e);function UN(e,t,i,r,o,u){o?(e.opacity=st(0,i.opacity??1,BN(r)),e.opacityExit=st(t.opacity??1,0,HN(r))):u&&(e.opacity=st(t.opacity??1,i.opacity??1,r));for(let c=0;crt?1:i(bl(e,t,r))}function FN(e,t,i){const r=kt(e)?e:Ls(e);return r.start(rg("",r,t,i)),r.animation}function wl(e,t,i,r={passive:!0}){return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i)}const kN=(e,t)=>e.depth-t.depth;class qN{constructor(){this.children=[],this.isDirty=!1}add(t){Im(this.children,t),this.isDirty=!0}remove(t){Hc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kN),this.isDirty=!1,this.children.forEach(t)}}function GN(e,t){const i=an.now(),r=({timestamp:o})=>{const u=o-i;u>=t&&(Pa(r),e(u-t))};return ot.setup(r,!0),()=>Pa(r)}function Oc(e){return kt(e)?e.get():e}class IN{constructor(){this.members=[]}add(t){Im(this.members,t);for(let i=this.members.length-1;i>=0;i--){const r=this.members[i];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Hc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Hc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){for(let i=this.members.indexOf(t)-1;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,i){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:u}=t.options;(o===void 0||o!==u)&&(t.resumeFrom=r,i&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Dc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ep=["","X","Y","Z"],YN=1e3;let KN=0;function tp(e,t,i,r){const{latestValues:o}=t;o[e]&&(i[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function k1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=c1(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:o,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",ot,!(o||u))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&k1(r)}function q1({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(c={},f=t?.()){this.id=KN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ZN),this.nodes.forEach(iL),this.nodes.forEach(aL),this.nodes.forEach(JN)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;hthis.root.updateBlockedByResize=!1;ot.read(()=>{y=window.innerWidth}),e(c,()=>{const S=window.innerWidth;S!==y&&(y=S,this.root.updateBlockedByResize=!0,g&&g(),g=GN(b,250),Dc.hasAnimatedSinceResize&&(Dc.hasAnimatedSinceResize=!1,this.nodes.forEach(Mx)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:b,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||m.getDefaultTransition()||uL,{onLayoutAnimationStart:C,onLayoutAnimationComplete:R}=m.getProps(),A=!this.targetLayout||!B1(this.targetLayout,S),j=!y&&b;if(this.options.layoutRoot||this.resumeFrom||j||y&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...ag(x,"layout"),onPlay:C,onComplete:R};(m.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(g,j,L.path)}else y||Mx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rL),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&k1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!rn(this.snapshot.measuredBox.x)&&!rn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h{const K=W/1e3,T=q?.(K);T?(b.x.translate=T.x,b.x.scale=st(c.x.scale,1,K),b.x.origin=c.x.origin,b.x.originPoint=c.x.originPoint,b.y.translate=T.y,b.y.scale=st(c.y.scale,1,K),b.y.origin=c.y.origin,b.y.originPoint=c.y.originPoint):(Ox(b.x,c.x,K),Ox(b.y,c.y,K)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qc(S,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),oL(this.relativeTarget,this.relativeTargetOrigin,S,K),V&&VN(this.relativeTarget,V)&&(this.isProjectionDirty=!1),V||(V=jt()),ii(V,this.relativeTarget)),R&&(this.animationValues=y,UN(y,g,this.latestValues,K,L,j)),T&&T.rotate!==void 0&&(this.animationValues||(this.animationValues=y),this.animationValues.pathRotation=T.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=K},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Pa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ot.update(()=>{Dc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ls(0)),this.motionValue.jump(0,!1),this.currentAnimation=FN(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),c.onUpdate&&c.onUpdate(f)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:f,target:h,layout:m,latestValues:g}=c;if(!(!f||!h||!m)){if(this!==c&&this.layout&&m&&G1(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||jt();const y=rn(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+y;const b=rn(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+b}ii(f,h),Mc(f,g),al(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(c,f){this.sharedNodes.has(c)||this.sharedNodes.set(c,new IN),this.sharedNodes.get(c).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let f=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&tp("z",c,m,this.animationValues);for(let g=0;gc.currentAnimation?.stop()),this.root.nodes.forEach(Tx),this.root.sharedNodes.clear()}}}function QN(e){e.updateLayout()}function XN(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:o}=e.options,u=t.source!==e.layout.source;if(o==="size")yi(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],b=rn(y);y.min=i[g].min,y.max=y.min+b});else if(o==="x"||o==="y"){const g=o==="x"?"y":"x";im(u?t.measuredBox[g]:t.layoutBox[g],i[g])}else G1(o,t.layoutBox,i)&&yi(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],b=rn(i[g]);y.max=y.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+b)});const c=Rs();al(c,i,t.layoutBox);const f=Rs();u?al(f,e.applyTransform(r,!0),t.measuredBox):al(f,i,t.layoutBox);const h=!U1(c);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:b}=g;if(y&&b){const S=e.options.layoutAnchor||void 0,x=jt();Qc(x,t.layoutBox,y.layoutBox,S);const C=jt();Qc(C,i,b.layoutBox,S),B1(x,C)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=x,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:f,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function ZN(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function JN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WN(e){e.clearSnapshot()}function Tx(e){e.clearMeasurements()}function eL(e){e.isLayoutDirty=!0,e.updateLayout()}function Ax(e){e.isLayoutDirty=!1}function tL(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function nL(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iL(e){e.resolveTargetDelta()}function aL(e){e.calcProjection()}function rL(e){e.resetSkewAndRotation()}function sL(e){e.removeLeadSnapshot()}function Ox(e,t,i){e.translate=st(t.translate,0,i),e.scale=st(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function Dx(e,t,i,r){e.min=st(t.min,i.min,r),e.max=st(t.max,i.max,r)}function oL(e,t,i,r){Dx(e.x,t.x,i.x,r),Dx(e.y,t.y,i.y,r)}function lL(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uL={duration:.45,ease:[.4,0,.1,1]},jx=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Nx=jx("applewebkit/")&&!jx("chrome/")?Math.round:qn;function Lx(e){e.min=Nx(e.min),e.max=Nx(e.max)}function cL(e){Lx(e.x),Lx(e.y)}function G1(e,t,i){return e==="position"||e==="preserve-aspect"&&!DN(wx(t),wx(i),.2)}function fL(e){return e!==e.root&&e.scroll?.wasRoot}const dL=q1({attachResizeListener:(e,t)=>wl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),np={current:void 0},I1=q1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new dL({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),mg=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function zx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hL(...e){return t=>{let i=!1;const r=e.map(o=>{const u=zx(o,t);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let o=0;o{const{width:b,height:S,top:x,left:C,right:R,bottom:A,direction:j}=h.current;if(t||u===!1||!f.current||!b||!S)return;const L=j==="rtl",V=i==="left"?L?`right: ${R}`:`left: ${C}`:L?`left: ${C}`:`right: ${R}`,q=r==="bottom"?`bottom: ${A}`:`top: ${x}`;f.current.dataset.motionPopId=c;const W=document.createElement("style");m&&(W.nonce=m);const K=o??document.head;return K.appendChild(W),W.sheet&&W.sheet.insertRule(` + [data-motion-pop-id="${c}"] { + position: absolute !important; + width: ${b}px !important; + height: ${S}px !important; + ${V}px !important; + ${q}px !important; + } + `),()=>{f.current?.removeAttribute("data-motion-pop-id"),K.contains(W)&&K.removeChild(W)}},[t]),E.jsx(mL,{isPresent:t,childRef:f,sizeRef:h,pop:u,children:u===!1?e:_.cloneElement(e,{ref:y})})}const yL=({children:e,initial:t,isPresent:i,onExitComplete:r,custom:o,presenceAffectsLayout:u,mode:c,anchorX:f,anchorY:h,root:m})=>{const g=Gm(vL),y=_.useId();let b=!0,S=_.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:i,custom:o,onExitComplete:x=>{g.set(x,!0);for(const C of g.values())if(!C)return;r&&r()},register:x=>(g.set(x,!1),()=>g.delete(x))}),[i,g,r]);return u&&b&&(S={...S}),_.useMemo(()=>{g.forEach((x,C)=>g.set(C,!1))},[i]),_.useEffect(()=>{!i&&!g.size&&r&&r()},[i]),e=E.jsx(gL,{pop:c==="popLayout",isPresent:i,anchorX:f,anchorY:h,root:m,children:e}),E.jsx(sf.Provider,{value:S,children:e})};function vL(){return new Map}function Y1(e=!0){const t=_.useContext(sf);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:r,register:o}=t,u=_.useId();_.useEffect(()=>{if(e)return o(u)},[e]);const c=_.useCallback(()=>e&&r&&r(u),[u,r,e]);return!i&&r?[!1,c]:[!0]}const lc=e=>e.key||"";function Vx(e){const t=[];return _.Children.forEach(e,i=>{_.isValidElement(i)&&t.push(i)}),t}const bL=({children:e,custom:t,initial:i=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:u="sync",propagate:c=!1,anchorX:f="left",anchorY:h="top",root:m})=>{const[g,y]=Y1(c),b=_.useMemo(()=>Vx(e),[e]),S=c&&!g?[]:b.map(lc),x=_.useRef(!0),C=_.useRef(b),R=Gm(()=>new Map),A=_.useRef(new Set),[j,L]=_.useState(b),[V,q]=_.useState(b);xC(()=>{x.current=!1,C.current=b;for(let T=0;T{const ne=lc(T),ee=c&&!g?!1:b===V||S.includes(ne),he=()=>{if(A.current.has(ne))return;if(R.has(ne))A.current.add(ne),R.set(ne,!0);else return;let ae=!0;R.forEach(Le=>{Le||(ae=!1)}),ae&&(K?.(),q(C.current),c&&y?.(),r&&r())};return E.jsx(yL,{isPresent:ee,initial:!x.current||i?void 0:!1,custom:t,presenceAffectsLayout:o,mode:u,root:m,onExitComplete:ee?void 0:he,anchorX:f,anchorY:h,children:T},ne)})})},K1=_.createContext({strict:!1}),$x={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Px=!1;function SL(){if(Px)return;const e={};for(const t in $x)e[t]={isEnabled:i=>$x[t].some(r=>!!i[r])};C1(e),Px=!0}function Q1(){return SL(),iN()}function xL(e){const t=Q1();for(const i in e)t[i]={...t[i],...e[i]};C1(t)}const wL=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Xc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wL.has(e)}let X1=e=>!Xc(e);function CL(e){typeof e=="function"&&(X1=t=>t.startsWith("on")?!Xc(t):e(t))}try{CL(require("@emotion/is-prop-valid").default)}catch{}function EL(e,t,i){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||kt(e[o])||(X1(o)||i===!0&&Xc(o)||!t&&!Xc(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const cf=_.createContext({});function RL(e,t){if(uf(e)){const{initial:i,animate:r}=e;return{initial:i===!1||xl(i)?i:void 0,animate:xl(r)?r:void 0}}return e.inherit!==!1?t:{}}function _L(e){const{initial:t,animate:i}=RL(e,_.useContext(cf));return _.useMemo(()=>({initial:t,animate:i}),[Ux(t),Ux(i)])}function Ux(e){return Array.isArray(e)?e.join(" "):e}const gg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Z1(e,t,i){for(const r in t)!kt(t[r])&&!O1(r,i)&&(e[r]=t[r])}function TL({transformTemplate:e},t){return _.useMemo(()=>{const i=gg();return hg(i,t,e),Object.assign({},i.vars,i.style)},[t])}function AL(e,t){const i=e.style||{},r={};return Z1(r,i,e),Object.assign(r,TL(e,t)),r}function ML(e,t){const i={},r=AL(e,t);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=r,i}const J1=()=>({...gg(),attrs:{}});function OL(e,t,i,r){const o=_.useMemo(()=>{const u=J1();return D1(u,t,N1(r),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};Z1(u,e.style,e),o.style={...u,...o.style}}return o}const DL=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function yg(e){return typeof e!="string"||e.includes("-")?!1:!!(DL.indexOf(e)>-1||/[A-Z]/u.test(e))}function jL(e,t,i,{latestValues:r},o,u=!1,c){const h=(c??yg(e)?OL:ML)(t,r,o,e),m=EL(t,typeof e=="string",u),g=e!==_.Fragment?{...m,...h,ref:i}:{},{children:y}=t,b=_.useMemo(()=>kt(y)?y.get():y,[y]);return _.createElement(e,{...g,children:b})}function NL({scrapeMotionValuesFromProps:e,createRenderState:t},i,r,o){return{latestValues:LL(i,r,o,e),renderState:t()}}function LL(e,t,i,r){const o={},u=r(e,{});for(const b in u)o[b]=Oc(u[b]);let{initial:c,animate:f}=e;const h=uf(e),m=x1(e);t&&m&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),f===void 0&&(f=t.animate));let g=i?i.initial===!1:!1;g=g||c===!1;const y=g?f:c;if(y&&typeof y!="boolean"&&!lf(y)){const b=Array.isArray(y)?y:[y];for(let S=0;S(t,i)=>{const r=_.useContext(cf),o=_.useContext(sf),u=()=>NL(e,t,r,o);return i?u():Gm(u)},zL=W1({scrapeMotionValuesFromProps:pg,createRenderState:gg}),VL=W1({scrapeMotionValuesFromProps:L1,createRenderState:J1}),$L=Symbol.for("motionComponentSymbol");function PL(e,t,i){const r=_.useRef(i);_.useInsertionEffect(()=>{r.current=i});const o=_.useRef(null);return _.useCallback(u=>{u&&e.onMount?.(u),t&&(u?t.mount(u):t.unmount());const c=r.current;if(typeof c=="function")if(u){const f=c(u);typeof f=="function"&&(o.current=f)}else o.current?(o.current(),o.current=null):c(u);else c&&(c.current=u)},[t])}const eE=_.createContext({});function xs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function UL(e,t,i,r,o,u){const{visualElement:c}=_.useContext(cf),f=_.useContext(K1),h=_.useContext(sf),m=_.useContext(mg),g=m.reducedMotion,y=m.skipAnimations,b=_.useRef(null),S=_.useRef(!1);r=r||f.renderer,!b.current&&r&&(b.current=r(e,{visualState:t,parent:c,props:i,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:g,skipAnimations:y,isSVG:u}),S.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const x=b.current,C=_.useContext(eE);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&BL(b.current,i,o,C);const R=_.useRef(!1);_.useInsertionEffect(()=>{x&&R.current&&x.update(i,h)});const A=i[u1],j=_.useRef(!!A&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(A)&&window.MotionHasOptimisedAnimation?.(A));return xC(()=>{S.current=!0,x&&(R.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),j.current&&x.animationState&&x.animationState.animateChanges())}),_.useEffect(()=>{x&&(!j.current&&x.animationState&&x.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(A)}),j.current=!1),x.enteringChildren=void 0)}),x}function BL(e,t,i,r){const{layoutId:o,layout:u,drag:c,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutAnchor:g,layoutCrossfade:y}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:tE(e.parent)),e.projection.setOptions({layoutId:o,layout:u,alwaysMeasureLayout:!!c||f&&xs(f),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:m,layoutAnchor:g})}function tE(e){if(e)return e.options.allowProjection!==!1?e.projection:tE(e.parent)}function ip(e,{forwardMotionProps:t=!1,type:i}={},r,o){r&&xL(r);const u=i?i==="svg":yg(e),c=u?VL:zL;function f(m,g){let y;const b={..._.useContext(mg),...m,layoutId:HL(m)},{isStatic:S}=b,x=_L(m),C=c(m,S);if(!S&&typeof window<"u"){FL();const R=kL(b);y=R.MeasureLayout,x.visualElement=UL(e,C,b,o,R.ProjectionNode,u)}return E.jsxs(cf.Provider,{value:x,children:[y&&x.visualElement?E.jsx(y,{visualElement:x.visualElement,...b}):null,jL(e,m,PL(C,x.visualElement,g),C,S,t,u)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=_.forwardRef(f);return h[$L]=e,h}function HL({layoutId:e}){const t=_.useContext(qm).id;return t&&e!==void 0?t+"-"+e:e}function FL(e,t){_.useContext(K1).strict}function kL(e){const t=Q1(),{drag:i,layout:r}=t;if(!i&&!r)return{};const o={...i,...r};return{MeasureLayout:i?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function qL(e,t){if(typeof Proxy>"u")return ip;const i=new Map,r=(u,c)=>ip(u,c,e,t),o=(u,c)=>r(u,c);return new Proxy(o,{get:(u,c)=>c==="create"?r:(i.has(c)||i.set(c,ip(c,void 0,e,t)),i.get(c))})}const GL=(e,t)=>t.isSVG??yg(e)?new SN(t):new pN(t,{allowProjection:e!==_.Fragment});class IL extends Ba{constructor(t){super(t),t.animationState||(t.animationState=RN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();lf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let YL=0;class KL extends Ba{constructor(){super(...arguments),this.id=YL++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:u,custom:c}=this.node.getProps();if(typeof u=="string"||typeof u=="object"&&u!==null&&!Array.isArray(u)){const f=wr(this.node,u,c);if(f){const{transition:h,transitionEnd:m,...g}=f;for(const y in g)this.node.getValue(y)?.jump(g[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);i&&!t&&o.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const QL={animation:{Feature:IL},exit:{Feature:KL}};function zl(e){return{point:{x:e.pageX,y:e.pageY}}}const XL=e=>t=>ug(t)&&e(t,zl(t));function rl(e,t,i,r){return wl(e,t,XL(i),r)}const nE=({current:e})=>e?e.ownerDocument.defaultView:null,Bx=(e,t)=>Math.abs(e-t);function ZL(e,t){const i=Bx(e.x,t.x),r=Bx(e.y,t.y);return Math.sqrt(i**2+r**2)}const Hx=new Set(["auto","scroll"]);class iE{constructor(t,i,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:u=!1,distanceThreshold:c=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=S=>{this.handleScroll(S.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=uc(this.lastRawMoveEventInfo,this.transformPagePoint));const S=ap(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=ZL(S.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!C)return;const{point:R}=S,{timestamp:A}=Ft;this.history.push({...R,timestamp:A});const{onStart:j,onMove:L}=this.handlers;x||(j&&j(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,S)},this.handlePointerMove=(S,x)=>{this.lastMoveEvent=S,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=uc(x,this.transformPagePoint),ot.update(this.updatePoint,!0)},this.handlePointerUp=(S,x)=>{this.end();const{onEnd:C,onSessionEnd:R,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=ap(S.type==="pointercancel"?this.lastMoveEventInfo:uc(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(S,j),R&&R(S,j)},!ug(t))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=o||window;const h=zl(t),m=uc(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=Ft;this.history=[{...g,timestamp:y}];const{onSessionStart:b}=i;b&&b(t,ap(m,this.history)),this.removeListeners=jl(rl(this.contextWindow,"pointermove",this.handlePointerMove),rl(this.contextWindow,"pointerup",this.handlePointerUp),rl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let i=t.parentElement;for(;i;){const r=getComputedStyle(i);(Hx.has(r.overflowX)||Hx.has(r.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const i=this.scrollPositions.get(t);if(!i)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:o.x-i.x,y:o.y-i.y};u.x===0&&u.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(t,o),ot.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Pa(this.updatePoint)}}function uc(e,t){return t?{point:t(e.point)}:e}function Fx(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ap({point:e},t){return{point:e,delta:Fx(e,aE(t)),offset:Fx(e,JL(t)),velocity:WL(t,.1)}}function JL(e){return e[0]}function aE(e){return e[e.length-1]}function WL(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,r=null;const o=aE(e);for(;i>=0&&(r=e[i],!(o.timestamp-r.timestamp>Tn(t)));)i--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>Tn(t)*2&&(r=e[1]);const u=Fn(o.timestamp-r.timestamp);if(u===0)return{x:0,y:0};const c={x:(o.x-r.x)/u,y:(o.y-r.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function ez(e,{min:t,max:i},r){return t!==void 0&&ei&&(e=r?st(i,e,r.max):Math.min(e,i)),e}function kx(e,t,i){return{min:t!==void 0?e.min+t:void 0,max:i!==void 0?e.max+i-(e.max-e.min):void 0}}function tz(e,{top:t,left:i,bottom:r,right:o}){return{x:kx(e.x,i,o),y:kx(e.y,t,r)}}function qx(e,t){let i=t.min-e.min,r=t.max-e.max;return t.max-t.minr?i=bl(t.min,t.max-r,e.min):r>o&&(i=bl(e.min,e.max-o,t.min)),xi(0,1,i)}function az(e,t){const i={};return t.min!==void 0&&(i.min=t.min-e.min),t.max!==void 0&&(i.max=t.max-e.min),i}const am=.35;function rz(e=am){return e===!1?e=0:e===!0&&(e=am),{x:Gx(e,"left","right"),y:Gx(e,"top","bottom")}}function Gx(e,t,i){return{min:Ix(e,t),max:Ix(e,i)}}function Ix(e,t){return typeof e=="number"?e:e[t]||0}const sz=new WeakMap;class oz{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=jt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const u=y=>{i&&this.snapToCursor(zl(y).point),this.stopAnimation()},c=(y,b)=>{const{drag:S,dragPropagation:x,onDragStart:C}=this.getProps();if(S&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Nj(S),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yi(A=>{let j=this.getAxisMotionValue(A).get()||0;if(bi.test(j)){const{projection:L}=this.visualElement;if(L&&L.layout){const V=L.layout.layoutBox[A];V&&(j=rn(V)*(parseFloat(j)/100))}}this.originPoint[A]=j}),C&&ot.update(()=>C(y,b),!1,!0),Kp(this.visualElement,"transform");const{animationState:R}=this.visualElement;R&&R.setActive("whileDrag",!0)},f=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:S,dragDirectionLock:x,onDirectionLock:C,onDrag:R}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:A}=b;if(x&&this.currentDirection===null){this.currentDirection=uz(A),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",b.point,A),this.updateAxis("y",b.point,A),this.visualElement.render(),R&&ot.update(()=>R(y,b),!1,!0)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new iE(t,{onSessionStart:u,onStart:c,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:r,contextWindow:nE(this.visualElement),element:this.visualElement.current})}stop(t,i){const r=t||this.latestPointerEvent,o=i||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!o||!r)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:f}=this.getProps();f&&ot.postRender(()=>f(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,i,r){const{drag:o}=this.getProps();if(!r||!cc(t,o,this.currentDirection))return;const u=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=ez(c,this.constraints[t],this.elastic[t])),u.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&xs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=tz(r.layoutBox,t):this.constraints=!1,this.elastic=rz(i),o!==this.constraints&&!xs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&yi(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=az(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!xs(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const u=lN(r,o.root,this.visualElement.getTransformPagePoint());let c=nz(o.layout.layoutBox,u);if(i){const f=i(rN(c));this.hasMutatedConstraints=!!f,f&&(c=R1(f))}return c}startAnimation(t){const{drag:i,dragMomentum:r,dragElastic:o,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=yi(g=>{if(!cc(g,i,this.currentDirection))return;let y=h&&h[g]||{};(c===!0||c===g)&&(y={min:0,max:0});const b=o?200:1e6,S=o?40:1e7,x={type:"inertia",velocity:r?t[g]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,x)});return Promise.all(m).then(f)}startAxisValueAnimation(t,i){const r=this.getAxisMotionValue(t);return Kp(this.visualElement,t),r.start(rg(t,r,0,i,this.visualElement,!1))}stopAnimation(){yi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){yi(i=>{const{drag:r}=this.getProps();if(!cc(i,r,this.currentDirection))return;const{projection:o}=this.visualElement,u=this.getAxisMotionValue(i);if(o&&o.layout){const{min:c,max:f}=o.layout.layoutBox[i],h=u.get()||0;u.set(t[i]-st(c,f,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:r}=this.visualElement;if(!xs(i)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};yi(c=>{const f=this.getAxisMotionValue(c);if(f&&this.constraints!==!1){const h=f.get();o[c]=iz({min:h,max:h},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),yi(c=>{if(!cc(c,t,null))return;const f=this.getAxisMotionValue(c),{min:h,max:m}=this.constraints[c];f.set(st(h,m,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;sz.set(this.visualElement,this);const t=this.visualElement.current,i=rl(t,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps(),b=m.target,S=b!==t&&Uj(b);g&&y&&!S&&this.start(m)});let r;const o=()=>{const{dragConstraints:m}=this.getProps();xs(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),r||(r=lz(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:u}=this.visualElement,c=u.addEventListener("measure",o);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),ot.read(o);const f=wl(window,"resize",()=>this.scalePositionWithinConstraints()),h=u.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(yi(y=>{const b=this.getAxisMotionValue(y);b&&(this.originPoint[y]+=m[y].translate,b.set(b.get()+m[y].translate))}),this.visualElement.render())}));return()=>{f(),i(),c(),h&&h(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:u=!1,dragElastic:c=am,dragMomentum:f=!0}=t;return{...t,drag:i,dragDirectionLock:r,dragPropagation:o,dragConstraints:u,dragElastic:c,dragMomentum:f}}}function Yx(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function lz(e,t,i){const r=ex(e,Yx(i)),o=ex(t,Yx(i));return()=>{r(),o()}}function cc(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function uz(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class cz extends Ba{constructor(t){super(t),this.removeGroupControls=qn,this.removeListeners=qn,this.controls=new oz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const rp=e=>(t,i)=>{e&&ot.update(()=>e(t,i),!1,!0)};class fz extends Ba{constructor(){super(...arguments),this.removePointerDownListener=qn}onPointerDown(t){this.session=new iE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:rp(t),onStart:rp(i),onMove:rp(r),onEnd:(u,c)=>{delete this.session,o&&ot.postRender(()=>o(u,c))}}}mount(){this.removePointerDownListener=rl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let sp=!1;class dz extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:r,layoutId:o}=this.props,{projection:u}=t;u&&(i.group&&i.group.add(u),r&&r.register&&o&&r.register(u),sp&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Dc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:r,drag:o,isPresent:u}=this.props,{projection:c}=r;return c&&(c.isPresent=u,t.layoutDependency!==i&&c.setOptions({...c.options,layoutDependency:i}),sp=!0,o||t.layoutDependency!==i||i===void 0||t.isPresent!==u?c.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?c.promote():c.relegate()||ot.postRender(()=>{const f=c.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:i}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=i,r.root.didUpdate(),lg.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:r}=this.props,{projection:o}=t;sp=!0,o&&(o.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rE(e){const[t,i]=Y1(),r=_.useContext(qm);return E.jsx(dz,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(eE),isPresent:t,safeToRemove:i})}const hz={pan:{Feature:fz},drag:{Feature:cz,ProjectionNode:I1,MeasureLayout:rE}};function Kx(e,t,i){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",i==="Start");const o="onHover"+i,u=r[o];u&&ot.postRender(()=>u(t,zl(t)))}class pz extends Ba{mount(){const{current:t}=this.node;t&&(this.unmount=zj(t,(i,r)=>(Kx(this.node,r,"Start"),o=>Kx(this.node,o,"End"))))}unmount(){}}class mz extends Ba{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=jl(wl(this.node.current,"focus",()=>this.onFocus()),wl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qx(e,t,i){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",i==="Start");const o="onTap"+(i==="End"?"":i),u=r[o];u&&ot.postRender(()=>u(t,zl(t)))}class gz extends Ba{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:r}=this.node.props;this.unmount=Hj(t,(o,u)=>(Qx(this.node,u,"Start"),(c,{success:f})=>Qx(this.node,c,f?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:r?.tap===!1})}unmount(){}}const rm=new WeakMap,op=new WeakMap,yz=e=>{const t=rm.get(e.target);t&&t(e)},vz=e=>{e.forEach(yz)};function bz({root:e,...t}){const i=e||document;op.has(i)||op.set(i,{});const r=op.get(i),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(vz,{root:e,...t})),r[o]}function Sz(e,t,i){const r=bz(t);return rm.set(e,i),r.observe(e),()=>{rm.delete(e),r.unobserve(e)}}const xz={some:0,all:1};class wz extends Ba{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:i,margin:r,amount:o="some",once:u}=t,c={root:i?i.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:xz[o]},f=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),b=m?g:y;b&&b(h)};this.stopObserver=Sz(this.node.current,c,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(Cz(t,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Cz({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const Ez={inView:{Feature:wz},tap:{Feature:gz},focus:{Feature:mz},hover:{Feature:pz}},Rz={layout:{ProjectionNode:I1,MeasureLayout:rE}},_z={...QL,...Ez,...hz,...Rz},vg=qL(_z,GL),Xx="/api/v1",Tz="moonbridge.console.token",Az="moonbridge.console.rememberedToken";let Mz="";class sm extends Error{status;code;raw;constructor(t,i,r,o){super(r),this.name="ApiError",this.status=t,this.code=i,this.raw=o}}function Oz(){const e=Zx(Jx("sessionStorage"),Tz);return e||(Zx(Jx("localStorage"),Az)??Mz)}async function lt(e,t={}){const i=Dz(e),r=Lz(t.headers),o=Oz();o&&(r.Authorization=`Bearer ${o}`);let u=t.rawBody;t.body!==void 0&&(r["Content-Type"]="application/json",u=JSON.stringify(t.body));const c=await fetch(i,{...t,headers:r,body:u}),f=await jz(c);if(!c.ok)throw Nz(c.status,f);return f}function Dz(e){return/^https?:\/\//.test(e)||e.startsWith("/api/v1/")||e==="/api/v1"||e.startsWith("/v1/")||e==="/v1"?e:e.startsWith("/")?`${Xx}${e}`:`${Xx}/${e}`}async function jz(e){const t=e.headers.get("Content-Type")??"",i=await e.text();if(i){if(t.includes("application/json"))try{return JSON.parse(i)}catch{return i}return i}}function Nz(e,t){if(Wx(t)&&Wx(t.error)){const i=lp(t.error.code)??lp(t.error.type)??"request_error",r=lp(t.error.message)??`Request failed with status ${e}`;return new sm(e,i,r,t)}return new sm(e,"request_error",`Request failed with status ${e}`,t)}function Zx(e,t){try{return e?.getItem(t)??null}catch{return null}}function Jx(e){if(!(typeof window>"u"))try{return window[e]}catch{return}}function Lz(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function Wx(e){return typeof e=="object"&&e!==null}function lp(e){return typeof e=="string"&&e?e:void 0}function bg(e={}){const t=new URLSearchParams;e.limit!==void 0&&t.set("limit",String(e.limit)),e.offset!==void 0&&t.set("offset",String(e.offset));const i=t.toString();return i?`?${i}`:""}const zz=()=>lt("/status"),Vz=e=>lt(`/providers${bg(e)}`),$z=(e,t)=>lt(`/providers/${encodeURIComponent(e)}`,{method:"PUT",body:t}),Pz=(e,t)=>lt(`/providers/${encodeURIComponent(e)}/offers`,{method:"POST",body:t}),Uz=e=>lt(`/models${bg(e)}`),Bz=(e,t)=>lt(`/models/${encodeURIComponent(e)}`,{method:"PUT",body:t}),Hz=e=>lt(`/routes${bg(e)}`),Fz=(e,t)=>lt(`/routes/${encodeURIComponent(e)}`,{method:"PUT",body:t}),Sg=()=>lt("/changes"),kz=()=>lt("/changes/apply",{method:"POST"}),qz=()=>lt("/changes/discard",{method:"POST"}),Gz=()=>lt("/config/effective"),Iz=e=>lt("/config/validate",{method:"POST",body:{config:e}}),Yz=e=>lt("/config/import",{method:"POST",body:{yaml:e}}),Kz=({includeSecrets:e=!1}={})=>lt(`/config/export?include_secrets=${e?"true":"false"}`,{headers:e?{"X-Confirm-Secrets":"true"}:void 0}),Qz=()=>lt("/defaults"),Xz=e=>lt("/defaults",{method:"PUT",body:e}),Zz=()=>lt("/web-search"),Jz=e=>lt("/web-search",{method:"PUT",body:e}),Wz=()=>lt("/extensions"),ew=e=>lt(`/extensions/${encodeURIComponent(e)}`),eV=(e,t)=>lt(`/extensions/${encodeURIComponent(e)}`,{method:"PUT",body:t}),tV=()=>lt("/stats/summary"),nV=()=>lt("/sessions"),Xi={status:["status"],providers:e=>["providers",e],models:e=>["models",e],routes:e=>["routes",e],changes:["changes"],statsSummary:["stats","summary"],sessions:["sessions"]};function Ha({label:e="加载中"}){return E.jsxs("section",{className:"state-panel","aria-busy":"true",children:[E.jsx("p",{className:"eyebrow",children:"Loading"}),E.jsx("h2",{children:e})]})}function iV({open:e,onClose:t}){const i=wm(),[r,o]=_.useState(""),u=nn({queryKey:Xi.changes,queryFn:Sg}),c=async()=>{await i.invalidateQueries()},f=Hb({mutationFn:kz,onSuccess:async m=>{o(m.message),await c()}}),h=Hb({mutationFn:qz,onSuccess:async m=>{o(m.message),await c()}});return E.jsx(bL,{children:e?E.jsxs(vg.aside,{className:"change-drawer","aria-label":"Pending changes",initial:{opacity:0,x:24},animate:{opacity:1,x:0},exit:{opacity:0,x:24},transition:{duration:.18},children:[E.jsxs("header",{className:"drawer-header",children:[E.jsxs("div",{children:[E.jsx("p",{className:"eyebrow",children:"Change Queue"}),E.jsx("h2",{children:"Pending Changes"})]}),E.jsx("button",{type:"button",className:"icon-text-button",onClick:t,children:"Close"})]}),u.isLoading?E.jsx(Ha,{label:"Loading changes"}):E.jsx(sE,{changes:u.data??[],compact:!0}),E.jsxs("div",{className:"drawer-actions",children:[E.jsx("button",{type:"button",onClick:()=>f.mutate(),disabled:f.isPending,children:"Apply changes"}),E.jsx("button",{type:"button",className:"secondary-button",onClick:()=>h.mutate(),disabled:h.isPending,children:"Discard changes"})]}),r?E.jsx("p",{className:"feedback-banner",children:r}):null]}):null})}function sE({changes:e,compact:t=!1}){return e.length===0?E.jsx("p",{className:"empty-state",children:"No staged changes"}):E.jsx("ul",{className:t?"change-list change-list--compact":"change-list",children:e.map(i=>E.jsxs("li",{children:[E.jsxs("div",{children:[E.jsx("span",{className:"status-pill",children:i.Resource??i.resource??"resource"}),E.jsx("span",{className:"status-pill status-pill--muted",children:i.Action??i.action??"change"})]}),E.jsx("strong",{children:i.TargetKey??i.target??"unknown"}),E.jsx("p",{children:aV(i)})]},i.ID??i.change_id??i.TargetKey??i.target))})}function aV(e){const t=e.After??e.after,i=e.Before??e.before;return tw(t)||tw(i)||"No payload summary"}function tw(e){if(!e)return"";try{return JSON.stringify(JSON.parse(e))}catch{return e}}const rV="#7AA7A2",sV={dark:{"--mb-color-primary":rV,"--mb-color-on-primary":"#08201d","--mb-color-primary-container":"#274e4a","--mb-color-on-primary-container":"#d4f3ee","--mb-color-secondary":"#bbc8c5","--mb-color-surface":"#101414","--mb-color-surface-container":"#1b2020","--mb-color-surface-container-high":"#252b2b","--mb-color-on-surface":"#e0e3e1","--mb-color-on-surface-variant":"#bec9c6","--mb-color-outline":"#899390","--mb-color-shadow":"#000000","--mb-color-error":"#ffb4ab","--mb-motion-standard":"180ms cubic-bezier(0.2, 0, 0, 1)"},light:{"--mb-color-primary":"#466965","--mb-color-on-primary":"#ffffff","--mb-color-primary-container":"#c9f0ea","--mb-color-on-primary-container":"#00201d","--mb-color-secondary":"#52615e","--mb-color-surface":"#f7fbf8","--mb-color-surface-container":"#e9efec","--mb-color-surface-container-high":"#dde5e2","--mb-color-on-surface":"#191c1b","--mb-color-on-surface-variant":"#424947","--mb-color-outline":"#727c79","--mb-color-shadow":"#000000","--mb-color-error":"#ba1a1a","--mb-motion-standard":"180ms cubic-bezier(0.2, 0, 0, 1)"}};function oV(e,t){Object.entries(sV[e]).forEach(([i,r])=>{t.style.setProperty(i,r)})}const oE="moonbridge.console.theme",lE=_.createContext(void 0);function lV(){if(typeof window>"u")return"dark";try{if(!window.localStorage)return"dark";const e=window.localStorage.getItem(oE);return e==="light"||e==="dark"?e:"dark"}catch{return"dark"}}function uV({children:e}){const[t,i]=_.useState(lV),r=_.useCallback(c=>{i(c)},[]),o=_.useCallback(()=>{i(c=>c==="dark"?"light":"dark")},[]);_.useEffect(()=>{const c=document.documentElement;c.dataset.theme=t,oV(t,c);try{window.localStorage?.setItem(oE,t)}catch{}},[t]);const u=_.useMemo(()=>({theme:t,setTheme:r,toggleTheme:o}),[t,r,o]);return E.jsx(lE.Provider,{value:u,children:e})}function cV(){const e=_.useContext(lE);if(!e)throw new Error("useConsoleTheme must be used within ThemeProvider");return e}const fV=[{to:"/overview",icon:"dashboard",label:"Overview"},{to:"/models",icon:"view_module",label:"Models"},{to:"/providers",icon:"lan",label:"Providers"},{to:"/routes",icon:"alt_route",label:"Routes"},{to:"/extensions",icon:"extension",label:"Extensions"},{to:"/changes",icon:"pending_actions",label:"Changes"},{to:"/config",icon:"tune",label:"Config"},{to:"/rpc-test",icon:"science",label:"RPC Test"}];function dV(){const{theme:e,toggleTheme:t}=cV(),[i,r]=_.useState(!1),o=e==="dark"?"light":"dark",u=e==="dark"?"light_mode":"dark_mode";return E.jsxs("div",{className:"app-shell",children:[E.jsx("style",{children:hV}),E.jsxs("header",{className:"top-app-bar",children:[E.jsxs("div",{children:[E.jsx("p",{children:"Moon Bridge"}),E.jsx("strong",{children:"Console"})]}),E.jsxs("div",{className:"top-app-bar__meta",children:[E.jsx("span",{children:"Same-origin API"}),E.jsx("span",{children:"Runtime API"}),E.jsx("button",{type:"button",className:"top-action-button",onClick:()=>r(!0),children:"Changes"}),_.createElement("md-icon-button",{"aria-label":`Switch to ${o} theme`,onClick:t},_.createElement("md-icon",null,u))]})]}),E.jsxs("div",{className:"workspace",children:[E.jsx("nav",{className:"navigation-rail","aria-label":"Console sections",children:fV.map(c=>E.jsxs(nC,{to:c.to,className:({isActive:f})=>f?"nav-item nav-item--active":"nav-item",children:[_.createElement("md-icon",null,c.icon),E.jsx("span",{children:c.label}),_.createElement("md-ripple")]},c.to))}),E.jsx(vg.main,{className:"content-surface",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18},children:E.jsx(UM,{})})]}),E.jsx(iV,{open:i,onClose:()=>r(!1)})]})}const hV=` + :root { + color-scheme: dark; + font-family: + Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, + "Segoe UI", sans-serif; + background: var(--mb-color-surface); + color: var(--mb-color-on-surface); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + } + + :root[data-theme="light"] { + color-scheme: light; + } + + * { + box-sizing: border-box; + } + + body { + margin: 0; + min-width: 320px; + min-height: 100vh; + background: var(--mb-color-surface); + } + + .app-shell { + min-height: 100vh; + background: + linear-gradient(180deg, rgba(122, 167, 162, 0.08), transparent 260px), + var(--mb-color-surface); + } + + .top-app-bar { + position: sticky; + top: 0; + z-index: 2; + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; + min-height: 72px; + padding: 12px 24px; + border-bottom: 1px solid color-mix(in srgb, var(--mb-color-outline) 36%, transparent); + background: color-mix(in srgb, var(--mb-color-surface) 92%, transparent); + backdrop-filter: blur(16px); + } + + .top-app-bar p, + .top-app-bar strong { + margin: 0; + } + + .top-app-bar p { + color: var(--mb-color-on-surface-variant); + font-size: 0.75rem; + line-height: 1.2; + } + + .top-app-bar strong { + display: block; + font-size: 1.25rem; + line-height: 1.2; + font-weight: 650; + } + + .top-app-bar__meta { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 10px; + color: var(--mb-color-on-surface-variant); + font-size: 0.875rem; + white-space: nowrap; + } + + .top-app-bar__meta span { + min-height: 32px; + display: inline-flex; + align-items: center; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 42%, transparent); + border-radius: 8px; + padding: 0 10px; + background: var(--mb-color-surface-container); + } + + .top-action-button, + button { + min-height: 38px; + border: 0; + border-radius: 8px; + padding: 0 14px; + color: var(--mb-color-on-primary); + background: var(--mb-color-primary); + font: inherit; + font-weight: 650; + cursor: pointer; + } + + button:disabled { + cursor: progress; + opacity: 0.7; + } + + .secondary-button, + .icon-text-button { + color: var(--mb-color-on-surface); + background: var(--mb-color-surface-container-high); + } + + md-icon-button { + --md-icon-button-icon-color: var(--mb-color-on-surface); + --md-icon-button-hover-icon-color: var(--mb-color-primary); + --md-icon-button-pressed-icon-color: var(--mb-color-primary); + } + + .workspace { + display: grid; + grid-template-columns: 96px minmax(0, 1fr); + min-height: calc(100vh - 72px); + } + + .navigation-rail { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + padding: 16px 10px; + border-right: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + background: var(--mb-color-surface); + } + + .nav-item { + position: relative; + overflow: hidden; + width: 76px; + min-height: 64px; + display: grid; + place-items: center; + gap: 3px; + padding: 8px 4px; + border-radius: 8px; + color: var(--mb-color-on-surface-variant); + text-decoration: none; + transition: + background var(--mb-motion-standard), + color var(--mb-motion-standard); + } + + .nav-item span { + max-width: 68px; + overflow: hidden; + text-overflow: ellipsis; + font-size: 0.6875rem; + line-height: 1.1; + text-align: center; + white-space: nowrap; + } + + .nav-item--active { + color: var(--mb-color-on-primary-container); + background: var(--mb-color-primary-container); + } + + .content-surface { + min-width: 0; + padding: 24px; + } + + .placeholder-panel { + min-height: calc(100vh - 120px); + display: flex; + align-items: center; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + border-radius: 8px; + padding: 32px; + background: var(--mb-color-surface-container); + box-shadow: 0 20px 60px color-mix(in srgb, var(--mb-color-shadow) 22%, transparent); + } + + .placeholder-panel > div { + max-width: 760px; + } + + .eyebrow { + margin: 0 0 10px; + color: var(--mb-color-primary); + font-size: 0.75rem; + font-weight: 700; + text-transform: uppercase; + } + + h1 { + margin: 0; + font-size: clamp(2rem, 4vw, 3.5rem); + line-height: 1.05; + font-weight: 650; + } + + .placeholder-panel p:last-child { + margin: 18px 0 0; + max-width: 620px; + color: var(--mb-color-on-surface-variant); + font-size: 1rem; + line-height: 1.6; + } + + .page-stack { + display: grid; + gap: 18px; + } + + .page-header { + max-width: 920px; + } + + .page-header h1 { + font-size: 2rem; + line-height: 1.15; + } + + .page-header p:last-child { + margin: 12px 0 0; + color: var(--mb-color-on-surface-variant); + font-size: 0.95rem; + line-height: 1.55; + } + + .metric-grid { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 12px; + } + + .metric-card, + .content-panel, + .state-panel { + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + border-radius: 8px; + background: var(--mb-color-surface-container); + box-shadow: 0 14px 42px color-mix(in srgb, var(--mb-color-shadow) 16%, transparent); + } + + .metric-card { + min-height: 112px; + display: grid; + align-content: space-between; + gap: 18px; + padding: 18px; + } + + .metric-card span { + color: var(--mb-color-on-surface-variant); + font-size: 0.78rem; + font-weight: 650; + text-transform: uppercase; + } + + .metric-card strong { + overflow-wrap: anywhere; + font-size: 1.65rem; + line-height: 1.1; + font-weight: 680; + } + + .section-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; + } + + .content-panel, + .state-panel { + min-width: 0; + padding: 20px; + } + + .state-panel { + min-height: 280px; + display: grid; + align-content: center; + } + + .content-panel h2, + .state-panel h2 { + margin: 0 0 14px; + font-size: 1rem; + line-height: 1.3; + } + + .state-panel p:last-child { + margin: 0; + color: var(--mb-color-on-surface-variant); + line-height: 1.55; + } + + .compact-list { + display: grid; + gap: 10px; + margin: 0; + padding: 0; + list-style: none; + } + + .compact-list li { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + gap: 12px; + align-items: center; + padding: 10px 0; + border-top: 1px solid color-mix(in srgb, var(--mb-color-outline) 24%, transparent); + } + + .compact-list li:first-child { + border-top: 0; + } + + .compact-list strong, + .compact-list span { + min-width: 0; + overflow-wrap: anywhere; + } + + .compact-list span, + .empty-state { + color: var(--mb-color-on-surface-variant); + } + + .empty-state { + margin: 0; + line-height: 1.55; + } + + .table-scroll { + overflow-x: auto; + } + + .resource-table { + width: 100%; + min-width: 720px; + border-collapse: collapse; + font-size: 0.92rem; + } + + .resource-table th, + .resource-table td { + padding: 13px 12px; + border-bottom: 1px solid color-mix(in srgb, var(--mb-color-outline) 28%, transparent); + text-align: left; + vertical-align: top; + } + + .resource-table th { + color: var(--mb-color-on-surface-variant); + font-size: 0.74rem; + font-weight: 720; + text-transform: uppercase; + } + + .resource-table td { + overflow-wrap: anywhere; + } + + .resource-table tbody tr:hover { + background: color-mix(in srgb, var(--mb-color-primary) 7%, transparent); + } + + .status-pill { + display: inline-flex; + align-items: center; + min-height: 28px; + border-radius: 8px; + padding: 0 9px; + color: var(--mb-color-on-primary-container); + background: var(--mb-color-primary-container); + font-size: 0.8rem; + font-weight: 650; + } + + .status-pill--muted { + color: var(--mb-color-on-surface); + background: var(--mb-color-surface-container-high); + } + + .form-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 14px; + } + + .form-grid label { + display: grid; + gap: 6px; + color: var(--mb-color-on-surface-variant); + font-size: 0.82rem; + font-weight: 650; + } + + .form-grid input, + .form-grid select, + .form-grid textarea, + .textarea-field textarea { + width: 100%; + min-height: 42px; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 44%, transparent); + border-radius: 8px; + padding: 8px 10px; + color: var(--mb-color-on-surface); + background: var(--mb-color-surface); + font: inherit; + } + + .form-grid__wide, + .form-actions { + grid-column: 1 / -1; + } + + .form-actions { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; + } + + .feedback-inline, + .feedback-banner { + color: var(--mb-color-primary); + font-weight: 650; + } + + .textarea-field { + display: grid; + gap: 8px; + color: var(--mb-color-on-surface-variant); + font-size: 0.82rem; + font-weight: 650; + } + + .textarea-field textarea { + min-height: 360px; + resize: vertical; + font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; + line-height: 1.45; + } + + .checkbox-inline { + display: inline-flex; + align-items: center; + gap: 8px; + color: var(--mb-color-on-surface-variant); + font-size: 0.9rem; + } + + .json-block { + max-height: 420px; + overflow: auto; + margin: 0; + border-radius: 8px; + padding: 14px; + color: var(--mb-color-on-surface); + background: var(--mb-color-surface); + font-size: 0.82rem; + line-height: 1.45; + } + + .button-list { + display: flex; + gap: 10px; + flex-wrap: wrap; + } + + .active-button { + outline: 2px solid var(--mb-color-primary); + outline-offset: 2px; + } + + .change-drawer { + position: fixed; + top: 88px; + right: 18px; + z-index: 5; + width: min(420px, calc(100vw - 36px)); + max-height: calc(100vh - 112px); + overflow: auto; + display: grid; + gap: 16px; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 44%, transparent); + border-radius: 8px; + padding: 18px; + background: var(--mb-color-surface-container-high); + box-shadow: 0 24px 80px color-mix(in srgb, var(--mb-color-shadow) 34%, transparent); + } + + .drawer-header, + .drawer-actions { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + } + + .drawer-header h2 { + margin: 0; + font-size: 1.1rem; + } + + .drawer-actions { + justify-content: flex-start; + flex-wrap: wrap; + } + + .change-list { + display: grid; + gap: 12px; + margin: 0; + padding: 0; + list-style: none; + } + + .change-list li { + display: grid; + gap: 8px; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 28%, transparent); + border-radius: 8px; + padding: 12px; + background: var(--mb-color-surface); + } + + .change-list li > div { + display: flex; + gap: 8px; + flex-wrap: wrap; + } + + .change-list strong, + .change-list p { + min-width: 0; + overflow-wrap: anywhere; + } + + .change-list p { + margin: 0; + color: var(--mb-color-on-surface-variant); + font-size: 0.85rem; + line-height: 1.45; + } + + @media (max-width: 760px) { + .top-app-bar { + align-items: flex-start; + flex-direction: column; + padding: 14px 16px; + } + + .top-app-bar__meta { + width: 100%; + flex-wrap: wrap; + justify-content: flex-start; + white-space: normal; + } + + .workspace { + grid-template-columns: 1fr; + } + + .navigation-rail { + position: sticky; + top: 103px; + z-index: 1; + flex-direction: row; + align-items: stretch; + justify-content: flex-start; + overflow-x: auto; + padding: 10px 12px; + border-right: 0; + border-bottom: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + } + + .nav-item { + flex: 0 0 76px; + } + + .content-surface { + padding: 16px; + } + + .placeholder-panel { + min-height: 440px; + padding: 24px; + } + + .metric-grid, + .section-grid { + grid-template-columns: 1fr; + } + + .compact-list li { + grid-template-columns: 1fr; + gap: 4px; + } + + .resource-table { + min-width: 640px; + } + + .form-grid, + .section-grid { + grid-template-columns: 1fr; + } + + .change-drawer { + top: 12px; + right: 12px; + left: 12px; + width: auto; + max-height: calc(100vh - 24px); + } + } +`;function uE({title:e="请求失败",message:t}){return E.jsxs("section",{className:"state-panel",role:"alert",children:[E.jsx("p",{className:"eyebrow",children:"Error"}),E.jsx("h2",{children:e}),E.jsx("p",{children:t})]})}const zs={limit:20,offset:0};function Fa({eyebrow:e,title:t,children:i}){return E.jsxs("header",{className:"page-header",children:[E.jsx("p",{className:"eyebrow",children:e}),E.jsx("h1",{children:t}),i?E.jsx("p",{children:i}):null]})}function pV(){return E.jsx(uE,{title:"Management API unavailable",message:"The persistence store is not available. Enable Moon Bridge persistence to use the console management API."})}function ka({error:e}){if(e instanceof sm&&(e.code==="store_unavailable"||e.status===404))return E.jsx(pV,{});const t=e instanceof Error?e.message:"Unknown request error";return E.jsx(uE,{message:t})}function sl(e){return typeof e=="number"?new Intl.NumberFormat().format(e):"0"}function mV(){const e=nn({queryKey:Xi.changes,queryFn:Sg});return e.error?E.jsx(ka,{error:e.error}):e.isLoading?E.jsx(Ha,{label:"Loading changes"}):E.jsxs("section",{className:"page-stack","aria-labelledby":"changes-title",children:[E.jsx(Fa,{eyebrow:"Review",title:"Changes",children:"Pending staged configuration changes. Apply them to reload runtime state, or discard them before they become active."}),E.jsx("section",{className:"content-panel",children:E.jsx(sE,{changes:e.data??[]})})]})}const xg=Symbol.for("yaml.alias"),om=Symbol.for("yaml.document"),Va=Symbol.for("yaml.map"),cE=Symbol.for("yaml.pair"),ff=Symbol.for("yaml.scalar"),Fs=Symbol.for("yaml.seq"),Kn=Symbol.for("yaml.node.type"),ks=e=>!!e&&typeof e=="object"&&e[Kn]===xg,Vl=e=>!!e&&typeof e=="object"&&e[Kn]===om,$l=e=>!!e&&typeof e=="object"&&e[Kn]===Va,Lt=e=>!!e&&typeof e=="object"&&e[Kn]===cE,yt=e=>!!e&&typeof e=="object"&&e[Kn]===ff,Pl=e=>!!e&&typeof e=="object"&&e[Kn]===Fs;function At(e){if(e&&typeof e=="object")switch(e[Kn]){case Va:case Fs:return!0}return!1}function Mt(e){if(e&&typeof e=="object")switch(e[Kn]){case xg:case Va:case ff:case Fs:return!0}return!1}const fE=e=>(yt(e)||At(e))&&!!e.anchor,hr=Symbol("break visit"),gV=Symbol("skip children"),ol=Symbol("remove node");function qs(e,t){const i=yV(t);Vl(e)?_s(null,e.contents,i,Object.freeze([e]))===ol&&(e.contents=null):_s(null,e,i,Object.freeze([]))}qs.BREAK=hr;qs.SKIP=gV;qs.REMOVE=ol;function _s(e,t,i,r){const o=vV(e,t,i,r);if(Mt(o)||Lt(o))return bV(e,r,o),_s(e,o,i,r);if(typeof o!="symbol"){if(At(t)){r=Object.freeze(r.concat(t));for(let u=0;ue.replace(/[!,[\]{}]/g,t=>SV[t]);class mn{constructor(t,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},mn.defaultYaml,t),this.tags=Object.assign({},mn.defaultTags,i)}clone(){const t=new mn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new mn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:mn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},mn.defaultTags);break}return t}add(t,i){this.atNextDocument&&(this.yaml={explicit:mn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},mn.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),o=r.shift();switch(o){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[u,c]=r;return this.tags[u]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[u]=r;if(u==="1.1"||u==="1.2")return this.yaml.version=u,!0;{const c=/^\d+\.\d+$/.test(u);return i(6,`Unsupported YAML version ${u}`,c),!1}}default:return i(0,`Unknown directive ${o}`,!0),!1}}tagName(t,i){if(t==="!")return"!";if(t[0]!=="!")return i(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const c=t.slice(2,-1);return c==="!"||c==="!!"?(i(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&i("Verbatim tags must end with a >"),c)}const[,r,o]=t.match(/^(.*!)([^!]*)$/s);o||i(`The ${t} tag has no suffix`);const u=this.tags[r];if(u)try{return u+decodeURIComponent(o)}catch(c){return i(String(c)),null}return r==="!"?t:(i(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[i,r]of Object.entries(this.tags))if(t.startsWith(r))return i+xV(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let o;if(t&&r.length>0&&Mt(t.contents)){const u={};qs(t.contents,(c,f)=>{Mt(f)&&f.tag&&(u[f.tag]=!0)}),o=Object.keys(u)}else o=[];for(const[u,c]of r)u==="!!"&&c==="tag:yaml.org,2002:"||(!t||o.some(f=>f.startsWith(c)))&&i.push(`%TAG ${u} ${c}`);return i.join(` +`)}}mn.defaultYaml={explicit:!1,version:"1.2"};mn.defaultTags={"!!":"tag:yaml.org,2002:"};function dE(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(i)}return!0}function hE(e){const t=new Set;return qs(e,{Value(i,r){r.anchor&&t.add(r.anchor)}}),t}function pE(e,t){for(let i=1;;++i){const r=`${e}${i}`;if(!t.has(r))return r}}function wV(e,t){const i=[],r=new Map;let o=null;return{onAnchor:u=>{i.push(u),o??(o=hE(e));const c=pE(t,o);return o.add(c),c},setAnchors:()=>{for(const u of i){const c=r.get(u);if(typeof c=="object"&&c.anchor&&(yt(c.node)||At(c.node)))c.node.anchor=c.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=u,f}}},sourceObjects:r}}function Ts(e,t,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let o=0,u=r.length;oGn(r,String(o),i));if(e&&typeof e.toJSON=="function"){if(!i||!fE(e))return e.toJSON(t,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=u=>{r.res=u,delete i.onCreate};const o=e.toJSON(t,i);return i.onCreate&&i.onCreate(o),o}return typeof e=="bigint"&&!i?.keep?Number(e):e}class wg{constructor(t){Object.defineProperty(this,Kn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:u}={}){if(!Vl(t))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:t,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},f=Gn(this,"",c);if(typeof o=="function")for(const{count:h,res:m}of c.anchors.values())o(m,h);return typeof u=="function"?Ts(u,{"":f},"",f):f}}class mE extends wg{constructor(t){super(xg),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,i){if(i?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],qs(t,{Node:(u,c)=>{(ks(c)||fE(c))&&r.push(c)}}),i&&(i.aliasResolveCache=r));let o;for(const u of r){if(u===this)break;u.anchor===this.source&&(o=u)}return o}toJSON(t,i){if(!i)return{source:this.source};const{anchors:r,doc:o,maxAliasCount:u}=i,c=this.resolve(o,i);if(!c){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let f=r.get(c);if(f||(Gn(c,null,i),f=r.get(c)),f?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(u>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=jc(o,c,r)),f.count*f.aliasCount>u)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return f.res}toString(t,i,r){const o=`*${this.source}`;if(t){if(dE(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(u)}if(t.implicitKey)return`${o} `}return o}}function jc(e,t,i){if(ks(t)){const r=t.resolve(e),o=i&&r&&i.get(r);return o?o.count*o.aliasCount:0}else if(At(t)){let r=0;for(const o of t.items){const u=jc(e,o,i);u>r&&(r=u)}return r}else if(Lt(t)){const r=jc(e,t.key,i),o=jc(e,t.value,i);return Math.max(r,o)}return 1}const gE=e=>!e||typeof e!="function"&&typeof e!="object";class Fe extends wg{constructor(t){super(ff),this.value=t}toJSON(t,i){return i?.keep?this.value:Gn(this.value,t,i)}toString(){return String(this.value)}}Fe.BLOCK_FOLDED="BLOCK_FOLDED";Fe.BLOCK_LITERAL="BLOCK_LITERAL";Fe.PLAIN="PLAIN";Fe.QUOTE_DOUBLE="QUOTE_DOUBLE";Fe.QUOTE_SINGLE="QUOTE_SINGLE";const CV="tag:yaml.org,2002:";function EV(e,t,i){if(t){const r=i.filter(u=>u.tag===t),o=r.find(u=>!u.format)??r[0];if(!o)throw new Error(`Tag ${t} not found`);return o}return i.find(r=>r.identify?.(e)&&!r.format)}function Cl(e,t,i){if(Vl(e)&&(e=e.contents),Mt(e))return e;if(Lt(e)){const y=i.schema[Va].createNode?.(i.schema,null,i);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:o,onTagObj:u,schema:c,sourceObjects:f}=i;let h;if(r&&e&&typeof e=="object"){if(h=f.get(e),h)return h.anchor??(h.anchor=o(e)),new mE(h.anchor);h={anchor:null,node:null},f.set(e,h)}t?.startsWith("!!")&&(t=CV+t.slice(2));let m=EV(e,t,c.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Fe(e);return h&&(h.node=y),y}m=e instanceof Map?c[Va]:Symbol.iterator in Object(e)?c[Fs]:c[Va]}u&&(u(m),delete i.onTagObj);const g=m?.createNode?m.createNode(i.schema,e,i):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(i.schema,e,i):new Fe(e);return t?g.tag=t:m.default||(g.tag=m.tag),h&&(h.node=g),g}function Zc(e,t,i){let r=i;for(let o=t.length-1;o>=0;--o){const u=t[o];if(typeof u=="number"&&Number.isInteger(u)&&u>=0){const c=[];c[u]=r,r=c}else r=new Map([[u,r]])}return Cl(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Wo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class yE extends wg{constructor(t,i){super(t),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(t){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(i.schema=t),i.items=i.items.map(r=>Mt(r)||Lt(r)?r.clone(t):r),this.range&&(i.range=this.range.slice()),i}addIn(t,i){if(Wo(t))this.add(i);else{const[r,...o]=t,u=this.get(r,!0);if(At(u))u.addIn(o,i);else if(u===void 0&&this.schema)this.set(r,Zc(this.schema,o,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${o}`)}}deleteIn(t){const[i,...r]=t;if(r.length===0)return this.delete(i);const o=this.get(i,!0);if(At(o))return o.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(t,i){const[r,...o]=t,u=this.get(r,!0);return o.length===0?!i&&yt(u)?u.value:u:At(u)?u.getIn(o,i):void 0}hasAllNullValues(t){return this.items.every(i=>{if(!Lt(i))return!1;const r=i.value;return r==null||t&&yt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[i,...r]=t;if(r.length===0)return this.has(i);const o=this.get(i,!0);return At(o)?o.hasIn(r):!1}setIn(t,i){const[r,...o]=t;if(o.length===0)this.set(r,i);else{const u=this.get(r,!0);if(At(u))u.setIn(o,i);else if(u===void 0&&this.schema)this.set(r,Zc(this.schema,o,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${o}`)}}}const RV=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Zi(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const br=(e,t,i)=>e.endsWith(` +`)?Zi(i,t):i.includes(` +`)?` +`+Zi(i,t):(e.endsWith(" ")?"":" ")+i,vE="flow",lm="block",Nc="quoted";function df(e,t,i="flow",{indentAtStart:r,lineWidth:o=80,minContentWidth:u=20,onFold:c,onOverflow:f}={}){if(!o||o<0)return e;oo-Math.max(2,u)?m.push(0):y=o-r);let b,S,x=!1,C=-1,R=-1,A=-1;i===lm&&(C=nw(e,C,t.length),C!==-1&&(y=C+h));for(let L;L=e[C+=1];){if(i===Nc&&L==="\\"){switch(R=C,e[C+1]){case"x":C+=3;break;case"u":C+=5;break;case"U":C+=9;break;default:C+=1}A=C}if(L===` +`)i===lm&&(C=nw(e,C,t.length)),y=C+t.length+h,b=void 0;else{if(L===" "&&S&&S!==" "&&S!==` +`&&S!==" "){const V=e[C+1];V&&V!==" "&&V!==` +`&&V!==" "&&(b=C)}if(C>=y)if(b)m.push(b),y=b+h,b=void 0;else if(i===Nc){for(;S===" "||S===" ";)S=L,L=e[C+=1],x=!0;const V=C>A+1?C-2:R-1;if(g[V])return e;m.push(V),g[V]=!0,y=V+h,b=void 0}else x=!0}S=L}if(x&&f&&f(),m.length===0)return e;c&&c();let j=e.slice(0,m[0]);for(let L=0;L({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),pf=e=>/^(%|---|\.\.\.)/m.test(e);function _V(e,t,i){if(!t||t<0)return!1;const r=t-i,o=e.length;if(o<=r)return!1;for(let u=0,c=0;ur)return!0;if(c=u+1,o-c<=r)return!1}return!0}function ll(e,t){const i=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=t,o=t.options.doubleQuotedMinMultiLineLength,u=t.indent||(pf(e)?" ":"");let c="",f=0;for(let h=0,m=i[h];m;m=i[++h])if(m===" "&&i[h+1]==="\\"&&i[h+2]==="n"&&(c+=i.slice(f,h)+"\\ ",h+=1,f=h,m="\\"),m==="\\")switch(i[h+1]){case"u":{c+=i.slice(f,h);const g=i.substr(h+2,4);switch(g){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:g.substr(0,2)==="00"?c+="\\x"+g.substr(2):c+=i.substr(h,6)}h+=5,f=h+1}break;case"n":if(r||i[h+2]==='"'||i.length +`;let y,b;for(b=i.length;b>0;--b){const q=i[b-1];if(q!==` +`&&q!==" "&&q!==" ")break}let S=i.substring(b);const x=S.indexOf(` +`);x===-1?y="-":i===S||x!==S.length-1?(y="+",u&&u()):y="",S&&(i=i.slice(0,-S.length),S[S.length-1]===` +`&&(S=S.slice(0,-1)),S=S.replace(cm,`$&${m}`));let C=!1,R,A=-1;for(R=0;R{W=!0});const T=df(`${j}${q}${S}`,m,lm,K);if(!W)return`>${V} +${m}${T}`}return i=i.replace(/\n+/g,`$&${m}`),`|${V} +${m}${j}${i}${S}`}function TV(e,t,i,r){const{type:o,value:u}=e,{actualString:c,implicitKey:f,indent:h,indentStep:m,inFlow:g}=t;if(f&&u.includes(` +`)||g&&/[[\]{},]/.test(u))return As(u,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(u))return f||g||!u.includes(` +`)?As(u,t):Lc(e,t,i,r);if(!f&&!g&&o!==Fe.PLAIN&&u.includes(` +`))return Lc(e,t,i,r);if(pf(u)){if(h==="")return t.forceBlockIndent=!0,Lc(e,t,i,r);if(f&&h===m)return As(u,t)}const y=u.replace(/\n+/g,`$& +${h}`);if(c){const b=C=>C.default&&C.tag!=="tag:yaml.org,2002:str"&&C.test?.test(y),{compat:S,tags:x}=t.doc.schema;if(x.some(b)||S?.some(b))return As(u,t)}return f?y:df(y,h,vE,hf(t,!1))}function Cg(e,t,i,r){const{implicitKey:o,inFlow:u}=t,c=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Fe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(f=Fe.QUOTE_DOUBLE);const h=g=>{switch(g){case Fe.BLOCK_FOLDED:case Fe.BLOCK_LITERAL:return o||u?As(c.value,t):Lc(c,t,i,r);case Fe.QUOTE_DOUBLE:return ll(c.value,t);case Fe.QUOTE_SINGLE:return um(c.value,t);case Fe.PLAIN:return TV(c,t,i,r);default:return null}};let m=h(f);if(m===null){const{defaultKeyType:g,defaultStringType:y}=t.options,b=o&&g||y;if(m=h(b),m===null)throw new Error(`Unsupported default string type ${b}`)}return m}function bE(e,t){const i=Object.assign({blockQuote:!0,commentString:RV,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function AV(e,t){if(t.tag){const o=e.filter(u=>u.tag===t.tag);if(o.length>0)return o.find(u=>u.format===t.format)??o[0]}let i,r;if(yt(t)){r=t.value;let o=e.filter(u=>u.identify?.(r));if(o.length>1){const u=o.filter(c=>c.test);u.length>0&&(o=u)}i=o.find(u=>u.format===t.format)??o.find(u=>!u.format)}else r=t,i=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!i){const o=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return i}function MV(e,t,{anchors:i,doc:r}){if(!r.directives)return"";const o=[],u=(yt(e)||At(e))&&e.anchor;u&&dE(u)&&(i.add(u),o.push(`&${u}`));const c=e.tag??(t.default?null:t.tag);return c&&o.push(r.directives.tagString(c)),o.join(" ")}function Vs(e,t,i,r){if(Lt(e))return e.toString(t,i,r);if(ks(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o;const u=Mt(e)?e:t.doc.createNode(e,{onTagObj:h=>o=h});o??(o=AV(t.doc.schema.tags,u));const c=MV(u,o,t);c.length>0&&(t.indentAtStart=(t.indentAtStart??0)+c.length+1);const f=typeof o.stringify=="function"?o.stringify(u,t,i,r):yt(u)?Cg(u,t,i,r):u.toString(t,i,r);return c?yt(u)||f[0]==="{"||f[0]==="["?`${c} ${f}`:`${c} +${t.indent}${f}`:f}function OV({key:e,value:t},i,r,o){const{allNullValues:u,doc:c,indent:f,indentStep:h,options:{commentString:m,indentSeq:g,simpleKeys:y}}=i;let b=Mt(e)&&e.comment||null;if(y){if(b)throw new Error("With simple keys, key nodes cannot have comments");if(At(e)||!Mt(e)&&typeof e=="object"){const K="With simple keys, collection cannot be used as a key value";throw new Error(K)}}let S=!y&&(!e||b&&t==null&&!i.inFlow||At(e)||(yt(e)?e.type===Fe.BLOCK_FOLDED||e.type===Fe.BLOCK_LITERAL:typeof e=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!S&&(y||!u),indent:f+h});let x=!1,C=!1,R=Vs(e,i,()=>x=!0,()=>C=!0);if(!S&&!i.inFlow&&R.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(i.inFlow){if(u||t==null)return x&&r&&r(),R===""?"?":S?`? ${R}`:R}else if(u&&!y||t==null&&S)return R=`? ${R}`,b&&!x?R+=br(R,i.indent,m(b)):C&&o&&o(),R;x&&(b=null),S?(b&&(R+=br(R,i.indent,m(b))),R=`? ${R} +${f}:`):(R=`${R}:`,b&&(R+=br(R,i.indent,m(b))));let A,j,L;Mt(t)?(A=!!t.spaceBefore,j=t.commentBefore,L=t.comment):(A=!1,j=null,L=null,t&&typeof t=="object"&&(t=c.createNode(t))),i.implicitKey=!1,!S&&!b&&yt(t)&&(i.indentAtStart=R.length+1),C=!1,!g&&h.length>=2&&!i.inFlow&&!S&&Pl(t)&&!t.flow&&!t.tag&&!t.anchor&&(i.indent=i.indent.substring(2));let V=!1;const q=Vs(t,i,()=>V=!0,()=>C=!0);let W=" ";if(b||A||j){if(W=A?` +`:"",j){const K=m(j);W+=` +${Zi(K,i.indent)}`}q===""&&!i.inFlow?W===` +`&&L&&(W=` + +`):W+=` +${i.indent}`}else if(!S&&At(t)){const K=q[0],T=q.indexOf(` +`),ne=T!==-1,ee=i.inFlow??t.flow??t.items.length===0;if(ne||!ee){let he=!1;if(ne&&(K==="&"||K==="!")){let ae=q.indexOf(" ");K==="&"&&ae!==-1&&aee===fc||typeof e=="symbol"&&e.description===fc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Fe(Symbol(fc)),{addToJSMap:SE}),stringify:()=>fc},jV=(e,t)=>(Wi.identify(t)||yt(t)&&(!t.type||t.type===Fe.PLAIN)&&Wi.identify(t.value))&&e?.doc.schema.tags.some(i=>i.tag===Wi.tag&&i.default);function SE(e,t,i){const r=xE(e,i);if(Pl(r))for(const o of r.items)up(e,t,o);else if(Array.isArray(r))for(const o of r)up(e,t,o);else up(e,t,r)}function up(e,t,i){const r=xE(e,i);if(!$l(r))throw new Error("Merge sources must be maps or map aliases");const o=r.toJSON(null,e,Map);for(const[u,c]of o)t instanceof Map?t.has(u)||t.set(u,c):t instanceof Set?t.add(u):Object.prototype.hasOwnProperty.call(t,u)||Object.defineProperty(t,u,{value:c,writable:!0,enumerable:!0,configurable:!0});return t}function xE(e,t){return e&&ks(t)?t.resolve(e.doc,e):t}function wE(e,t,{key:i,value:r}){if(Mt(i)&&i.addToJSMap)i.addToJSMap(e,t,r);else if(jV(e,i))SE(e,t,r);else{const o=Gn(i,"",e);if(t instanceof Map)t.set(o,Gn(r,o,e));else if(t instanceof Set)t.add(o);else{const u=NV(i,o,e),c=Gn(r,u,e);u in t?Object.defineProperty(t,u,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[u]=c}}return t}function NV(e,t,i){if(t===null)return"";if(typeof t!="object")return String(t);if(Mt(e)&&i?.doc){const r=bE(i.doc,{});r.anchors=new Set;for(const u of i.anchors.keys())r.anchors.add(u.anchor);r.inFlow=!0,r.inStringifyKey=!0;const o=e.toString(r);if(!i.mapKeyWarned){let u=JSON.stringify(o);u.length>40&&(u=u.substring(0,36)+'..."'),DV(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${u}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return o}return JSON.stringify(t)}function Eg(e,t,i){const r=Cl(e,void 0,i),o=Cl(t,void 0,i);return new In(r,o)}class In{constructor(t,i=null){Object.defineProperty(this,Kn,{value:cE}),this.key=t,this.value=i}clone(t){let{key:i,value:r}=this;return Mt(i)&&(i=i.clone(t)),Mt(r)&&(r=r.clone(t)),new In(i,r)}toJSON(t,i){const r=i?.mapAsMap?new Map:{};return wE(i,r,this)}toString(t,i,r){return t?.doc?OV(this,t,i,r):JSON.stringify(this)}}function CE(e,t,i){return(t.inFlow??e.flow?zV:LV)(e,t,i)}function LV({comment:e,items:t},i,{blockItemPrefix:r,flowChars:o,itemIndent:u,onChompKeep:c,onComment:f}){const{indent:h,options:{commentString:m}}=i,g=Object.assign({},i,{indent:u,type:null});let y=!1;const b=[];for(let x=0;xR=null,()=>y=!0);R&&(A+=br(A,u,m(R))),y&&R&&(y=!1),b.push(r+A)}let S;if(b.length===0)S=o.start+o.end;else{S=b[0];for(let x=1;xR=null);m||(m=y.length>g||A.includes(` +`)),x0&&(m||(m=y.reduce((j,L)=>j+L.length+2,2)+(A.length+2)>t.options.lineWidth)),m&&(A+=",")),R&&(A+=br(A,r,f(R))),y.push(A),g=y.length}const{start:b,end:S}=i;if(y.length===0)return b+S;if(!m){const x=y.reduce((C,R)=>C+R.length+2,2);m=t.options.lineWidth>0&&x>t.options.lineWidth}if(m){let x=b;for(const C of y)x+=C?` +${u}${o}${C}`:` +`;return`${x} +${o}${S}`}else return`${b}${c}${y.join(" ")}${c}${S}`}function Jc({indent:e,options:{commentString:t}},i,r,o){if(r&&o&&(r=r.replace(/^\n+/,"")),r){const u=Zi(t(r),e);i.push(u.trimStart())}}function Sr(e,t){const i=yt(t)?t.value:t;for(const r of e)if(Lt(r)&&(r.key===t||r.key===i||yt(r.key)&&r.key.value===i))return r}class Da extends yE{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Va,t),this.items=[]}static from(t,i,r){const{keepUndefined:o,replacer:u}=r,c=new this(t),f=(h,m)=>{if(typeof u=="function")m=u.call(i,h,m);else if(Array.isArray(u)&&!u.includes(h))return;(m!==void 0||o)&&c.items.push(Eg(h,m,r))};if(i instanceof Map)for(const[h,m]of i)f(h,m);else if(i&&typeof i=="object")for(const h of Object.keys(i))f(h,i[h]);return typeof t.sortMapEntries=="function"&&c.items.sort(t.sortMapEntries),c}add(t,i){let r;Lt(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new In(t,t?.value):r=new In(t.key,t.value);const o=Sr(this.items,r.key),u=this.schema?.sortMapEntries;if(o){if(!i)throw new Error(`Key ${r.key} already set`);yt(o.value)&&gE(r.value)?o.value.value=r.value:o.value=r.value}else if(u){const c=this.items.findIndex(f=>u(r,f)<0);c===-1?this.items.push(r):this.items.splice(c,0,r)}else this.items.push(r)}delete(t){const i=Sr(this.items,t);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(t,i){const o=Sr(this.items,t)?.value;return(!i&&yt(o)?o.value:o)??void 0}has(t){return!!Sr(this.items,t)}set(t,i){this.add(new In(t,i),!0)}toJSON(t,i,r){const o=r?new r:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(o);for(const u of this.items)wE(i,o,u);return o}toString(t,i,r){if(!t)return JSON.stringify(this);for(const o of this.items)if(!Lt(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),CE(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:i})}}const Gs={collection:"map",default:!0,nodeClass:Da,tag:"tag:yaml.org,2002:map",resolve(e,t){return $l(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,i)=>Da.from(e,t,i)};class Wc extends yE{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Fs,t),this.items=[]}add(t){this.items.push(t)}delete(t){const i=dc(t);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(t,i){const r=dc(t);if(typeof r!="number")return;const o=this.items[r];return!i&&yt(o)?o.value:o}has(t){const i=dc(t);return typeof i=="number"&&i=0?t:null}const Is={collection:"seq",default:!0,nodeClass:Wc,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Pl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,i)=>Wc.from(e,t,i)},mf={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,i,r){return t=Object.assign({actualString:!0},t),Cg(e,t,i,r)}},gf={identify:e=>e==null,createNode:()=>new Fe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Fe(null),stringify:({source:e},t)=>typeof e=="string"&&gf.test.test(e)?e:t.options.nullStr},Rg={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Fe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},i){if(e&&Rg.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?i.options.trueStr:i.options.falseStr}};function ui({format:e,minFractionDigits:t,tag:i,value:r}){if(typeof r=="bigint")return String(r);const o=typeof r=="number"?r:Number(r);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let u=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!i||i==="tag:yaml.org,2002:float")&&/^-?\d/.test(u)&&!u.includes("e")){let c=u.indexOf(".");c<0&&(c=u.length,u+=".");let f=t-(u.length-c-1);for(;f-- >0;)u+="0"}return u}const EE={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ui},RE={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ui(e)}},_E={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Fe(parseFloat(e)),i=e.indexOf(".");return i!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-i-1),t},stringify:ui},yf=e=>typeof e=="bigint"||Number.isInteger(e),_g=(e,t,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),i);function TE(e,t,i){const{value:r}=e;return yf(r)&&r>=0?i+r.toString(t):ui(e)}const AE={identify:e=>yf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,i)=>_g(e,2,8,i),stringify:e=>TE(e,8,"0o")},ME={identify:yf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,i)=>_g(e,0,10,i),stringify:ui},OE={identify:e=>yf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,i)=>_g(e,2,16,i),stringify:e=>TE(e,16,"0x")},VV=[Gs,Is,mf,gf,Rg,AE,ME,OE,EE,RE,_E];function iw(e){return typeof e=="bigint"||Number.isInteger(e)}const hc=({value:e})=>JSON.stringify(e),$V=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:hc},{identify:e=>e==null,createNode:()=>new Fe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:hc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:hc},{identify:iw,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:i})=>i?BigInt(e):parseInt(e,10),stringify:({value:e})=>iw(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:hc}],PV={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},UV=[Gs,Is].concat($V,PV),Tg={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const i=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let o=0;o1&&t("Each pair must have its own sequence indicator");const o=r.items[0]||new In(new Fe(null));if(r.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${r.commentBefore} +${o.key.commentBefore}`:r.commentBefore),r.comment){const u=o.value??o.key;u.comment=u.comment?`${r.comment} +${u.comment}`:r.comment}r=o}e.items[i]=Lt(r)?r:new In(r)}}else t("Expected a sequence for this tag");return e}function jE(e,t,i){const{replacer:r}=i,o=new Wc(e);o.tag="tag:yaml.org,2002:pairs";let u=0;if(t&&Symbol.iterator in Object(t))for(let c of t){typeof r=="function"&&(c=r.call(t,String(u++),c));let f,h;if(Array.isArray(c))if(c.length===2)f=c[0],h=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){const m=Object.keys(c);if(m.length===1)f=m[0],h=c[f];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else f=c;o.items.push(Eg(f,h,i))}return o}const Ag={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:DE,createNode:jE};class Os extends Wc{constructor(){super(),this.add=Da.prototype.add.bind(this),this.delete=Da.prototype.delete.bind(this),this.get=Da.prototype.get.bind(this),this.has=Da.prototype.has.bind(this),this.set=Da.prototype.set.bind(this),this.tag=Os.tag}toJSON(t,i){if(!i)return super.toJSON(t);const r=new Map;i?.onCreate&&i.onCreate(r);for(const o of this.items){let u,c;if(Lt(o)?(u=Gn(o.key,"",i),c=Gn(o.value,u,i)):u=Gn(o,"",i),r.has(u))throw new Error("Ordered maps must not include duplicate keys");r.set(u,c)}return r}static from(t,i,r){const o=jE(t,i,r),u=new this;return u.items=o.items,u}}Os.tag="tag:yaml.org,2002:omap";const Mg={collection:"seq",identify:e=>e instanceof Map,nodeClass:Os,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const i=DE(e,t),r=[];for(const{key:o}of i.items)yt(o)&&(r.includes(o.value)?t(`Ordered maps must not include duplicate keys: ${o.value}`):r.push(o.value));return Object.assign(new Os,i)},createNode:(e,t,i)=>Os.from(e,t,i)};function NE({value:e,source:t},i){return t&&(e?LE:zE).test.test(t)?t:e?i.options.trueStr:i.options.falseStr}const LE={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Fe(!0),stringify:NE},zE={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Fe(!1),stringify:NE},BV={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ui},HV={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ui(e)}},FV={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Fe(parseFloat(e.replace(/_/g,""))),i=e.indexOf(".");if(i!==-1){const r=e.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ui},Ul=e=>typeof e=="bigint"||Number.isInteger(e);function vf(e,t,i,{intAsBigInt:r}){const o=e[0];if((o==="-"||o==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(i){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const c=BigInt(e);return o==="-"?BigInt(-1)*c:c}const u=parseInt(e,i);return o==="-"?-1*u:u}function Og(e,t,i){const{value:r}=e;if(Ul(r)){const o=r.toString(t);return r<0?"-"+i+o.substr(1):i+o}return ui(e)}const kV={identify:Ul,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,i)=>vf(e,2,2,i),stringify:e=>Og(e,2,"0b")},qV={identify:Ul,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,i)=>vf(e,1,8,i),stringify:e=>Og(e,8,"0")},GV={identify:Ul,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,i)=>vf(e,0,10,i),stringify:ui},IV={identify:Ul,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,i)=>vf(e,2,16,i),stringify:e=>Og(e,16,"0x")};class Ds extends Da{constructor(t){super(t),this.tag=Ds.tag}add(t){let i;Lt(t)?i=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?i=new In(t.key,null):i=new In(t,null),Sr(this.items,i.key)||this.items.push(i)}get(t,i){const r=Sr(this.items,t);return!i&&Lt(r)?yt(r.key)?r.key.value:r.key:r}set(t,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const r=Sr(this.items,t);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new In(t))}toJSON(t,i){return super.toJSON(t,i,Set)}toString(t,i,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(t,i,r){const{replacer:o}=r,u=new this(t);if(i&&Symbol.iterator in Object(i))for(let c of i)typeof o=="function"&&(c=o.call(i,c,c)),u.items.push(Eg(c,null,r));return u}}Ds.tag="tag:yaml.org,2002:set";const Dg={collection:"map",identify:e=>e instanceof Set,nodeClass:Ds,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,i)=>Ds.from(e,t,i),resolve(e,t){if($l(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ds,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function jg(e,t){const i=e[0],r=i==="-"||i==="+"?e.substring(1):e,o=c=>t?BigInt(c):Number(c),u=r.replace(/_/g,"").split(":").reduce((c,f)=>c*o(60)+o(f),o(0));return i==="-"?o(-1)*u:u}function VE(e){let{value:t}=e,i=c=>c;if(typeof t=="bigint")i=c=>BigInt(c);else if(isNaN(t)||!isFinite(t))return ui(e);let r="";t<0&&(r="-",t*=i(-1));const o=i(60),u=[t%o];return t<60?u.unshift(0):(t=(t-u[0])/o,u.unshift(t%o),t>=60&&(t=(t-u[0])/o,u.unshift(t))),r+u.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const $E={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:i})=>jg(e,i),stringify:VE},PE={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>jg(e,!1),stringify:VE},bf={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(bf.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,o,u,c,f]=t.map(Number),h=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(i,r-1,o,u||0,c||0,f||0,h);const g=t[8];if(g&&g!=="Z"){let y=jg(g,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},aw=[Gs,Is,mf,gf,LE,zE,kV,qV,GV,IV,BV,HV,FV,Tg,Wi,Mg,Ag,Dg,$E,PE,bf],rw=new Map([["core",VV],["failsafe",[Gs,Is,mf]],["json",UV],["yaml11",aw],["yaml-1.1",aw]]),sw={binary:Tg,bool:Rg,float:_E,floatExp:RE,floatNaN:EE,floatTime:PE,int:ME,intHex:OE,intOct:AE,intTime:$E,map:Gs,merge:Wi,null:gf,omap:Mg,pairs:Ag,seq:Is,set:Dg,timestamp:bf},YV={"tag:yaml.org,2002:binary":Tg,"tag:yaml.org,2002:merge":Wi,"tag:yaml.org,2002:omap":Mg,"tag:yaml.org,2002:pairs":Ag,"tag:yaml.org,2002:set":Dg,"tag:yaml.org,2002:timestamp":bf};function cp(e,t,i){const r=rw.get(t);if(r&&!e)return i&&!r.includes(Wi)?r.concat(Wi):r.slice();let o=r;if(!o)if(Array.isArray(e))o=[];else{const u=Array.from(rw.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${u} or define customTags array`)}if(Array.isArray(e))for(const u of e)o=o.concat(u);else typeof e=="function"&&(o=e(o.slice()));return i&&(o=o.concat(Wi)),o.reduce((u,c)=>{const f=typeof c=="string"?sw[c]:c;if(!f){const h=JSON.stringify(c),m=Object.keys(sw).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${m}`)}return u.includes(f)||u.push(f),u},[])}const KV=(e,t)=>e.keyt.key?1:0;class Ng{constructor({compat:t,customTags:i,merge:r,resolveKnownTags:o,schema:u,sortMapEntries:c,toStringDefaults:f}){this.compat=Array.isArray(t)?cp(t,"compat"):t?cp(null,t):null,this.name=typeof u=="string"&&u||"core",this.knownTags=o?YV:{},this.tags=cp(i,this.name,r),this.toStringOptions=f??null,Object.defineProperty(this,Va,{value:Gs}),Object.defineProperty(this,ff,{value:mf}),Object.defineProperty(this,Fs,{value:Is}),this.sortMapEntries=typeof c=="function"?c:c===!0?KV:null}clone(){const t=Object.create(Ng.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function QV(e,t){const i=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(i.push(h),r=!0):e.directives.docStart&&(r=!0)}r&&i.push("---");const o=bE(e,t),{commentString:u}=o.options;if(e.commentBefore){i.length!==1&&i.unshift("");const h=u(e.commentBefore);i.unshift(Zi(h,""))}let c=!1,f=null;if(e.contents){if(Mt(e.contents)){if(e.contents.spaceBefore&&r&&i.push(""),e.contents.commentBefore){const g=u(e.contents.commentBefore);i.push(Zi(g,""))}o.forceBlockIndent=!!e.comment,f=e.contents.comment}const h=f?void 0:()=>c=!0;let m=Vs(e.contents,o,()=>f=null,h);f&&(m+=br(m,"",u(f))),(m[0]==="|"||m[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${m}`:i.push(m)}else i.push(Vs(e.contents,o));if(e.directives?.docEnd)if(e.comment){const h=u(e.comment);h.includes(` +`)?(i.push("..."),i.push(Zi(h,""))):i.push(`... ${h}`)}else i.push("...");else{let h=e.comment;h&&c&&(h=h.replace(/^\n+/,"")),h&&((!c||f)&&i[i.length-1]!==""&&i.push(""),i.push(Zi(u(h),"")))}return i.join(` +`)+` +`}let XV=class UE{constructor(t,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Kn,{value:om});let o=null;typeof i=="function"||Array.isArray(i)?o=i:r===void 0&&i&&(r=i,i=void 0);const u=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=u;let{version:c}=u;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new mn({version:c}),this.setSchema(c,r),this.contents=t===void 0?null:this.createNode(t,o,r)}clone(){const t=Object.create(UE.prototype,{[Kn]:{value:om}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Mt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ms(this.contents)&&this.contents.add(t)}addIn(t,i){ms(this.contents)&&this.contents.addIn(t,i)}createAlias(t,i){if(!t.anchor){const r=hE(this);t.anchor=!i||r.has(i)?pE(i||"a",r):i}return new mE(t.anchor)}createNode(t,i,r){let o;if(typeof i=="function")t=i.call({"":t},"",t),o=i;else if(Array.isArray(i)){const R=j=>typeof j=="number"||j instanceof String||j instanceof Number,A=i.filter(R).map(String);A.length>0&&(i=i.concat(A)),o=i}else r===void 0&&i&&(r=i,i=void 0);const{aliasDuplicateObjects:u,anchorPrefix:c,flow:f,keepUndefined:h,onTagObj:m,tag:g}=r??{},{onAnchor:y,setAnchors:b,sourceObjects:S}=wV(this,c||"a"),x={aliasDuplicateObjects:u??!0,keepUndefined:h??!1,onAnchor:y,onTagObj:m,replacer:o,schema:this.schema,sourceObjects:S},C=Cl(t,g,x);return f&&At(C)&&(C.flow=!0),b(),C}createPair(t,i,r={}){const o=this.createNode(t,null,r),u=this.createNode(i,null,r);return new In(o,u)}delete(t){return ms(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Wo(t)?this.contents==null?!1:(this.contents=null,!0):ms(this.contents)?this.contents.deleteIn(t):!1}get(t,i){return At(this.contents)?this.contents.get(t,i):void 0}getIn(t,i){return Wo(t)?!i&&yt(this.contents)?this.contents.value:this.contents:At(this.contents)?this.contents.getIn(t,i):void 0}has(t){return At(this.contents)?this.contents.has(t):!1}hasIn(t){return Wo(t)?this.contents!==void 0:At(this.contents)?this.contents.hasIn(t):!1}set(t,i){this.contents==null?this.contents=Zc(this.schema,[t],i):ms(this.contents)&&this.contents.set(t,i)}setIn(t,i){Wo(t)?this.contents=i:this.contents==null?this.contents=Zc(this.schema,Array.from(t),i):ms(this.contents)&&this.contents.setIn(t,i)}setSchema(t,i={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new mn({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new mn({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const o=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new Ng(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:i,mapAsMap:r,maxAliasCount:o,onAnchor:u,reviver:c}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},h=Gn(this.contents,i??"",f);if(typeof u=="function")for(const{count:m,res:g}of f.anchors.values())u(g,m);return typeof c=="function"?Ts(c,{"":h},"",h):h}toJSON(t,i){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:i})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const i=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return QV(this,t)}};function ms(e){if(At(e))return!0;throw new Error("Expected a YAML collection as document contents")}new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{} +\r `);function ZV(e,t,i){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:i===void 0&&t&&(i=t),typeof i=="string"&&(i=i.length),typeof i=="number"){const o=Math.round(i);i=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){const{keepUndefined:o}=i??t??{};if(!o)return}return Vl(e)&&!r?e.toString(i):new XV(e,r,i).toString(i)}function JV(e){const t=$t({mode:e.mode,server:$t({addr:e.server?.addr||"127.0.0.1:38440",auth_token:e.server?.auth_token}),persistence:$t({active_provider:e.persistence?.active_provider??"db_sqlite"}),defaults:$t(e.defaults??{model:WV(e),max_tokens:4096}),cache:$t(e.cache??{mode:"explicit",ttl:"5m",prompt_caching:!0,automatic_prompt_cache:!1,explicit_cache_breakpoints:!0,allow_retention_downgrade:!1,max_breakpoints:4,min_cache_tokens:1024,expected_reuse:2,minimum_value_score:2048,min_breakpoint_tokens:1024}),web_search:$t(e.web_search),models:pc(e.models,"slug",i=>$t({context_window:i.context_window,max_output_tokens:i.max_output_tokens,display_name:i.display_name,description:i.description})),providers:pc(e.providers,"key",i=>$t({base_url:i.base_url,api_key:i.api_key,version:i.version,user_agent:i.user_agent,protocol:i.protocol,offers:i.offers?.map(r=>$t({model:r.model,upstream_name:r.upstream_name,priority:r.priority,pricing:$t({input_price:r.input_price,output_price:r.output_price,cache_write_price:r.cache_write_price,cache_read_price:r.cache_read_price})}))})),routes:pc(e.routes,"alias",i=>$t({model:i.model,provider:i.provider,display_name:i.display_name,description:i.description,context_window:i.context_window})),extensions:pc(e.extensions,"name",i=>$t({enabled:i.enabled,config:$t(i.config)})),proxy:$t({response:$t(e.proxy?.response),anthropic:$t(e.proxy?.anthropic)})});return ZV(t,{indent:2})}function WV(e){return e.routes?.[0]?.alias??e.models?.[0]?.slug??""}function pc(e,t,i){if(e?.length)return e.reduce((r,o)=>{const u=String(o[t]??"");return u&&(r[u]=i(o)),r},{})}function $t(e){if(!(e==null||e==="")){if(Array.isArray(e)){const t=e.map($t).filter(i=>i!==void 0);return t.length?t:void 0}if(typeof e=="object"){const t=Object.entries(e).flatMap(([i,r])=>{const o=$t(r);return o===void 0?[]:[[i,o]]});return t.length?Object.fromEntries(t):void 0}return e}}function e$({onGenerate:e}){const[t,i]=_.useState({mode:"Transform",addr:"127.0.0.1:38440",auth_token:"",provider_key:"anthropic",base_url:"https://api.anthropic.com",api_key:"replace-with-provider-key",protocol:"anthropic",model_slug:"claude-sonnet",upstream_name:"",route_alias:"moonbridge"});function r(c){c.preventDefault(),e(JV(u()))}function o(c,f){i(h=>({...h,[c]:f}))}function u(){return{mode:t.mode,server:{addr:t.addr,auth_token:t.auth_token},persistence:{active_provider:"db_sqlite"},defaults:{model:t.route_alias,max_tokens:4096},providers:[{key:t.provider_key,base_url:t.base_url,api_key:t.api_key,protocol:t.protocol,offers:[{model:t.model_slug,upstream_name:t.upstream_name}]}],models:[{slug:t.model_slug,display_name:t.model_slug,context_window:128e3,max_output_tokens:4096}],routes:[{alias:t.route_alias,model:t.model_slug,provider:t.provider_key,display_name:t.route_alias}]}}return E.jsxs("form",{className:"form-grid",onSubmit:r,children:[E.jsxs("label",{children:["Mode",E.jsxs("select",{value:t.mode,onChange:c=>o("mode",c.currentTarget.value),children:[E.jsx("option",{value:"Transform",children:"Transform"}),E.jsx("option",{value:"CaptureResponse",children:"CaptureResponse"}),E.jsx("option",{value:"CaptureAnthropic",children:"CaptureAnthropic"})]})]}),E.jsxs("label",{children:["Server Addr",E.jsx("input",{value:t.addr,onChange:c=>o("addr",c.currentTarget.value)})]}),E.jsxs("label",{children:["Auth Token",E.jsx("input",{value:t.auth_token,onChange:c=>o("auth_token",c.currentTarget.value)})]}),E.jsxs("label",{children:["Provider Key",E.jsx("input",{value:t.provider_key,onChange:c=>o("provider_key",c.currentTarget.value)})]}),E.jsxs("label",{className:"form-grid__wide",children:["Base URL",E.jsx("input",{value:t.base_url,onChange:c=>o("base_url",c.currentTarget.value)})]}),E.jsxs("label",{children:["API Key",E.jsx("input",{value:t.api_key,onChange:c=>o("api_key",c.currentTarget.value)})]}),E.jsxs("label",{children:["Protocol",E.jsxs("select",{value:t.protocol,onChange:c=>o("protocol",c.currentTarget.value),children:[E.jsx("option",{value:"anthropic",children:"anthropic"}),E.jsx("option",{value:"openai-response",children:"openai-response"}),E.jsx("option",{value:"google",children:"google"})]})]}),E.jsxs("label",{children:["Model Slug",E.jsx("input",{value:t.model_slug,onChange:c=>o("model_slug",c.currentTarget.value)})]}),E.jsxs("label",{children:["Upstream Name",E.jsx("input",{value:t.upstream_name,onChange:c=>o("upstream_name",c.currentTarget.value)})]}),E.jsxs("label",{children:["Route Alias",E.jsx("input",{value:t.route_alias,onChange:c=>o("route_alias",c.currentTarget.value)})]}),E.jsx("div",{className:"form-actions",children:E.jsx("button",{type:"submit",children:"Generate YAML"})})]})}const t$=`mode: Transform +`;function n$(){const[e,t]=_.useState(t$),[i,r]=_.useState(!1),[o,u]=_.useState(""),[c,f]=_.useState({model:"",max_tokens:"4096",system_prompt:""}),[h,m]=_.useState({support:"auto",max_uses:"4",tavily_api_key:"******",firecrawl_api_key:"******",search_max_rounds:"2"}),g=nn({queryKey:["config","effective"],queryFn:Gz}),y=nn({queryKey:["defaults"],queryFn:Qz}),b=nn({queryKey:["web-search"],queryFn:Zz});_.useEffect(()=>{y.data&&f({model:y.data.model,max_tokens:String(y.data.max_tokens),system_prompt:y.data.system_prompt})},[y.data]),_.useEffect(()=>{b.data&&m({support:b.data.support,max_uses:String(b.data.max_uses),tavily_api_key:"******",firecrawl_api_key:"******",search_max_rounds:String(b.data.search_max_rounds)})},[b.data]);async function S(){const V=await Iz(e);u(V.valid?"Valid config":`Invalid config: ${(V.errors??[]).join("; ")}`)}async function x(){const V=await Yz(e);u(V.message||`${V.count} changes staged`)}async function C(){const V=await Kz({includeSecrets:i});t(V),u(i?"Exported with secrets":"Exported masked config")}async function R(){const V=await Xz({model:c.model,max_tokens:Number(c.max_tokens),system_prompt:c.system_prompt});u(`Staged change #${V.change_id}`)}async function A(){const V=await Jz({support:h.support,max_uses:Number(h.max_uses),tavily_api_key:h.tavily_api_key,firecrawl_api_key:h.firecrawl_api_key,search_max_rounds:Number(h.search_max_rounds)});u(`Staged change #${V.change_id}`)}return E.jsxs("section",{className:"page-stack","aria-labelledby":"config-title",children:[E.jsx(Fa,{eyebrow:"Configuration",title:"Config",children:"Generate, validate, import, export, and stage Moon Bridge YAML configuration."}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Visual Generator"}),E.jsx(e$,{onGenerate:t})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"YAML Preview and Import"}),E.jsxs("label",{className:"textarea-field",children:["YAML Editor",E.jsx("textarea",{value:e,onChange:V=>t(V.currentTarget.value),rows:18})]}),E.jsxs("div",{className:"form-actions",children:[E.jsx("button",{type:"button",onClick:S,children:"Validate"}),E.jsx("button",{type:"button",onClick:x,children:"Import"}),E.jsx("button",{type:"button",className:"secondary-button",onClick:C,children:"Export"}),E.jsxs("label",{className:"checkbox-inline",children:[E.jsx("input",{type:"checkbox",checked:i,onChange:V=>r(V.currentTarget.checked)}),"Include secrets"]}),o?E.jsx("span",{className:"feedback-inline",children:o}):null]})]}),E.jsxs("div",{className:"section-grid",children:[E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Defaults"}),E.jsxs("div",{className:"form-grid",children:[E.jsxs("label",{children:["Default Model",E.jsx("input",{value:c.model,onChange:V=>j("model",V.currentTarget.value)})]}),E.jsxs("label",{children:["Max Tokens",E.jsx("input",{type:"number",value:c.max_tokens,onChange:V=>j("max_tokens",V.currentTarget.value)})]}),E.jsxs("label",{className:"form-grid__wide",children:["System Prompt",E.jsx("textarea",{rows:5,value:c.system_prompt,onChange:V=>j("system_prompt",V.currentTarget.value)})]}),E.jsx("div",{className:"form-actions",children:E.jsx("button",{type:"button",onClick:R,children:"Stage defaults"})})]})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Web Search"}),E.jsxs("div",{className:"form-grid",children:[E.jsxs("label",{children:["Web Search Support",E.jsxs("select",{value:h.support,onChange:V=>L("support",V.currentTarget.value),children:[E.jsx("option",{value:"auto",children:"auto"}),E.jsx("option",{value:"enabled",children:"enabled"}),E.jsx("option",{value:"disabled",children:"disabled"}),E.jsx("option",{value:"injected",children:"injected"})]})]}),E.jsxs("label",{children:["Max Uses",E.jsx("input",{type:"number",value:h.max_uses,onChange:V=>L("max_uses",V.currentTarget.value)})]}),E.jsxs("label",{children:["Tavily API Key",E.jsx("input",{value:h.tavily_api_key,onChange:V=>L("tavily_api_key",V.currentTarget.value)})]}),E.jsxs("label",{children:["Firecrawl API Key",E.jsx("input",{value:h.firecrawl_api_key,onChange:V=>L("firecrawl_api_key",V.currentTarget.value)})]}),E.jsxs("label",{children:["Search Max Rounds",E.jsx("input",{type:"number",value:h.search_max_rounds,onChange:V=>L("search_max_rounds",V.currentTarget.value)})]}),E.jsx("div",{className:"form-actions",children:E.jsx("button",{type:"button",onClick:A,children:"Stage web search"})})]})]})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Effective Config Snapshot"}),g.isLoading?E.jsx(Ha,{label:"Loading effective config"}):g.error?E.jsx(ka,{error:g.error}):E.jsx("pre",{className:"json-block",children:JSON.stringify(g.data??{},null,2)})]})]});function j(V,q){f(W=>({...W,[V]:q}))}function L(V,q){m(W=>({...W,[V]:q}))}}function i$(){const[e,t]=_.useState(""),[i,r]=_.useState("{}"),[o,u]=_.useState(""),c=nn({queryKey:["extensions"],queryFn:Wz}),f=nn({queryKey:["extensions",e],queryFn:()=>ew(e),enabled:!!e});if(c.error)return E.jsx(ka,{error:c.error});if(c.isLoading)return E.jsx(Ha,{label:"Loading extensions"});async function h(g){t(g),u("");const y=await ew(g);r(JSON.stringify(y,null,2))}async function m(){const g=JSON.parse(i),y=await eV(e,g);u(`Staged change #${y.change_id}`)}return E.jsxs("section",{className:"page-stack","aria-labelledby":"extensions-title",children:[E.jsx(Fa,{eyebrow:"Extensions",title:"Extensions",children:"Inspect extension config as JSON and stage safe updates through the management API."}),E.jsxs("div",{className:"section-grid",children:[E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Installed Extensions"}),(c.data?.length??0)>0?E.jsx("div",{className:"button-list",children:c.data?.map(g=>E.jsx("button",{type:"button",className:g===e?"secondary-button active-button":"secondary-button",onClick:()=>{h(g)},children:g},g))}):E.jsx("p",{className:"empty-state",children:"No extensions registered"})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"JSON Editor"}),f.isFetching&&e?E.jsxs("p",{className:"empty-state",children:["Refreshing ",e]}):null,E.jsxs("label",{className:"textarea-field",children:["Extension JSON",E.jsx("textarea",{value:i,onChange:g=>r(g.currentTarget.value),rows:18})]}),E.jsxs("div",{className:"form-actions",children:[E.jsx("button",{type:"button",onClick:m,disabled:!e,children:"Stage extension"}),o?E.jsx("span",{className:"feedback-inline",children:o}):null]})]})]})]})}function a$(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function La(e,t){return typeof e=="function"?e(t):e}function An(e,t){return i=>{t.setState(r=>({...r,[e]:La(i,r[e])}))}}function Sf(e){return e instanceof Function}function r$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function s$(e,t){const i=[],r=o=>{o.forEach(u=>{i.push(u);const c=t(u);c!=null&&c.length&&r(c)})};return r(e),i}function Ce(e,t,i){let r=[],o;return u=>{let c;i.key&&i.debug&&(c=Date.now());const f=e(u);if(!(f.length!==r.length||f.some((g,y)=>r[y]!==g)))return o;r=f;let m;if(i.key&&i.debug&&(m=Date.now()),o=t(...f),i==null||i.onChange==null||i.onChange(o),i.key&&i.debug&&i!=null&&i.debug()){const g=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-m)*100)/100,b=y/16,S=(x,C)=>{for(x=String(x);x.length{var o;return(o=e?.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function o$(e,t,i,r){const o=()=>{var c;return(c=u.getValue())!=null?c:e.options.renderFallbackValue},u={id:`${t.id}_${i.id}`,row:t,column:i,getValue:()=>t.getValue(r),renderValue:o,getContext:Ce(()=>[e,i,t,u],(c,f,h,m)=>({table:c,column:f,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),Ee(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(u,i,t,e)},{}),u}function l$(e,t,i,r){var o,u;const f={...e._getDefaultColumnDef(),...t},h=f.accessorKey;let m=(o=(u=f.id)!=null?u:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?o:typeof f.header=="string"?f.header:void 0,g;if(f.accessorFn?g=f.accessorFn:h&&(h.includes(".")?g=b=>{let S=b;for(const C of h.split(".")){var x;S=(x=S)==null?void 0:x[C]}return S}:g=b=>b[f.accessorKey]),!m)throw new Error;let y={id:`${String(m)}`,accessorFn:g,parent:r,depth:i,columnDef:f,columns:[],getFlatColumns:Ce(()=>[!0],()=>{var b;return[y,...(b=y.columns)==null?void 0:b.flatMap(S=>S.getFlatColumns())]},Ee(e.options,"debugColumns")),getLeafColumns:Ce(()=>[e._getOrderColumnsFn()],b=>{var S;if((S=y.columns)!=null&&S.length){let x=y.columns.flatMap(C=>C.getLeafColumns());return b(x)}return[y]},Ee(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(y,e);return y}const It="debugHeaders";function ow(e,t,i){var r;let u={id:(r=i.id)!=null?r:t.id,column:t,index:i.index,isPlaceholder:!!i.isPlaceholder,placeholderId:i.placeholderId,depth:i.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],f=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(f),c.push(h)};return f(u),c},getContext:()=>({table:e,header:u,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(u,e)}),u}const u$={createTable:e=>{e.getHeaderGroups=Ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,i,r,o)=>{var u,c;const f=(u=r?.map(y=>i.find(b=>b.id===y)).filter(Boolean))!=null?u:[],h=(c=o?.map(y=>i.find(b=>b.id===y)).filter(Boolean))!=null?c:[],m=i.filter(y=>!(r!=null&&r.includes(y.id))&&!(o!=null&&o.includes(y.id)));return mc(t,[...f,...m,...h],e)},Ee(e.options,It)),e.getCenterHeaderGroups=Ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,i,r,o)=>(i=i.filter(u=>!(r!=null&&r.includes(u.id))&&!(o!=null&&o.includes(u.id))),mc(t,i,e,"center")),Ee(e.options,It)),e.getLeftHeaderGroups=Ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,i,r)=>{var o;const u=(o=r?.map(c=>i.find(f=>f.id===c)).filter(Boolean))!=null?o:[];return mc(t,u,e,"left")},Ee(e.options,It)),e.getRightHeaderGroups=Ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,i,r)=>{var o;const u=(o=r?.map(c=>i.find(f=>f.id===c)).filter(Boolean))!=null?o:[];return mc(t,u,e,"right")},Ee(e.options,It)),e.getFooterGroups=Ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ee(e.options,It)),e.getLeftFooterGroups=Ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ee(e.options,It)),e.getCenterFooterGroups=Ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ee(e.options,It)),e.getRightFooterGroups=Ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ee(e.options,It)),e.getFlatHeaders=Ce(()=>[e.getHeaderGroups()],t=>t.map(i=>i.headers).flat(),Ee(e.options,It)),e.getLeftFlatHeaders=Ce(()=>[e.getLeftHeaderGroups()],t=>t.map(i=>i.headers).flat(),Ee(e.options,It)),e.getCenterFlatHeaders=Ce(()=>[e.getCenterHeaderGroups()],t=>t.map(i=>i.headers).flat(),Ee(e.options,It)),e.getRightFlatHeaders=Ce(()=>[e.getRightHeaderGroups()],t=>t.map(i=>i.headers).flat(),Ee(e.options,It)),e.getCenterLeafHeaders=Ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(i=>{var r;return!((r=i.subHeaders)!=null&&r.length)}),Ee(e.options,It)),e.getLeftLeafHeaders=Ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(i=>{var r;return!((r=i.subHeaders)!=null&&r.length)}),Ee(e.options,It)),e.getRightLeafHeaders=Ce(()=>[e.getRightFlatHeaders()],t=>t.filter(i=>{var r;return!((r=i.subHeaders)!=null&&r.length)}),Ee(e.options,It)),e.getLeafHeaders=Ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,i,r)=>{var o,u,c,f,h,m;return[...(o=(u=t[0])==null?void 0:u.headers)!=null?o:[],...(c=(f=i[0])==null?void 0:f.headers)!=null?c:[],...(h=(m=r[0])==null?void 0:m.headers)!=null?h:[]].map(g=>g.getLeafHeaders()).flat()},Ee(e.options,It))}};function mc(e,t,i,r){var o,u;let c=0;const f=function(b,S){S===void 0&&(S=1),c=Math.max(c,S),b.filter(x=>x.getIsVisible()).forEach(x=>{var C;(C=x.columns)!=null&&C.length&&f(x.columns,S+1)},0)};f(e);let h=[];const m=(b,S)=>{const x={depth:S,id:[r,`${S}`].filter(Boolean).join("_"),headers:[]},C=[];b.forEach(R=>{const A=[...C].reverse()[0],j=R.column.depth===x.depth;let L,V=!1;if(j&&R.column.parent?L=R.column.parent:(L=R.column,V=!0),A&&A?.column===L)A.subHeaders.push(R);else{const q=ow(i,L,{id:[r,S,L.id,R?.id].filter(Boolean).join("_"),isPlaceholder:V,placeholderId:V?`${C.filter(W=>W.column===L).length}`:void 0,depth:S,index:C.length});q.subHeaders.push(R),C.push(q)}x.headers.push(R),R.headerGroup=x}),h.push(x),S>0&&m(C,S-1)},g=t.map((b,S)=>ow(i,b,{depth:c,index:S}));m(g,c-1),h.reverse();const y=b=>b.filter(x=>x.column.getIsVisible()).map(x=>{let C=0,R=0,A=[0];x.subHeaders&&x.subHeaders.length?(A=[],y(x.subHeaders).forEach(L=>{let{colSpan:V,rowSpan:q}=L;C+=V,A.push(q)})):C=1;const j=Math.min(...A);return R=R+j,x.colSpan=C,x.rowSpan=R,{colSpan:C,rowSpan:R}});return y((o=(u=h[0])==null?void 0:u.headers)!=null?o:[]),h}const c$=(e,t,i,r,o,u,c)=>{let f={id:t,index:r,original:i,depth:o,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(f._valuesCache.hasOwnProperty(h))return f._valuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return f._valuesCache[h]=m.accessorFn(f.original,r),f._valuesCache[h]},getUniqueValues:h=>{if(f._uniqueValuesCache.hasOwnProperty(h))return f._uniqueValuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(f._uniqueValuesCache[h]=m.columnDef.getUniqueValues(f.original,r),f._uniqueValuesCache[h]):(f._uniqueValuesCache[h]=[f.getValue(h)],f._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=f.getValue(h))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>s$(f.subRows,h=>h.subRows),getParentRow:()=>f.parentId?e.getRow(f.parentId,!0):void 0,getParentRows:()=>{let h=[],m=f;for(;;){const g=m.getParentRow();if(!g)break;h.push(g),m=g}return h.reverse()},getAllCells:Ce(()=>[e.getAllLeafColumns()],h=>h.map(m=>o$(e,f,m,m.id)),Ee(e.options,"debugRows")),_getAllCellsByColumnId:Ce(()=>[f.getAllCells()],h=>h.reduce((m,g)=>(m[g.column.id]=g,m),{}),Ee(e.options,"debugRows"))};for(let h=0;h{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},BE=(e,t,i)=>{var r,o;const u=i==null||(r=i.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(u))};BE.autoRemove=e=>oi(e);const HE=(e,t,i)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(i))};HE.autoRemove=e=>oi(e);const FE=(e,t,i)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===i?.toLowerCase()};FE.autoRemove=e=>oi(e);const kE=(e,t,i)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(i)};kE.autoRemove=e=>oi(e);const qE=(e,t,i)=>!i.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});qE.autoRemove=e=>oi(e)||!(e!=null&&e.length);const GE=(e,t,i)=>i.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});GE.autoRemove=e=>oi(e)||!(e!=null&&e.length);const IE=(e,t,i)=>e.getValue(t)===i;IE.autoRemove=e=>oi(e);const YE=(e,t,i)=>e.getValue(t)==i;YE.autoRemove=e=>oi(e);const Lg=(e,t,i)=>{let[r,o]=i;const u=e.getValue(t);return u>=r&&u<=o};Lg.resolveFilterValue=e=>{let[t,i]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof i!="number"?parseFloat(i):i,u=t===null||Number.isNaN(r)?-1/0:r,c=i===null||Number.isNaN(o)?1/0:o;if(u>c){const f=u;u=c,c=f}return[u,c]};Lg.autoRemove=e=>oi(e)||oi(e[0])&&oi(e[1]);const Qi={includesString:BE,includesStringSensitive:HE,equalsString:FE,arrIncludes:kE,arrIncludesAll:qE,arrIncludesSome:GE,equals:IE,weakEquals:YE,inNumberRange:Lg};function oi(e){return e==null||e===""}const d$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:An("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const i=t.getCoreRowModel().flatRows[0],r=i?.getValue(e.id);return typeof r=="string"?Qi.includesString:typeof r=="number"?Qi.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Qi.equals:Array.isArray(r)?Qi.arrIncludes:Qi.weakEquals},e.getFilterFn=()=>{var i,r;return Sf(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(i=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?i:Qi[e.columnDef.filterFn]},e.getCanFilter=()=>{var i,r,o;return((i=e.columnDef.enableColumnFilter)!=null?i:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var i;return(i=t.getState().columnFilters)==null||(i=i.find(r=>r.id===e.id))==null?void 0:i.value},e.getFilterIndex=()=>{var i,r;return(i=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?i:-1},e.setFilterValue=i=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),u=r?.find(g=>g.id===e.id),c=La(i,u?u.value:void 0);if(lw(o,c,e)){var f;return(f=r?.filter(g=>g.id!==e.id))!=null?f:[]}const h={id:e.id,value:c};if(u){var m;return(m=r?.map(g=>g.id===e.id?h:g))!=null?m:[]}return r!=null&&r.length?[...r,h]:[h]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const i=e.getAllLeafColumns(),r=o=>{var u;return(u=La(t,o))==null?void 0:u.filter(c=>{const f=i.find(h=>h.id===c.id);if(f){const h=f.getFilterFn();if(lw(h,c.value,f))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var i,r;e.setColumnFilters(t?[]:(i=(r=e.initialState)==null?void 0:r.columnFilters)!=null?i:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function lw(e,t,i){return(e&&e.autoRemove?e.autoRemove(t,i):!1)||typeof t>"u"||typeof t=="string"&&!t}const h$=(e,t,i)=>i.reduce((r,o)=>{const u=o.getValue(e);return r+(typeof u=="number"?u:0)},0),p$=(e,t,i)=>{let r;return i.forEach(o=>{const u=o.getValue(e);u!=null&&(r>u||r===void 0&&u>=u)&&(r=u)}),r},m$=(e,t,i)=>{let r;return i.forEach(o=>{const u=o.getValue(e);u!=null&&(r=u)&&(r=u)}),r},g$=(e,t,i)=>{let r,o;return i.forEach(u=>{const c=u.getValue(e);c!=null&&(r===void 0?c>=c&&(r=o=c):(r>c&&(r=c),o{let i=0,r=0;if(t.forEach(o=>{let u=o.getValue(e);u!=null&&(u=+u)>=u&&(++i,r+=u)}),i)return r/i},v$=(e,t)=>{if(!t.length)return;const i=t.map(u=>u.getValue(e));if(!r$(i))return;if(i.length===1)return i[0];const r=Math.floor(i.length/2),o=i.sort((u,c)=>u-c);return i.length%2!==0?o[r]:(o[r-1]+o[r])/2},b$=(e,t)=>Array.from(new Set(t.map(i=>i.getValue(e))).values()),S$=(e,t)=>new Set(t.map(i=>i.getValue(e))).size,x$=(e,t)=>t.length,fp={sum:h$,min:p$,max:m$,extent:g$,mean:y$,median:v$,unique:b$,uniqueCount:S$,count:x$},w$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,i;return(t=(i=e.getValue())==null||i.toString==null?void 0:i.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:An("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(i=>i!=null&&i.includes(e.id)?i.filter(r=>r!==e.id):[...i??[],e.id])},e.getCanGroup=()=>{var i,r;return((i=e.columnDef.enableGrouping)!=null?i:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var i;return(i=t.getState().grouping)==null?void 0:i.includes(e.id)},e.getGroupedIndex=()=>{var i;return(i=t.getState().grouping)==null?void 0:i.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const i=e.getCanGroup();return()=>{i&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const i=t.getCoreRowModel().flatRows[0],r=i?.getValue(e.id);if(typeof r=="number")return fp.sum;if(Object.prototype.toString.call(r)==="[object Date]")return fp.extent},e.getAggregationFn=()=>{var i,r;if(!e)throw new Error;return Sf(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(i=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?i:fp[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var i,r;e.setGrouping(t?[]:(i=(r=e.initialState)==null?void 0:r.grouping)!=null?i:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=i=>{if(e._groupingValuesCache.hasOwnProperty(i))return e._groupingValuesCache[i];const r=t.getColumn(i);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[i]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[i]):e.getValue(i)},e._groupingValuesCache={}},createCell:(e,t,i,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===i.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=i.subRows)!=null&&o.length)}}};function C$(e,t,i){if(!(t!=null&&t.length)||!i)return e;const r=e.filter(u=>!t.includes(u.id));return i==="remove"?r:[...t.map(u=>e.find(c=>c.id===u)).filter(Boolean),...r]}const E$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:An("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ce(i=>[ul(t,i)],i=>i.findIndex(r=>r.id===e.id),Ee(t.options,"debugColumns")),e.getIsFirstColumn=i=>{var r;return((r=ul(t,i)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=i=>{var r;const o=ul(t,i);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var i;e.setColumnOrder(t?[]:(i=e.initialState.columnOrder)!=null?i:[])},e._getOrderColumnsFn=Ce(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,i,r)=>o=>{let u=[];if(!(t!=null&&t.length))u=o;else{const c=[...t],f=[...o];for(;f.length&&c.length;){const h=c.shift(),m=f.findIndex(g=>g.id===h);m>-1&&u.push(f.splice(m,1)[0])}u=[...u,...f]}return C$(u,i,r)},Ee(e.options,"debugTable"))}},dp=()=>({left:[],right:[]}),R$={getInitialState:e=>({columnPinning:dp(),...e}),getDefaultOptions:e=>({onColumnPinningChange:An("columnPinning",e)}),createColumn:(e,t)=>{e.pin=i=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var u,c;if(i==="right"){var f,h;return{left:((f=o?.left)!=null?f:[]).filter(y=>!(r!=null&&r.includes(y))),right:[...((h=o?.right)!=null?h:[]).filter(y=>!(r!=null&&r.includes(y))),...r]}}if(i==="left"){var m,g;return{left:[...((m=o?.left)!=null?m:[]).filter(y=>!(r!=null&&r.includes(y))),...r],right:((g=o?.right)!=null?g:[]).filter(y=>!(r!=null&&r.includes(y)))}}return{left:((u=o?.left)!=null?u:[]).filter(y=>!(r!=null&&r.includes(y))),right:((c=o?.right)!=null?c:[]).filter(y=>!(r!=null&&r.includes(y)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,u,c;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((u=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?u:!0)}),e.getIsPinned=()=>{const i=e.getLeafColumns().map(f=>f.id),{left:r,right:o}=t.getState().columnPinning,u=i.some(f=>r?.includes(f)),c=i.some(f=>o?.includes(f));return u?"left":c?"right":!1},e.getPinnedIndex=()=>{var i,r;const o=e.getIsPinned();return o?(i=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?i:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(i,r,o)=>{const u=[...r??[],...o??[]];return i.filter(c=>!u.includes(c.column.id))},Ee(t.options,"debugRows")),e.getLeftVisibleCells=Ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(i,r)=>(r??[]).map(u=>i.find(c=>c.column.id===u)).filter(Boolean).map(u=>({...u,position:"left"})),Ee(t.options,"debugRows")),e.getRightVisibleCells=Ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(i,r)=>(r??[]).map(u=>i.find(c=>c.column.id===u)).filter(Boolean).map(u=>({...u,position:"right"})),Ee(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var i,r;return e.setColumnPinning(t?dp():(i=(r=e.initialState)==null?void 0:r.columnPinning)!=null?i:dp())},e.getIsSomeColumnsPinned=t=>{var i;const r=e.getState().columnPinning;if(!t){var o,u;return!!((o=r.left)!=null&&o.length||(u=r.right)!=null&&u.length)}return!!((i=r[t])!=null&&i.length)},e.getLeftLeafColumns=Ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,i)=>(i??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Ee(e.options,"debugColumns")),e.getRightLeafColumns=Ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,i)=>(i??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Ee(e.options,"debugColumns")),e.getCenterLeafColumns=Ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,i,r)=>{const o=[...i??[],...r??[]];return t.filter(u=>!o.includes(u.id))},Ee(e.options,"debugColumns"))}};function _$(e){return e||(typeof document<"u"?document:null)}const gc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},hp=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),T$={getDefaultColumnDef:()=>gc,getInitialState:e=>({columnSizing:{},columnSizingInfo:hp(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:An("columnSizing",e),onColumnSizingInfoChange:An("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var i,r,o;const u=t.getState().columnSizing[e.id];return Math.min(Math.max((i=e.columnDef.minSize)!=null?i:gc.minSize,(r=u??e.columnDef.size)!=null?r:gc.size),(o=e.columnDef.maxSize)!=null?o:gc.maxSize)},e.getStart=Ce(i=>[i,ul(t,i),t.getState().columnSizing],(i,r)=>r.slice(0,e.getIndex(i)).reduce((o,u)=>o+u.getSize(),0),Ee(t.options,"debugColumns")),e.getAfter=Ce(i=>[i,ul(t,i),t.getState().columnSizing],(i,r)=>r.slice(e.getIndex(i)+1).reduce((o,u)=>o+u.getSize(),0),Ee(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(i=>{let{[e.id]:r,...o}=i;return o})},e.getCanResize=()=>{var i,r;return((i=e.columnDef.enableResizing)!=null?i:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let i=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var u;i+=(u=o.column.getSize())!=null?u:0}};return r(e),i},e.getStart=()=>{if(e.index>0){const i=e.headerGroup.headers[e.index-1];return i.getStart()+i.getSize()}return 0},e.getResizeHandler=i=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return u=>{if(!r||!o||(u.persist==null||u.persist(),pp(u)&&u.touches&&u.touches.length>1))return;const c=e.getSize(),f=e?e.getLeafHeaders().map(A=>[A.column.id,A.column.getSize()]):[[r.id,r.getSize()]],h=pp(u)?Math.round(u.touches[0].clientX):u.clientX,m={},g=(A,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(L=>{var V,q;const W=t.options.columnResizeDirection==="rtl"?-1:1,K=(j-((V=L?.startOffset)!=null?V:0))*W,T=Math.max(K/((q=L?.startSize)!=null?q:0),-.999999);return L.columnSizingStart.forEach(ne=>{let[ee,he]=ne;m[ee]=Math.round(Math.max(he+he*T,0)*100)/100}),{...L,deltaOffset:K,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||A==="end")&&t.setColumnSizing(L=>({...L,...m})))},y=A=>g("move",A),b=A=>{g("end",A),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},S=_$(i),x={moveHandler:A=>y(A.clientX),upHandler:A=>{S?.removeEventListener("mousemove",x.moveHandler),S?.removeEventListener("mouseup",x.upHandler),b(A.clientX)}},C={moveHandler:A=>(A.cancelable&&(A.preventDefault(),A.stopPropagation()),y(A.touches[0].clientX),!1),upHandler:A=>{var j;S?.removeEventListener("touchmove",C.moveHandler),S?.removeEventListener("touchend",C.upHandler),A.cancelable&&(A.preventDefault(),A.stopPropagation()),b((j=A.touches[0])==null?void 0:j.clientX)}},R=A$()?{passive:!1}:!1;pp(u)?(S?.addEventListener("touchmove",C.moveHandler,R),S?.addEventListener("touchend",C.upHandler,R)):(S?.addEventListener("mousemove",x.moveHandler,R),S?.addEventListener("mouseup",x.upHandler,R)),t.setColumnSizingInfo(A=>({...A,startOffset:h,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:f,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var i;e.setColumnSizing(t?{}:(i=e.initialState.columnSizing)!=null?i:{})},e.resetHeaderSizeInfo=t=>{var i;e.setColumnSizingInfo(t?hp():(i=e.initialState.columnSizingInfo)!=null?i:hp())},e.getTotalSize=()=>{var t,i;return(t=(i=e.getHeaderGroups()[0])==null?void 0:i.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,i;return(t=(i=e.getLeftHeaderGroups()[0])==null?void 0:i.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,i;return(t=(i=e.getCenterHeaderGroups()[0])==null?void 0:i.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,i;return(t=(i=e.getRightHeaderGroups()[0])==null?void 0:i.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let yc=null;function A$(){if(typeof yc=="boolean")return yc;let e=!1;try{const t={get passive(){return e=!0,!1}},i=()=>{};window.addEventListener("test",i,t),window.removeEventListener("test",i)}catch{e=!1}return yc=e,yc}function pp(e){return e.type==="touchstart"}const M$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:An("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=i=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:i??!e.getIsVisible()}))},e.getIsVisible=()=>{var i,r;const o=e.columns;return(i=o.length?o.some(u=>u.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?i:!0},e.getCanHide=()=>{var i,r;return((i=e.columnDef.enableHiding)!=null?i:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>i=>{e.toggleVisibility==null||e.toggleVisibility(i.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ce(()=>[e.getAllCells(),t.getState().columnVisibility],i=>i.filter(r=>r.column.getIsVisible()),Ee(t.options,"debugRows")),e.getVisibleCells=Ce(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(i,r,o)=>[...i,...r,...o],Ee(t.options,"debugRows"))},createTable:e=>{const t=(i,r)=>Ce(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(u=>u.getIsVisible==null?void 0:u.getIsVisible()),Ee(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=i=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(i),e.resetColumnVisibility=i=>{var r;e.setColumnVisibility(i?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=i=>{var r;i=(r=i)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,u)=>({...o,[u.id]:i||!(u.getCanHide!=null&&u.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(i=>!(i.getIsVisible!=null&&i.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(i=>i.getIsVisible==null?void 0:i.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>i=>{var r;e.toggleAllColumnsVisible((r=i.target)==null?void 0:r.checked)}}};function ul(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const O$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},D$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:An("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var i;const r=(i=e.getCoreRowModel().flatRows[0])==null||(i=i._getAllCellsByColumnId()[t.id])==null?void 0:i.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var i,r,o,u;return((i=e.columnDef.enableGlobalFilter)!=null?i:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((u=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?u:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Qi.includesString,e.getGlobalFilterFn=()=>{var t,i;const{globalFilterFn:r}=e.options;return Sf(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(i=e.options.filterFns)==null?void 0:i[r])!=null?t:Qi[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},j$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:An("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,i=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(i)return;i=!0,e._queue(()=>{e.resetExpanded(),i=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,u;e.setExpanded(r?{}:(o=(u=e.initialState)==null?void 0:u.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(u=>{const c=u.split(".");r=Math.max(r,c.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=i=>{t.setExpanded(r=>{var o;const u=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(f=>{c[f]=!0}):c=r,i=(o=i)!=null?o:!u,!u&&i)return{...c,[e.id]:!0};if(u&&!i){const{[e.id]:f,...h}=c;return h}return r})},e.getIsExpanded=()=>{var i;const r=t.getState().expanded;return!!((i=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?i:r===!0||r?.[e.id])},e.getCanExpand=()=>{var i,r,o;return(i=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?i:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let i=!0,r=e;for(;i&&r.parentId;)r=t.getRow(r.parentId,!0),i=r.getIsExpanded();return i},e.getToggleExpandedHandler=()=>{const i=e.getCanExpand();return()=>{i&&e.toggleExpanded()}}}},fm=0,dm=10,mp=()=>({pageIndex:fm,pageSize:dm}),N$={getInitialState:e=>({...e,pagination:{...mp(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:An("pagination",e)}),createTable:e=>{let t=!1,i=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(i)return;i=!0,e._queue(()=>{e.resetPageIndex(),i=!1})}},e.setPagination=r=>{const o=u=>La(r,u);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?mp():(o=e.initialState.pagination)!=null?o:mp())},e.setPageIndex=r=>{e.setPagination(o=>{let u=La(r,o.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return u=Math.max(0,Math.min(u,c)),{...o,pageIndex:u}})},e.resetPageIndex=r=>{var o,u;e.setPageIndex(r?fm:(o=(u=e.initialState)==null||(u=u.pagination)==null?void 0:u.pageIndex)!=null?o:fm)},e.resetPageSize=r=>{var o,u;e.setPageSize(r?dm:(o=(u=e.initialState)==null||(u=u.pagination)==null?void 0:u.pageSize)!=null?o:dm)},e.setPageSize=r=>{e.setPagination(o=>{const u=Math.max(1,La(r,o.pageSize)),c=o.pageSize*o.pageIndex,f=Math.floor(c/u);return{...o,pageIndex:f,pageSize:u}})},e.setPageCount=r=>e.setPagination(o=>{var u;let c=La(r,(u=e.options.pageCount)!=null?u:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...o,pageCount:c}}),e.getPageOptions=Ce(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((u,c)=>c)),o},Ee(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},gp=()=>({top:[],bottom:[]}),L$={getInitialState:e=>({rowPinning:gp(),...e}),getDefaultOptions:e=>({onRowPinningChange:An("rowPinning",e)}),createRow:(e,t)=>{e.pin=(i,r,o)=>{const u=r?e.getLeafRows().map(h=>{let{id:m}=h;return m}):[],c=o?e.getParentRows().map(h=>{let{id:m}=h;return m}):[],f=new Set([...c,e.id,...u]);t.setRowPinning(h=>{var m,g;if(i==="bottom"){var y,b;return{top:((y=h?.top)!=null?y:[]).filter(C=>!(f!=null&&f.has(C))),bottom:[...((b=h?.bottom)!=null?b:[]).filter(C=>!(f!=null&&f.has(C))),...Array.from(f)]}}if(i==="top"){var S,x;return{top:[...((S=h?.top)!=null?S:[]).filter(C=>!(f!=null&&f.has(C))),...Array.from(f)],bottom:((x=h?.bottom)!=null?x:[]).filter(C=>!(f!=null&&f.has(C)))}}return{top:((m=h?.top)!=null?m:[]).filter(C=>!(f!=null&&f.has(C))),bottom:((g=h?.bottom)!=null?g:[]).filter(C=>!(f!=null&&f.has(C)))}})},e.getCanPin=()=>{var i;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(i=r??o)!=null?i:!0},e.getIsPinned=()=>{const i=[e.id],{top:r,bottom:o}=t.getState().rowPinning,u=i.some(f=>r?.includes(f)),c=i.some(f=>o?.includes(f));return u?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var i,r;const o=e.getIsPinned();if(!o)return-1;const u=(i=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:i.map(c=>{let{id:f}=c;return f});return(r=u?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var i,r;return e.setRowPinning(t?gp():(i=(r=e.initialState)==null?void 0:r.rowPinning)!=null?i:gp())},e.getIsSomeRowsPinned=t=>{var i;const r=e.getState().rowPinning;if(!t){var o,u;return!!((o=r.top)!=null&&o.length||(u=r.bottom)!=null&&u.length)}return!!((i=r[t])!=null&&i.length)},e._getPinnedRows=(t,i,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(i??[]).map(c=>{const f=e.getRow(c,!0);return f.getIsAllParentsExpanded()?f:null}):(i??[]).map(c=>t.find(f=>f.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=Ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,i)=>e._getPinnedRows(t,i,"top"),Ee(e.options,"debugRows")),e.getBottomRows=Ce(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,i)=>e._getPinnedRows(t,i,"bottom"),Ee(e.options,"debugRows")),e.getCenterRows=Ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,i,r)=>{const o=new Set([...i??[],...r??[]]);return t.filter(u=>!o.has(u.id))},Ee(e.options,"debugRows"))}},z$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:An("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var i;return e.setRowSelection(t?{}:(i=e.initialState.rowSelection)!=null?i:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(i=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...i},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(u=>{u.getCanSelect()&&(r[u.id]=!0)}):o.forEach(u=>{delete r[u.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(i=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...i};return e.getRowModel().rows.forEach(u=>{hm(o,u.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,i)=>Object.keys(t).length?yp(e,i):{rows:[],flatRows:[],rowsById:{}},Ee(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,i)=>Object.keys(t).length?yp(e,i):{rows:[],flatRows:[],rowsById:{}},Ee(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,i)=>Object.keys(t).length?yp(e,i):{rows:[],flatRows:[],rowsById:{}},Ee(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:i}=e.getState();let r=!!(t.length&&Object.keys(i).length);return r&&t.some(o=>o.getCanSelect()&&!i[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:i}=e.getState();let r=!!t.length;return r&&t.some(o=>!i[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const i=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return i>0&&i{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(i=>i.getCanSelect()).some(i=>i.getIsSelected()||i.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(i,r)=>{const o=e.getIsSelected();t.setRowSelection(u=>{var c;if(i=typeof i<"u"?i:!o,e.getCanSelect()&&o===i)return u;const f={...u};return hm(f,e.id,i,(c=r?.selectChildren)!=null?c:!0,t),f})},e.getIsSelected=()=>{const{rowSelection:i}=t.getState();return zg(e,i)},e.getIsSomeSelected=()=>{const{rowSelection:i}=t.getState();return pm(e,i)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:i}=t.getState();return pm(e,i)==="all"},e.getCanSelect=()=>{var i;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(i=t.options.enableRowSelection)!=null?i:!0},e.getCanSelectSubRows=()=>{var i;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(i=t.options.enableSubRowSelection)!=null?i:!0},e.getCanMultiSelect=()=>{var i;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(i=t.options.enableMultiRowSelection)!=null?i:!0},e.getToggleSelectedHandler=()=>{const i=e.getCanSelect();return r=>{var o;i&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},hm=(e,t,i,r,o)=>{var u;const c=o.getRow(t,!0);i?(c.getCanMultiSelect()||Object.keys(e).forEach(f=>delete e[f]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(u=c.subRows)!=null&&u.length&&c.getCanSelectSubRows()&&c.subRows.forEach(f=>hm(e,f.id,i,r,o))};function yp(e,t){const i=e.getState().rowSelection,r=[],o={},u=function(c,f){return c.map(h=>{var m;const g=zg(h,i);if(g&&(r.push(h),o[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:u(h.subRows)}),g)return h}).filter(Boolean)};return{rows:u(t.rows),flatRows:r,rowsById:o}}function zg(e,t){var i;return(i=t[e.id])!=null?i:!1}function pm(e,t,i){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,u=!1;return e.subRows.forEach(c=>{if(!(u&&!o)&&(c.getCanSelect()&&(zg(c,t)?u=!0:o=!1),c.subRows&&c.subRows.length)){const f=pm(c,t);f==="all"?u=!0:(f==="some"&&(u=!0),o=!1)}}),o?"all":u?"some":!1}const mm=/([0-9]+)/gm,V$=(e,t,i)=>KE(Ua(e.getValue(i)).toLowerCase(),Ua(t.getValue(i)).toLowerCase()),$$=(e,t,i)=>KE(Ua(e.getValue(i)),Ua(t.getValue(i))),P$=(e,t,i)=>Vg(Ua(e.getValue(i)).toLowerCase(),Ua(t.getValue(i)).toLowerCase()),U$=(e,t,i)=>Vg(Ua(e.getValue(i)),Ua(t.getValue(i))),B$=(e,t,i)=>{const r=e.getValue(i),o=t.getValue(i);return r>o?1:rVg(e.getValue(i),t.getValue(i));function Vg(e,t){return e===t?0:e>t?1:-1}function Ua(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function KE(e,t){const i=e.split(mm).filter(Boolean),r=t.split(mm).filter(Boolean);for(;i.length&&r.length;){const o=i.shift(),u=r.shift(),c=parseInt(o,10),f=parseInt(u,10),h=[c,f].sort();if(isNaN(h[0])){if(o>u)return 1;if(u>o)return-1;continue}if(isNaN(h[1]))return isNaN(c)?-1:1;if(c>f)return 1;if(f>c)return-1}return i.length-r.length}const Qo={alphanumeric:V$,alphanumericCaseSensitive:$$,text:P$,textCaseSensitive:U$,datetime:B$,basic:H$},F$={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:An("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const i=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of i){const u=o?.getValue(e.id);if(Object.prototype.toString.call(u)==="[object Date]")return Qo.datetime;if(typeof u=="string"&&(r=!0,u.split(mm).length>1))return Qo.alphanumeric}return r?Qo.text:Qo.basic},e.getAutoSortDir=()=>{const i=t.getFilteredRowModel().flatRows[0];return typeof i?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var i,r;if(!e)throw new Error;return Sf(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(i=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?i:Qo[e.columnDef.sortingFn]},e.toggleSorting=(i,r)=>{const o=e.getNextSortingOrder(),u=typeof i<"u"&&i!==null;t.setSorting(c=>{const f=c?.find(S=>S.id===e.id),h=c?.findIndex(S=>S.id===e.id);let m=[],g,y=u?i:o==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?f?g="toggle":g="add":c!=null&&c.length&&h!==c.length-1?g="replace":f?g="toggle":g="replace",g==="toggle"&&(u||o||(g="remove")),g==="add"){var b;m=[...c,{id:e.id,desc:y}],m.splice(0,m.length-((b=t.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=c.map(S=>S.id===e.id?{...S,desc:y}:S):g==="remove"?m=c.filter(S=>S.id!==e.id):m=[{id:e.id,desc:y}];return m})},e.getFirstSortDir=()=>{var i,r;return((i=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?i:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=i=>{var r,o;const u=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==u&&((r=t.options.enableSortingRemoval)==null||r)&&(!(i&&(o=t.options.enableMultiRemove)!=null)||o)?!1:c==="desc"?"asc":"desc":u},e.getCanSort=()=>{var i,r;return((i=e.columnDef.enableSorting)!=null?i:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var i,r;return(i=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?i:!!e.accessorFn},e.getIsSorted=()=>{var i;const r=(i=t.getState().sorting)==null?void 0:i.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var i,r;return(i=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?i:-1},e.clearSorting=()=>{t.setSorting(i=>i!=null&&i.length?i.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const i=e.getCanSort();return r=>{i&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var i,r;e.setSorting(t?[]:(i=(r=e.initialState)==null?void 0:r.sorting)!=null?i:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},k$=[u$,M$,E$,R$,f$,d$,O$,D$,F$,w$,j$,N$,L$,z$,T$];function q$(e){var t,i;const r=[...k$,...(t=e._features)!=null?t:[]];let o={_features:r};const u=o._features.reduce((b,S)=>Object.assign(b,S.getDefaultOptions==null?void 0:S.getDefaultOptions(o)),{}),c=b=>o.options.mergeOptions?o.options.mergeOptions(u,b):{...u,...b};let h={...{},...(i=e.initialState)!=null?i:{}};o._features.forEach(b=>{var S;h=(S=b.getInitialState==null?void 0:b.getInitialState(h))!=null?S:h});const m=[];let g=!1;const y={_features:r,options:{...u,...e},initialState:h,_queue:b=>{m.push(b),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(S=>setTimeout(()=>{throw S})))},reset:()=>{o.setState(o.initialState)},setOptions:b=>{const S=La(b,o.options);o.options=c(S)},getState:()=>o.options.state,setState:b=>{o.options.onStateChange==null||o.options.onStateChange(b)},_getRowId:(b,S,x)=>{var C;return(C=o.options.getRowId==null?void 0:o.options.getRowId(b,S,x))!=null?C:`${x?[x.id,S].join("."):S}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(b,S)=>{let x=(S?o.getPrePaginationRowModel():o.getRowModel()).rowsById[b];if(!x&&(x=o.getCoreRowModel().rowsById[b],!x))throw new Error;return x},_getDefaultColumnDef:Ce(()=>[o.options.defaultColumn],b=>{var S;return b=(S=b)!=null?S:{},{header:x=>{const C=x.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:x=>{var C,R;return(C=(R=x.renderValue())==null||R.toString==null?void 0:R.toString())!=null?C:null},...o._features.reduce((x,C)=>Object.assign(x,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...b}},Ee(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Ce(()=>[o._getColumnDefs()],b=>{const S=function(x,C,R){return R===void 0&&(R=0),x.map(A=>{const j=l$(o,A,R,C),L=A;return j.columns=L.columns?S(L.columns,j,R+1):[],j})};return S(b)},Ee(e,"debugColumns")),getAllFlatColumns:Ce(()=>[o.getAllColumns()],b=>b.flatMap(S=>S.getFlatColumns()),Ee(e,"debugColumns")),_getAllFlatColumnsById:Ce(()=>[o.getAllFlatColumns()],b=>b.reduce((S,x)=>(S[x.id]=x,S),{}),Ee(e,"debugColumns")),getAllLeafColumns:Ce(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(b,S)=>{let x=b.flatMap(C=>C.getLeafColumns());return S(x)},Ee(e,"debugColumns")),getColumn:b=>o._getAllFlatColumnsById()[b]};Object.assign(o,y);for(let b=0;bCe(()=>[e.options.data],t=>{const i={rows:[],flatRows:[],rowsById:{}},r=function(o,u,c){u===void 0&&(u=0);const f=[];for(let m=0;me._autoResetPageIndex()))}function uw(e,t){return e?I$(e)?_.createElement(e,t):e:null}function I$(e){return Y$(e)||typeof e=="function"||K$(e)}function Y$(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function K$(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Q$(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[i]=_.useState(()=>({current:q$(t)})),[r,o]=_.useState(()=>i.current.initialState);return i.current.setOptions(u=>({...u,...e,state:{...r,...e.state},onStateChange:c=>{o(c),e.onStateChange==null||e.onStateChange(c)}})),i.current}function $g({columns:e,data:t,emptyLabel:i="No resources"}){const r=a$(),o=Q$({data:t,columns:e.map((u,c)=>r.display({id:`${c}-${u.header}`,header:u.header,cell:f=>u.accessor(f.row.original)})),getCoreRowModel:G$()});return t.length===0?E.jsx("p",{className:"empty-state",children:i}):E.jsx("div",{className:"table-scroll",children:E.jsxs("table",{className:"resource-table",children:[E.jsx("thead",{children:o.getHeaderGroups().map(u=>E.jsx("tr",{children:u.headers.map(c=>E.jsx("th",{scope:"col",children:uw(c.column.columnDef.header,c.getContext())},c.id))},u.id))}),E.jsx("tbody",{children:o.getRowModel().rows.map(u=>E.jsx("tr",{children:u.getVisibleCells().map(c=>E.jsx("td",{children:uw(c.column.columnDef.cell,c.getContext())},c.id))},u.id))})]})})}function X$(){const[e,t]=_.useState({slug:"",display_name:"",description:"",context_window:"128000",max_output_tokens:"4096"}),[i,r]=_.useState(""),o=nn({queryKey:Xi.models(zs),queryFn:()=>Uz(zs)});if(o.error)return E.jsx(ka,{error:o.error});if(o.isLoading)return E.jsx(Ha,{label:"Loading models"});return E.jsxs("section",{className:"page-stack","aria-labelledby":"models-title",children:[E.jsx(Fa,{eyebrow:"Catalog",title:"Models",children:"Runtime model definitions and provider availability from the management API."}),E.jsx("section",{className:"content-panel",children:E.jsx($g,{data:o.data?.data??[],emptyLabel:"No models configured",columns:[{header:"Slug",accessor:f=>f.slug},{header:"Display Name",accessor:f=>f.display_name??"-"},{header:"Context",accessor:f=>sl(f.context_window)},{header:"Providers",accessor:f=>f.providers.length>0?f.providers.join(", "):"-"}]})}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Stage Model"}),E.jsxs("form",{className:"form-grid",onSubmit:c,children:[E.jsxs("label",{children:["Slug",E.jsx("input",{value:e.slug,onChange:f=>u("slug",f.currentTarget.value),required:!0})]}),E.jsxs("label",{children:["Display Name",E.jsx("input",{value:e.display_name,onChange:f=>u("display_name",f.currentTarget.value)})]}),E.jsxs("label",{className:"form-grid__wide",children:["Description",E.jsx("input",{value:e.description,onChange:f=>u("description",f.currentTarget.value)})]}),E.jsxs("label",{children:["Context Window",E.jsx("input",{type:"number",min:"1",value:e.context_window,onChange:f=>u("context_window",f.currentTarget.value)})]}),E.jsxs("label",{children:["Max Output Tokens",E.jsx("input",{type:"number",min:"1",value:e.max_output_tokens,onChange:f=>u("max_output_tokens",f.currentTarget.value)})]}),E.jsxs("div",{className:"form-actions",children:[E.jsx("button",{type:"submit",children:"Stage model"}),i?E.jsx("span",{className:"feedback-inline",children:i}):null]})]})]})]});function u(f,h){t(m=>({...m,[f]:h}))}async function c(f){f.preventDefault();const h=await Bz(e.slug.trim(),{display_name:e.display_name,description:e.description,context_window:Number(e.context_window),max_output_tokens:Number(e.max_output_tokens)});r(`Staged change #${h.change_id}`)}}function Z$(){const e=nn({queryKey:Xi.status,queryFn:zz}),t=nn({queryKey:Xi.statsSummary,queryFn:tV}),i=nn({queryKey:Xi.sessions,queryFn:nV}),r=nn({queryKey:Xi.changes,queryFn:Sg}),o=e.error??t.error??i.error??r.error;if(o)return E.jsx(ka,{error:o});if(e.isLoading||t.isLoading||i.isLoading||r.isLoading)return E.jsx(Ha,{label:"Loading console overview"});const u=r.data?.length??0;return E.jsxs("section",{className:"page-stack","aria-labelledby":"overview-title",children:[E.jsx(Fa,{eyebrow:"Runtime",title:"Overview",children:"Current Moon Bridge runtime health, usage, sessions, and staged configuration changes."}),E.jsxs("div",{className:"metric-grid",children:[E.jsx(gs,{label:"Mode",value:e.data?.mode??"unknown"}),E.jsx(gs,{label:"Providers",value:sl(e.data?.provider_count)}),E.jsx(gs,{label:"Routes",value:sl(e.data?.route_count)}),E.jsx(gs,{label:"Changes",value:`${u} pending`}),E.jsx(gs,{label:"Requests",value:sl(t.data?.requests)}),E.jsx(gs,{label:"Cache Hit Rate",value:`${Math.round((t.data?.cache_hit_rate??0)*100)}%`})]}),E.jsxs("div",{className:"section-grid",children:[E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Active Sessions"}),(i.data?.length??0)>0?E.jsx("ul",{className:"compact-list",children:i.data?.map(c=>E.jsxs("li",{children:[E.jsx("strong",{children:c.key}),E.jsx("span",{children:c.model??"No model selected"})]},`${c.key}-${c.created_at}`))}):E.jsx("p",{className:"empty-state",children:"No active sessions"})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Pending Changes"}),(r.data?.length??0)>0?E.jsx("ul",{className:"compact-list",children:r.data?.slice(0,6).map(c=>E.jsxs("li",{children:[E.jsx("strong",{children:c.TargetKey??c.target??"unknown"}),E.jsxs("span",{children:[c.Resource??c.resource," / ",c.Action??c.action]})]},c.ID??c.change_id??c.TargetKey))}):E.jsx("p",{className:"empty-state",children:"No staged changes"})]})]})]})}function gs({label:e,value:t}){return E.jsxs(vg.article,{className:"metric-card",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18},children:[E.jsx("span",{children:e}),E.jsx("strong",{children:t})]})}function J$(){const[e,t]=_.useState({key:"",base_url:"",api_key:"",version:"",protocol:"anthropic",user_agent:""}),[i,r]=_.useState({provider_key:"",model:"",upstream_name:"",priority:"0",input_price:"0",output_price:"0",cache_write:"0",cache_read:"0"}),[o,u]=_.useState(""),c=nn({queryKey:Xi.providers(zs),queryFn:()=>Vz(zs)});if(c.error)return E.jsx(ka,{error:c.error});if(c.isLoading)return E.jsx(Ha,{label:"Loading providers"});return E.jsxs("section",{className:"page-stack","aria-labelledby":"providers-title",children:[E.jsx(Fa,{eyebrow:"Upstream",title:"Providers",children:"Provider endpoints, protocols, offer counts, and health labels."}),E.jsx("section",{className:"content-panel",children:E.jsx($g,{data:c.data?.data??[],emptyLabel:"No providers configured",columns:[{header:"Key",accessor:y=>y.key},{header:"Protocol",accessor:y=>E.jsx("span",{className:"status-pill",children:y.protocol})},{header:"Base URL",accessor:y=>y.base_url},{header:"Offers",accessor:y=>sl(y.offer_count)},{header:"Health",accessor:y=>y.health_status},{header:"Test",accessor:y=>y.protocol==="anthropic"?"Anthropic probe":"Not available"}]})}),E.jsxs("section",{className:"section-grid",children:[E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Stage Provider"}),E.jsxs("form",{className:"form-grid",onSubmit:m,children:[E.jsxs("label",{children:["Key",E.jsx("input",{value:e.key,onChange:y=>f("key",y.currentTarget.value),required:!0})]}),E.jsxs("label",{children:["Protocol",E.jsxs("select",{value:e.protocol,onChange:y=>f("protocol",y.currentTarget.value),children:[E.jsx("option",{value:"anthropic",children:"anthropic"}),E.jsx("option",{value:"openai",children:"openai"}),E.jsx("option",{value:"google",children:"google"})]})]}),E.jsxs("label",{className:"form-grid__wide",children:["Base URL",E.jsx("input",{value:e.base_url,onChange:y=>f("base_url",y.currentTarget.value),required:!0})]}),E.jsxs("label",{children:["API Key",E.jsx("input",{type:"password",value:e.api_key,onChange:y=>f("api_key",y.currentTarget.value),required:!0})]}),E.jsxs("label",{children:["Version",E.jsx("input",{value:e.version,onChange:y=>f("version",y.currentTarget.value)})]}),E.jsxs("label",{className:"form-grid__wide",children:["User Agent",E.jsx("input",{value:e.user_agent,onChange:y=>f("user_agent",y.currentTarget.value)})]}),E.jsxs("div",{className:"form-actions",children:[E.jsx("button",{type:"submit",children:"Stage provider"}),o?E.jsx("span",{className:"feedback-inline",children:o}):null]})]})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Stage Offer"}),E.jsxs("form",{className:"form-grid",onSubmit:g,children:[E.jsxs("label",{children:["Provider Key",E.jsx("input",{value:i.provider_key||e.key,onChange:y=>h("provider_key",y.currentTarget.value)})]}),E.jsxs("label",{children:["Offer Model",E.jsx("input",{value:i.model,onChange:y=>h("model",y.currentTarget.value),required:!0})]}),E.jsxs("label",{className:"form-grid__wide",children:["Upstream Name",E.jsx("input",{value:i.upstream_name,onChange:y=>h("upstream_name",y.currentTarget.value)})]}),E.jsxs("label",{children:["Priority",E.jsx("input",{type:"number",value:i.priority,onChange:y=>h("priority",y.currentTarget.value)})]}),E.jsxs("label",{children:["Input Price",E.jsx("input",{type:"number",value:i.input_price,onChange:y=>h("input_price",y.currentTarget.value)})]}),E.jsxs("label",{children:["Output Price",E.jsx("input",{type:"number",value:i.output_price,onChange:y=>h("output_price",y.currentTarget.value)})]}),E.jsx("div",{className:"form-actions",children:E.jsx("button",{type:"submit",children:"Stage offer"})})]})]})]})]});function f(y,b){t(S=>({...S,[y]:b}))}function h(y,b){r(S=>({...S,[y]:b}))}async function m(y){y.preventDefault();const b=await $z(e.key.trim(),{base_url:e.base_url,api_key:e.api_key,protocol:e.protocol,version:e.version,user_agent:e.user_agent});u(`Staged change #${b.change_id}`)}async function g(y){y.preventDefault();const b=(i.provider_key||e.key).trim(),S=await Pz(b,{model:i.model,upstream_name:i.upstream_name,priority:Number(i.priority),input_price:Number(i.input_price),output_price:Number(i.output_price),cache_write:Number(i.cache_write),cache_read:Number(i.cache_read)});u(`Staged change #${S.change_id}`)}}function W$(){return lt("/v1/models")}function eP(e){return lt("/v1/responses",{method:"POST",body:{...e,stream:e.stream??!1}})}function tP(){const e=nn({queryKey:["responses","models"],queryFn:W$}),[t,i]=_.useState(""),[r,o]=_.useState("ping"),[u,c]=_.useState("256"),[f,h]=_.useState("0.2"),[m,g]=_.useState(null),[y,b]=_.useState(null),[S,x]=_.useState(null);if(e.error)return E.jsx(ka,{error:e.error});async function C(R){R.preventDefault(),x(null);const A=performance.now();try{const j=await eP({model:t||e.data?.models[0]?.slug||"",input:r,max_output_tokens:Number(u),temperature:Number(f)});g(Math.round(performance.now()-A)),b(j)}catch(j){g(Math.round(performance.now()-A)),x(j)}}return E.jsxs("section",{className:"page-stack","aria-labelledby":"rpc-test-title",children:[E.jsx(Fa,{eyebrow:"Smoke Test",title:"RPC Test",children:"Send a minimal non-streaming `/v1/responses` request through Moon Bridge."}),E.jsxs("div",{className:"section-grid",children:[E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Request"}),E.jsxs("form",{className:"form-grid",onSubmit:C,children:[E.jsxs("label",{className:"form-grid__wide",children:["Model",E.jsxs("select",{value:t,onChange:R=>i(R.currentTarget.value),children:[E.jsx("option",{value:"",children:"Select model"}),e.data?.models.map(R=>E.jsx("option",{value:R.slug,children:R.slug},R.slug))]})]}),E.jsxs("label",{className:"form-grid__wide",children:["Input",E.jsx("textarea",{rows:6,value:r,onChange:R=>o(R.currentTarget.value)})]}),E.jsxs("label",{children:["Max Output Tokens",E.jsx("input",{type:"number",value:u,onChange:R=>c(R.currentTarget.value)})]}),E.jsxs("label",{children:["Temperature",E.jsx("input",{type:"number",step:"0.1",value:f,onChange:R=>h(R.currentTarget.value)})]}),E.jsx("div",{className:"form-actions",children:E.jsx("button",{type:"submit",children:"Send"})})]})]}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Response"}),m!==null?E.jsxs("p",{className:"feedback-inline",children:["Latency: ",m,"ms"]}):null,S?E.jsx("pre",{className:"json-block",children:JSON.stringify(S,null,2)}):E.jsx("pre",{className:"json-block",children:JSON.stringify(y??{},null,2)})]})]})]})}function nP(){const[e,t]=_.useState({alias:"",model:"",provider:"",display_name:"",context_window:"128000"}),[i,r]=_.useState(""),o=nn({queryKey:Xi.routes(zs),queryFn:()=>Hz(zs)});if(o.error)return E.jsx(ka,{error:o.error});if(o.isLoading)return E.jsx(Ha,{label:"Loading routes"});return E.jsxs("section",{className:"page-stack","aria-labelledby":"routes-title",children:[E.jsx(Fa,{eyebrow:"Aliases",title:"Routes",children:"Route aliases mapped to provider/model pairs. Read values may include upstream model names."}),E.jsx("section",{className:"content-panel",children:E.jsx($g,{data:o.data?.data??[],emptyLabel:"No routes configured",columns:[{header:"Alias",accessor:f=>f.alias},{header:"Model",accessor:f=>f.model},{header:"Provider",accessor:f=>f.provider},{header:"Display Name",accessor:f=>f.display_name??"-"}]})}),E.jsxs("section",{className:"content-panel",children:[E.jsx("h2",{children:"Stage Route"}),E.jsxs("form",{className:"form-grid",onSubmit:c,children:[E.jsxs("label",{children:["Alias",E.jsx("input",{value:e.alias,onChange:f=>u("alias",f.currentTarget.value),required:!0})]}),E.jsxs("label",{children:["Model",E.jsx("input",{value:e.model,onChange:f=>u("model",f.currentTarget.value),required:!0})]}),E.jsxs("label",{children:["Provider",E.jsx("input",{value:e.provider,onChange:f=>u("provider",f.currentTarget.value)})]}),E.jsxs("label",{children:["Display Name",E.jsx("input",{value:e.display_name,onChange:f=>u("display_name",f.currentTarget.value)})]}),E.jsxs("label",{children:["Context Window",E.jsx("input",{type:"number",min:"1",value:e.context_window,onChange:f=>u("context_window",f.currentTarget.value)})]}),E.jsxs("div",{className:"form-actions",children:[E.jsx("button",{type:"submit",children:"Stage route"}),i?E.jsx("span",{className:"feedback-inline",children:i}):null]})]})]})]});function u(f,h){t(m=>({...m,[f]:h}))}async function c(f){f.preventDefault();const h=await Fz(e.alias.trim(),{model:e.model,provider:e.provider,display_name:e.display_name,context_window:Number(e.context_window)});r(`Staged change #${h.change_id}`)}}const iP=[{index:!0,element:E.jsx(PM,{to:"/overview",replace:!0})},{path:"overview",element:E.jsx(Z$,{})},{path:"models",element:E.jsx(X$,{})},{path:"providers",element:E.jsx(J$,{})},{path:"routes",element:E.jsx(nP,{})},{path:"extensions",element:E.jsx(i$,{})},{path:"changes",element:E.jsx(mV,{})},{path:"config",element:E.jsx(n$,{})},{path:"rpc-test",element:E.jsx(tP,{})}],aP=cO([{path:"/",element:E.jsx(dV,{}),children:iP}],{basename:"/console"}),rP=new UT({defaultOptions:{queries:{retry:1,staleTime:15e3,refetchOnWindowFocus:!1}}}),QE=document.getElementById("root");if(!QE)throw new Error("Root element #root was not found");hT.createRoot(QE).render(E.jsx(_.StrictMode,{children:E.jsx(BT,{client:rP,children:E.jsx(uV,{children:E.jsx(wO,{router:aP})})})})); diff --git a/internal/service/webui/dist/index.html b/internal/service/webui/dist/index.html index 90a388f0..f04be5a8 100644 --- a/internal/service/webui/dist/index.html +++ b/internal/service/webui/dist/index.html @@ -4,9 +4,9 @@ Moon Bridge Console +
- diff --git a/webui/src/app/App.tsx b/webui/src/app/App.tsx index d8121b3e..9d3b2f44 100644 --- a/webui/src/app/App.tsx +++ b/webui/src/app/App.tsx @@ -2,9 +2,10 @@ import "@material/web/button/text-button.js"; import "@material/web/icon/icon.js"; import "@material/web/iconbutton/icon-button.js"; import "@material/web/ripple/ripple.js"; -import { createElement } from "react"; +import { createElement, useState } from "react"; import { NavLink, Outlet } from "react-router-dom"; import { motion } from "motion/react"; +import { ChangeQueueDrawer } from "../components/ChangeQueueDrawer"; import { useConsoleTheme } from "../theme/ThemeProvider"; const navItems = [ @@ -20,6 +21,7 @@ const navItems = [ export function App() { const { theme, toggleTheme } = useConsoleTheme(); + const [changeDrawerOpen, setChangeDrawerOpen] = useState(false); const nextTheme = theme === "dark" ? "light" : "dark"; const themeIcon = theme === "dark" ? "light_mode" : "dark_mode"; @@ -32,8 +34,15 @@ export function App() { Console
- 127.0.0.1:38440 + Same-origin API Runtime API + {createElement( "md-icon-button", { @@ -71,6 +80,10 @@ export function App() {
+ setChangeDrawerOpen(false)} + /> ); } @@ -163,6 +176,30 @@ const shellStyles = ` background: var(--mb-color-surface-container); } + .top-action-button, + button { + min-height: 38px; + border: 0; + border-radius: 8px; + padding: 0 14px; + color: var(--mb-color-on-primary); + background: var(--mb-color-primary); + font: inherit; + font-weight: 650; + cursor: pointer; + } + + button:disabled { + cursor: progress; + opacity: 0.7; + } + + .secondary-button, + .icon-text-button { + color: var(--mb-color-on-surface); + background: var(--mb-color-surface-container-high); + } + md-icon-button { --md-icon-button-icon-color: var(--mb-color-on-surface); --md-icon-button-hover-icon-color: var(--mb-color-primary); @@ -260,6 +297,346 @@ const shellStyles = ` line-height: 1.6; } + .page-stack { + display: grid; + gap: 18px; + } + + .page-header { + max-width: 920px; + } + + .page-header h1 { + font-size: 2rem; + line-height: 1.15; + } + + .page-header p:last-child { + margin: 12px 0 0; + color: var(--mb-color-on-surface-variant); + font-size: 0.95rem; + line-height: 1.55; + } + + .metric-grid { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 12px; + } + + .metric-card, + .content-panel, + .state-panel { + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 34%, transparent); + border-radius: 8px; + background: var(--mb-color-surface-container); + box-shadow: 0 14px 42px color-mix(in srgb, var(--mb-color-shadow) 16%, transparent); + } + + .metric-card { + min-height: 112px; + display: grid; + align-content: space-between; + gap: 18px; + padding: 18px; + } + + .metric-card span { + color: var(--mb-color-on-surface-variant); + font-size: 0.78rem; + font-weight: 650; + text-transform: uppercase; + } + + .metric-card strong { + overflow-wrap: anywhere; + font-size: 1.65rem; + line-height: 1.1; + font-weight: 680; + } + + .section-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; + } + + .content-panel, + .state-panel { + min-width: 0; + padding: 20px; + } + + .state-panel { + min-height: 280px; + display: grid; + align-content: center; + } + + .content-panel h2, + .state-panel h2 { + margin: 0 0 14px; + font-size: 1rem; + line-height: 1.3; + } + + .state-panel p:last-child { + margin: 0; + color: var(--mb-color-on-surface-variant); + line-height: 1.55; + } + + .compact-list { + display: grid; + gap: 10px; + margin: 0; + padding: 0; + list-style: none; + } + + .compact-list li { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + gap: 12px; + align-items: center; + padding: 10px 0; + border-top: 1px solid color-mix(in srgb, var(--mb-color-outline) 24%, transparent); + } + + .compact-list li:first-child { + border-top: 0; + } + + .compact-list strong, + .compact-list span { + min-width: 0; + overflow-wrap: anywhere; + } + + .compact-list span, + .empty-state { + color: var(--mb-color-on-surface-variant); + } + + .empty-state { + margin: 0; + line-height: 1.55; + } + + .table-scroll { + overflow-x: auto; + } + + .resource-table { + width: 100%; + min-width: 720px; + border-collapse: collapse; + font-size: 0.92rem; + } + + .resource-table th, + .resource-table td { + padding: 13px 12px; + border-bottom: 1px solid color-mix(in srgb, var(--mb-color-outline) 28%, transparent); + text-align: left; + vertical-align: top; + } + + .resource-table th { + color: var(--mb-color-on-surface-variant); + font-size: 0.74rem; + font-weight: 720; + text-transform: uppercase; + } + + .resource-table td { + overflow-wrap: anywhere; + } + + .resource-table tbody tr:hover { + background: color-mix(in srgb, var(--mb-color-primary) 7%, transparent); + } + + .status-pill { + display: inline-flex; + align-items: center; + min-height: 28px; + border-radius: 8px; + padding: 0 9px; + color: var(--mb-color-on-primary-container); + background: var(--mb-color-primary-container); + font-size: 0.8rem; + font-weight: 650; + } + + .status-pill--muted { + color: var(--mb-color-on-surface); + background: var(--mb-color-surface-container-high); + } + + .form-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 14px; + } + + .form-grid label { + display: grid; + gap: 6px; + color: var(--mb-color-on-surface-variant); + font-size: 0.82rem; + font-weight: 650; + } + + .form-grid input, + .form-grid select, + .form-grid textarea, + .textarea-field textarea { + width: 100%; + min-height: 42px; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 44%, transparent); + border-radius: 8px; + padding: 8px 10px; + color: var(--mb-color-on-surface); + background: var(--mb-color-surface); + font: inherit; + } + + .form-grid__wide, + .form-actions { + grid-column: 1 / -1; + } + + .form-actions { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; + } + + .feedback-inline, + .feedback-banner { + color: var(--mb-color-primary); + font-weight: 650; + } + + .textarea-field { + display: grid; + gap: 8px; + color: var(--mb-color-on-surface-variant); + font-size: 0.82rem; + font-weight: 650; + } + + .textarea-field textarea { + min-height: 360px; + resize: vertical; + font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; + line-height: 1.45; + } + + .checkbox-inline { + display: inline-flex; + align-items: center; + gap: 8px; + color: var(--mb-color-on-surface-variant); + font-size: 0.9rem; + } + + .json-block { + max-height: 420px; + overflow: auto; + margin: 0; + border-radius: 8px; + padding: 14px; + color: var(--mb-color-on-surface); + background: var(--mb-color-surface); + font-size: 0.82rem; + line-height: 1.45; + } + + .button-list { + display: flex; + gap: 10px; + flex-wrap: wrap; + } + + .active-button { + outline: 2px solid var(--mb-color-primary); + outline-offset: 2px; + } + + .change-drawer { + position: fixed; + top: 88px; + right: 18px; + z-index: 5; + width: min(420px, calc(100vw - 36px)); + max-height: calc(100vh - 112px); + overflow: auto; + display: grid; + gap: 16px; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 44%, transparent); + border-radius: 8px; + padding: 18px; + background: var(--mb-color-surface-container-high); + box-shadow: 0 24px 80px color-mix(in srgb, var(--mb-color-shadow) 34%, transparent); + } + + .drawer-header, + .drawer-actions { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + } + + .drawer-header h2 { + margin: 0; + font-size: 1.1rem; + } + + .drawer-actions { + justify-content: flex-start; + flex-wrap: wrap; + } + + .change-list { + display: grid; + gap: 12px; + margin: 0; + padding: 0; + list-style: none; + } + + .change-list li { + display: grid; + gap: 8px; + border: 1px solid color-mix(in srgb, var(--mb-color-outline) 28%, transparent); + border-radius: 8px; + padding: 12px; + background: var(--mb-color-surface); + } + + .change-list li > div { + display: flex; + gap: 8px; + flex-wrap: wrap; + } + + .change-list strong, + .change-list p { + min-width: 0; + overflow-wrap: anywhere; + } + + .change-list p { + margin: 0; + color: var(--mb-color-on-surface-variant); + font-size: 0.85rem; + line-height: 1.45; + } + @media (max-width: 760px) { .top-app-bar { align-items: flex-start; @@ -303,5 +680,32 @@ const shellStyles = ` min-height: 440px; padding: 24px; } + + .metric-grid, + .section-grid { + grid-template-columns: 1fr; + } + + .compact-list li { + grid-template-columns: 1fr; + gap: 4px; + } + + .resource-table { + min-width: 640px; + } + + .form-grid, + .section-grid { + grid-template-columns: 1fr; + } + + .change-drawer { + top: 12px; + right: 12px; + left: 12px; + width: auto; + max-height: calc(100vh - 24px); + } } `; diff --git a/webui/src/app/PlaceholderPage.tsx b/webui/src/app/PlaceholderPage.tsx new file mode 100644 index 00000000..3cf1c67c --- /dev/null +++ b/webui/src/app/PlaceholderPage.tsx @@ -0,0 +1,14 @@ +export function PlaceholderPage({ title }: { title: string }) { + return ( +
+
+

Console workspace

+

{title}

+

+ This surface is ready for Moon Bridge API data, staged changes, and + operational controls. +

+
+
+ ); +} diff --git a/webui/src/app/routes.tsx b/webui/src/app/routes.tsx index d9e1cfe5..cefc5e5e 100644 --- a/webui/src/app/routes.tsx +++ b/webui/src/app/routes.tsx @@ -1,20 +1,14 @@ import { Navigate, Outlet, createBrowserRouter } from "react-router-dom"; import { App } from "./App"; - -function PlaceholderPage({ title }: { title: string }) { - return ( -
-
-

Console workspace

-

{title}

-

- This surface is ready for Moon Bridge API data, staged changes, and - operational controls. -

-
-
- ); -} +import { ChangesPage } from "../features/changes/ChangesPage"; +import { ConfigPage } from "../features/config/ConfigPage"; +import { ExtensionsPage } from "../features/extensions/ExtensionsPage"; +import { ModelsPage } from "../features/models/ModelsPage"; +import { OverviewPage } from "../features/overview/OverviewPage"; +import { ProvidersPage } from "../features/providers/ProvidersPage"; +import { RpcTestPage } from "../features/rpcTest/RpcTestPage"; +import { RoutesPage } from "../features/routes/RoutesPage"; +import { PlaceholderPage } from "./PlaceholderPage"; export function RouteOutlet() { return ; @@ -22,14 +16,14 @@ export function RouteOutlet() { export const routes = [ { index: true, element: }, - { path: "overview", element: }, - { path: "models", element: }, - { path: "providers", element: }, - { path: "routes", element: }, - { path: "extensions", element: }, - { path: "changes", element: }, - { path: "config", element: }, - { path: "rpc-test", element: } + { path: "overview", element: }, + { path: "models", element: }, + { path: "providers", element: }, + { path: "routes", element: }, + { path: "extensions", element: }, + { path: "changes", element: }, + { path: "config", element: }, + { path: "rpc-test", element: } ]; export const router = createBrowserRouter( diff --git a/webui/src/components/ChangeQueueDrawer.test.tsx b/webui/src/components/ChangeQueueDrawer.test.tsx new file mode 100644 index 00000000..9bd69434 --- /dev/null +++ b/webui/src/components/ChangeQueueDrawer.test.tsx @@ -0,0 +1,72 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import * as management from "../rpc/management"; +import { ChangeQueueDrawer } from "./ChangeQueueDrawer"; + +function renderDrawer() { + const client = new QueryClient({ + defaultOptions: { queries: { retry: false } } + }); + return render( + + undefined} /> + + ); +} + +describe("ChangeQueueDrawer", () => { + afterEach(() => { + vi.restoreAllMocks(); + }); + + test("lists pending changes and applies them", async () => { + vi.spyOn(management, "getChanges").mockResolvedValue([ + { + ID: 4, + Action: "update", + Resource: "model", + TargetKey: "claude-sonnet", + Before: "{}", + After: "{\"display_name\":\"Claude Sonnet\"}", + CreatedAt: "2026-05-24T00:00:00Z" + } + ]); + const apply = vi + .spyOn(management, "applyChanges") + .mockResolvedValue({ status: "success", message: "applied" }); + vi.spyOn(management, "discardChanges").mockResolvedValue({ + status: "success", + message: "discarded" + }); + + renderDrawer(); + + expect(await screen.findByText("claude-sonnet")).toBeInTheDocument(); + await userEvent.click(screen.getByRole("button", { name: /apply/i })); + + expect(apply).toHaveBeenCalledTimes(1); + await waitFor(() => { + expect(screen.getByText("applied")).toBeInTheDocument(); + }); + }); + + test("discards pending changes", async () => { + vi.spyOn(management, "getChanges").mockResolvedValue([]); + vi.spyOn(management, "applyChanges").mockResolvedValue({ + status: "success", + message: "applied" + }); + const discard = vi + .spyOn(management, "discardChanges") + .mockResolvedValue({ status: "success", message: "discarded" }); + + renderDrawer(); + + await userEvent.click(await screen.findByRole("button", { name: /discard/i })); + + expect(discard).toHaveBeenCalledTimes(1); + expect(await screen.findByText("discarded")).toBeInTheDocument(); + }); +}); diff --git a/webui/src/components/ChangeQueueDrawer.tsx b/webui/src/components/ChangeQueueDrawer.tsx new file mode 100644 index 00000000..9a16df4e --- /dev/null +++ b/webui/src/components/ChangeQueueDrawer.tsx @@ -0,0 +1,137 @@ +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { AnimatePresence, motion } from "motion/react"; +import { useState } from "react"; +import { + applyChanges, + discardChanges, + getChanges +} from "../rpc/management"; +import { queryKeys } from "../rpc/queryKeys"; +import type { ChangeRow } from "../rpc/types"; +import { LoadingState } from "./LoadingState"; + +export function ChangeQueueDrawer({ + open, + onClose +}: { + open: boolean; + onClose: () => void; +}) { + const queryClient = useQueryClient(); + const [message, setMessage] = useState(""); + const changes = useQuery({ queryKey: queryKeys.changes, queryFn: getChanges }); + + const refreshConfigQueries = async () => { + await queryClient.invalidateQueries(); + }; + + const apply = useMutation({ + mutationFn: applyChanges, + onSuccess: async (result) => { + setMessage(result.message); + await refreshConfigQueries(); + } + }); + + const discard = useMutation({ + mutationFn: discardChanges, + onSuccess: async (result) => { + setMessage(result.message); + await refreshConfigQueries(); + } + }); + + return ( + + {open ? ( + +
+
+

Change Queue

+

Pending Changes

+
+ +
+ + {changes.isLoading ? ( + + ) : ( + + )} + +
+ + +
+ {message ?

{message}

: null} +
+ ) : null} +
+ ); +} + +export function ChangeList({ + changes, + compact = false +}: { + changes: ChangeRow[]; + compact?: boolean; +}) { + if (changes.length === 0) { + return

No staged changes

; + } + + return ( +
    + {changes.map((change) => ( +
  • +
    + {change.Resource ?? change.resource ?? "resource"} + {change.Action ?? change.action ?? "change"} +
    + {change.TargetKey ?? change.target ?? "unknown"} +

    {summarizeChange(change)}

    +
  • + ))} +
+ ); +} + +function summarizeChange(change: ChangeRow) { + const after = change.After ?? change.after; + const before = change.Before ?? change.before; + return compactJSON(after) || compactJSON(before) || "No payload summary"; +} + +function compactJSON(value: string | undefined) { + if (!value) { + return ""; + } + try { + return JSON.stringify(JSON.parse(value)); + } catch { + return value; + } +} diff --git a/webui/src/components/ResourceTable.tsx b/webui/src/components/ResourceTable.tsx new file mode 100644 index 00000000..6b1bcad2 --- /dev/null +++ b/webui/src/components/ResourceTable.tsx @@ -0,0 +1,71 @@ +import { + createColumnHelper, + flexRender, + getCoreRowModel, + useReactTable, + type ColumnDef +} from "@tanstack/react-table"; +import type { ReactNode } from "react"; + +export type ResourceColumn = { + header: string; + accessor: (row: T) => ReactNode; +}; + +type ResourceTableProps = { + columns: ResourceColumn[]; + data: T[]; + emptyLabel?: string; +}; + +export function ResourceTable({ + columns, + data, + emptyLabel = "No resources" +}: ResourceTableProps) { + const columnHelper = createColumnHelper(); + const table = useReactTable({ + data, + columns: columns.map((column, index) => + columnHelper.display({ + id: `${index}-${column.header}`, + header: column.header, + cell: (context) => column.accessor(context.row.original) + }) + ) as ColumnDef[], + getCoreRowModel: getCoreRowModel() + }); + + if (data.length === 0) { + return

{emptyLabel}

; + } + + return ( +
+ + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + ))} + + ))} + + + {table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + ))} + + ))} + +
+ {flexRender(header.column.columnDef.header, header.getContext())} +
+ {flexRender(cell.column.columnDef.cell, cell.getContext())} +
+
+ ); +} diff --git a/webui/src/e2e/console.test.tsx b/webui/src/e2e/console.test.tsx new file mode 100644 index 00000000..319d2a1b --- /dev/null +++ b/webui/src/e2e/console.test.tsx @@ -0,0 +1,87 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import { ConfigPage } from "../features/config/ConfigPage"; +import { OverviewPage } from "../features/overview/OverviewPage"; +import * as management from "../rpc/management"; +import { CONSOLE_THEME_STORAGE_KEY, ThemeProvider } from "../theme/ThemeProvider"; + +function renderWithProviders(ui: React.ReactElement) { + const client = new QueryClient({ + defaultOptions: { queries: { retry: false } } + }); + return render( + + {ui} + + ); +} + +describe("console smoke flow", () => { + afterEach(() => { + vi.restoreAllMocks(); + localStorage.clear(); + }); + + test("defaults to dark theme and renders overview runtime cards", async () => { + vi.spyOn(management, "getStatus").mockResolvedValue({ + uptime: "N/A", + version: "dev", + mode: "Transform", + provider_count: 1, + route_count: 1, + addr: "127.0.0.1:38441", + timestamp: "2026-05-24T00:00:00Z" + }); + vi.spyOn(management, "getStatsSummary").mockResolvedValue({ + requests: 0, + input_tokens: 0, + output_tokens: 0, + cache_hit_rate: 0, + total_cost: 0, + duration: "0s" + }); + vi.spyOn(management, "getSessions").mockResolvedValue([]); + vi.spyOn(management, "getChanges").mockResolvedValue([]); + + renderWithProviders(); + + expect(document.documentElement.dataset.theme).toBe("dark"); + expect(localStorage.getItem(CONSOLE_THEME_STORAGE_KEY)).toBe("dark"); + expect(await screen.findByText("Transform")).toBeInTheDocument(); + expect(screen.getByText("0 pending")).toBeInTheDocument(); + }); + + test("config generator creates YAML and import stages changes", async () => { + vi.spyOn(management, "getEffectiveConfig").mockResolvedValue({}); + vi.spyOn(management, "getDefaults").mockResolvedValue({ + model: "moonbridge", + max_tokens: 4096, + system_prompt: "" + }); + vi.spyOn(management, "getWebSearch").mockResolvedValue({ + support: "auto", + max_uses: 8, + tavily_api_key: "****", + firecrawl_api_key: "****", + search_max_rounds: 5 + }); + vi.spyOn(management, "validateConfig").mockResolvedValue({ valid: true }); + const importConfig = vi.spyOn(management, "importConfig").mockResolvedValue({ + changes: [{ change_id: 1, resource: "route", target: "moonbridge" }], + count: 1, + message: "staged" + }); + vi.spyOn(management, "exportConfig").mockResolvedValue("mode: Transform\n"); + + renderWithProviders(); + + await userEvent.click(await screen.findByRole("button", { name: /generate yaml/i })); + expect(screen.getByDisplayValue(/providers:/i)).toBeInTheDocument(); + await userEvent.click(screen.getByRole("button", { name: /import/i })); + + expect(importConfig).toHaveBeenCalledWith(expect.stringContaining("routes:")); + expect(await screen.findByText("staged")).toBeInTheDocument(); + }); +}); diff --git a/webui/src/features/changes/ChangesPage.test.tsx b/webui/src/features/changes/ChangesPage.test.tsx new file mode 100644 index 00000000..da5f32ee --- /dev/null +++ b/webui/src/features/changes/ChangesPage.test.tsx @@ -0,0 +1,43 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { render, screen } from "@testing-library/react"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import * as management from "../../rpc/management"; +import { ChangesPage } from "./ChangesPage"; + +function renderPage() { + const client = new QueryClient({ + defaultOptions: { queries: { retry: false } } + }); + return render( + + + + ); +} + +describe("ChangesPage", () => { + afterEach(() => { + vi.restoreAllMocks(); + }); + + test("renders pending changes with before and after summaries", async () => { + vi.spyOn(management, "getChanges").mockResolvedValue([ + { + ID: 9, + Action: "create", + Resource: "route", + TargetKey: "moonbridge", + Before: "", + After: "{\"model\":\"claude-sonnet\"}", + CreatedAt: "2026-05-24T00:00:00Z" + } + ]); + + renderPage(); + + expect(await screen.findByText("moonbridge")).toBeInTheDocument(); + expect(screen.getByText("route")).toBeInTheDocument(); + expect(screen.getByText("create")).toBeInTheDocument(); + expect(screen.getByText(/claude-sonnet/)).toBeInTheDocument(); + }); +}); diff --git a/webui/src/features/changes/ChangesPage.tsx b/webui/src/features/changes/ChangesPage.tsx new file mode 100644 index 00000000..820eaff7 --- /dev/null +++ b/webui/src/features/changes/ChangesPage.tsx @@ -0,0 +1,28 @@ +import { useQuery } from "@tanstack/react-query"; +import { ChangeList } from "../../components/ChangeQueueDrawer"; +import { LoadingState } from "../../components/LoadingState"; +import { getChanges } from "../../rpc/management"; +import { queryKeys } from "../../rpc/queryKeys"; +import { PageHeader, QueryErrorState } from "../shared"; + +export function ChangesPage() { + const query = useQuery({ queryKey: queryKeys.changes, queryFn: getChanges }); + + if (query.error) { + return ; + } + if (query.isLoading) { + return ; + } + + return ( +
+ + Pending staged configuration changes. Apply them to reload runtime state, or discard them before they become active. + +
+ +
+
+ ); +} diff --git a/webui/src/features/config/ConfigGenerator.tsx b/webui/src/features/config/ConfigGenerator.tsx new file mode 100644 index 00000000..b1f2a29d --- /dev/null +++ b/webui/src/features/config/ConfigGenerator.tsx @@ -0,0 +1,124 @@ +import { type FormEvent, useState } from "react"; +import { + generateConfigYAML, + type GeneratedConfigDraft +} from "../../rpc/configGenerator"; + +export function ConfigGenerator({ onGenerate }: { onGenerate: (yaml: string) => void }) { + const [draft, setDraft] = useState({ + mode: "Transform", + addr: "127.0.0.1:38440", + auth_token: "", + provider_key: "anthropic", + base_url: "https://api.anthropic.com", + api_key: "replace-with-provider-key", + protocol: "anthropic", + model_slug: "claude-sonnet", + upstream_name: "", + route_alias: "moonbridge" + }); + + function submit(event: FormEvent) { + event.preventDefault(); + onGenerate(generateConfigYAML(toDraft())); + } + + function update(field: keyof typeof draft, value: string) { + setDraft((current) => ({ ...current, [field]: value })); + } + + function toDraft(): GeneratedConfigDraft { + return { + mode: draft.mode as GeneratedConfigDraft["mode"], + server: { addr: draft.addr, auth_token: draft.auth_token }, + persistence: { active_provider: "db_sqlite" }, + defaults: { model: draft.route_alias, max_tokens: 4096 }, + providers: [ + { + key: draft.provider_key, + base_url: draft.base_url, + api_key: draft.api_key, + protocol: draft.protocol, + offers: [ + { + model: draft.model_slug, + upstream_name: draft.upstream_name + } + ] + } + ], + models: [ + { + slug: draft.model_slug, + display_name: draft.model_slug, + context_window: 128000, + max_output_tokens: 4096 + } + ], + routes: [ + { + alias: draft.route_alias, + model: draft.model_slug, + provider: draft.provider_key, + display_name: draft.route_alias + } + ] + }; + } + + return ( + + + + + + + + + + + +
+ +
+ + ); +} diff --git a/webui/src/features/config/ConfigPage.test.tsx b/webui/src/features/config/ConfigPage.test.tsx new file mode 100644 index 00000000..68be53f4 --- /dev/null +++ b/webui/src/features/config/ConfigPage.test.tsx @@ -0,0 +1,121 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, test, vi } from "vitest"; +import * as management from "../../rpc/management"; +import { ConfigPage } from "./ConfigPage"; + +function renderPage() { + const client = new QueryClient({ + defaultOptions: { queries: { retry: false } } + }); + return render( + + + + ); +} + +describe("ConfigPage", () => { + afterEach(() => { + vi.restoreAllMocks(); + }); + + test("generates YAML and validates it", async () => { + vi.spyOn(management, "getEffectiveConfig").mockResolvedValue({}); + vi.spyOn(management, "exportConfig").mockResolvedValue("mode: Transform\n"); + const validate = vi + .spyOn(management, "validateConfig") + .mockResolvedValue({ valid: true }); + vi.spyOn(management, "importConfig").mockResolvedValue({ + changes: [], + count: 0, + message: "imported" + }); + + renderPage(); + + await userEvent.clear(await screen.findByLabelText(/provider key/i)); + await userEvent.type(screen.getByLabelText(/provider key/i), "preview"); + await userEvent.click(screen.getByRole("button", { name: /generate yaml/i })); + expect(screen.getByDisplayValue(/providers:/i)).toBeInTheDocument(); + + await userEvent.click(screen.getByRole("button", { name: /^validate$/i })); + + expect(validate).toHaveBeenCalledWith(expect.stringContaining("preview:")); + expect(await screen.findByText(/valid config/i)).toBeInTheDocument(); + }); + + test("imports raw YAML and exports with secret confirmation", async () => { + vi.spyOn(management, "getEffectiveConfig").mockResolvedValue({}); + const exportConfig = vi + .spyOn(management, "exportConfig") + .mockResolvedValue("mode: Transform\n"); + vi.spyOn(management, "validateConfig").mockResolvedValue({ valid: true }); + const importConfig = vi.spyOn(management, "importConfig").mockResolvedValue({ + changes: [{ change_id: 1, resource: "model", target: "claude-sonnet" }], + count: 1, + message: "staged" + }); + + renderPage(); + + await userEvent.clear(await screen.findByLabelText(/yaml editor/i)); + await userEvent.type(screen.getByLabelText(/yaml editor/i), "mode: Transform"); + await userEvent.click(screen.getByRole("button", { name: /import/i })); + + expect(importConfig).toHaveBeenCalledWith("mode: Transform"); + expect(await screen.findByText("staged")).toBeInTheDocument(); + + await userEvent.click(screen.getByLabelText(/include secrets/i)); + await userEvent.click(screen.getByRole("button", { name: /export/i })); + + expect(exportConfig).toHaveBeenLastCalledWith({ includeSecrets: true }); + }); + + test("stages defaults and web search settings", async () => { + vi.spyOn(management, "getEffectiveConfig").mockResolvedValue({}); + vi.spyOn(management, "exportConfig").mockResolvedValue("mode: Transform\n"); + vi.spyOn(management, "getDefaults").mockResolvedValue({ + model: "moonbridge", + max_tokens: 4096, + system_prompt: "" + }); + vi.spyOn(management, "getWebSearch").mockResolvedValue({ + support: "auto", + max_uses: 4, + tavily_api_key: "****", + firecrawl_api_key: "****", + search_max_rounds: 2 + }); + const putDefaults = vi + .spyOn(management, "putDefaults") + .mockResolvedValue({ change_id: 31, status: "pending" }); + const putWebSearch = vi + .spyOn(management, "putWebSearch") + .mockResolvedValue({ change_id: 32, status: "pending" }); + vi.spyOn(management, "validateConfig").mockResolvedValue({ valid: true }); + vi.spyOn(management, "importConfig").mockResolvedValue({ + changes: [], + count: 0, + message: "staged" + }); + + renderPage(); + + const defaultModel = await screen.findByLabelText(/default model/i); + await waitFor(() => expect(defaultModel).toHaveValue("moonbridge")); + await userEvent.clear(defaultModel); + await userEvent.type(defaultModel, "claude-sonnet"); + await userEvent.click(screen.getByRole("button", { name: /stage defaults/i })); + expect(putDefaults).toHaveBeenCalledWith(expect.objectContaining({ + model: "claude-sonnet" + })); + + await userEvent.selectOptions(screen.getByLabelText(/web search support/i), "enabled"); + await userEvent.click(screen.getByRole("button", { name: /stage web search/i })); + expect(putWebSearch).toHaveBeenCalledWith(expect.objectContaining({ + support: "enabled" + })); + }); +}); diff --git a/webui/src/features/config/ConfigPage.tsx b/webui/src/features/config/ConfigPage.tsx new file mode 100644 index 00000000..5af07972 --- /dev/null +++ b/webui/src/features/config/ConfigPage.tsx @@ -0,0 +1,258 @@ +import { useQuery } from "@tanstack/react-query"; +import { useEffect, useState } from "react"; +import { LoadingState } from "../../components/LoadingState"; +import { + exportConfig, + getEffectiveConfig, + getDefaults, + getWebSearch, + importConfig, + putDefaults, + putWebSearch, + validateConfig +} from "../../rpc/management"; +import { PageHeader, QueryErrorState } from "../shared"; +import { ConfigGenerator } from "./ConfigGenerator"; + +const defaultYAML = "mode: Transform\n"; + +export function ConfigPage() { + const [yaml, setYAML] = useState(defaultYAML); + const [includeSecrets, setIncludeSecrets] = useState(false); + const [feedback, setFeedback] = useState(""); + const [defaultsForm, setDefaultsForm] = useState({ + model: "", + max_tokens: "4096", + system_prompt: "" + }); + const [webSearchForm, setWebSearchForm] = useState({ + support: "auto", + max_uses: "4", + tavily_api_key: "******", + firecrawl_api_key: "******", + search_max_rounds: "2" + }); + const effective = useQuery({ + queryKey: ["config", "effective"], + queryFn: getEffectiveConfig + }); + const defaults = useQuery({ + queryKey: ["defaults"], + queryFn: getDefaults + }); + const webSearch = useQuery({ + queryKey: ["web-search"], + queryFn: getWebSearch + }); + + useEffect(() => { + if (defaults.data) { + setDefaultsForm({ + model: defaults.data.model, + max_tokens: String(defaults.data.max_tokens), + system_prompt: defaults.data.system_prompt + }); + } + }, [defaults.data]); + + useEffect(() => { + if (webSearch.data) { + setWebSearchForm({ + support: webSearch.data.support, + max_uses: String(webSearch.data.max_uses), + tavily_api_key: "******", + firecrawl_api_key: "******", + search_max_rounds: String(webSearch.data.search_max_rounds) + }); + } + }, [webSearch.data]); + + async function validate() { + const result = await validateConfig(yaml); + setFeedback(result.valid ? "Valid config" : `Invalid config: ${(result.errors ?? []).join("; ")}`); + } + + async function importYAML() { + const result = await importConfig(yaml); + setFeedback(result.message || `${result.count} changes staged`); + } + + async function exportYAML() { + const exported = await exportConfig({ includeSecrets }); + setYAML(exported); + setFeedback(includeSecrets ? "Exported with secrets" : "Exported masked config"); + } + + async function stageDefaults() { + const result = await putDefaults({ + model: defaultsForm.model, + max_tokens: Number(defaultsForm.max_tokens), + system_prompt: defaultsForm.system_prompt + }); + setFeedback(`Staged change #${result.change_id}`); + } + + async function stageWebSearch() { + const result = await putWebSearch({ + support: webSearchForm.support, + max_uses: Number(webSearchForm.max_uses), + tavily_api_key: webSearchForm.tavily_api_key, + firecrawl_api_key: webSearchForm.firecrawl_api_key, + search_max_rounds: Number(webSearchForm.search_max_rounds) + }); + setFeedback(`Staged change #${result.change_id}`); + } + + return ( +
+ + Generate, validate, import, export, and stage Moon Bridge YAML configuration. + + +
+

Visual Generator

+ +
+ +
+

YAML Preview and Import

+