diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 00000000..6ab6682f --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,135 @@ +# Architecture + +The 508.dev integrations repo is a service-oriented monorepo. It keeps Discord +gateway logic, HTTP/API handling, background job execution, and shared runtime +utilities in separate packages while sharing one deployment stack. + +## Service Layout + +```text +apps/ + discord_bot/ Discord gateway process and bot commands + api/ FastAPI dashboard, auth, webhooks, and ingest API + admin_dashboard/ React + Vite dashboard source + worker/ queue consumer, jobs, CRM processors, migrations +packages/ + shared/ settings, queue helpers, clients, CRM utilities, agent code +``` + +Primary runtime services: + +- `discord_bot`: Discord gateway process. Bot features are loaded as cogs. +- `web`: FastAPI dashboard + ingest service. Validates requests, persists jobs, + and enqueues work. +- `worker`: background consumer. Executes jobs from Redis and persists outcomes. +- `redis`: queue transport. +- `postgres`: source-of-truth job state, audit events, identity/cache tables. +- `minio`: internal S3-compatible file handoff path. + +## Data And Queue Model + +The API keeps ingest endpoints fast: validate input, persist a job row, enqueue, +and return. Long-running processing belongs in worker jobs. + +Job state is persisted in Postgres table `jobs` with: + +- job type +- status: `queued`, `running`, `succeeded`, `failed`, `dead`, `canceled` +- payload/result +- idempotency key +- attempt counters +- retry scheduling through `run_after` +- lock metadata + +Redis is the delivery transport. Postgres remains the source of truth for +retries, idempotency, and inspection. + +Worker schema is managed by Alembic migrations in +`apps/worker/src/five08/worker/migrations`. The Web/API service applies these +migrations on startup through `run_job_migrations()`. + +## Dashboard And Auth + +The operations dashboard is served at `/dashboard` by the FastAPI app. The React +source lives in `apps/admin_dashboard` and builds into the API package static +directory. + +Dashboard browser routes and `/dashboard/api/*` use an HttpOnly session cookie. +They do not accept `X-API-Secret`. + +Dashboard sessions are created by: + +- OIDC login routes, when OIDC is configured. +- Discord dashboard deep links created by `/auth/discord/links`. +- Local/dev CLI-generated deep links through `./scripts/dev.sh login`. + +Discord-backed sessions carry the linked CRM contact id from the local `people` +cache when available. Steering Committee+ sessions can use broader CRM people +lookup and onboarding views. Admin+ sessions can access jobs, reruns, sync +actions, and audit views. + +Sensitive dashboard permissions require SSO validation in production. Local, +dev, development, and test environments allow trusted dev role context for +faster dashboard testing. + +## Protected API Routes + +Non-dashboard protected API routes use `API_SHARED_SECRET` in `X-API-Secret`. +This includes webhook and secret-backed operational routes until per-webhook or +per-route auth is introduced. + +Human-triggered CRM actions should write best-effort audit events. Audit writes +must not break command execution if the audit path is temporarily unavailable. + +## Shared Runtime Code + +Cross-service runtime code belongs in `packages/shared/src/five08/`: + +- settings +- queue helpers +- integration clients +- CRM utilities +- project/gig helpers +- agent orchestration support + +Service-specific behavior should stay inside the owning app package. + +## Internal File Movement + +MinIO is the internal transfer mechanism for file handoffs inside the stack. +The default internal bucket is `internal-transfers`. + +External object-store adapters should remain separate from this internal transfer +path so the deployment can later support multi-cloud or vendor-specific storage +without changing internal job mechanics. + +## Deployment Shape + +Production deploys as one Compose application with independently restartable +services: + +- `discord_bot` +- `web` +- `worker` +- `redis` +- `postgres` +- `minio` + +`compose.yaml` is the canonical Coolify/base stack. The root +`docker-compose.yml` is a compatibility wrapper. Local host-port publishing is +handled by `compose.local.yaml` through `./scripts/docker-compose.sh`. + +The base stack attaches app services to the external infra network named by +`INFRA_DOCKER_NETWORK`, allowing same-host services such as Bifrost and Langfuse +to be addressed by Docker DNS aliases. + +## Extension Rules + +- Add bot features as isolated cogs. +- Add shared config in `packages/shared/src/five08/settings.py`. +- Add service-specific config in that service's `config.py`. +- Keep deterministic routing, retries, status-code handling, and validation in + code rather than LLM calls. +- Register rerunnable job callables consistently for backend rerun resolution and + worker execution. +- Keep audit logging best effort. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 91585bbb..2adccb1c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,57 +1,71 @@ # Development Guide -This guide covers setup and workflows for the 508.dev monorepo (`discord bot + api + worker + shared package`). +This guide covers local setup and day-to-day workflows for the 508.dev +integrations monorepo. ## Prerequisites - Python 3.12+ +- `python3` on PATH - [uv](https://docs.astral.sh/uv/) -- Docker (optional, for Compose-based local runs) +- Docker with Compose support +- Bun for the admin dashboard frontend -## Monorepo Layout +Only `python3` is assumed to exist locally; use `uv run`, package scripts, or +repo-provided entrypoints for project commands. -```text -apps/discord_bot/src/five08/discord_bot/ # Discord bot package -apps/api/src/five08/backend/ # Backend API package -apps/worker/src/five08/worker/ # Worker consumer package -packages/shared/src/five08/ # Shared package +## First-Time Setup + +```bash +uv sync +cp .env.example .env ``` -## Setup +Edit `.env` for the integrations you plan to exercise. At minimum, set +`API_SHARED_SECRET` when you need protected API routes or local dashboard login +links. + +## Local Dev Stack -1. Install dependencies: +`./scripts/dev.sh` is the primary local-dev entrypoint. It assigns deterministic +per-worktree localhost ports, exports service URLs, starts Docker-managed infra, +and runs migrations before DB-using app services. + +Recommended dashboard/worker loop without the Discord bot: ```bash -uv sync +./scripts/dev.sh no-bot ``` -2. Configure environment: +Aliases: ```bash -cp .env.example .env +./scripts/dev.sh dashboard +./scripts/dev.sh web-worker ``` -The backend API process runs Alembic migrations on startup (`apps/worker/src/five08/worker/db_migrations.py`) so the `jobs` table is created or upgraded before requests are accepted. +Run everything, including the Discord bot: -3. Start local infrastructure: +```bash +./scripts/dev.sh all +``` + +Run individual pieces: ```bash ./scripts/dev.sh infra -./scripts/dev.sh api +./scripts/dev.sh web # ./scripts/dev.sh api also works ./scripts/dev.sh worker ./scripts/dev.sh discord-bot ``` -`infra` brings up only the Docker infra. Use the host-service subcommands to run -the app processes with per-worktree ports and derived localhost URLs. - -To launch infra plus all host-run services together with prefixed logs: +Run migrations without starting app services: ```bash -./scripts/dev.sh all +./scripts/dev.sh migrate ``` -Show, export, or stop the local dev environment: +Show or stop the local environment: ```bash ./scripts/dev.sh ports @@ -60,56 +74,96 @@ Show, export, or stop the local dev environment: ``` `./scripts/dev.sh env` emits shell-safe exports for the current worktree and -avoids printing the resolved Postgres password directly. +avoids printing the resolved Postgres password or API shared secret directly. + +## Dashboard Login In Development -4. Run services on the host: +When the API is running, create a local/dev one-time dashboard login link without +starting the Discord bot: ```bash -# bot -uv run --package discord_bot discord-bot +./scripts/dev.sh login +``` -# webhook ingest API -uv run --package api backend-api +The command calls the same `/auth/discord/links` endpoint used by the Discord +`/dashboard-login` command, but supplies trusted local/dev role context from the +CLI. It requires `API_SHARED_SECRET` in `.env` or the shell. -# job consumer -uv run --package worker worker-consumer +Optional overrides: -# EspoCRM search / REPL / batch updates -uv run --package five08 crmctl repl +```bash +DEV_DASHBOARD_DISCORD_USER_ID=dev-user \ +DEV_DASHBOARD_DISPLAY_NAME="Local Admin" \ +DEV_DASHBOARD_ROLES=Admin \ +./scripts/dev.sh login /dashboard/projects ``` -## Docker Compose Workflow +The local/dev fallback only works when `ENVIRONMENT` is `local`, `dev`, +`development`, or `test`. Production still requires normal dashboard identity +validation. -For day-to-day development, prefer `./scripts/dev.sh` plus host-run app -services. That entrypoint exports deterministic per-worktree localhost ports -and service URLs so the apps work without manual overrides. Use the Compose -wrapper when you need full container parity, including Coolify-style runs. +## Host-Run Entrypoints -Start full stack (discord_bot + api + worker + redis + postgres + minio): +You can run service entrypoints directly when you already have infra running: ```bash -./scripts/docker-compose.sh up --build +uv run --package discord_bot discord-bot +uv run --package api backend-api +uv run --package worker worker-consumer ``` -Note: the service Dockerfiles use BuildKit cache mounts, so containerized builds -require BuildKit-capable Docker / `docker compose build` support. +Prefer the `dev.sh` wrappers for normal work because they derive the right +worktree-local URLs and ports automatically. -Stop stack: +## Admin Dashboard Frontend + +The dashboard source lives in `apps/admin_dashboard` and builds into +`apps/api/src/five08/backend/static/dashboard`, which the FastAPI app serves. ```bash -./scripts/docker-compose.sh down +cd apps/admin_dashboard +bun install --frozen-lockfile +bun run format +bun run lint +bun run typecheck +bun run test +bun run build ``` -Show the deterministic host ports assigned to the current worktree: +Run `bun run build` after dashboard source changes when the checked-in FastAPI +static bundle should be updated. + +## Docker Compose Workflow + +For day-to-day development, prefer host-run app services through `dev.sh`. +Use Compose when you need container parity with deployment: ```bash +./scripts/docker-compose.sh up --build +./scripts/docker-compose.sh down ./scripts/docker-compose.sh print-ports ``` -Set `*_HOST_PORT` or `COMPOSE_PROJECT_NAME` in `.env` or the invoking shell if you -need fixed values; otherwise the wrapper computes deterministic per-worktree ones. +`compose.yaml` is the canonical Coolify/base stack. `compose.local.yaml` adds +local host port publishing for the helper wrapper. `docker-compose.yml` is a +compatibility wrapper for tools that still look for that filename. + +The `web` service publishes container port `8090` to +`${WEB_HOST_BIND:-127.0.0.1}:${WEB_HOST_PORT:-8090}` so a host-side Cloudflare +Tunnel can target the dashboard/API at localhost. Redis, Postgres, and MinIO are +not published by the base file. + +The app services attach to the external infra network named by +`INFRA_DOCKER_NETWORK`. Pre-create it if needed: + +```bash +docker network create 508-infra +``` + +BuildKit-capable Docker / `docker compose build` support is required because the +service Dockerfiles use BuildKit cache mounts. -## Testing and Quality +## Testing And Quality ```bash ./scripts/test.sh @@ -118,62 +172,31 @@ need fixed values; otherwise the wrapper computes deterministic per-worktree one ./scripts/mypy.sh ``` -## Adding Bot Features +For dashboard-only checks: -Bot features remain Discord.py cogs in: - -- `apps/discord_bot/src/five08/discord_bot/cogs/` - -Pattern: - -```python -from discord.ext import commands - -class MyCog(commands.Cog): - def __init__(self, bot: commands.Bot) -> None: - self.bot = bot - -async def setup(bot: commands.Bot) -> None: - await bot.add_cog(MyCog(bot)) +```bash +cd apps/admin_dashboard +bun run check ``` -## Adding Worker Jobs - -1. Add job function in `apps/worker/src/five08/worker/jobs.py`. -2. Enqueue from `apps/api/src/five08/backend/api.py` (or from bot code if needed). -3. Ensure job type/queue settings and Postgres settings are configured in `.env`. - -### Job architecture - -- API layer persists jobs first in Postgres with idempotency keys. -- Queue layer uses Dramatiq actors over Redis for delivery. -- MinIO is the current internal transfer mechanism (bucket: `internal-transfers`) and is intended only for stack-internal file movement; external S3 integrations are separate. - -## Worker CRM Flow +## Useful CLIs -- EspoCRM webhooks are accepted at `POST /webhooks/espocrm`. -- Each event enqueues `five08.worker.jobs.process_contact_skills_job`. -- Jobs use modules under `apps/worker/src/five08/worker/crm/` to: - - fetch contact + attachments from EspoCRM - - extract text from resume-like files - - extract skills (LLM when configured, heuristic fallback otherwise) - - update contact skills field in EspoCRM -- Manual queueing is available via `POST /process-contact/{contact_id}`. -- Human action audit ingest is available at `POST /audit/events`. +Jobs CLI: -## CRM Cleanup CLI - -Use `crmctl` when you want direct EspoCRM contact search/update control outside the Discord UI. +```bash +uv run --package worker jobsctl --help +uv run --package worker jobsctl recent +``` -Examples: +EspoCRM cleanup and bulk edits: ```bash +uv run --package five08 crmctl repl uv run --package five08 crmctl search --where timezone__is_null=true --where location__is_not_null=true uv run --package five08 crmctl batch-update --where timezone__is_null=true --where location__is_not_null=true --update timezone=@location -uv run --package five08 crmctl batch-update --where timezone__is_null=true --where location__is_not_null=true --update timezone=@location --apply ``` -Inside `uv run --package five08 crmctl repl`, contacts are mutable Python objects: +Inside `crmctl repl`, contacts are mutable Python objects: ```python contacts = search(timezone__is_null=True, location__is_not_null=True) @@ -182,28 +205,30 @@ contact.timezone = contact.infer_timezone() contact.save() ``` -## Discord CRM Audit Flow +## Feature Patterns -- CRM slash commands in `apps/discord_bot/src/five08/discord_bot/cogs/crm.py` emit best-effort audit events for human actions. -- Audit writing is centralized in `apps/discord_bot/src/five08/discord_bot/utils/audit.py`. -- Audit writes must never break command execution; failures are logged as warnings only. +Bot features live as Discord.py cogs in +`apps/discord_bot/src/five08/discord_bot/cogs/`: -## Environment Variables +```python +from discord.ext import commands -Use `.env.example` as source of truth. Key categories: +class MyCog(commands.Cog): + def __init__(self, bot: commands.Bot) -> None: + self.bot = bot -- Shared queue/runtime: `REDIS_URL`, `REDIS_QUEUE_NAME`, `POSTGRES_URL`, `JOB_MAX_ATTEMPTS`, `JOB_RETRY_BASE_SECONDS`, `JOB_RETRY_MAX_SECONDS`, `LOG_LEVEL`, webhook settings. Local defaults target host-run services; `docker-compose.yml` injects Docker-network URLs for containerized runs. -- Bot credentials/integrations: Discord, email, Espo, Kimai -- Discord CRM audit writer: `AUDIT_API_BASE_URL`, `AUDIT_API_TIMEOUT_SECONDS` (plus shared `API_SHARED_SECRET`) -- Worker controls: `WORKER_NAME`, `WORKER_QUEUE_NAMES`, `WORKER_BURST` -- Worker CRM processing: `MAX_ATTACHMENTS_PER_CONTACT`, `MAX_FILE_SIZE_MB`, `ALLOWED_FILE_TYPES`, `OPENAI_API_KEY`, `OPENAI_BASE_URL`, `OPENAI_MODEL`, `RESUME_EXTRACTOR_VERSION` -- Resume upload UX wiring: `BACKEND_API_BASE_URL` on bot; worker-side LinkedIn field mapping is fixed in code. +async def setup(bot: commands.Bot) -> None: + await bot.add_cog(MyCog(bot)) +``` -## CI Notes +Worker jobs live in `apps/worker/src/five08/worker/jobs.py`. API-triggered jobs +should persist state first, enqueue second, and keep long processing inside the +worker. -GitHub Actions runs tests, lint, mypy, and security checks against: +## More Reference -- `apps/discord_bot/src/five08/discord_bot/` -- `apps/worker/src/five08/worker/` -- `packages/shared/src/five08/` -- `tests/` +- [Architecture](./ARCHITECTURE.md) +- [Configuration Reference](./docs/configuration.md) +- [API Service](./apps/api/README.md) +- [Worker Service](./apps/worker/README.md) +- [Discord Bot](./apps/discord_bot/README.md) diff --git a/README.md b/README.md index 22bd5809..8039445d 100644 --- a/README.md +++ b/README.md @@ -1,433 +1,94 @@ -# 508.dev Integrations Monorepo +# 508.dev Integrations -Monorepo for the 508.dev Discord bot and job processing stack. +Monorepo for the 508.dev operations automation stack: Discord workflows, the +FastAPI operations dashboard, background jobs, CRM sync, and shared integration +clients. -## Architecture +## What Is In This Repo -This repository follows a service-oriented monorepo layout: +| Path | Purpose | +| --- | --- | +| `apps/discord_bot` | Discord gateway process and slash-command cogs. | +| `apps/api` | FastAPI backend, protected ingest endpoints, auth, and `/dashboard`. | +| `apps/admin_dashboard` | React + Vite admin dashboard source. | +| `apps/worker` | Queue consumer, job handlers, CRM processors, and Alembic migrations. | +| `packages/shared` | Shared settings, queue helpers, integration clients, CRM utilities, and agent code. | +| `scripts` | Local development, test, formatting, and Compose helpers. | +| `docs` | Feature and operational documentation. | -```text -. -├── apps/ -│ ├── discord_bot/ # Discord gateway process -│ │ └── src/five08/discord_bot/ -│ ├── api/ # Backend API + dashboard code -│ │ └── src/five08/backend/ -│ └── worker/ # Async queue worker -│ └── src/five08/worker/ -├── packages/ -│ └── shared/ -│ └── src/five08/ # Shared settings, queue helpers, shared clients -├── compose.yaml # canonical Coolify/base container stack -├── compose.local.yaml # local infra host port publishing override -├── docker-compose.yml # compatibility wrapper including compose.yaml -├── tests/ # Unit and integration tests -└── pyproject.toml # uv workspace root -``` - -## Services - -- `discord_bot`: Discord gateway process. -- `web`: FastAPI dashboard + ingest service that validates and enqueues jobs. -- `worker`: Dramatiq worker that executes jobs from Redis queue. -- `redis`: queue transport between API and worker. -- `postgres`: job state persistence, retries, idempotency. -- `minio`: internal S3-compatible storage transport. - -Migrations: - -- `apps/worker/src/five08/worker/migrations` (Alembic) -- `web` runs `run_job_migrations()` during startup to keep DB schema current. - -### Job model - -- Jobs are persisted in Postgres table `jobs`. -- Job states: `queued`, `running`, `succeeded`, `failed`, `dead`, `canceled`. -- Idempotency key is unique and optional. -- Attempts are stored with `run_after`/retry state so delivery failures are never lost. -- Human audit events are persisted in `audit_events`. -- CRM identity cache is persisted in `people`. - -### Backend API Endpoints - -See the API service docs: [`apps/api/README.md#backend-api-endpoints`](./apps/api/README.md#backend-api-endpoints). -CLI request examples are documented at [`apps/worker/README.md#cli-usage`](./apps/worker/README.md#cli-usage). -Discord gig tracking and dashboard behavior are documented at -[`docs/discord-gig-dashboard.md`](./docs/discord-gig-dashboard.md). - -The operations dashboard is served at `/dashboard`. It is available only to -active dashboard sessions created through the existing OIDC or Discord dashboard -login link flows, and Discord-backed sessions carry the linked CRM contact id -from the local `people` cache. Steering Committee+ Discord-backed sessions can -use CRM people lookup and onboarding assignment. Admin+ sessions can also access -recent jobs, job details/reruns, people-cache sync, and recent human audit -events. - -### Current API/queue caveats - -- Non-dashboard protected API endpoints use a shared `API_SHARED_SECRET` in `X-API-Secret` today. This includes webhook and secret-backed admin routes until per-webhook/per-route auth is introduced. -- `/dashboard` and `/dashboard/api/*` are browser-facing dashboard routes that use the HttpOnly session cookie from OIDC or Discord dashboard login flows. They do not accept `X-API-Secret`. -- Worker startup uses a single effective queue name for actor registration; keep this explicit if you later add true multi-queue routing. -- Backend rerun/enqueue behavior relies on one shared job-handler set. Add any new worker callable consistently to both backend handler resolution and worker dispatch. - -## Local Development +## Quickstart -### 1. Install dependencies +Install dependencies: ```bash uv sync ``` -### 2. Configure environment +Create local configuration: ```bash cp .env.example .env -# then edit .env ``` -### 3. Start local infrastructure - -For development, run Redis, Postgres, and MinIO in Docker and run the app -processes on the host: +Start the dashboard/API, worker, and local infrastructure without the Discord +bot: ```bash -./scripts/dev.sh infra -./scripts/dev.sh web -./scripts/dev.sh worker -./scripts/dev.sh discord-bot +./scripts/dev.sh no-bot ``` -`infra` brings up only the Docker infra. Use the host-service subcommands to run -the app processes with per-worktree ports and derived localhost URLs. The -DB-using host-service subcommands run Alembic migrations before starting the -service so the bot and worker do not race the API startup schema migration. - -Run migrations without starting app services: +In another terminal, create a local dashboard login link: ```bash -./scripts/dev.sh migrate +./scripts/dev.sh login ``` -To launch infra plus all host-run services together with prefixed logs: +Open the printed link, then use the dashboard at `/dashboard`. -```bash -./scripts/dev.sh all -``` - -Show, export, or stop the local dev environment: +To run the Discord bot too: ```bash -./scripts/dev.sh ports -./scripts/dev.sh env -./scripts/dev.sh down -``` - -`./scripts/dev.sh env` emits shell-safe exports for the current worktree and -avoids printing the resolved Postgres password directly. - -### 4. Run app services on the host - -```bash -# Discord bot -uv run --package discord_bot discord-bot - -# Web/API dashboard and ingest service -uv run --package api backend-api - -# Worker queue consumer -uv run --package worker worker-consumer - -# Jobs CLI -uv run --package worker jobsctl --help -# recent jobs (past hour by default): -uv run --package worker jobsctl recent - -# EspoCRM REPL / search / batch updates -uv run --package five08 crmctl repl -uv run --package five08 crmctl search --where timezone__is_null=true --where location__is_not_null=true -uv run --package five08 crmctl batch-update --where timezone__is_null=true --where location__is_not_null=true --update timezone=@location -``` - -`./scripts/dev.sh` exports deterministic per-worktree localhost ports and -service URLs so the apps can run on the host without manual overrides. Use -the lower-level Compose wrapper when you want full containerized parity. - -For local full-container runs, including deterministic localhost ports: - -```bash -./scripts/docker-compose.sh up --build -``` - -Coolify should use `/compose.yaml` as the base Compose file. A small -`docker-compose.yml` compatibility wrapper includes it for tools still configured -to read the older filename. The `web` service publishes container port `8090` -to `${WEB_HOST_BIND:-127.0.0.1}:${WEB_HOST_PORT:-8090}` -so a host-side Cloudflare Tunnel can target the dashboard/API at localhost. -The base file does not publish Redis, Postgres, or MinIO host ports. The app -services also attach to the shared infra network named by `INFRA_DOCKER_NETWORK` -so they can reach -Portainer-managed Bifrost and Langfuse by Docker DNS. The network is declared -as external, so pre-create it before running Compose if it does not already -exist. - -```bash -docker network create 508-infra -``` - -Set `INFRA_DOCKER_NETWORK` if the shared network has a different name. -With Portainer services attached to the same network using aliases like `bifrost` -and `langfuse`, configure: - -```env -OPENAI_BASE_URL=http://bifrost:8080/openai -LANGFUSE_BASE_URL=http://langfuse:3000 +./scripts/dev.sh all ``` -Agent model routing allows this exact internal Docker DNS Bifrost URL for -same-host deployments. Public/provider base URLs remain restricted to HTTPS -allowlisted hosts. - -Note: the service Dockerfiles use BuildKit cache mounts, so containerized builds -require BuildKit-capable Docker / `docker compose build` support. - -Show the deterministic host ports for the current worktree: +## Common Commands ```bash -./scripts/docker-compose.sh print-ports -``` - -Set `*_HOST_PORT` or `COMPOSE_PROJECT_NAME` in `.env` or the invoking shell if you -want to pin them; otherwise the wrapper computes deterministic per-worktree values. - -## License - -This repository is licensed under the GNU Affero General Public License v3.0. -See [LICENSE](./LICENSE). - -## Environment Variables +./scripts/dev.sh infra # Redis, Postgres, MinIO only +./scripts/dev.sh web # FastAPI dashboard/API with reload +./scripts/dev.sh worker # worker consumer with reload +./scripts/dev.sh discord-bot # Discord bot process +./scripts/dev.sh no-bot # infra + dashboard/API + worker +./scripts/dev.sh login # local/dev dashboard login link +./scripts/dev.sh ports # deterministic worktree ports +./scripts/dev.sh down # stop local Docker infra -Use `.env.example` as the source of truth for defaults. - -### Core Runtime (Bot + Worker) - -- `Required`: `ESPO_BASE_URL`, `ESPO_API_KEY` -- `Optional`: `LOG_LEVEL` (default: `INFO`) -- `Optional`: `ENVIRONMENT` (default: `local`; non-local values require explicit `POSTGRES_URL` and `MINIO_ROOT_PASSWORD`) - -### Queue + Job Runtime - -- `Optional`: `REDIS_URL` (default: `redis://127.0.0.1:6379/0`; `./scripts/dev.sh` overrides it to a deterministic per-worktree localhost port, Compose injects `redis://redis:6379/0`) -- `Optional`: `REDIS_QUEUE_NAME` (default: `jobs.default`) -- `Optional`: `REDIS_KEY_PREFIX` (default: `jobs`) -- `Optional`: `REDIS_HOST_BIND` (default: `127.0.0.1`) -- `Optional`: `REDIS_HOST_PORT` (default when unset: deterministic per-worktree value `12000 + WORKTREE_ENV_SLOT`; set `REDIS_HOST_PORT=6379` in your shell or `.env` to pin it to `6379`) -- `Optional`: `JOB_TIMEOUT_SECONDS` (default: `600`) -- `Optional`: `JOB_RESULT_TTL_SECONDS` (default: `3600`) -- `Optional`: `JOB_MAX_ATTEMPTS` (default: `8`) -- `Optional`: `JOB_RETRY_BASE_SECONDS` (default: `5`) -- `Optional`: `JOB_RETRY_MAX_SECONDS` (default: `300`) -- `Optional`: `GIG_RECRUITING_STALE_DAYS` (default: `7`; dashboard warnings and Discord reminders for recruiting gigs with no updates) - -### Postgres + Compose Exposure - -- `Optional`: `POSTGRES_URL` (default: `postgresql://postgres:postgres@127.0.0.1:5432/workflows`; `./scripts/dev.sh` overrides it to a deterministic per-worktree localhost port, Compose injects a Docker-network URL) -- `Optional` (Compose DB container): `POSTGRES_DB` (default: `workflows`) -- `Optional` (Compose DB container): `POSTGRES_USER` (default: `postgres`) -- `Optional` (Compose DB container): `POSTGRES_PASSWORD` (default: `postgres`) -- `Optional` (Compose host bind): `POSTGRES_HOST_BIND` (default: `127.0.0.1`) -- `Optional` (Compose host port): `POSTGRES_HOST_PORT` (default when unset: deterministic per-worktree value `15432 + WORKTREE_ENV_SLOT`; use `5432` only if you explicitly pin it, e.g. `POSTGRES_HOST_PORT=5432`; see `./scripts/docker-compose.sh print-ports`) - -### MinIO + Internal Transfers - -- `Required` in non-local environments: `MINIO_ROOT_PASSWORD` -- `Optional`: `MINIO_ENDPOINT` (default: `http://127.0.0.1:9000`; `./scripts/dev.sh` overrides it to a deterministic per-worktree localhost port, Compose injects `http://minio:9000`) -- `Optional`: `MINIO_INTERNAL_BUCKET` (default: `internal-transfers`) -- `Optional`: `MINIO_ROOT_USER` (default: `internal`) -- `Optional`: `MINIO_HOST_BIND` (default: `127.0.0.1`; set `0.0.0.0` to expose externally) -- `Optional`: `MINIO_API_HOST_PORT` (default when unset: deterministic per-worktree value `24000 + WORKTREE_ENV_SLOT`; pinned values must avoid browser-unsafe ports such as `5060`; see `./scripts/docker-compose.sh print-ports`) -- `Optional`: `MINIO_CONSOLE_HOST_PORT` (default when unset: deterministic per-worktree value `28000 + WORKTREE_ENV_SLOT`; pinned values must avoid browser-unsafe ports such as `5060`; see `./scripts/docker-compose.sh print-ports`) -- Note: `MINIO_ACCESS_KEY` / `MINIO_SECRET_KEY` are `SharedSettings` alias properties (`minio_access_key`, `minio_secret_key`) and are not env-loaded fields. -- Note: use `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD` as the actual env vars. - -### Web/API Service - -- `Required` for non-dashboard protected endpoints: `API_SHARED_SECRET` (protected API requests are rejected when unset) -- `Optional`: `WEB_HOST` (default: `0.0.0.0`; direct process bind host, while Compose pins the container bind host to `0.0.0.0`) -- `Optional`: `WEB_HOST_BIND` (default: `127.0.0.1`; Compose host bind for Cloudflare Tunnel/local exposure) -- `Optional`: `WEB_PORT` (direct process listen port; Compose pins the container's internal listen port to `8090`; host-run `./scripts/dev.sh` ignores `.env` for this key and defaults to a deterministic per-worktree value near `18080 + WORKTREE_ENV_SLOT`) -- `Optional`: `WEB_HOST_PORT` (published host port for Docker/Cloudflare Tunnel; default `8090` when running `docker compose` directly; `./scripts/docker-compose.sh` computes a deterministic per-worktree value when unset, and pinned values must avoid browser-unsafe ports such as `5060`; see `./scripts/docker-compose.sh print-ports`) -- Deprecated fallback names still work for now: `WEBHOOK_INGEST_HOST`, `WEBHOOK_INGEST_PORT`, `WEBHOOK_INGEST_HOST_BIND`, `WEBHOOK_INGEST_HOST_PORT`. - -### Backend API OIDC Session Auth - -- `Optional` (required when enabling OIDC login): `OIDC_ISSUER_URL`, `OIDC_CLIENT_ID`, `OIDC_CLIENT_SECRET` -- `Optional`: `OIDC_SCOPE` (default: `openid profile email groups`) -- `Optional`: `OIDC_GROUPS_CLAIM` (default: `groups`) -- `Optional`: `OIDC_ADMIN_GROUPS` (default: `authentik Admins`; grants full dashboard admin permissions) -- `Optional`: `OIDC_CALLBACK_PATH` (default: `/auth/callback`) -- `Optional`: `OIDC_REDIRECT_BASE_URL` (default: infer from request base URL) -- `Optional`: `AUTH_SESSION_COOKIE_NAME` (default: `five08_session`) -- `Optional`: `AUTH_SESSION_TTL_SECONDS` (default: `86400`, one day) -- `Optional`: `DASHBOARD_DEFAULT_PATH` (default: `/dashboard`) -- `Optional`: `DASHBOARD_PUBLIC_BASE_URL` (public base URL for generated deep links; set this in production, for example `https://workflows.508.dev`) -- Note: OIDC timeout/cache timings are fixed in code; auth cookies always use `SameSite=Lax` and enable `secure` automatically outside local/dev/test environments. - -### Discord Admin Deep-Link Validation - -- `Optional`: `DISCORD_SERVER_ID` (required for Discord API fallback role checks) -- `Optional`: `DISCORD_ADMIN_ROLES` (default: `Admin,Owner`; marks Discord roles eligible for admin dashboard permissions) -- `Optional`: `DISCORD_API_TIMEOUT_SECONDS` (default: `8.0`) -- `Optional`: `DISCORD_LINK_TTL_SECONDS` (default: `600`) -- `Optional`: `DISCORD_LINK_REQUIRE_OIDC_IDENTITY_CHECKS` (code default: `true`; local `.env.example` sets `false` so Discord dashboard links work without OIDC; set `true` in production with Authentik) -- `Optional`: `DISCORD_BOT_TOKEN` (needed only for fallback Discord API checks; DB role check remains primary) -- Note: Discord dashboard links are available to active CRM-linked Discord users - with Steering Committee role or higher. Steering Committee receives CRM people - lookup and onboarding permissions. Jobs, reruns, people sync, and audit are - sensitive admin permissions and require an SSO-validated dashboard session in - production; local/dev/test environments allow them for development. - -### Worker Consumer - -- `Optional`: `WORKER_NAME` (default: `worker`) -- `Optional`: `DISCORD_BOT_INTERNAL_BASE_URL` (default: `http://127.0.0.1:3000`; `./scripts/dev.sh worker` overrides it to the worktree bot port, Compose injects `http://discord_bot:3000`) -- `Optional`: `WORKER_QUEUE_NAMES` (default: `jobs.default`, comma-separated) -- `Optional`: `WORKER_BURST` (default: `false`) - -### Worker CRM Sync + Skills Extraction - -- `Optional`: `CRM_SYNC_ENABLED` (default: `true`) -- `Optional`: `CRM_SYNC_INTERVAL_SECONDS` (default: `900`) -- `Optional`: `CRM_SYNC_PAGE_SIZE` (default: `200`) -- `Optional`: `CHECK_EMAIL_WAIT` (default: `2`; minutes between mailbox polls) -- `Optional`: `MAX_ATTACHMENTS_PER_CONTACT` (default: `3`) -- `Optional`: `MAX_FILE_SIZE_MB` (default: `10`) -- `Optional`: `ALLOWED_FILE_TYPES` (default: `pdf,doc,docx,txt`) -- `Optional`: `OPENAI_API_KEY` (if unset, heuristic extraction is used) -- `Optional`: `OPENAI_BASE_URL` (set `https://openrouter.ai/api/v1` for OpenRouter) -- `Optional`: `OPENAI_DIRECT_API_KEY` / `OPENAI_API_KEY_DIRECT`, `OPENAI_DIRECT_BASE_URL`, `OPENAI_DIRECT_MODEL` (direct OpenAI fallback when the primary base URL is Bifrost) -- `Optional`: `FIREWORKS_API_KEY` (direct fallback when Bifrost is not routing Fireworks) -- `Optional`: `OPENROUTER_API_KEY` (direct OpenRouter fallback when Bifrost is unavailable or misconfigured) -- `Optional`: `LANGFUSE_BASE_URL` (Langfuse endpoint for LLM tracing/observability) -- `Optional`: `RESUME_AI_API_KEY`, `RESUME_AI_BASE_URL` (resume-specific provider; falls back to `OPENAI_API_KEY` / `OPENAI_BASE_URL` when unset or incomplete) -- `Optional`: `RESUME_AI_MODEL` (default: `gpt-4.1-mini`; use plain names like `gpt-4.1-mini`, OpenRouter gets auto-prefixed to `openai/`) -- Note: resume/profile LLM calls retry matching direct providers after Bifrost request failures. For example, `RESUME_AI_MODEL=openrouter/openai/gpt-4.1-mini` through Bifrost retries direct OpenRouter as `openai/gpt-4.1-mini`, then direct OpenAI when those keys are configured. -- `Optional`: `OPENAI_MODEL` (default: `gpt-5-mini`; fallback/legacy model setting) -- `Optional`: `RESUME_EXTRACTOR_VERSION` (default: `v1`; used in resume processing idempotency/ledger keys) -- `Optional`: `INTAKE_RESUME_FETCH_TIMEOUT_SECONDS` (default: `20.0`; timeout for intake resume URL downloads) -- `Optional`: `INTAKE_RESUME_MAX_REDIRECTS` (default: `3`; max redirects followed for intake resume URL downloads) -- `Optional`: `INTAKE_RESUME_ALLOWED_HOSTS` (default: empty; optional comma-separated host allowlist for intake resume URL downloads) -- `Optional`: `EMAIL_RESUME_INTAKE_ENABLED` (default: `false`; enables worker-side mailbox resume processing loop) -- `Optional`: `EMAIL_RESUME_ALLOWED_EXTENSIONS` (default: `pdf,doc,docx`) -- `Optional`: `EMAIL_RESUME_MAX_FILE_SIZE_MB` (default: `10`) -- `Optional`: `EMAIL_REQUIRE_SENDER_AUTH_HEADERS` (default: `true`; requires SPF/DKIM/DMARC pass headers) -- `Required when EMAIL_RESUME_INTAKE_ENABLED=true`: `EMAIL_USERNAME`, `EMAIL_PASSWORD`, `IMAP_SERVER` -- Note: worker CRM wiring uses the fixed LinkedIn field `cLinkedIn`, keeps the intake-completed field unset, and matches resume filenames with `resume,cv,curriculum`. - -### Discord Bot Core - -- `Required`: `DISCORD_BOT_TOKEN` -- `Optional`: `BACKEND_API_BASE_URL` (default: `http://127.0.0.1:8090`; `./scripts/dev.sh` overrides it to the worktree web/API port, Compose injects `http://web:8090`) -- `Optional`: `HEALTHCHECK_PORT` (host-run `./scripts/dev.sh` ignores `.env` for this key and defaults to a deterministic per-worktree value near `30000 + WORKTREE_ENV_SLOT`; export it in your shell only when you intentionally want a fixed port, and avoid browser-unsafe ports such as `5060`) -- `Optional`: `DISCORD_DEFAULT_JOB_FORUM_CHANNELS` (default: `gigs:part_time,fulltime-roles:full_time`; comma-separated `forum-name:posting_type` list auto-registered and backfilled on bot startup) -- Note: bot message chunking uses Discord's 2000 character limit in code. - -### Discord Agent Gateway - -- `Optional`: `AGENT_API_TIMEOUT_SECONDS` (default: `8.0`; timeout for synchronous Discord agent gateway calls) -- `Optional`: `AGENT_FAST_MODEL`, `AGENT_FAST_BASE_URL`, `AGENT_FAST_API_KEY` -- `Optional`: `AGENT_STRONG_MODEL`, `AGENT_STRONG_BASE_URL`, `AGENT_STRONG_API_KEY` -- `Optional`: `AGENT_REASONING_MODEL`, `AGENT_REASONING_BASE_URL`, `AGENT_REASONING_API_KEY` -- `Optional`: `AGENT_FALLBACK_MODEL` (default: `gpt-4.1-mini`; uses `OPENAI_API_KEY` / `OPENAI_BASE_URL`) -- `Optional`: `AGENT_INTENT_NORMALIZER_ENABLED` (default: `true`; when deterministic parsing fails, asks the fast agent model to rewrite loose phrasing into one supported command shape) -- `Optional`: `AGENT_INTENT_NORMALIZER_TIMEOUT_SECONDS` (default: `3.0`) -- Note: tier-specific agent models can point at OpenAI-compatible providers such as Bifrost or Fireworks. Agent model base URLs must be HTTPS endpoints on `bifrost.508.dev`, `api.openai.com`, `api.fireworks.ai`, or `openrouter.ai`, except the internal Docker-network Bifrost URL `http://bifrost:8080/openai` is also allowed for same-host deployments. If `OPENAI_BASE_URL` points at Bifrost and tier-specific `AGENT_*` values are unset, the planner defaults to Fireworks Kimi via Bifrost as `fireworks/accounts/fireworks/models/kimi-k2p6`. Explicit Bifrost provider-prefixed planner models, such as `openrouter/openai/gpt-4.1-mini`, are passed through unchanged. If Bifrost is not configured and `FIREWORKS_API_KEY` is set, the planner falls back to direct Fireworks as `accounts/fireworks/models/kimi-k2p6`. If a configured provider is missing its usable API key, it is skipped and the fallback order is `reasoning -> strong -> fast -> AGENT_FALLBACK_MODEL -> gpt-4.1-mini`; `strong` falls back through `fast`, and `fast` falls back through the OpenAI fallback. -- Note: the Discord bot accepts agent requests through `/agent` and explicit bot mentions. Mentioned requests work in server channels and threads; lightweight public-safe clarifications stay in a response thread, while executed mention results and write confirmations are sent by DM so private memory and sensitive tool output can be shown only in the private destination. Sensitive reports point to ephemeral slash commands. Replies in bot-created agent threads continue the agent flow without repeating the mention. -- Agent tools follow the deterministic path: deterministic parsing runs first, the optional LLM intent normalizer can only rewrite unsupported phrasing into supported command shapes, policy authorizes scopes, write tools require confirmation, and the backend executes known-good tool code. -- `Optional`: `GITHUB_API_TOKEN`, `GITHUB_DEFAULT_REPO`, `GITHUB_ALLOWED_REPOS` (comma-separated; GitHub Issues are the canonical code-task backend for agent-created code work, and agent tools only access the default/allowed repositories). -- Existing integration tools also expose CRM contact search/update, DocuSeal member-agreement submission, and Migadu mailbox creation when their normal service env vars are configured. -- Note: the current generic task tool registry is an MVP, process-local in-memory store for non-code/org tasks until the task-management platform is selected. It is not durable across backend restarts or shared across multiple API workers. Task reads require an explicit project filter to avoid guild-wide task enumeration. -- Note: agent audit writes are best-effort. If the audit store is down, agent actions can still execute and should be considered temporarily untraced until audit ingestion recovers. - -### Discord CRM Audit Logging (Best Effort) - -- `Optional`: `AUDIT_API_BASE_URL` (defaults to `BACKEND_API_BASE_URL`; Compose clears stale `.env` values so the fallback uses the injected backend URL) -- `Optional`: `AUDIT_API_TIMEOUT_SECONDS` (default: `2.0`) -- `Optional`: `DISCORD_LOGS_WEBHOOK_URL` (if set, command and job events are posted to this Discord webhook) -- `Optional`: `DISCORD_LOGS_WEBHOOK_WAIT` (default: `true`; request delivery confirmation from Discord) - -### Kimai (Legacy/Deprecating) - -- `Currently required by config model`: `KIMAI_BASE_URL`, `KIMAI_API_TOKEN` - -## Commands - -```bash -# tests ./scripts/test.sh - -# lint ./scripts/lint.sh - -# format ./scripts/format.sh - -# type check ./scripts/mypy.sh ``` -## CRM REPL And Batch Updates - -For EspoCRM cleanup and bulk edits outside the Discord UI, use `crmctl` from the shared package. - -The REPL entrypoint is: - -```bash -uv run --package five08 crmctl repl -``` - -Inside the REPL you get: - -- `search(**criteria)` for contact lookups -- `get(contact_id)` for a mutable contact object -- `contact.save()` to persist pending changes -- `batch_update(where={...}, update={...}, apply=False)` for preview/apply flows -- `FROM_LOCATION` to infer `cTimezone` from location fields -- `field__operator=value` filters for both CLI `--where` and Python kwargs - -Examples: - -```bash -uv run --package five08 crmctl search \ - --where timezone__is_null=true \ - --where location__is_not_null=true \ - --where member_type__in=Member,Prospect - -uv run --package five08 crmctl search \ - --where roles__contains=developer \ - --where phone__not_like=+1% - -uv run --package five08 crmctl batch-update \ - --where timezone__is_null=true \ - --where location__is_not_null=true \ - --update timezone=@location - -uv run --package five08 crmctl batch-update \ - --where timezone__is_null=true \ - --where location__is_not_null=true \ - --update timezone=@location \ - --apply -``` - -For Discord bot docs, see [`Discord Bot`](./apps/discord_bot/README.md). - -For local development helper commands, see [`DEVELOPMENT.md`](./DEVELOPMENT.md). +## Documentation +- [Development Guide](./DEVELOPMENT.md): local setup, service commands, dashboard login, Compose workflow, quality checks, and CLIs. +- [Architecture](./ARCHITECTURE.md): services, job model, auth model, deployment shape, and extension points. +- [Configuration Reference](./docs/configuration.md): environment variable groups and local/runtime configuration notes. +- [API Service](./apps/api/README.md): backend endpoints and dashboard auth routes. +- [Worker Service](./apps/worker/README.md): job CLI, worker endpoints, and queue usage examples. +- [Discord Bot](./apps/discord_bot/README.md): bot commands and Discord-specific workflows. +- [Discord Gig Dashboard](./docs/discord-gig-dashboard.md): gig tracking and dashboard behavior. +- [Discord Agent Eval Harness](./docs/discord-agent-eval-harness.md): Discord agent eval workflow. ## Deployment -Deploy as a single Compose application. +Production runs as a Compose application with independently restartable +`discord_bot`, `web`, and `worker` services plus Redis, Postgres, and MinIO. +See [Architecture](./ARCHITECTURE.md#deployment-shape) and +[Configuration Reference](./docs/configuration.md) before changing runtime +configuration. -MinIO is used as the internal transfer mechanism so file handoffs stay inside the stack. -External object storage adapters can be added later for multi-cloud or vendor-specific routing. +## License -This keeps one stack and one shared env set while still allowing independent service scaling/restarts (`discord_bot`, `web`, `worker`). +This repository is licensed under the GNU Affero General Public License v3.0. +See [LICENSE](./LICENSE). diff --git a/apps/admin_dashboard/src/main.tsx b/apps/admin_dashboard/src/main.tsx index 0b998bc8..4894c29d 100644 --- a/apps/admin_dashboard/src/main.tsx +++ b/apps/admin_dashboard/src/main.tsx @@ -273,6 +273,23 @@ type AgentReport = { }> } +type DashboardDevError = { + id: string + occurredAt: string + message: string + name?: string + status?: number + statusText?: string + method?: string + url?: string + path?: string + view?: string + detail?: string + error?: string + payload?: unknown + stack?: string +} + const routes: Record = { people: "/dashboard/people", gigs: "/dashboard/gigs", @@ -337,13 +354,81 @@ type FilterState = Partial> class ApiRequestError extends Error { status: number + statusText: string payload: unknown - - constructor(message: string, status: number, payload: unknown) { + url: string + method: string + + constructor( + message: string, + status: number, + statusText: string, + payload: unknown, + url: string, + method: string, + ) { super(message) this.name = "ApiRequestError" this.status = status + this.statusText = statusText this.payload = payload + this.url = url + this.method = method + } +} + +function stringFieldFromPayload(payload: unknown, key: string) { + if (!payload || typeof payload !== "object") return undefined + const value = (payload as Record)[key] + if (typeof value === "string") return value + if (value === undefined || value === null) return undefined + return JSON.stringify(value) +} + +function messageForApiError(record: Record, fallback: string) { + const detail = record.detail + if (typeof detail === "string" && detail.trim()) return detail + + const error = record.error + if (typeof error !== "string") return fallback + if (error === "person_not_found") { + const person = + typeof record.person === "string" && record.person.trim() ? record.person : "that person" + return `No CRM person, ERPNext user, or ERPNext supplier matched "${person}". Try an email address or an exact name from CRM/ERPNext.` + } + if (error === "candidate_not_found") { + return "The selected person record is no longer available. Search again and choose one of the current matches." + } + if (error === "ambiguous_person") { + return "Multiple people matched. Choose the matching person record." + } + return error || fallback +} + +function messageFromUnknown(error: unknown, fallback: string) { + if (typeof error === "string" && error.trim()) return error + if (error instanceof Error && error.message.trim()) return error.message + return fallback +} + +function devErrorFromUnknown(error: unknown, fallback: string): DashboardDevError { + const message = messageFromUnknown(error, fallback) + const apiError = error instanceof ApiRequestError ? error : null + return { + id: `${Date.now()}-${Math.random().toString(36).slice(2)}`, + occurredAt: new Date().toLocaleTimeString(), + message, + name: error instanceof Error ? error.name : undefined, + status: apiError?.status, + statusText: apiError?.statusText, + method: apiError?.method, + url: apiError?.url, + path: `${window.location.pathname}${window.location.search}`, + view: rawViewFromPath() || "people", + detail: apiError ? stringFieldFromPayload(apiError.payload, "detail") : undefined, + error: apiError ? stringFieldFromPayload(apiError.payload, "error") : undefined, + payload: apiError?.payload, + stack: error instanceof Error ? error.stack : undefined, } } @@ -367,17 +452,37 @@ function detailIdFromPath(expectedView: "gigs" | "projects" = "gigs") { } async function requestJson(url: string, options: RequestInit = {}): Promise { + const method = String(options.method || "GET").toUpperCase() const headers = new Headers(options.headers) headers.set("Accept", "application/json") - const response = await fetch(url, { - credentials: "same-origin", - ...options, - headers, - }) + let response: Response + try { + response = await fetch(url, { + credentials: "same-origin", + ...options, + headers, + }) + } catch (error) { + throw new ApiRequestError( + messageFromUnknown(error, "Network request failed"), + 0, + "Network request failed", + null, + url, + method, + ) + } if (response.status === 401) { const next = `${window.location.pathname}${window.location.search}` || "/dashboard" window.location.assign(`/auth/login?next=${encodeURIComponent(next)}`) - throw new Error("Session expired") + throw new ApiRequestError( + "Session expired", + response.status, + response.statusText, + null, + url, + method, + ) } if (!response.ok) { let detail: unknown = response.statusText @@ -386,7 +491,7 @@ async function requestJson(url: string, options: RequestInit = {}): Promise - detail = record.detail || record.error || detail + detail = messageForApiError(record, String(detail || "Request failed")) } } catch { detail = response.statusText @@ -394,7 +499,10 @@ async function requestJson(url: string, options: RequestInit = {}): Promise @@ -567,6 +675,7 @@ function App() { const [agentReport, setAgentReport] = useState(null) const [jobDetail, setJobDetail] = useState(null) const [loading, setLoading] = useState>({}) + const [devErrors, setDevErrors] = useState([]) const [historicalPersonChoice, setHistoricalPersonChoice] = useState<{ projectId: string person: string @@ -619,6 +728,13 @@ function App() { setToast({ message, tone }) } + function showError(error: unknown, fallback: string) { + showToast(messageFromUnknown(error, fallback), "error") + if (import.meta.env.DEV) { + setDevErrors((current) => [devErrorFromUnknown(error, fallback), ...current].slice(0, 8)) + } + } + function setBusy(key: string, value: boolean) { setLoading((current) => ({ ...current, [key]: value })) } @@ -736,7 +852,7 @@ function App() { setJobs(payload) showToast(`Loaded ${payload.length} jobs`, "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load jobs", "error") + showError(error, "Unable to load jobs") } finally { setBusy("jobs", false) } @@ -750,7 +866,7 @@ function App() { showToast(`Loaded ${payload.length} gig${payload.length === 1 ? "" : "s"}`, "ok") void loadNotifications() } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load gigs", "error") + showError(error, "Unable to load gigs") } finally { setBusy("gigs", false) } @@ -767,7 +883,7 @@ function App() { "ok", ) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load projects", "error") + showError(error, "Unable to load projects") } finally { setBusy("projects", false) } @@ -782,7 +898,7 @@ function App() { }) showToast(`Queued project sync ${payload.job_id}`, "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to queue project sync", "error") + showError(error, "Unable to queue project sync") } finally { setBusy("syncProjects", false) } @@ -804,7 +920,7 @@ function App() { ) showToast("Updated project status", "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to update project", "error") + showError(error, "Unable to update project") } finally { setBusy(`project:${projectId}:status`, false) } @@ -838,7 +954,7 @@ function App() { ) return failures.length === 0 } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to bulk update projects", "error") + showError(error, "Unable to bulk update projects") return false } finally { setBusy("projectsBulkUpdate", false) @@ -864,7 +980,7 @@ function App() { showToast("Added project user", "ok") return true } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to add project user", "error") + showError(error, "Unable to add project user") return false } finally { setBusy(`project:${projectId}:user`, false) @@ -904,7 +1020,7 @@ function App() { return false } } - showToast(error instanceof Error ? error.message : "Unable to add historical member", "error") + showError(error, "Unable to add historical member") return false } finally { setBusy(`project:${projectId}:historical`, false) @@ -925,7 +1041,7 @@ function App() { showToast(status === "no_row" ? "Marked as no wiki row" : "Confirmed wiki match", "ok") await loadWikiMatches() } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to save wiki match", "error") + showError(error, "Unable to save wiki match") } finally { setBusy(`project:${projectId}:wiki`, false) } @@ -938,7 +1054,7 @@ function App() { setWikiMatches(payload) showToast("Loaded wiki match preview", "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load wiki matches", "error") + showError(error, "Unable to load wiki matches") } finally { setBusy("wikiMatches", false) } @@ -951,7 +1067,7 @@ function App() { setGigDetail(payload) } catch (error) { setGigDetail(null) - showToast(error instanceof Error ? error.message : "Unable to load gig", "error") + showError(error, "Unable to load gig") } finally { setBusy(`gig:${gigId}:detail`, false) } @@ -972,7 +1088,7 @@ function App() { setStaleRecruitingDays(payload.stale_days || 7) setNotifications(payload.notifications || []) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load notifications", "error") + showError(error, "Unable to load notifications") } finally { setBusy("notifications", false) } @@ -999,7 +1115,7 @@ function App() { await loadGigs() if (selectedGigId === gigId) await loadGigDetail(gigId) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to update gig", "error") + showError(error, "Unable to update gig") } finally { setBusy(`gig:${gigId}:status`, false) } @@ -1026,7 +1142,7 @@ function App() { await loadGigs() if (selectedGigId === gigId) await loadGigDetail(gigId) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to update candidate", "error") + showError(error, "Unable to update candidate") } finally { setBusy(`application:${applicationId}:status`, false) } @@ -1048,7 +1164,7 @@ function App() { const payload = await requestJson(peopleUrl()) setPeople(payload) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load people", "error") + showError(error, "Unable to load people") } finally { setBusy("people", false) } @@ -1071,7 +1187,7 @@ function App() { const payload = await requestJson(onboardingUrl()) setOnboarding(payload) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load onboarding", "error") + showError(error, "Unable to load onboarding") } finally { setBusy("onboarding", false) } @@ -1082,7 +1198,7 @@ function App() { try { setAuditEvents(await requestJson("/dashboard/api/audit-events?limit=25")) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load audit events", "error") + showError(error, "Unable to load audit events") } finally { setBusy("audit", false) } @@ -1093,7 +1209,7 @@ function App() { try { setAgentReport(await requestJson("/dashboard/api/agent?limit=100")) } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load agent report", "error") + showError(error, "Unable to load agent report") } finally { setBusy("agent", false) } @@ -1109,7 +1225,7 @@ function App() { setJobDetail(detail) showToast(`Loaded ${jobId}`, "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to load job detail", "error") + showError(error, "Unable to load job detail") } finally { setBusy(`detail:${jobId}`, false) } @@ -1126,7 +1242,7 @@ function App() { showToast(`Queued rerun ${payload.job_id}`, "ok") await loadJobs() } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to rerun job", "error") + showError(error, "Unable to rerun job") } finally { setBusy(`rerun:${jobId}`, false) } @@ -1141,7 +1257,7 @@ function App() { }) showToast(`Queued people sync ${payload.job_id}`, "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to queue people sync", "error") + showError(error, "Unable to queue people sync") } finally { setBusy("syncPeople", false) } @@ -1191,7 +1307,7 @@ function App() { ) showToast(`Assigned ${payload.onboarder}`, "ok") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to assign onboarder", "error") + showError(error, "Unable to assign onboarder") } finally { setBusy(`onboarder:${normalizedContactId}`, false) } @@ -1205,7 +1321,7 @@ function App() { }) window.location.assign(payload.end_session_url || "/dashboard") } catch (error) { - showToast(error instanceof Error ? error.message : "Unable to log out", "error") + showError(error, "Unable to log out") setBusy("logout", false) } } @@ -1229,7 +1345,7 @@ function App() { } }) .catch((error: unknown) => { - showToast(error instanceof Error ? error.message : "Dashboard failed to load", "error") + showError(error, "Dashboard failed to load") }) }, []) @@ -1249,6 +1365,23 @@ function App() { return () => window.clearTimeout(timeout) }, [toast.message]) + // biome-ignore lint/correctness/useExhaustiveDependencies: dev diagnostics should subscribe once to global browser errors. + useEffect(() => { + if (!import.meta.env.DEV) return undefined + const onError = (event: ErrorEvent) => { + showError(event.error || event.message, "Unhandled dashboard error") + } + const onUnhandledRejection = (event: PromiseRejectionEvent) => { + showError(event.reason, "Unhandled promise rejection") + } + window.addEventListener("error", onError) + window.addEventListener("unhandledrejection", onUnhandledRejection) + return () => { + window.removeEventListener("error", onError) + window.removeEventListener("unhandledrejection", onUnhandledRejection) + } + }, []) + // biome-ignore lint/correctness/useExhaustiveDependencies: each loader reads the latest filter state for the active view. useEffect(() => { if (permissions.length === 0) return @@ -1463,6 +1596,9 @@ function App() { onOpenNotification={openNotification} /> + {import.meta.env.DEV ? ( + setDevErrors([])} /> + ) : null} void +}) { + if (errors.length === 0) return null + const [latest, ...previous] = errors + const status = latest.status === 0 ? "Network" : latest.status + const endpoint = [latest.method, latest.url].filter(Boolean).join(" ") + const statusLabel = [status, latest.statusText].filter(Boolean).join(" ") + const payload = + latest.payload === null || latest.payload === undefined + ? "" + : JSON.stringify(latest.payload, null, 2) + const summaryFields = [ + ["Endpoint", endpoint], + ["Status", statusLabel || latest.name], + ["Route", latest.path], + ["View", latest.view], + ["Detail", latest.detail], + ["Error", latest.error], + ].filter(([, value]) => Boolean(value)) + + return ( + + ) +} + function FilterChips({ filters, onRemove, diff --git a/apps/api/src/five08/backend/api.py b/apps/api/src/five08/backend/api.py index aabde01f..d2b35273 100644 --- a/apps/api/src/five08/backend/api.py +++ b/apps/api/src/five08/backend/api.py @@ -2739,6 +2739,39 @@ def __init__( self.detail = detail +def _historical_project_member_error_payload( + exc: HistoricalProjectMemberResolutionError, + *, + person: str, +) -> dict[str, Any]: + """Return dashboard-friendly resolution error details.""" + if exc.detail: + detail = exc.detail + elif exc.code == "person_not_found": + detail = ( + f'No CRM person, ERPNext user, or ERPNext supplier matched "{person}". ' + "Try an email address or an exact name from CRM/ERPNext." + ) + elif exc.code == "candidate_not_found": + detail = ( + "The selected person record is no longer available. Search again and " + "choose one of the current matches." + ) + elif exc.code == "ambiguous_person": + detail = ( + f'Multiple people matched "{person}". Choose the matching person record.' + ) + else: + detail = "Unable to resolve that person for the historical roster." + + return { + "error": exc.code, + "detail": detail, + "person": person, + "candidates": exc.candidates, + } + + def _text_or_none(value: Any) -> str | None: if value is None: return None @@ -3492,11 +3525,7 @@ async def dashboard_add_project_historical_member_handler( except HistoricalProjectMemberResolutionError as exc: status_code = 409 if exc.candidates else 400 return JSONResponse( - { - "error": exc.code, - "detail": exc.detail, - "candidates": exc.candidates, - }, + _historical_project_member_error_payload(exc, person=normalized_person), status_code=status_code, ) except ValueError: diff --git a/apps/api/src/five08/backend/static/dashboard/.vite/manifest.json b/apps/api/src/five08/backend/static/dashboard/.vite/manifest.json index 84f5f4ed..0eaab464 100644 --- a/apps/api/src/five08/backend/static/dashboard/.vite/manifest.json +++ b/apps/api/src/five08/backend/static/dashboard/.vite/manifest.json @@ -1,11 +1,11 @@ { "index.html": { - "file": "assets/index-617IyoY5.js", + "file": "assets/index-WxptdPpM.js", "name": "index", "src": "index.html", "isEntry": true, "css": [ - "assets/index-Cjc8hvil.css" + "assets/index-CIisEPpj.css" ] } } \ No newline at end of file diff --git a/apps/api/src/five08/backend/static/dashboard/assets/index-617IyoY5.js b/apps/api/src/five08/backend/static/dashboard/assets/index-617IyoY5.js deleted file mode 100644 index 35889d8c..00000000 --- a/apps/api/src/five08/backend/static/dashboard/assets/index-617IyoY5.js +++ /dev/null @@ -1,9 +0,0 @@ -var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function te(){}var S={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function re(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return re(e.type,t,e.props)}function ae(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function oe(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var se=/\/+/g;function ce(e,t){return typeof e==`object`&&e&&e.key!=null?oe(``+e.key):t.toString(36)}function C(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(te,te):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function le(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,le(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ce(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(se,`$&/`)+`/`),le(o,r,i,``,function(e){return e})):o!=null&&(ae(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(se,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{n.exports=t()})),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},l=n(),u=(0,l.createContext)({}),d=()=>(0,l.useContext)(u),f=(0,l.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:u,...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=d()??{},y=i??g?Number(n??h)*24/Number(t??m):n??h;return(0,l.createElement)(`svg`,{ref:p,...s,width:t??m??s.width,height:t??m??s.height,stroke:e??_,strokeWidth:y,className:r(`lucide`,v,a),...!o&&!c(f)&&{"aria-hidden":`true`},...f},[...u.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(o)?o:[o]])}),p=(e,t)=>{let n=(0,l.forwardRef)(({className:n,...a},s)=>(0,l.createElement)(f,{ref:s,iconNode:t,className:r(`lucide-${i(o(e))}`,`lucide-${e}`,n),...a}));return n.displayName=o(e),n},m=p(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),h=p(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),g=p(`briefcase-business`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),_=p(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),v=p(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),y=p(`file-clock`,[[`path`,{d:`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85`,key:`ryk6xj`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 14v2.2l1.6 1`,key:`6m4bie`}],[`circle`,{cx:`8`,cy:`16`,r:`6`,key:`10v15b`}]]),b=p(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),x=p(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ee=p(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),te=p(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),S=p(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ne=p(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),re=p(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ie=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,ae());else{var t=n(l);t!==null&&ce(x,t.startTime-e)}}var ee=!1,te=-1,S=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():ee=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){te=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ce(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ae=e(((e,t)=>{t.exports=ie()})),oe=e((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=oe()})),ce=e((e=>{var t=ae(),r=n(),i=se();function a(e){var t=`https://react.dev/errors/`+e;if(1me||(e.current=pe[me],pe[me]=null,me--)}function O(e,t){me++,pe[me]=e.current,e.current=t}var he=E(null),ge=E(null),_e=E(null),ve=E(null);function ye(e,t){switch(O(_e,t),O(ge,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}D(he),O(he,e)}function be(){D(he),D(ge),D(_e)}function xe(e){e.memoizedState!==null&&O(ve,e);var t=he.current,n=Hd(t,e.type);t!==n&&(O(ge,e),O(he,n))}function Se(e){ge.current===e&&(D(he),D(ge)),ve.current===e&&(D(ve),Qf._currentValue=fe)}var Ce,we;function k(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?k(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return k(e.type);case 16:return k(`Lazy`);case 13:return e.child!==t&&t!==null?k(`Suspense Fallback`):k(`Suspense`);case 19:return k(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return k(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,A=262144,Ze=4194304;function Qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $e(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Qe(n))):i=Qe(o):i=Qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Qe(n))):i=Qe(o)):i=Qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 nt(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function V(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.textContent,a=i.length;for(e=0;e=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=V(),fn=dn=un=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Tr=sn&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==It(r)||(r=Er,`selectionStart`in r&&wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Or&&yr(Or,r)||(Or=r,r=Ed(Dr,`onSelect`),0>=o,i-=o,Si=1<<32-Ke(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&wi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),U&&wi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&wi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),U&&wi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&wa(l)===r.type){n(e,r.sibling),c=i(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=wa(o),b(e,r,o,c)}if(de(o))return v(e,r,o,c);if(C(o)){if(l=C(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===x)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Y&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=w.T,s={};w.T=s,Ms(e,!1,t,n);try{var c=i(),l=w.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{T.p=a,o!==null&&s.types!==null&&(o.types=s.types),w.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Cs(e).queue;bs(e,i,t,fe,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:fe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=za(n);var r=Ba(t,e,n);r!==null&&(hu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Qr(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,vr(s,o))return Zr(e,t,i,0),q===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(a(479))}else t=Qr(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ge(!0);try{n(t)}finally{Ge(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,i=Do();if(U){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),q===null)throw Error(a(349));Y&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[N]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=_e.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ki,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[N]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[N]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[N]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(a(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[N]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),i=!1}else i=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return be(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(D(oo),r=t.memoizedState,r===null)return Ic(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return O(oo,oo.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>tu&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}else{if(!i)if(e=so(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*Pe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=oo.current,O(oo,i?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&D(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Rc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),be(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(a(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(oo),null;case 4:return be(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&D(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:D(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&D(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ft]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[N]=e,t[ft]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Cr(e),wr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[N]=e,Ct(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=xr(s,h),v=xr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,w.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(a(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{T.p=i,w.T=r,Vu(e,t)}}function Wu(e,t,n){t=mi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(it(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=mi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),it(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Pe()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=nt()),e=$r(e,t),e!==null&&(it(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ae(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=$e(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Pe(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=St(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ct(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=_e.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=St(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=St(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=St(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Rt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Rt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,Ct(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ct(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ce()}))();function le(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,w=ue,T=(e,t)=>n=>{if(t?.variants==null)return w(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=de(t)||de(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return w(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},fe=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),me=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),E=`-`,D=[],O=`arbitrary..`,he=e=>{let t=ve(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return _e(e);let n=e.split(E);return ge(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?fe(i,t):t:i||D}return n[e]||D}}},ge=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ge(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(E):e.slice(t).join(E),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?O+r:void 0})(),ve=e=>{let{theme:t,classGroups:n}=e;return ye(n,t)},ye=(e,t)=>{let n=me();for(let r in e){let i=e[r];be(i,n,r,t)}return n},be=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){Se(e,t,n);return}if(typeof e==`function`){Ce(e,t,n,r);return}we(e,t,n,r)},Se=(e,t,n)=>{let r=e===``?t:k(t,e);r.classGroupId=n},Ce=(e,t,n,r)=>{if(Te(e)){be(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pe(n,e))},we=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(E),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},De=`!`,Oe=`:`,ke=[],Ae=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),je=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return Ae(t,l,c,u)};if(t){let e=t+Oe,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ae(ke,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Me=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ne=e=>({cache:Ee(e.cacheSize),parseClassName:je(e),sortModifiers:Me(e),postfixLookupClassGroupIds:Pe(e),...he(e)}),Pe=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Fe),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+De:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},Le=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=Ne(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ie(e,n);return i(e,a),a};return a=o,(...e)=>a(Le(...e))},Be=[],Ve=e=>{let t=t=>t[e]||Be;return t.isThemeGetter=!0,t},He=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ue=/^\((?:(\w[\w-]*):)?(.+)\)$/i,We=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ge=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ke=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Je=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xe=e=>We.test(e),A=e=>!!e&&!Number.isNaN(Number(e)),Ze=e=>!!e&&Number.isInteger(Number(e)),Qe=e=>e.endsWith(`%`)&&A(e.slice(0,-1)),$e=e=>Ge.test(e),et=()=>!0,tt=e=>Ke.test(e)&&!qe.test(e),nt=()=>!1,rt=e=>Je.test(e),it=e=>Ye.test(e),at=e=>!j(e)&&!P(e),ot=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),st=e=>bt(e,wt,nt),j=e=>He.test(e),ct=e=>bt(e,Tt,tt),lt=e=>bt(e,Et,A),ut=e=>bt(e,Ot,et),dt=e=>bt(e,Dt,nt),M=e=>bt(e,St,nt),N=e=>bt(e,Ct,it),ft=e=>bt(e,kt,rt),P=e=>Ue.test(e),pt=e=>xt(e,Tt),mt=e=>xt(e,Dt),ht=e=>xt(e,St),gt=e=>xt(e,wt),_t=e=>xt(e,Ct),vt=e=>xt(e,kt,!0),yt=e=>xt(e,Ot,!0),bt=(e,t,n)=>{let r=He.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},xt=(e,t,n=!1)=>{let r=Ue.exec(e);return r?r[1]?t(r[1]):n:!1},St=e=>e===`position`||e===`percentage`,Ct=e=>e===`image`||e===`url`,wt=e=>e===`length`||e===`size`||e===`bg-size`,Tt=e=>e===`length`,Et=e=>e===`number`,Dt=e=>e===`family-name`,Ot=e=>e===`number`||e===`weight`,kt=e=>e===`shadow`,At=ze(()=>{let e=Ve(`color`),t=Ve(`font`),n=Ve(`text`),r=Ve(`font-weight`),i=Ve(`tracking`),a=Ve(`leading`),o=Ve(`breakpoint`),s=Ve(`container`),c=Ve(`spacing`),l=Ve(`radius`),u=Ve(`shadow`),d=Ve(`inset-shadow`),f=Ve(`text-shadow`),p=Ve(`drop-shadow`),m=Ve(`blur`),h=Ve(`perspective`),g=Ve(`aspect`),_=Ve(`ease`),v=Ve(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),P,j],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],te=()=>[`auto`,`contain`,`none`],S=()=>[P,j,c],ne=()=>[Xe,`full`,`auto`,...S()],re=()=>[Ze,`none`,`subgrid`,P,j],ie=()=>[`auto`,{span:[`full`,Ze,P,j]},Ze,P,j],ae=()=>[Ze,`auto`,P,j],oe=()=>[`auto`,`min`,`max`,`fr`,P,j],se=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ce=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],C=()=>[`auto`,...S()],le=()=>[Xe,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...S()],ue=()=>[Xe,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...S()],de=()=>[Xe,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...S()],w=()=>[e,P,j],T=()=>[...b(),ht,M,{position:[P,j]}],fe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],pe=()=>[`auto`,`cover`,`contain`,gt,st,{size:[P,j]}],me=()=>[Qe,pt,ct],E=()=>[``,`none`,`full`,l,P,j],D=()=>[``,A,pt,ct],O=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[A,Qe,ht,M],_e=()=>[``,`none`,m,P,j],ve=()=>[`none`,A,P,j],ye=()=>[`none`,A,P,j],be=()=>[A,P,j],xe=()=>[Xe,`full`,...S()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$e],breakpoint:[$e],color:[et],container:[$e],"drop-shadow":[$e],ease:[`in`,`out`,`in-out`],font:[at],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$e],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$e],shadow:[$e],spacing:[`px`,A],text:[$e],"text-shadow":[$e],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Xe,j,P,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,P,j]}],"container-named":[ot],columns:[{columns:[A,j,P,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ze,`auto`,P,j]}],basis:[{basis:[Xe,`full`,`auto`,s,...S()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[A,Xe,`auto`,`initial`,`none`,j]}],grow:[{grow:[``,A,P,j]}],shrink:[{shrink:[``,A,P,j]}],order:[{order:[Ze,`first`,`last`,`none`,P,j]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...se(),`normal`]}],"justify-items":[{"justify-items":[...ce(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ce()]}],"align-content":[{content:[`normal`,...se()]}],"align-items":[{items:[...ce(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ce(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...ce(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ce()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":S()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":S()}],"space-y-reverse":[`space-y-reverse`],size:[{size:le()}],"inline-size":[{inline:[`auto`,...ue()]}],"min-inline-size":[{"min-inline":[`auto`,...ue()]}],"max-inline-size":[{"max-inline":[`none`,...ue()]}],"block-size":[{block:[`auto`,...de()]}],"min-block-size":[{"min-block":[`auto`,...de()]}],"max-block-size":[{"max-block":[`none`,...de()]}],w:[{w:[s,`screen`,...le()]}],"min-w":[{"min-w":[s,`screen`,`none`,...le()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...le()]}],h:[{h:[`screen`,`lh`,...le()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...le()]}],"max-h":[{"max-h":[`screen`,`lh`,...le()]}],"font-size":[{text:[`base`,n,pt,ct]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,yt,ut]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Qe,j]}],"font-family":[{font:[mt,dt,t]}],"font-features":[{"font-features":[j]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,P,j]}],"line-clamp":[{"line-clamp":[A,`none`,P,lt]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":[`none`,P,j]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,P,j]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...O(),`wavy`]}],"text-decoration-thickness":[{decoration:[A,`from-font`,`auto`,P,ct]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[A,`auto`,P,j]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:S()}],"tab-size":[{tab:[Ze,P,j]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,P,j]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,P,j]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ze,P,j],radial:[``,P,j],conic:[Ze,P,j]},_t,N]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-bs":[{"border-bs":D()}],"border-w-be":[{"border-be":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":D()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...O(),`hidden`,`none`]}],"divide-style":[{divide:[...O(),`hidden`,`none`]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-bs":[{"border-bs":w()}],"border-color-be":[{"border-be":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...O(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[A,P,j]}],"outline-w":[{outline:[``,A,pt,ct]}],"outline-color":[{outline:w()}],shadow:[{shadow:[``,`none`,u,vt,ft]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":[`none`,d,vt,ft]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:D()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[A,ct]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":[`none`,f,vt,ft]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[A,P,j]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[A]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[P,j]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[A]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,P,j]}],filter:[{filter:[``,`none`,P,j]}],blur:[{blur:_e()}],brightness:[{brightness:[A,P,j]}],contrast:[{contrast:[A,P,j]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,vt,ft]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:[``,A,P,j]}],"hue-rotate":[{"hue-rotate":[A,P,j]}],invert:[{invert:[``,A,P,j]}],saturate:[{saturate:[A,P,j]}],sepia:[{sepia:[``,A,P,j]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,P,j]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[A,P,j]}],"backdrop-contrast":[{"backdrop-contrast":[A,P,j]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,A,P,j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[A,P,j]}],"backdrop-invert":[{"backdrop-invert":[``,A,P,j]}],"backdrop-opacity":[{"backdrop-opacity":[A,P,j]}],"backdrop-saturate":[{"backdrop-saturate":[A,P,j]}],"backdrop-sepia":[{"backdrop-sepia":[``,A,P,j]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,P,j]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[A,`initial`,P,j]}],ease:[{ease:[`linear`,`initial`,_,P,j]}],delay:[{delay:[A,P,j]}],animate:[{animate:[`none`,v,P,j]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,P,j]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[P,j,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ze,P,j]}],accent:[{accent:w()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,P,j]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":w()}],"scrollbar-track-color":[{"scrollbar-track":w()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,P,j]}],fill:[{fill:[`none`,...w()]}],"stroke-w":[{stroke:[A,pt,ct,lt]}],stroke:[{stroke:[`none`,...w()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function jt(...e){return At(ue(e))}var Mt=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=e(((e,t)=>{t.exports=Mt()}))(),Nt=T(`inline-flex min-h-[22px] items-center rounded-full border px-2 py-0.5 text-[11px] font-extrabold uppercase leading-tight`,{variants:{variant:{neutral:`border-border bg-secondary text-muted-foreground`,succeeded:`border-emerald-400/35 bg-emerald-500/15 text-emerald-300`,failed:`border-red-400/40 bg-red-500/15 text-red-300`,dead:`border-red-400/40 bg-red-500/15 text-red-300`,missing:`border-red-400/40 bg-red-500/15 text-red-300`,running:`border-amber-400/40 bg-amber-500/15 text-amber-300`,queued:`border-teal-400/40 bg-teal-500/15 text-teal-200`,canceled:`border-border bg-secondary text-muted-foreground`}},defaultVariants:{variant:`neutral`}});function I({className:e,variant:t,...n}){return(0,F.jsx)(`span`,{"data-slot":`badge`,className:jt(Nt({variant:t,className:e})),...n})}var Pt=T(`inline-flex min-h-9 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md border text-sm font-semibold transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`border-border bg-secondary text-secondary-foreground hover:bg-secondary/80`,outline:`border-border bg-background hover:bg-accent hover:text-accent-foreground`,ghost:`border-transparent hover:bg-accent hover:text-accent-foreground`,destructive:`border-destructive bg-destructive text-white hover:bg-destructive/90`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,icon:`size-9`}},defaultVariants:{variant:`secondary`,size:`default`}});function L({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,F.jsx)(`button`,{"data-slot":`button`,type:r,className:jt(Pt({variant:t,size:n,className:e})),...i})}function R({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card`,className:jt(`rounded-lg border bg-card text-card-foreground shadow-[0_18px_44px_rgb(0_0_0/0.22)]`,e),...t})}function Ft({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-header`,className:jt(`flex items-center justify-between gap-3 border-b px-4 py-3`,e),...t})}function It({className:e,...t}){return(0,F.jsx)(`h2`,{"data-slot":`card-title`,className:jt(`text-[15px] font-bold`,e),...t})}function Lt({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-content`,className:jt(`p-4`,e),...t})}function Rt({className:e,type:t,...n}){return(0,F.jsx)(`input`,{"data-slot":`input`,type:t,className:jt(`flex min-h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function zt({className:e,...t}){return(0,F.jsx)(`label`,{"data-slot":`label`,className:jt(`grid gap-1.5 text-xs font-bold text-muted-foreground`,e),...t})}function Bt({className:e,...t}){return(0,F.jsx)(`select`,{"data-slot":`select`,className:jt(`flex min-h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}function Vt({className:e,...t}){return(0,F.jsx)(`table`,{"data-slot":`table`,className:jt(`w-full border-collapse text-sm`,e),...t})}function Ht({className:e,...t}){return(0,F.jsx)(`thead`,{"data-slot":`table-header`,className:e,...t})}function Ut({className:e,...t}){return(0,F.jsx)(`tbody`,{"data-slot":`table-body`,className:e,...t})}function Wt({className:e,...t}){return(0,F.jsx)(`tr`,{"data-slot":`table-row`,className:jt(`border-b transition-colors hover:bg-muted/45`,e),...t})}function z({className:e,...t}){return(0,F.jsx)(`th`,{"data-slot":`table-head`,className:jt(`bg-secondary px-3 py-3 text-left align-middle text-xs font-extrabold text-muted-foreground`,e),...t})}function B({className:e,...t}){return(0,F.jsx)(`td`,{"data-slot":`table-cell`,className:jt(`px-3 py-3 align-middle text-sm`,e),...t})}var Gt={pending:`Needs review`,selected:`Assigned to onboarder`,reachingout:`Reaching out`,awaitingcontribution:`Awaiting contribution`,onboarded:`Onboarded`,waitlist:`Waitlist`,rejected:`Rejected`};function Kt(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function qt(e,t=new Date){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;let r=t.getTime()-n.getTime();return r<0?0:Math.floor(r/864e5)}function Jt(e){return e==null?``:JSON.stringify(e,null,2)}function Yt(e){return e.onboarding_state||e.onboardingState||e.cOnboardingState||``}function Xt(e){let t=String(e||``).trim();if(!t)return`No status`;let n=t.toLowerCase();return Gt[n]?Gt[n]:t.replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Zt(e){let t=String(e||``).trim().toLowerCase();return!t||t===`pending`?`neutral`:t===`selected`?`queued`:t===`rejected`?`failed`:t===`onboarded`?`succeeded`:t===`waitlist`?`running`:`queued`}function Qt(e){let t=String(e||``).trim();return!t||t.toLowerCase()===`none`?``:t}function $t(e){let t=String(e||``).trim();return t?/^https?:\/\//i.test(t)?t:`https://${t.replace(/^\/+/,``)}`:``}function en(e){try{return new URL($t(e))}catch{return null}}function tn(e,t){let n=e.toLowerCase();return n===t||n.endsWith(`.${t}`)}function nn(e){return e.split(`/`).filter(Boolean).map(e=>encodeURIComponent(e)).join(`/`)}function rn(e){let t=String(e||``).trim();if(!t)return``;let n=en(t);if(n&&tn(n.hostname,`linkedin.com`))return n.href;if(/^https?:\/\//i.test(t))return``;let r=t.replace(/^@/,``).replace(/^\/+|\/+$/g,``).replace(/^in\//i,``);return r?`https://www.linkedin.com/in/${nn(r)}`:``}function an(e){let t=String(e||``).trim().replace(/^@/,``);if(!t)return``;let n=en(t);if(n&&tn(n.hostname,`github.com`))return n.href;if(/^https?:\/\//i.test(t))return``;let r=t.replace(/^\/+|\/+$/g,``);return r?`https://github.com/${nn(r)}`:``}var on={people:`/dashboard/people`,gigs:`/dashboard/gigs`,projects:`/dashboard/projects`,onboarding:`/dashboard/onboarding`,jobs:`/dashboard/jobs`,agent:`/dashboard/agent`,audit:`/dashboard/audit`},sn={people:`people:read`,gigs:`gigs:read`,projects:`projects:read`,onboarding:`onboarding:read`,jobs:`jobs:read`,agent:`audit:read`,audit:`audit:read`},cn={discord:{label:`Discord`,options:[[`linked`,`Linked`],[`missing`,`Missing`]]},email_508:{label:`508 email`,options:[[`present`,`Present`],[`missing`,`Missing`]]},resume:{label:`Resume`,options:[[`present`,`Present`],[`missing`,`Missing`]]},skills:{label:`Skills`,options:[[`present`,`Parsed`],[`missing`,`Not parsed`]]},sync_status:{label:`Sync status`,options:[[`active`,`Active`],[`conflict`,`Conflict`],[`missing_in_crm`,`Missing in CRM`]]}},ln=class extends Error{status;payload;constructor(e,t,n){super(e),this.name=`ApiRequestError`,this.status=t,this.payload=n}};function un(){return window.location.pathname.split(`/`).filter(Boolean)[1]||``}function dn(){let e=un();return Object.hasOwn(on,e)?e:`people`}function fn(e=`gigs`){let[,t,n]=window.location.pathname.split(`/`).filter(Boolean);if(t!==e||!n)return``;try{return decodeURIComponent(n)}catch{return``}}async function V(e,t={}){let n=new Headers(t.headers);n.set(`Accept`,`application/json`);let r=await fetch(e,{credentials:`same-origin`,...t,headers:n});if(r.status===401){let e=`${window.location.pathname}${window.location.search}`||`/dashboard`;throw window.location.assign(`/auth/login?next=${encodeURIComponent(e)}`),Error(`Session expired`)}if(!r.ok){let e=r.statusText,t=null;try{if(t=await r.json(),t&&typeof t==`object`){let n=t;e=n.detail||n.error||e}}catch{e=r.statusText}throw new ln(typeof e==`string`?e:JSON.stringify(e),r.status,t)}return r.json()}function pn(e,t,n){if(e===`gigs`){let e=t;if(n===`title`)return e.title||``;if(n===`status`)return e.status||``;if(n===`applications`)return Number(e.application_count||0);if(n===`activity`)return En(e)}if(e===`projects`){let e=t;if(n===`display_name`)return e.display_name||``;if(n===`customer`)return e.customer||``;if(n===`status`)return e.source_status||``;if(n===`roster_count`)return Number(e.roster_count||0);if(n===`modified`)return e.source_modified_at||e.last_synced_at||``}if(e===`onboarding`){let e=t,r=e.profile_status||{};if(n===`name`)return e.name||e.email_508||e.email||``;if(n===`onboarding_state`){let t=Yt(e);return t.toLowerCase()===`pending`?`zzz-${t}`:t}if(n===`onboarder`)return e.onboarder||``;if(n===`updated`)return e.onboarding_updated_at||``;if(n===`profile_gaps`)return[!r.discord_linked,!r.latest_resume,Number(r.skills_count||0)<=0].filter(Boolean).length}if(e===`people`){let e=t,r=e.profile_status||{};if(n===`name`)return e.name||e.email_508||e.email||``;if(n===`status`)return[r.crm_active,r.is_member,r.discord_linked,r.email_508,r.latest_resume].filter(Boolean).length;if(n===`discord`)return e.discord_username||e.discord_user_id||``;if(n===`resume`)return e.latest_resume_name||e.latest_resume_id||``}if(e===`audit`){let e=t;if(n===`actor`)return e.actor_display_name||e.actor_subject||e.actor_provider||``}return t[n]??``}function mn(e,t,n){let r=n.direction===`asc`?1:-1;return[...t].sort((t,i)=>{let a=pn(e,t,n.key),o=pn(e,i,n.key);return typeof a==`number`&&typeof o==`number`?(a-o)*r:String(a).localeCompare(String(o),void 0,{numeric:!0})*r})}function hn({label:e,scope:t,sort:n,sortKey:r,onSort:i}){let a=n.key===r,o=n.direction===`asc`?`↑`:`↓`;return(0,F.jsx)(`button`,{type:`button`,"data-sort-scope":t,"data-sort-key":r,className:`text-left font-[inherit] text-inherit hover:text-foreground`,onClick:()=>i(t,r),children:a?`${e} ${o}`:e})}function H({className:e,label:t,scope:n,sort:r,sortKey:i,onSort:a}){return(0,F.jsx)(z,{className:e,"aria-sort":r.key===i?r.direction===`asc`?`ascending`:`descending`:`none`,children:(0,F.jsx)(hn,{label:t,scope:n,sort:r,sortKey:i,onSort:a})})}function gn({label:e,value:t,id:n}){return(0,F.jsxs)(R,{className:`p-4`,children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:e}),(0,F.jsx)(`strong`,{id:n,className:`block text-2xl`,children:t})]})}function _n({children:e,hidden:t}){return t?null:(0,F.jsx)(`div`,{className:`px-4 py-7 text-center text-sm text-muted-foreground`,children:e})}function vn(){let e=fn(`projects`),[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)(dn()),[a,o]=(0,l.useState)({message:``}),[s,c]=(0,l.useState)([]),[u,d]=(0,l.useState)(``),[f,p]=(0,l.useState)([]),[m,v]=(0,l.useState)([]),[ee,te]=(0,l.useState)([]),[re,ie]=(0,l.useState)({}),[ae,oe]=(0,l.useState)(null),[se,ce]=(0,l.useState)(null),[C,le]=(0,l.useState)(fn()),[ue,de]=(0,l.useState)(e),[w,T]=(0,l.useState)([]),[fe,pe]=(0,l.useState)(!1),[me,E]=(0,l.useState)([]),[D,O]=(0,l.useState)([]),[he,ge]=(0,l.useState)([]),[_e,ve]=(0,l.useState)(null),[ye,be]=(0,l.useState)(null),[xe,Se]=(0,l.useState)({}),[Ce,we]=(0,l.useState)(null),[k,Te]=(0,l.useState)({onboarding:{key:`onboarding_state`,direction:`asc`},gigs:{key:`activity`,direction:`desc`},projects:{key:`display_name`,direction:`asc`},jobs:{key:`updated_at`,direction:`desc`},people:{key:`name`,direction:`asc`},agent:{key:`occurred_at`,direction:`desc`},audit:{key:`occurred_at`,direction:`desc`}}),[Ee,De]=(0,l.useState)(`60`),[Oe,ke]=(0,l.useState)(``),[Ae,je]=(0,l.useState)(``),[Me,Ne]=(0,l.useState)(``),[Pe,Fe]=(0,l.useState)(100),[Ie,Le]=(0,l.useState)(``),[Re,ze]=(0,l.useState)(e?``:`Open`),[Be,Ve]=(0,l.useState)(7),[He,Ue]=(0,l.useState)(``),[We,Ge]=(0,l.useState)(``),[Ke,qe]=(0,l.useState)({}),[Je,Ye]=(0,l.useState)(`discord`),[Xe,A]=(0,l.useState)(`linked`),[Ze,Qe]=(0,l.useState)(``),[$e,et]=(0,l.useState)(``),[tt,nt]=(0,l.useState)(``),[rt,it]=(0,l.useState)({}),[at,ot]=(0,l.useState)(`discord`),[st,j]=(0,l.useState)(`linked`),ct=(0,l.useRef)(()=>void 0);function lt(e){return s.includes(e)}function ut(e){return lt(sn[e])}function dt(){return Object.keys(on).find(e=>ut(e))||`people`}function M(e,t){o({message:e,tone:t})}function N(e,t){Se(n=>({...n,[e]:t}))}function ft(e,t=!1){let n=e;ut(n)||(M(`${n[0].toUpperCase()}${n.slice(1)} requires SSO validation`,`error`),n=dt()),n!==`gigs`&&le(``),n!==`projects`&&de(``),n===`gigs`&&t&&le(``),n===`projects`&&t&&de(``),i(n),t?window.history.pushState({view:n},``,on[n]):(!Object.hasOwn(on,un())||n!==e)&&window.history.replaceState({view:n},``,on[n])}ct.current=ft;function P(e){return!u||!e?``:`${u}/#Contact/view/${encodeURIComponent(e)}`}function pt(e){return!u||!e?``:`${u}/api/v1/Attachment/file/${encodeURIComponent(e)}`}function mt(e,t){Te(n=>{let r=n[e];return{...n,[e]:{key:t,direction:r.key===t&&r.direction===`asc`?`desc`:`asc`}}})}function ht(e){le(e),ce(m.find(t=>t.id===e)||null),i(`gigs`),window.history.pushState({view:`gigs`,gigId:e},``,`/dashboard/gigs/${encodeURIComponent(e)}`)}function gt(){le(``),ce(null),window.history.replaceState({view:`gigs`},``,on.gigs)}function _t(e){de(e),i(`projects`),window.history.pushState({view:`projects`,projectId:e},``,`/dashboard/projects/${encodeURIComponent(e)}`)}function vt(){de(``),window.history.replaceState({view:`projects`},``,on.projects)}async function yt(){let e=await V(`/dashboard/api/me`);n(e);let t=Array.isArray(e.permissions)?e.permissions:[];return c(t),d((e.crm_base_url||``).replace(/\/+$/,``)),t}function bt(){let e=new URLSearchParams({minutes:Ee,limit:`100`});return Oe&&e.set(`status`,Oe),Ae.trim()&&e.set(`type`,Ae.trim()),`/dashboard/api/jobs?${e.toString()}`}function xt(){let e=new URLSearchParams({limit:String(Pe)});return Me&&e.set(`status`,Me),`/dashboard/api/gigs?${e.toString()}`}function St(){let e=new URLSearchParams({limit:`100`,status:Re});return Ie.trim()&&e.set(`query`,Ie.trim()),`/dashboard/api/projects?${e.toString()}`}async function Ct(){N(`jobs`,!0),M(`Loading jobs`);try{let e=await V(bt());p(e),M(`Loaded ${e.length} jobs`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to load jobs`,`error`)}finally{N(`jobs`,!1)}}async function wt(){N(`gigs`,!0);try{let e=await V(xt());v(e),M(`Loaded ${e.length} gig${e.length===1?``:`s`}`,`ok`),R()}catch(e){M(e instanceof Error?e.message:`Unable to load gigs`,`error`)}finally{N(`gigs`,!1)}}async function Tt(){N(`projects`,!0);try{let e=await V(St());te(e.projects||[]),ie(e.summary||{}),M(`Loaded ${(e.projects||[]).length} project${(e.projects||[]).length===1?``:`s`}`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to load projects`,`error`)}finally{N(`projects`,!1)}}async function Et(){N(`syncProjects`,!0),M(`Queueing project sync`);try{M(`Queued project sync ${(await V(`/dashboard/api/sync/projects`,{method:`POST`})).job_id}`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to queue project sync`,`error`)}finally{N(`syncProjects`,!1)}}async function Dt(e,t){N(`project:${e}:status`,!0);try{let n=await V(`/dashboard/api/projects/${encodeURIComponent(e)}/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:t})});te(t=>t.map(t=>t.id===e?n.project:t)),M(`Updated project status`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to update project`,`error`)}finally{N(`project:${e}:status`,!1)}}async function Ot(e,t){if(e.length===0)return!1;N(`projectsBulkUpdate`,!0);try{let n=await V(`/dashboard/api/projects/bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project_ids:e,...t})}),r=n.projects||[];te(e=>e.map(e=>r.find(t=>t.id===e.id)||e));let i=n.failures||[];return M(i.length?`Updated ${r.length}; ${i.length} failed`:`Updated ${r.length} project${r.length===1?``:`s`}`,i.length?`error`:`ok`),i.length===0}catch(e){return M(e instanceof Error?e.message:`Unable to bulk update projects`,`error`),!1}finally{N(`projectsBulkUpdate`,!1)}}async function kt(e,t){let n=t.trim();if(!n)return!1;N(`project:${e}:user`,!0);try{let t=await V(`/dashboard/api/projects/${encodeURIComponent(e)}/users`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({user:n})});return te(n=>n.map(n=>n.id===e?t.project:n)),M(`Added project user`,`ok`),!0}catch(e){return M(e instanceof Error?e.message:`Unable to add project user`,`error`),!1}finally{N(`project:${e}:user`,!1)}}async function At(e,t,n){let r=t.trim();if(!r)return!1;N(`project:${e}:historical`,!0);try{let t=await V(`/dashboard/api/projects/${encodeURIComponent(e)}/historical-members`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({person:r,candidate_id:n})});return te(n=>n.map(n=>n.id===e?t.project:n)),we(null),M(`Added historical project member`,`ok`),!0}catch(t){if(t instanceof ln&&t.status===409){let n=t.payload?.candidates||[];if(n.length>0)return we({projectId:e,person:r,candidates:n}),M(`Choose the matching person record`,`error`),!1}return M(t instanceof Error?t.message:`Unable to add historical member`,`error`),!1}finally{N(`project:${e}:historical`,!1)}}async function Mt(e,t,n){N(`project:${e}:wiki`,!0);try{await V(`/dashboard/api/projects/${encodeURIComponent(e)}/wiki-match`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:t,row_key:n})}),M(t===`no_row`?`Marked as no wiki row`:`Confirmed wiki match`,`ok`),await Nt()}catch(e){M(e instanceof Error?e.message:`Unable to save wiki match`,`error`)}finally{N(`project:${e}:wiki`,!1)}}async function Nt(){N(`wikiMatches`,!0);try{oe(await V(`/dashboard/api/projects/wiki-matches`)),M(`Loaded wiki match preview`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to load wiki matches`,`error`)}finally{N(`wikiMatches`,!1)}}async function I(e){N(`gig:${e}:detail`,!0);try{ce(await V(`/dashboard/api/gigs/${encodeURIComponent(e)}`))}catch(e){ce(null),M(e instanceof Error?e.message:`Unable to load gig`,`error`)}finally{N(`gig:${e}:detail`,!1)}}async function Pt(){await wt(),C&&await I(C)}async function R(){if(lt(`gigs:read`)){N(`notifications`,!0);try{let e=await V(`/dashboard/api/notifications?limit=20`);Ve(e.stale_days||7),T(e.notifications||[])}catch(e){M(e instanceof Error?e.message:`Unable to load notifications`,`error`)}finally{N(`notifications`,!1)}}}async function Ft(e,t){N(`gig:${e}:status`,!0);try{let n=(await V(`/dashboard/api/gigs/${encodeURIComponent(e)}/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:t})})).discord_title_sync?.status;M(n===`error`?`Updated gig status; Discord title sync failed`:`Updated gig status`,n===`error`?`error`:`ok`),await wt(),C===e&&await I(e)}catch(e){M(e instanceof Error?e.message:`Unable to update gig`,`error`)}finally{N(`gig:${e}:status`,!1)}}async function It(e,t,n){N(`application:${t}:status`,!0);try{await V(`/dashboard/api/gigs/${encodeURIComponent(e)}/applications/${encodeURIComponent(t)}/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:n})}),M(`Updated candidate status`,`ok`),await wt(),C===e&&await I(e)}catch(e){M(e instanceof Error?e.message:`Unable to update candidate`,`error`)}finally{N(`application:${t}:status`,!1)}}function Lt(){let e=new URLSearchParams({limit:`25`});He.trim()&&e.set(`query`,He.trim()),We&&e.set(`is_member`,We);for(let[t,n]of Object.entries(Ke))n&&e.set(t,n);return`/dashboard/api/people?${e.toString()}`}async function Rt(){N(`people`,!0);try{E(await V(Lt()))}catch(e){M(e instanceof Error?e.message:`Unable to load people`,`error`)}finally{N(`people`,!1)}}function zt(){let e=new URLSearchParams({limit:`25`});Ze.trim()&&e.set(`query`,Ze.trim()),$e&&e.set(`onboarding_state`,$e),tt.trim()&&e.set(`onboarder`,tt.trim());for(let[t,n]of Object.entries(rt))n&&e.set(t,n);return`/dashboard/api/onboarding?${e.toString()}`}async function Bt(){N(`onboarding`,!0);try{O(await V(zt()))}catch(e){M(e instanceof Error?e.message:`Unable to load onboarding`,`error`)}finally{N(`onboarding`,!1)}}async function Vt(){N(`audit`,!0);try{ge(await V(`/dashboard/api/audit-events?limit=25`))}catch(e){M(e instanceof Error?e.message:`Unable to load audit events`,`error`)}finally{N(`audit`,!1)}}async function Ht(){N(`agent`,!0);try{ve(await V(`/dashboard/api/agent?limit=100`))}catch(e){M(e instanceof Error?e.message:`Unable to load agent report`,`error`)}finally{N(`agent`,!1)}}async function Ut(e){N(`detail:${e}`,!0),M(`Loading ${e}`);try{be(await V(`/dashboard/api/jobs/${encodeURIComponent(e)}`)),M(`Loaded ${e}`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to load job detail`,`error`)}finally{N(`detail:${e}`,!1)}}async function Wt(e){N(`rerun:${e}`,!0),M(`Rerunning ${e}`);try{M(`Queued rerun ${(await V(`/dashboard/api/jobs/${encodeURIComponent(e)}/rerun`,{method:`POST`})).job_id}`,`ok`),await Ct()}catch(e){M(e instanceof Error?e.message:`Unable to rerun job`,`error`)}finally{N(`rerun:${e}`,!1)}}async function z(){N(`syncPeople`,!0),M(`Queueing people sync`);try{M(`Queued people sync ${(await V(`/dashboard/api/sync/people`,{method:`POST`})).job_id}`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to queue people sync`,`error`)}finally{N(`syncPeople`,!1)}}async function B(e,t){let n=String(e||``).trim(),r=t.trim();if(!n){M(`Missing CRM contact id`,`error`);return}if(!r){M(`Enter a 508 username`,`error`);return}N(`onboarder:${n}`,!0),M(`Assigning ${r}`);try{let e=await V(`/dashboard/api/onboarding/${encodeURIComponent(n)}/onboarder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({onboarder:r})});O(t=>t.map(t=>t.crm_contact_id===e.contact_id?{...t,onboarder:e.onboarder,onboarding_state:e.state_updated&&e.onboarding_state?e.onboarding_state:t.onboarding_state,onboarding_status_label:e.onboarding_status_label||(e.state_updated?void 0:t.onboarding_status_label)}:t)),M(`Assigned ${e.onboarder}`,`ok`)}catch(e){M(e instanceof Error?e.message:`Unable to assign onboarder`,`error`)}finally{N(`onboarder:${n}`,!1)}}async function Gt(){N(`logout`,!0);try{let e=await V(`/auth/logout`,{method:`POST`});window.location.assign(e.end_session_url||`/dashboard`)}catch(e){M(e instanceof Error?e.message:`Unable to log out`,`error`),N(`logout`,!1)}}(0,l.useEffect)(()=>{yt().then(e=>{let t=dn(),n=e.includes(sn[t])?t:Object.keys(on).find(t=>e.includes(sn[t]))||`people`;le(n===`gigs`?fn():``),de(n===`projects`?fn(`projects`):``),i(n),(!Object.hasOwn(on,un())||n!==t)&&window.history.replaceState({view:n},``,on[n])}).catch(e=>{M(e instanceof Error?e.message:`Dashboard failed to load`,`error`)})},[]),(0,l.useEffect)(()=>{let e=()=>{le(fn()),de(fn(`projects`)),ct.current(dn(),!1)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,l.useEffect)(()=>{if(!a.message)return;let e=window.setTimeout(()=>o({message:``}),4500);return()=>window.clearTimeout(e)},[a.message]),(0,l.useEffect)(()=>{s.length!==0&&(lt(`gigs:read`)&&R(),r===`people`&&Rt(),r===`gigs`&&wt(),r===`projects`&&Tt(),r===`onboarding`&&Bt(),r===`jobs`&&Ct(),r===`agent`&&Ht(),r===`audit`&&Vt())},[r]),(0,l.useEffect)(()=>{s.length!==0&&(lt(`gigs:read`)&&R(),r===`people`&&Rt(),r===`gigs`&&wt(),r===`projects`&&Tt(),r===`onboarding`&&Bt(),r===`jobs`&&Ct(),r===`agent`&&Ht(),r===`audit`&&Vt())},[s]),(0,l.useEffect)(()=>{r===`jobs`&&s.length>0&&Ct()},[Ee,Oe]),(0,l.useEffect)(()=>{r===`gigs`&&s.length>0&&wt()},[Me,Pe]),(0,l.useEffect)(()=>{r===`projects`&&s.length>0&&Tt()},[Re]),(0,l.useEffect)(()=>{r===`gigs`&&C&&s.length>0&&I(C)},[r,C,s]),(0,l.useEffect)(()=>{r===`people`&&s.length>0&&Rt()},[We]),(0,l.useEffect)(()=>{r===`people`&&s.length>0&&Rt()},[Ke]),(0,l.useEffect)(()=>{r===`onboarding`&&s.length>0&&Bt()},[$e]),(0,l.useEffect)(()=>{r===`onboarding`&&s.length>0&&Bt()},[rt]);let Kt=(0,l.useMemo)(()=>mn(`jobs`,f,k.jobs),[f,k.jobs]),qt=(0,l.useMemo)(()=>mn(`people`,me,k.people),[me,k.people]),Jt=(0,l.useMemo)(()=>mn(`onboarding`,D,k.onboarding),[D,k.onboarding]),Yt=(0,l.useMemo)(()=>mn(`gigs`,m,k.gigs),[m,k.gigs]),Xt=(0,l.useMemo)(()=>mn(`projects`,ee,k.projects),[ee,k.projects]),Zt=(0,l.useMemo)(()=>se?.id===C?se:Yt.find(e=>e.id===C)||null,[se,C,Yt]),Qt=(0,l.useMemo)(()=>Xt.find(e=>e.id===ue)||null,[ue,Xt]),$t=(0,l.useMemo)(()=>mn(`audit`,he,k.audit),[he,k.audit]),en=(0,l.useMemo)(()=>f.reduce((e,t)=>(e[t.status]=(e[t.status]||0)+1,e),{}),[f]),tn=Object.keys(cn).filter(e=>!Ke[e]),nn=Object.keys(cn).filter(e=>e!==`sync_status`&&e!==`email_508`&&!rt[e]);function rn(e){e.type===`stale_recruiting_gig`&&(Ne(`recruiting`),ft(`gigs`,!0)),pe(!1)}(0,l.useEffect)(()=>{!tn.includes(Je)&&tn[0]&&Ye(tn[0])},[tn,Je]),(0,l.useEffect)(()=>{let e=cn[Je]?.options;e?.[0]&&!e.some(([e])=>e===Xe)&&A(e[0][0])},[Je,Xe]),(0,l.useEffect)(()=>{!nn.includes(at)&&nn[0]&&ot(nn[0])},[nn,at]),(0,l.useEffect)(()=>{let e=cn[at]?.options;e?.[0]&&!e.some(([e])=>e===st)&&j(e[0][0])},[at,st]);let an=[t?.email,t?.crm_contact_id?`CRM ${t.crm_contact_id}`:``,t?.actor_provider].filter(Boolean).join(` | `);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`header`,{className:`sticky top-0 z-20 border-b bg-background/90 backdrop-blur`,children:(0,F.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-4 px-5 py-4 md:flex-row md:items-center md:justify-between`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-xl font-bold`,children:`508 Operations Dashboard`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Operations view for authenticated 508 operators.`})]}),(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[lt(`gigs:read`)?(0,F.jsx)(`div`,{className:`relative`,children:(0,F.jsxs)(L,{id:`notifications`,type:`button`,variant:`outline`,size:`icon`,"aria-label":`Notifications`,"aria-expanded":fe,onClick:()=>pe(e=>!e),children:[(0,F.jsx)(h,{}),w.length>0?(0,F.jsx)(`span`,{className:`absolute -right-1 -top-1 grid min-h-5 min-w-5 place-items-center rounded-full bg-red-500 px-1 text-[11px] font-bold text-white`,children:w.length}):null]})}):null,(0,F.jsxs)(`div`,{className:`grid min-w-0 gap-0.5 text-right text-sm text-muted-foreground`,children:[(0,F.jsx)(`strong`,{id:`userName`,className:`truncate text-foreground`,children:t?.display_name||t?.email||t?.subject||`Loading user`}),(0,F.jsx)(`span`,{id:`userMeta`,className:`truncate`,children:an||`Checking session`})]}),(0,F.jsxs)(L,{id:`logout`,type:`button`,variant:`outline`,onClick:Gt,disabled:xe.logout,children:[(0,F.jsx)(x,{}),`Log out`]})]})]})}),(0,F.jsx)(yn,{open:fe,notifications:w,loading:xe.notifications,onClose:()=>pe(!1),onRefresh:R,onOpenNotification:rn}),(0,F.jsx)(xn,{toast:a}),(0,F.jsx)(bn,{choice:Ce,loading:!!(Ce&&xe[`project:${Ce.projectId}:historical`]),crmContactUrl:P,onClose:()=>we(null),onChoose:e=>{Ce&&At(Ce.projectId,Ce.person,e)}}),(0,F.jsxs)(`main`,{className:`mx-auto grid max-w-7xl grid-cols-1 gap-5 px-5 py-5 md:grid-cols-[190px_minmax(0,1fr)]`,children:[(0,F.jsx)(`nav`,{className:`grid content-start gap-1 md:sticky md:top-24`,"aria-label":`Dashboard sections`,children:[[`people`,`People`,ne],[`gigs`,`Gigs`,g],[`projects`,`Projects`,b],[`onboarding`,`Onboarding`,_],[`jobs`,`Jobs`,g],[`agent`,`Agent`,S],[`audit`,`Audit`,y]].filter(([e])=>ut(e)).map(([e,t,n])=>(0,F.jsxs)(`a`,{className:jt(`flex min-h-10 items-center gap-2 rounded-md border border-transparent px-3 text-sm font-extrabold text-muted-foreground hover:border-border hover:bg-secondary hover:text-foreground`,r===e&&`border-primary bg-accent text-accent-foreground`),"data-view-link":e,"data-permission":sn[e],href:on[e],"aria-current":r===e?`page`:void 0,onClick:t=>{t.preventDefault(),ft(e,!0)},children:[(0,F.jsx)(n,{className:`size-4`}),t]},e))}),(0,F.jsxs)(`div`,{className:`grid min-w-0 gap-5`,children:[r===`people`?(0,F.jsx)(Rn,{crmBaseUrl:u,people:qt,sort:k.people,canSync:lt(`people:sync`),loading:xe,peopleQuery:He,peopleMember:We,peopleFilters:Ke,peopleFilterKind:Je,peopleFilterValue:Xe,peopleFilterKeys:tn,onSearch:Rt,onSync:z,onSort:e=>mt(`people`,e),setPeopleQuery:Ue,setPeopleMember:Ge,setPeopleFilterKind:Ye,setPeopleFilterValue:A,addFilter:()=>{qe(e=>({...e,[Je]:Xe}))},removeFilter:e=>{qe(t=>{let n={...t};return delete n[e],n})},crmContactUrl:P,crmAttachmentUrl:pt}):null,r===`gigs`?(0,F.jsx)(Nn,{gigs:Yt,selectedGig:Zt,selectedGigId:C,sort:k.gigs,loading:xe,status:Me,limit:Pe,staleDays:Be,canWrite:lt(`gigs:write`),crmContactUrl:P,crmAttachmentUrl:pt,setStatus:Ne,setLimit:Fe,onRefresh:Pt,onSort:e=>mt(`gigs`,e),onOpenGig:ht,onCloseGig:gt,onUpdateStatus:Ft,onUpdateApplicationStatus:It}):null,r===`projects`?(0,F.jsx)(jn,{projects:Xt,selectedProject:Qt,selectedProjectId:ue,summary:re,wikiMatches:ae,sort:k.projects,loading:xe,query:Ie,status:Re,canSync:lt(`projects:sync`),canWrite:lt(`projects:write`),crmContactUrl:P,setQuery:Le,setStatus:ze,onSearch:Tt,onSync:Et,onUpdateStatus:Dt,onBulkUpdate:Ot,onAddUser:kt,onAddHistoricalMember:At,onUpdateWikiMatch:Mt,onWikiMatches:Nt,onOpenProject:_t,onCloseProject:vt,onSort:e=>mt(`projects`,e)}):null,r===`onboarding`?(0,F.jsx)(zn,{people:Jt,sort:k.onboarding,loading:xe,onboardingQuery:Ze,onboardingState:$e,onboarderFilter:tt,onboardingFilters:rt,onboardingFilterKind:at,onboardingFilterValue:st,onboardingFilterKeys:nn,onSearch:Bt,onSort:e=>mt(`onboarding`,e),onAssign:B,setOnboardingQuery:Qe,setOnboardingState:et,setOnboarderFilter:nt,setOnboardingFilterKind:ot,setOnboardingFilterValue:j,addFilter:()=>{it(e=>({...e,[at]:st}))},removeFilter:e=>{it(t=>{let n={...t};return delete n[e],n})},crmContactUrl:P,crmAttachmentUrl:pt}):null,r===`jobs`?(0,F.jsx)(Vn,{jobs:Kt,jobDetail:ye,sort:k.jobs,loading:xe,minutes:Ee,status:Oe,jobType:Ae,jobCounts:en,canWrite:lt(`jobs:write`),setMinutes:De,setStatus:ke,setJobType:je,onSearch:Ct,onSort:e=>mt(`jobs`,e),onDetail:Ut,onRerun:Wt}):null,r===`audit`?(0,F.jsx)(Hn,{events:$t,sort:k.audit,loading:xe,onRefresh:Vt,onSort:e=>mt(`audit`,e)}):null,r===`agent`?(0,F.jsx)(Un,{report:_e,loading:xe,onRefresh:Ht}):null]})]})]})}function yn({open:e,notifications:t,loading:n,onClose:r,onRefresh:i,onOpenNotification:a}){return e?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-40`,"aria-labelledby":`notificationsTitle`,"aria-modal":`true`,role:`dialog`,children:[(0,F.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default bg-black/45`,"aria-label":`Close notifications`,onClick:r}),(0,F.jsxs)(`aside`,{className:`absolute right-0 top-0 grid h-full w-full max-w-md grid-rows-[auto_minmax(0,1fr)] border-l bg-background shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b p-4`,children:[(0,F.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,F.jsx)(`strong`,{id:`notificationsTitle`,className:`text-base`,children:`Notifications`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t.length===0?`No active notifications`:`${t.length} active`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(L,{type:`button`,variant:`outline`,size:`sm`,onClick:i,disabled:n,children:[(0,F.jsx)(ee,{}),`Refresh`]}),(0,F.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:r,children:(0,F.jsx)(re,{})})]})]}),(0,F.jsx)(`div`,{className:`min-h-0 overflow-auto p-4`,children:t.length===0?(0,F.jsx)(`div`,{className:`rounded-md border border-dashed p-6 text-sm text-muted-foreground`,children:`No active notifications.`}):(0,F.jsx)(`div`,{className:`grid gap-3`,children:t.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`grid gap-2 rounded-md border p-3 text-left hover:bg-secondary`,onClick:()=>a(e),children:[(0,F.jsx)(`span`,{className:`text-sm font-bold`,children:e.title}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.message})]},e.id))})})]})]}):null}function bn({choice:e,loading:t,crmContactUrl:n,onClose:r,onChoose:i}){return e?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-50 grid place-items-center p-4`,"aria-labelledby":`historicalPersonChoiceTitle`,"aria-modal":`true`,role:`dialog`,children:[(0,F.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default bg-black/45`,"aria-label":`Close person selection`,onClick:r}),(0,F.jsxs)(`div`,{className:`relative grid w-full max-w-2xl gap-4 rounded-md border bg-background p-5 shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{id:`historicalPersonChoiceTitle`,className:`block text-base`,children:`Choose person record`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.person})]}),(0,F.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close person selection`,onClick:r,children:(0,F.jsx)(re,{})})]}),(0,F.jsx)(`div`,{className:`grid gap-2`,children:e.candidates.map(e=>(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border p-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-center`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`strong`,{className:`block truncate`,children:e.label||e.full_name||e.email||`Person`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-sm text-muted-foreground`,children:[e.email?(0,F.jsx)(`span`,{children:e.email}):null,e.sources?.length?(0,F.jsx)(`span`,{children:e.sources.join(`, `)}):null,e.erpnext_user_id?(0,F.jsxs)(`span`,{children:[`ERP `,e.erpnext_user_id]}):null,e.supplier_erpnext_id?(0,F.jsxs)(`span`,{children:[`Supplier `,e.supplier_erpnext_id]}):null,e.crm_contact_id&&n(e.crm_contact_id)?(0,F.jsx)(`a`,{className:`font-semibold text-primary underline-offset-4 hover:underline`,href:n(e.crm_contact_id),target:`_blank`,rel:`noreferrer`,children:`CRM`}):null]})]}),(0,F.jsx)(L,{type:`button`,disabled:t,onClick:()=>i(e.candidate_id),children:`Select`})]},e.candidate_id))})]})]}):null}function xn({toast:e}){return e.message?(0,F.jsx)(`div`,{id:`toast`,role:`status`,className:jt(`fixed bottom-5 right-5 z-50 max-w-sm rounded-md border bg-background px-4 py-3 text-sm font-semibold shadow-lg`,e.tone===`ok`&&`border-emerald-500/40 text-emerald-300`,e.tone===`error`&&`border-red-500/40 text-red-300`),children:e.message}):null}function Sn({filters:e,onRemove:t,suffix:n=`filter`}){return(0,F.jsx)(`fieldset`,{className:`m-0 flex min-h-7 flex-wrap gap-2 border-0 p-0`,"aria-label":`Active filters`,children:Object.entries(e).map(([e,r])=>{let i=cn[e],a=i.options.find(([e])=>e===r),o=`${i.label}: ${a?a[1]:r}`;return(0,F.jsxs)(L,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full`,"aria-label":`Remove ${o} ${n}`,onClick:()=>t(e),children:[o,` x`]},e)})})}var Cn=[`recruiting`,`filled`,`unknown`,`lost`,`outdated`],wn=[`suggested`,`interested`,`reviewing`,`contacted`,`accepted`,`rejected`,`withdrawn`];function Tn(e){return String(e||``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function En(e){let t=[e.last_activity_at,e.last_status_changed_at,e.posted_at,e.created_at].map(e=>e?new Date(e).getTime():NaN).filter(e=>!Number.isNaN(e));return t.length>0?new Date(Math.max(...t)).toISOString():``}function Dn(e,t){if(e.status!==`recruiting`)return null;let n=qt(En(e));return n===null||ne.projects.map(e=>e.id),[e.projects]),f=(0,l.useMemo)(()=>new Set(d),[d]),p=n.filter(e=>f.has(e)),h=e.projects.length>0&&p.length===e.projects.length;(0,l.useEffect)(()=>{r(e=>e.filter(e=>f.has(e)))},[f]);function g(e,t){r(n=>t?Array.from(new Set([...n,e])):n.filter(t=>t!==e))}async function _(){let t={};i&&(t.status=i),o&&(t.project_type=o),await e.onBulkUpdate(p,t)&&(r([]),a(``),s(``),u(!1))}let y=(0,F.jsxs)(R,{className:`grid gap-3 p-4 md:grid-cols-[minmax(0,1fr)_180px_auto_auto_auto] md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Search projects`,(0,F.jsx)(Rt,{id:`projectQuery`,value:e.query,autoComplete:`off`,placeholder:`Project, customer, ERP id`,onChange:t=>e.setQuery(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`projectStatus`,value:e.status,onChange:t=>e.setStatus(t.target.value),children:[(0,F.jsx)(`option`,{value:`Open`,children:`Open`}),(0,F.jsx)(`option`,{value:``,children:`Any status`})]})]}),(0,F.jsxs)(L,{id:`refreshProjects`,type:`button`,onClick:e.onSearch,disabled:e.loading.projects,children:[(0,F.jsx)(ee,{}),`Refresh`]}),e.canSync?(0,F.jsxs)(L,{id:`syncProjects`,type:`button`,variant:`outline`,onClick:e.onSync,disabled:e.loading.syncProjects,children:[(0,F.jsx)(ee,{}),`Sync ERP`]}):null,(0,F.jsxs)(L,{id:`wikiProjectMatches`,type:`button`,variant:`outline`,onClick:e.onWikiMatches,disabled:e.loading.wikiMatches,children:[(0,F.jsx)(te,{}),`Wiki match`]})]});return e.selectedProjectId&&!e.selectedProject&&e.loading.projects?(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Project detail`})}),(0,F.jsx)(Lt,{className:`text-sm text-muted-foreground`,children:`Loading project.`})]})]}):e.selectedProjectId&&!e.selectedProject?(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Project detail`})}),(0,F.jsxs)(Lt,{className:`grid gap-3`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This project is not in the current result set. Clear filters or refresh the project list.`}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,onClick:e.onCloseProject,children:[(0,F.jsx)(m,{}),`Back to projects`]})]})]})]}):e.selectedProject?(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsx)(Mn,{project:e.selectedProject,loading:e.loading,canWrite:e.canWrite,crmContactUrl:e.crmContactUrl,onBack:e.onCloseProject,onUpdateStatus:e.onUpdateStatus,onAddUser:e.onAddUser,onAddHistoricalMember:e.onAddHistoricalMember})]}):(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsxs)(`section`,{className:`grid gap-3 md:grid-cols-2`,"aria-label":`Project summary`,children:[(0,F.jsx)(gn,{id:`projectMetricOpen`,label:`Open`,value:e.summary.open_project_count||0}),(0,F.jsx)(gn,{id:`projectMetricTotal`,label:`Projects`,value:e.summary.project_count||0})]}),e.canWrite?(0,F.jsxs)(R,{className:`flex flex-wrap items-center justify-between gap-3 p-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Selected`}),(0,F.jsxs)(`strong`,{className:`block`,children:[p.length,` project(s)`]})]}),(0,F.jsx)(L,{type:`button`,disabled:p.length===0,onClick:()=>u(!0),children:`Bulk edit`})]}):null,c?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-50 grid place-items-center p-4`,"aria-labelledby":`bulkProjectEditTitle`,"aria-modal":`true`,role:`dialog`,children:[(0,F.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default bg-black/45`,"aria-label":`Close bulk project edit`,onClick:()=>u(!1)}),(0,F.jsxs)(`div`,{className:`relative grid w-full max-w-lg gap-4 rounded-md border bg-background p-5 shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{id:`bulkProjectEditTitle`,className:`block text-base`,children:`Bulk edit projects`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[p.length,` selected`]})]}),(0,F.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close bulk project edit`,onClick:()=>u(!1),children:(0,F.jsx)(re,{})})]}),(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[(0,F.jsx)(`strong`,{className:`text-sm`,children:`Changes`}),(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{value:i,onChange:e=>a(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`No change`}),(0,F.jsx)(`option`,{value:`Open`,children:`Open`}),(0,F.jsx)(`option`,{value:`Completed`,children:`Completed`}),(0,F.jsx)(`option`,{value:`Cancelled`,children:`Cancelled`})]})]}),(0,F.jsxs)(zt,{children:[`ERP Type`,(0,F.jsxs)(Bt,{value:o,onChange:e=>s(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`No change`}),(0,F.jsx)(`option`,{value:`Internal`,children:`Internal`}),(0,F.jsx)(`option`,{value:`External`,children:`External`})]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,F.jsx)(L,{type:`button`,variant:`outline`,onClick:()=>u(!1),children:`Cancel`}),(0,F.jsx)(L,{type:`button`,disabled:e.loading.projectsBulkUpdate||p.length===0||!i&&!o,onClick:()=>void _(),children:`Apply changes`})]})]})]}):null,(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`ERP projects`}),(0,F.jsx)(`span`,{id:`projectsStatus`,className:`text-sm text-muted-foreground`,children:e.loading.projects?`Loading`:`${e.projects.length} shown | synced ${Kt(e.summary.last_synced_at)}`})]}),(0,F.jsx)(_n,{hidden:e.projects.length!==0,children:`No projects match this view. Sync ERP projects if the cache is empty.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`projectsTable`,className:jt(`min-w-[1100px]`,e.projects.length===0&&`hidden`),"aria-label":`ERP projects`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[e.canWrite?(0,F.jsx)(z,{className:`w-[48px]`,children:(0,F.jsx)(`input`,{type:`checkbox`,"aria-label":`Select all visible projects`,checked:h,onChange:e=>{r(e.target.checked?d:[])}})}):null,(0,F.jsx)(H,{className:`w-[24%]`,label:`Project`,scope:`projects`,sort:e.sort,sortKey:`display_name`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[16%]`,label:`Customer`,scope:`projects`,sort:e.sort,sortKey:`customer`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[10%]`,label:`Status`,scope:`projects`,sort:e.sort,sortKey:`status`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{className:`w-[16%]`,children:`Timeline`}),(0,F.jsx)(H,{className:`w-[10%]`,label:`Roster`,scope:`projects`,sort:e.sort,sortKey:`roster_count`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[14%]`,label:`Modified`,scope:`projects`,sort:e.sort,sortKey:`modified`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{children:`ERP`})]})}),(0,F.jsx)(Ut,{id:`projectsBody`,children:e.projects.map(t=>{let n=t.roster_members||[];return(0,F.jsxs)(Wt,{children:[e.canWrite?(0,F.jsx)(B,{children:(0,F.jsx)(`input`,{type:`checkbox`,"aria-label":`Select ${t.display_name}`,checked:p.includes(t.id),onChange:e=>g(t.id,e.target.checked)})}):null,(0,F.jsxs)(B,{children:[(0,F.jsx)(`button`,{type:`button`,className:`text-left font-bold text-primary underline-offset-4 hover:underline`,onClick:()=>e.onOpenProject(t.id),children:t.display_name}),(0,F.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5`,children:[t.project_type?(0,F.jsx)(I,{variant:`neutral`,children:t.project_type}):null,t.linked_engagement_count?(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[t.linked_engagement_count,` linked gig`]}):null]})]}),(0,F.jsx)(B,{children:t.customer_erpnext_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:t.customer_erpnext_url,target:`_blank`,rel:`noreferrer`,children:[t.customer,(0,F.jsx)(v,{className:`size-3.5`})]}):t.customer||`None`}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:On(t.source_status),children:t.source_status||`Unknown`})}),(0,F.jsx)(B,{children:[t.actual_start_date,t.actual_end_date].filter(Boolean).map(e=>kn(e)).join(` to `)||`Not set`}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`grid gap-1`,children:[(0,F.jsx)(`strong`,{children:n.length}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[n.map(An).slice(0,4).join(`, `)||`No ERP roster`,n.length>4?` +${n.length-4}`:``]})]})}),(0,F.jsx)(B,{children:Kt(t.source_modified_at)}),(0,F.jsx)(B,{className:`text-xs`,children:t.erpnext_project_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-mono font-semibold text-primary underline-offset-4 hover:underline`,href:t.erpnext_project_url,target:`_blank`,rel:`noreferrer`,children:[t.erpnext_project_id,(0,F.jsx)(v,{className:`size-3.5`})]}):(0,F.jsx)(`span`,{className:`font-mono`,children:`Unlinked`})})]},t.id)})})]})})]}),e.wikiMatches?(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Wiki match preview`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.wikiMatches.document?.title||`Client & Project Info`,` |`,` `,Kt(e.wikiMatches.document?.updatedAt)]})]}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`wikiMatchesTable`,className:`min-w-[920px]`,"aria-label":`Wiki matches`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`ERP project`}),(0,F.jsx)(z,{children:`Best wiki row`}),(0,F.jsx)(z,{children:`Confidence`}),(0,F.jsx)(z,{children:`Section`}),(0,F.jsx)(z,{children:`Decision`})]})}),(0,F.jsx)(Ut,{children:t.map((t,n)=>{let r=t.project,i=t.best_match?.row||{},a=t.manual_match?.match_status||``,o=r?.id||i.row_key||[i.section,i.Client].filter(Boolean).join(`:`)||`wiki-match-${n}`;return(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:r?.display_name||`Unknown`}),(0,F.jsxs)(B,{children:[(0,F.jsx)(`strong`,{children:i.Client||`No match`}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:[i.DRI,i.Members].filter(Boolean).join(` | `)})]}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:t.best_match?.confidence===`high`?`succeeded`:t.best_match?.confidence===`medium`?`running`:`neutral`,children:t.best_match?`${t.best_match.confidence} ${t.best_match.score}`:`none`})}),(0,F.jsx)(B,{children:i.section||``}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a?(0,F.jsx)(I,{variant:a===`confirmed`?`succeeded`:`neutral`,children:a===`no_row`?`No wiki row`:`Confirmed`}):null,e.canWrite&&r?.id?(0,F.jsxs)(F.Fragment,{children:[i.row_key?(0,F.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,disabled:e.loading[`project:${r.id}:wiki`],onClick:()=>void e.onUpdateWikiMatch(r.id,`confirmed`,i.row_key),children:`Confirm`}):null,(0,F.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,disabled:e.loading[`project:${r.id}:wiki`],onClick:()=>void e.onUpdateWikiMatch(r.id,`no_row`),children:`No row`})]}):null]})})]},o)})})]})})]}):null]})}function Mn(e){let t=e.project,n=t.roster_members||[],[r,i]=(0,l.useState)(``),a=[t.actual_start_date||t.expected_start_date,t.actual_end_date||t.expected_end_date].filter(Boolean).map(e=>kn(e)).join(` to `)||`Not set`,o=typeof t.percent_complete==`number`?`${Math.round(t.percent_complete)}%`:`Not set`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[auto_minmax(0,1fr)_auto] md:items-start`,children:[(0,F.jsxs)(L,{type:`button`,variant:`outline`,onClick:e.onBack,children:[(0,F.jsx)(m,{}),`Projects`]}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(It,{children:t.display_name}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,F.jsx)(I,{variant:On(t.source_status),children:t.source_status||`Unknown`}),t.erpnext_project_id?(0,F.jsx)(`span`,{className:`font-mono`,children:t.erpnext_project_id}):null,t.last_synced_at?(0,F.jsxs)(`span`,{children:[`Synced `,Kt(t.last_synced_at)]}):null]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-start gap-2 md:justify-end`,children:[e.canWrite?(0,F.jsxs)(Bt,{className:`w-[160px]`,"aria-label":`Status for ${t.display_name}`,value:t.source_status||``,disabled:e.loading[`project:${t.id}:status`],onChange:n=>e.onUpdateStatus(t.id,n.target.value),children:[(0,F.jsx)(`option`,{value:`Open`,children:`Open`}),(0,F.jsx)(`option`,{value:`Completed`,children:`Completed`}),(0,F.jsx)(`option`,{value:`Cancelled`,children:`Cancelled`})]}):null,t.erpnext_project_url?(0,F.jsxs)(`a`,{className:`inline-flex min-h-9 items-center justify-center gap-2 rounded-md border bg-secondary px-3 text-sm font-semibold`,href:t.erpnext_project_url,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(v,{className:`size-4`}),`ERP project`]}):null,t.customer_erpnext_url?(0,F.jsxs)(`a`,{className:`inline-flex min-h-9 items-center justify-center gap-2 rounded-md border bg-secondary px-3 text-sm font-semibold`,href:t.customer_erpnext_url,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(v,{className:`size-4`}),`ERP customer`]}):null]})]})}),(0,F.jsxs)(Lt,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Customer`}),(0,F.jsx)(`strong`,{className:`block`,children:t.customer||`None`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Timeline`}),(0,F.jsx)(`strong`,{className:`block`,children:a})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Progress`}),(0,F.jsx)(`strong`,{className:`block`,children:o})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Linked Gigs`}),(0,F.jsx)(`strong`,{className:`block`,children:t.linked_engagement_count||0})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`ERP Type`}),(0,F.jsx)(`div`,{className:`mt-1`,children:t.project_type?(0,F.jsx)(I,{variant:`neutral`,children:t.project_type}):(0,F.jsx)(`strong`,{className:`block`,children:`Not set`})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`ERP Modified`}),(0,F.jsx)(`strong`,{className:`block`,children:Kt(t.source_modified_at)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Cache ID`}),(0,F.jsx)(`strong`,{className:`block break-all font-mono text-xs`,children:t.id})]})]})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Project roster`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.length?`${n.length} synced ERP user${n.length===1?``:`s`}`:`No ERP roster`})]}),e.canWrite?(0,F.jsxs)(Lt,{className:`grid gap-3 border-b md:grid-cols-[minmax(0,1fr)_auto_auto] md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Roster person`,(0,F.jsx)(Rt,{value:r,autoComplete:`off`,placeholder:`name@508.dev or full name`,onChange:e=>i(e.target.value),onKeyDown:n=>{n.key===`Enter`&&(n.preventDefault(),e.onAddUser(t.id,r).then(e=>e&&i(``)))}})]}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,disabled:e.loading[`project:${t.id}:user`]||!r.trim(),onClick:()=>void e.onAddUser(t.id,r).then(e=>{e&&i(``)}),children:[(0,F.jsx)(ne,{}),`Add ERP user`]}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,disabled:e.loading[`project:${t.id}:historical`]||!r.trim(),onClick:()=>void e.onAddHistoricalMember(t.id,r).then(e=>{e&&i(``)}),children:[(0,F.jsx)(ne,{}),`Add historical`]})]}):null,(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{className:`min-w-[760px]`,"aria-label":`Project roster`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`Name`}),(0,F.jsx)(z,{children:`Email`}),(0,F.jsx)(z,{children:`ERP user`}),(0,F.jsx)(z,{children:`Links`}),(0,F.jsx)(z,{children:`Source`}),(0,F.jsx)(z,{children:`Last seen`})]})}),(0,F.jsx)(Ut,{children:n.length?n.map(t=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:(0,F.jsx)(`strong`,{children:t.full_name||t.email||t.source_user_id})}),(0,F.jsx)(B,{children:t.email||`None`}),(0,F.jsx)(B,{className:`font-mono text-xs`,children:t.erpnext_user_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:t.erpnext_user_url,target:`_blank`,rel:`noreferrer`,children:[t.source_user_id||`ERP user`,(0,F.jsx)(v,{className:`size-3.5`})]}):t.source_user_id||`Unknown`}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.supplier_erpnext_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:t.supplier_erpnext_url,target:`_blank`,rel:`noreferrer`,children:[`Supplier`,(0,F.jsx)(v,{className:`size-3.5`})]}):null,t.crm_contact_id&&e.crmContactUrl(t.crm_contact_id)?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:e.crmContactUrl(t.crm_contact_id),target:`_blank`,rel:`noreferrer`,children:[`CRM`,(0,F.jsx)(v,{className:`size-3.5`})]}):null,!t.supplier_erpnext_url&&!(t.crm_contact_id&&e.crmContactUrl(t.crm_contact_id))?(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):null]})}),(0,F.jsx)(B,{children:t.roster_kind||t.source||`ERP`}),(0,F.jsx)(B,{children:Kt(t.last_seen_at)})]},`${t.source||``}:${t.source_user_id||t.email}`)):(0,F.jsx)(Wt,{children:(0,F.jsx)(B,{colSpan:6,className:`text-sm text-muted-foreground`,children:`No roster rows have been synced for this project.`})})})]})})]})]})}function Nn(e){let t=e.gigs.reduce((t,n)=>(t.total+=1,t.applications+=Number(n.application_count||0),t.interested+=Number(n.interested_count||0),Dn(n,e.staleDays)!==null&&(t.stale+=1),t),{total:0,applications:0,interested:0,stale:0}),n=(0,F.jsxs)(R,{className:`grid gap-3 p-4 md:grid-cols-[minmax(160px,1fr)_auto_auto] md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`gigStatus`,value:e.status,onChange:t=>e.setStatus(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any status`}),Cn.map(e=>(0,F.jsx)(`option`,{value:e,children:Tn(e)},e))]})]}),(0,F.jsxs)(L,{id:`refreshGigs`,type:`button`,onClick:e.onRefresh,disabled:e.loading.gigs,children:[(0,F.jsx)(ee,{}),`Refresh gigs`]}),e.gigs.length>=e.limit?(0,F.jsx)(L,{type:`button`,variant:`outline`,onClick:()=>e.setLimit(Math.min(e.limit+100,500)),disabled:e.loading.gigs||e.limit>=500,children:`Load more`}):null]}),r=e.selectedGigId?e.loading[`gig:${e.selectedGigId}:detail`]:!1;return e.selectedGigId&&!e.selectedGig&&(e.loading.gigs||r)?(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Gig detail`})}),(0,F.jsx)(Lt,{className:`text-sm text-muted-foreground`,children:`Loading gig.`})]})]}):e.selectedGigId&&!e.selectedGig?(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Gig detail`})}),(0,F.jsxs)(Lt,{className:`grid gap-3`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This gig is not in the current result set. Clear filters or refresh the gig list.`}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,onClick:e.onCloseGig,children:[(0,F.jsx)(m,{}),`Back to gigs`]})]})]})]}):e.selectedGig?(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsx)(In,{gig:e.selectedGig,loading:e.loading,canWrite:e.canWrite,crmContactUrl:e.crmContactUrl,crmAttachmentUrl:e.crmAttachmentUrl,staleDays:e.staleDays,onBack:e.onCloseGig,onUpdateStatus:e.onUpdateStatus,onUpdateApplicationStatus:e.onUpdateApplicationStatus})]}):(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsxs)(`section`,{className:`grid gap-3 md:grid-cols-4`,"aria-label":`Gig summary`,children:[(0,F.jsx)(gn,{id:`gigMetricTotal`,label:`Gigs`,value:t.total}),(0,F.jsx)(gn,{id:`gigMetricCandidates`,label:`Candidates`,value:t.applications}),(0,F.jsx)(gn,{id:`gigMetricInterested`,label:`Interested`,value:t.interested}),(0,F.jsx)(gn,{id:`gigMetricStale`,label:`Stale recruiting`,value:t.stale})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Discord gigs`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,F.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onSort(`activity`),"aria-label":`Sort gigs by activity`,children:[`Activity`,` `,e.sort.key===`activity`?e.sort.direction===`asc`?`↑`:`↓`:``]}),(0,F.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onSort(`title`),"aria-label":`Sort gigs by title`,children:[`Title `,e.sort.key===`title`?e.sort.direction===`asc`?`↑`:`↓`:``]}),(0,F.jsx)(`span`,{id:`gigsStatus`,className:`text-sm text-muted-foreground`,children:e.loading.gigs?`Loading`:`${e.gigs.length} shown`})]})]}),(0,F.jsx)(_n,{hidden:e.gigs.length!==0,children:`No gigs match this view.`}),(0,F.jsx)(`div`,{id:`gigsBody`,className:jt(`grid gap-3 p-4`,e.gigs.length===0&&`hidden`),children:e.gigs.map(t=>(0,F.jsx)(Pn,{gig:t,loading:e.loading,canWrite:e.canWrite,staleDays:e.staleDays,onOpenGig:e.onOpenGig,onUpdateStatus:e.onUpdateStatus},t.id))})]})]})}function Pn({gig:e,loading:t,canWrite:n,onOpenGig:r,onUpdateStatus:i,staleDays:a}){let o=Array.isArray(e.applications)?e.applications:[],s=e.discord_guild_id&&e.discord_thread_id?`https://discord.com/channels/${encodeURIComponent(e.discord_guild_id)}/${encodeURIComponent(e.discord_thread_id)}`:``,c=Dn(e,a);return(0,F.jsxs)(`article`,{className:`grid gap-4 rounded-md border bg-background p-4 lg:grid-cols-[minmax(0,1fr)_220px_180px] lg:items-start`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`a`,{className:`text-base font-extrabold text-primary`,href:`/dashboard/gigs/${encodeURIComponent(e.id)}`,onClick:t=>{t.preventDefault(),r(e.id)},children:e.title||`Untitled gig`}),(0,F.jsx)(I,{variant:e.status===`filled`?`succeeded`:e.status===`lost`?`failed`:`queued`,children:e.status_label||Tn(e.status)}),c===null?null:(0,F.jsxs)(I,{variant:`running`,children:[c,`d stale`]})]}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.posting_type?(0,F.jsx)(I,{variant:`neutral`,children:Tn(e.posting_type)}):null,e.discord_channel_name?(0,F.jsxs)(I,{variant:`neutral`,children:[`#`,e.discord_channel_name]}):null,(e.required_skills||[]).slice(0,5).map(e=>(0,F.jsx)(I,{variant:`queued`,children:e},e)),(e.preferred_skills||[]).slice(0,3).map(e=>(0,F.jsx)(I,{variant:`neutral`,children:e},e))]}),(0,F.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground`,children:[(0,F.jsxs)(`span`,{children:[`Activity `,Kt(En(e))||`unknown`]}),(0,F.jsxs)(`span`,{children:[`Posted `,Kt(e.posted_at)||`unknown`]}),s?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:s,target:`_blank`,rel:`noreferrer`,children:`Open Discord thread`}):null]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm lg:grid-cols-1`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`block text-xs font-bold text-muted-foreground`,children:`People`}),(0,F.jsx)(`strong`,{children:e.application_count||o.length}),(0,F.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[Number(e.interested_count||0),` interested`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`block text-xs font-bold text-muted-foreground`,children:`Top candidates`}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:o.slice(0,3).map(e=>Fn(e)).join(`, `)||`None yet`})]})]}),(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[n?(0,F.jsx)(Bt,{"aria-label":`Status for ${e.title||`gig`}`,value:e.status,disabled:t[`gig:${e.id}:status`],onChange:t=>i(e.id,t.target.value),children:Cn.map(e=>(0,F.jsx)(`option`,{value:e,children:Tn(e)},e))}):null,(0,F.jsx)(L,{type:`button`,onClick:()=>r(e.id),children:`Manage people`})]})]})}function Fn(e){return e.name||e.email_508||e.discord_username||(typeof e.evaluation?.discord_username==`string`?e.evaluation.discord_username:``)||`Candidate`}function In({gig:e,loading:t,canWrite:n,crmContactUrl:r,crmAttachmentUrl:i,staleDays:a,onBack:o,onUpdateStatus:s,onUpdateApplicationStatus:c}){let l=Array.isArray(e.applications)?e.applications:[],u=e.discord_guild_id&&e.discord_thread_id?`https://discord.com/channels/${encodeURIComponent(e.discord_guild_id)}/${encodeURIComponent(e.discord_thread_id)}`:``,d=Dn(e,a);return(0,F.jsxs)(`div`,{className:`grid gap-5`,children:[(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{className:`items-start`,children:[(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,className:`w-fit`,onClick:o,children:[(0,F.jsx)(m,{}),`Back to gigs`]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(It,{className:`text-xl`,children:e.title||`Untitled gig`}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[(0,F.jsx)(I,{variant:e.status===`filled`?`succeeded`:e.status===`lost`?`failed`:`queued`,children:e.status_label||Tn(e.status)}),d===null?null:(0,F.jsxs)(I,{variant:`running`,children:[d,`d stale`]}),e.posting_type?(0,F.jsx)(I,{variant:`neutral`,children:Tn(e.posting_type)}):null,e.discord_channel_name?(0,F.jsxs)(I,{variant:`neutral`,children:[`#`,e.discord_channel_name]}):null,(e.required_skills||[]).map(e=>(0,F.jsx)(I,{variant:`queued`,children:e},e)),(e.preferred_skills||[]).map(e=>(0,F.jsx)(I,{variant:`neutral`,children:e},e))]})]})]}),(0,F.jsxs)(`div`,{className:`grid min-w-[190px] gap-2`,children:[n?(0,F.jsxs)(zt,{children:[`Gig status`,(0,F.jsx)(Bt,{"aria-label":`Status for ${e.title||`gig`}`,value:e.status,disabled:t[`gig:${e.id}:status`],onChange:t=>s(e.id,t.target.value),children:Cn.map(e=>(0,F.jsx)(`option`,{value:e,children:Tn(e)},e))})]}):null,u?(0,F.jsxs)(`a`,{className:`inline-flex min-h-9 items-center justify-center gap-2 rounded-md border bg-secondary px-3 text-sm font-semibold`,href:u,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(v,{className:`size-4`}),`Discord thread`]}):null]})]}),(0,F.jsxs)(Lt,{className:`grid gap-4 lg:grid-cols-[1fr_1fr_1fr]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Activity`}),(0,F.jsx)(`strong`,{className:`block`,children:Kt(En(e))||`unknown`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Posted `,Kt(e.posted_at)||`unknown`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`People`}),(0,F.jsx)(`strong`,{className:`block`,children:e.application_count||l.length}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[Number(e.interested_count||0),` interested`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Discord`}),(0,F.jsx)(`strong`,{className:`block`,children:e.discord_channel_name||`No channel`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.discord_thread_id?`Thread ${e.discord_thread_id}`:`No thread`})]})]})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`People`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[l.length,` candidate`,l.length===1?``:`s`]})]}),(0,F.jsx)(_n,{hidden:l.length!==0,children:`No suggested or interested people yet.`}),(0,F.jsx)(`div`,{className:jt(`grid gap-3 p-4`,l.length===0&&`hidden`),children:l.map(a=>(0,F.jsx)(Ln,{gigId:e.id,application:a,loading:t,canWrite:n,crmContactUrl:r,crmAttachmentUrl:i,onUpdateApplicationStatus:c},a.id))})]})]})}function Ln({gigId:e,application:t,loading:n,canWrite:r,crmContactUrl:i,crmAttachmentUrl:a,onUpdateApplicationStatus:o}){let s=Fn(t),c=i(t.crm_contact_id),l=a(t.latest_resume_id),u=typeof t.fit_score==`number`?`${Math.round(t.fit_score)}/100`:typeof t.match_score==`number`?t.match_score.toFixed(1):``,d=typeof t.evaluation?.llm_summary==`string`?t.evaluation.llm_summary:``;return(0,F.jsxs)(`div`,{className:`grid gap-2 rounded-md border bg-background p-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[c?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:c,target:`_blank`,rel:`noopener noreferrer`,children:s}):(0,F.jsx)(`strong`,{children:s}),(0,F.jsx)(I,{variant:t.status===`interested`?`succeeded`:`neutral`,children:Tn(t.status)}),(0,F.jsx)(I,{variant:`neutral`,children:Tn(t.source||`manual_add`)}),u?(0,F.jsxs)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:[`Fit `,u]}):null,c?(0,F.jsx)(`a`,{className:`text-xs font-extrabold text-primary`,href:c,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open ${s} CRM profile`,children:`CRM profile`}):null,l?(0,F.jsx)(`a`,{className:`text-xs font-extrabold text-primary`,href:l,target:`_blank`,rel:`noopener noreferrer`,children:`Resume`}):null]}),d?(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:d}):null,r?(0,F.jsx)(Bt,{"aria-label":`Candidate status for ${s}`,value:t.status||`suggested`,disabled:n[`application:${t.id}:status`],onChange:n=>o(e,t.id,n.target.value),children:wn.map(e=>(0,F.jsx)(`option`,{value:e,children:Tn(e)},e))}):null]})}function Rn(e){let t=cn[e.peopleFilterKind]?.options||[];return(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`People lookup`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[e.canSync?(0,F.jsxs)(L,{id:`syncPeople`,"data-permission":`people:sync`,type:`button`,onClick:e.onSync,disabled:e.loading.syncPeople,children:[(0,F.jsx)(ee,{}),`Sync people`]}):null,e.crmBaseUrl?(0,F.jsx)(`a`,{id:`crmHomeLink`,className:`text-sm font-extrabold text-primary`,href:e.crmBaseUrl,target:`_blank`,rel:`noreferrer`,children:`Open CRM`}):null,(0,F.jsx)(`span`,{id:`peopleStatus`,className:`text-sm text-muted-foreground`,children:e.loading.people?`Loading`:`${e.people.length} shown`})]})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b p-4 md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Search CRM people cache`,(0,F.jsx)(Rt,{id:`peopleQuery`,value:e.peopleQuery,autoComplete:`off`,placeholder:`Name, email, CRM id, Discord, resume`,onChange:t=>e.setPeopleQuery(t.target.value),onKeyDown:t=>{t.key===`Enter`&&e.onSearch()}})]}),(0,F.jsxs)(L,{id:`searchPeople`,type:`button`,onClick:e.onSearch,disabled:e.loading.people,children:[(0,F.jsx)(te,{}),`Search`]})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b bg-background p-4 md:grid-cols-[minmax(120px,.7fr)_minmax(150px,1fr)_minmax(150px,1fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Member`,(0,F.jsxs)(Bt,{id:`peopleMember`,value:e.peopleMember,onChange:t=>e.setPeopleMember(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any`}),(0,F.jsx)(`option`,{value:`true`,children:`Member`}),(0,F.jsx)(`option`,{value:`false`,children:`Not member`})]})]}),(0,F.jsxs)(zt,{children:[`Add filter`,(0,F.jsx)(Bt,{id:`peopleFilterKind`,value:e.peopleFilterKind,disabled:e.peopleFilterKeys.length===0,onChange:t=>e.setPeopleFilterKind(t.target.value),children:e.peopleFilterKeys.map(e=>(0,F.jsx)(`option`,{value:e,children:cn[e].label},e))})]}),(0,F.jsxs)(zt,{children:[`Value`,(0,F.jsx)(Bt,{id:`peopleFilterValue`,value:e.peopleFilterValue,onChange:t=>e.setPeopleFilterValue(t.target.value),children:t.map(([e,t])=>(0,F.jsx)(`option`,{value:e,children:t},e))})]}),(0,F.jsx)(L,{id:`addPeopleFilter`,type:`button`,onClick:e.addFilter,disabled:e.peopleFilterKeys.length===0,children:`Add filter`}),(0,F.jsx)(`div`,{id:`activePeopleFilters`,className:`md:col-span-4`,children:(0,F.jsx)(Sn,{filters:e.peopleFilters,onRemove:e.removeFilter})})]}),(0,F.jsx)(_n,{hidden:e.people.length!==0,children:`No people match this lookup.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`peopleTable`,className:jt(`min-w-[900px]`,e.people.length===0&&`hidden`),"aria-label":`People lookup results`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[27%]`,label:`Name`,scope:`people`,sort:e.sort,sortKey:`name`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[28%]`,label:`Status`,scope:`people`,sort:e.sort,sortKey:`status`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[20%]`,label:`Discord`,scope:`people`,sort:e.sort,sortKey:`discord`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[25%]`,label:`Resume / skills`,scope:`people`,sort:e.sort,sortKey:`resume`,onSort:(t,n)=>e.onSort(n)})]})}),(0,F.jsx)(Ut,{id:`peopleBody`,children:e.people.map(t=>{let n=t.name||t.email_508||t.email||`CRM contact`,r=e.crmContactUrl(t.crm_contact_id),i=t.profile_status||{},a=Number(i.skills_count||0),o=e.crmAttachmentUrl(t.latest_resume_id);return(0,F.jsxs)(Wt,{children:[(0,F.jsxs)(B,{children:[r?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:r,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${n} in CRM`,children:n}):(0,F.jsx)(`strong`,{children:n}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:[t.email_508||t.email,t.contact_type].filter(Boolean).join(` | `)})]}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[i.crm_active?null:(0,F.jsx)(I,{variant:`missing`,children:t.sync_status||`CRM sync issue`}),(0,F.jsx)(I,{variant:i.is_member?`succeeded`:`missing`,children:i.is_member?`Member`:`Missing Member`}),(0,F.jsx)(I,{variant:i.discord_linked?`succeeded`:`missing`,children:i.discord_linked?`Discord`:`Missing Discord`}),(0,F.jsx)(I,{variant:i.email_508?`succeeded`:`missing`,children:i.email_508?`508 email`:`Missing 508 email`}),i.latest_resume?null:(0,F.jsx)(I,{variant:`missing`,children:`Missing Resume`})]})}),(0,F.jsx)(B,{children:[t.discord_username,t.discord_user_id].filter(Boolean).join(` | `)||`Not linked`}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[o?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:o,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${n} resume`,children:`Resume`}):(0,F.jsx)(`span`,{children:t.latest_resume_name||t.latest_resume_id||`No resume`}),(0,F.jsx)(I,{variant:a>0?`succeeded`:`missing`,children:a>0?`Skills parsed`:`Skills not parsed`})]})})]},t.crm_contact_id||n)})})]})})]})}function zn(e){let t=cn[e.onboardingFilterKind]?.options||[];return(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Onboarding queue`}),(0,F.jsx)(`span`,{id:`onboardingStatus`,className:`text-sm text-muted-foreground`,children:e.loading.onboarding?`Loading`:`${e.people.length} shown`})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b p-4 md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Search prospects`,(0,F.jsx)(Rt,{id:`onboardingQuery`,value:e.onboardingQuery,autoComplete:`off`,placeholder:`Name, email, Discord, onboarder`,onChange:t=>e.setOnboardingQuery(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(L,{id:`searchOnboarding`,type:`button`,onClick:e.onSearch,disabled:e.loading.onboarding,children:[(0,F.jsx)(te,{}),`Search`]})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b bg-background p-4 md:grid-cols-[minmax(140px,.8fr)_minmax(150px,1fr)_minmax(150px,1fr)_minmax(120px,.7fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`onboardingState`,value:e.onboardingState,onChange:t=>e.setOnboardingState(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any state`}),(0,F.jsx)(`option`,{value:`pending`,children:`Needs review`}),(0,F.jsx)(`option`,{value:`selected`,children:`Assigned to onboarder`}),(0,F.jsx)(`option`,{value:`reachingout`,children:`Reaching out`}),(0,F.jsx)(`option`,{value:`awaitingcontribution`,children:`Awaiting contribution`})]})]}),(0,F.jsxs)(zt,{children:[`Onboarder`,(0,F.jsx)(Rt,{id:`onboarderFilter`,value:e.onboarderFilter,autoComplete:`off`,placeholder:`Any onboarder`,onChange:t=>e.setOnboarderFilter(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(zt,{children:[`Add filter`,(0,F.jsx)(Bt,{id:`onboardingFilterKind`,value:e.onboardingFilterKind,disabled:e.onboardingFilterKeys.length===0,onChange:t=>e.setOnboardingFilterKind(t.target.value),children:e.onboardingFilterKeys.map(e=>(0,F.jsx)(`option`,{value:e,children:cn[e].label},e))})]}),(0,F.jsxs)(zt,{children:[`Value`,(0,F.jsx)(Bt,{id:`onboardingFilterValue`,value:e.onboardingFilterValue,onChange:t=>e.setOnboardingFilterValue(t.target.value),children:t.map(([e,t])=>(0,F.jsx)(`option`,{value:e,children:t},e))})]}),(0,F.jsx)(L,{id:`addOnboardingFilter`,type:`button`,onClick:e.addFilter,disabled:e.onboardingFilterKeys.length===0,children:`Add filter`}),(0,F.jsx)(`div`,{id:`activeOnboardingFilters`,className:`md:col-span-5`,children:(0,F.jsx)(Sn,{filters:e.onboardingFilters,onRemove:e.removeFilter,suffix:`onboarding filter`})})]}),(0,F.jsx)(_n,{hidden:e.people.length!==0,children:`No prospects match this queue view.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`onboardingTable`,className:jt(`min-w-[1180px]`,e.people.length===0&&`hidden`),"aria-label":`Onboarding queue`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[20%]`,label:`Name`,scope:`onboarding`,sort:e.sort,sortKey:`name`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[13%]`,label:`Status`,scope:`onboarding`,sort:e.sort,sortKey:`onboarding_state`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[22%]`,label:`Onboarder`,scope:`onboarding`,sort:e.sort,sortKey:`onboarder`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[13%]`,label:`Updated`,scope:`onboarding`,sort:e.sort,sortKey:`updated`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{className:`w-[15%]`,children:`Links`}),(0,F.jsx)(H,{className:`w-[17%]`,label:`Needs`,scope:`onboarding`,sort:e.sort,sortKey:`profile_gaps`,onSort:(t,n)=>e.onSort(n)})]})}),(0,F.jsx)(Ut,{id:`onboardingBody`,children:e.people.map(t=>(0,F.jsx)(Bn,{person:t,loading:e.loading,onAssign:e.onAssign,crmContactUrl:e.crmContactUrl,crmAttachmentUrl:e.crmAttachmentUrl},t.crm_contact_id||t.name))})]})})]})}function Bn({person:e,loading:t,onAssign:n,crmContactUrl:r,crmAttachmentUrl:i}){let a=e.name||e.email_508||e.email||`CRM contact`,[o,s]=(0,l.useState)(Qt(e.onboarder));(0,l.useEffect)(()=>s(Qt(e.onboarder)),[e.onboarder]);let c=e.profile_status||{},u=[[`Discord`,c.discord_linked],[`Resume`,c.latest_resume],[`Skills`,Number(c.skills_count||0)>0]].filter(([,e])=>!e),d=r(e.crm_contact_id),f=i(e.latest_resume_id);return(0,F.jsxs)(Wt,{children:[(0,F.jsxs)(B,{children:[d?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:d,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} in CRM`,children:a}):(0,F.jsx)(`strong`,{children:a}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e.email_508||e.email||``})]}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:Zt(Yt(e)),children:e.onboarding_status_label||Xt(Yt(e))})}),(0,F.jsx)(B,{children:(0,F.jsxs)(`form`,{className:`grid max-w-64 grid-cols-[minmax(100px,1fr)_auto] items-center gap-2`,onSubmit:t=>{t.preventDefault(),n(e.crm_contact_id,o)},children:[(0,F.jsx)(Rt,{"aria-label":`Onboarder for ${a}`,value:o,placeholder:`508 username`,onChange:e=>s(e.target.value)}),(0,F.jsx)(L,{type:`submit`,size:`sm`,"aria-label":`Save onboarder for ${a}`,disabled:t[`onboarder:${e.crm_contact_id}`],children:`Save`})]})}),(0,F.jsx)(B,{children:Kt(e.onboarding_updated_at)}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[f?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:f,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} resume`,children:`Resume`}):null,rn(e.linkedin)?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:rn(e.linkedin),target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} LinkedIn`,children:`LinkedIn`}):null,an(e.github_username)?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:an(e.github_username),target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} GitHub`,children:e.github_username||`GitHub`}):null,!f&&!rn(e.linkedin)&&!an(e.github_username)?`None`:null]})}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[u.map(([e])=>(0,F.jsxs)(I,{variant:`missing`,children:[`Missing `,e]},String(e))),u.length===0?`None`:null]})})]})}function Vn(e){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R,{className:`grid gap-3 p-4 md:grid-cols-4 md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Window`,(0,F.jsxs)(Bt,{id:`minutes`,value:e.minutes,onChange:t=>e.setMinutes(t.target.value),children:[(0,F.jsx)(`option`,{value:`15`,children:`15 minutes`}),(0,F.jsx)(`option`,{value:`60`,children:`1 hour`}),(0,F.jsx)(`option`,{value:`360`,children:`6 hours`}),(0,F.jsx)(`option`,{value:`1440`,children:`24 hours`})]})]}),(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`status`,value:e.status,onChange:t=>e.setStatus(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any status`}),(0,F.jsx)(`option`,{value:`queued`,children:`Queued`}),(0,F.jsx)(`option`,{value:`running`,children:`Running`}),(0,F.jsx)(`option`,{value:`succeeded`,children:`Succeeded`}),(0,F.jsx)(`option`,{value:`failed`,children:`Failed`}),(0,F.jsx)(`option`,{value:`dead`,children:`Dead`}),(0,F.jsx)(`option`,{value:`canceled`,children:`Canceled`})]})]}),(0,F.jsxs)(zt,{children:[`Type`,(0,F.jsx)(Rt,{id:`jobType`,value:e.jobType,autoComplete:`off`,placeholder:`Any type`,onChange:t=>e.setJobType(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(L,{id:`refreshJobs`,type:`button`,onClick:e.onSearch,disabled:e.loading.jobs,children:[(0,F.jsx)(ee,{}),`Refresh jobs`]})]}),(0,F.jsxs)(`section`,{className:`grid gap-3 md:grid-cols-4`,"aria-label":`Job summary`,children:[(0,F.jsx)(gn,{id:`metricTotal`,label:`Total`,value:e.jobs.length}),(0,F.jsx)(gn,{id:`metricQueued`,label:`Queued`,value:e.jobCounts.queued||0}),(0,F.jsx)(gn,{id:`metricRunning`,label:`Running`,value:e.jobCounts.running||0}),(0,F.jsx)(gn,{id:`metricFailed`,label:`Failed`,value:(e.jobCounts.failed||0)+(e.jobCounts.dead||0)})]}),(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Recent jobs`})}),(0,F.jsx)(_n,{hidden:e.jobs.length!==0,children:`No jobs match these filters.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`jobsTable`,className:jt(`min-w-[980px]`,e.jobs.length===0&&`hidden`),"aria-label":`Recent jobs`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[22%]`,label:`Job id`,scope:`jobs`,sort:e.sort,sortKey:`job_id`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[24%]`,label:`Type`,scope:`jobs`,sort:e.sort,sortKey:`type`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[12%]`,label:`Status`,scope:`jobs`,sort:e.sort,sortKey:`status`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[12%]`,label:`Attempts`,scope:`jobs`,sort:e.sort,sortKey:`attempts`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[18%]`,label:`Updated`,scope:`jobs`,sort:e.sort,sortKey:`updated_at`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{children:`Actions`})]})}),(0,F.jsx)(Ut,{id:`jobsBody`,children:e.jobs.map(t=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{className:`font-mono`,children:t.job_id}),(0,F.jsx)(B,{children:t.type}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:t.status||`neutral`,children:t.status})}),(0,F.jsxs)(B,{children:[t.attempts,`/`,t.max_attempts]}),(0,F.jsx)(B,{children:Kt(t.updated_at)}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,F.jsx)(L,{type:`button`,size:`sm`,variant:`outline`,"aria-label":`View details for ${t.type} job ${t.job_id}`,onClick:()=>e.onDetail(t.job_id),disabled:e.loading[`detail:${t.job_id}`],children:`Details`}),e.canWrite?(0,F.jsx)(L,{type:`button`,size:`sm`,"aria-label":`Rerun ${t.type} job ${t.job_id}`,onClick:()=>e.onRerun(t.job_id),disabled:e.loading[`rerun:${t.job_id}`],children:`Rerun`}):null]})})]},t.job_id))})]})})]}),e.jobDetail?(0,F.jsxs)(R,{id:`jobDetailPanel`,children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Job detail`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.jobDetail.job_id})]}),(0,F.jsxs)(Lt,{className:`grid gap-4`,children:[(0,F.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[[`Type`,e.jobDetail.type],[`Status`,e.jobDetail.status],[`Attempts`,`${e.jobDetail.attempts}/${e.jobDetail.max_attempts}`],[`Updated`,Kt(e.jobDetail.updated_at)],[`Created`,Kt(e.jobDetail.created_at)],[`Run after`,Kt(e.jobDetail.run_after)],[`Locked by`,e.jobDetail.locked_by||`None`],[`Last error`,e.jobDetail.last_error||`None`]].map(([e,t])=>(0,F.jsxs)(`div`,{className:`grid gap-1 rounded-md border bg-background p-3`,children:[(0,F.jsx)(`span`,{className:`text-[11px] font-extrabold uppercase text-muted-foreground`,children:e}),(0,F.jsx)(`strong`,{className:`break-words text-sm`,children:t})]},e))}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`mb-2 text-[15px] font-bold`,children:`Payload`}),(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-background p-3 font-mono text-xs`,children:Jt(e.jobDetail.payload)||`No payload`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`mb-2 text-[15px] font-bold`,children:`Result`}),(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-background p-3 font-mono text-xs`,children:Jt(e.jobDetail.result)||`No result`})]})]})]}):null]})}function Hn(e){return(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Recent audit`}),(0,F.jsxs)(L,{id:`refreshAudit`,type:`button`,variant:`outline`,onClick:e.onRefresh,disabled:e.loading.audit,children:[(0,F.jsx)(ee,{}),`Refresh`]})]}),(0,F.jsx)(_n,{hidden:e.events.length!==0,children:`No audit events found.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`auditTable`,className:jt(`min-w-[760px]`,e.events.length===0&&`hidden`),"aria-label":`Recent audit events`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[24%]`,label:`Time`,scope:`audit`,sort:e.sort,sortKey:`occurred_at`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[28%]`,label:`Actor`,scope:`audit`,sort:e.sort,sortKey:`actor`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[28%]`,label:`Action`,scope:`audit`,sort:e.sort,sortKey:`action`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[20%]`,label:`Result`,scope:`audit`,sort:e.sort,sortKey:`result`,onSort:(t,n)=>e.onSort(n)})]})}),(0,F.jsx)(Ut,{id:`auditBody`,children:e.events.map(e=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:Kt(e.occurred_at)}),(0,F.jsx)(B,{children:e.actor_display_name||e.actor_subject||e.actor_provider}),(0,F.jsx)(B,{children:e.action}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:e.result===`success`?`succeeded`:`failed`,children:e.result})})]},e.id||`${e.occurred_at||``}-${e.actor_subject||``}-${e.action||``}`))})]})})]})}function Un({report:e,loading:t,onRefresh:n}){let r=e?.summary||{},i=[[`Status`,e?.status_counts||{}],[`Intent`,e?.intent_counts||{}],[`Planner`,e?.planner_counts||{}]].flatMap(([e,t])=>Object.entries(t).map(([t,n])=>({label:e,value:t,count:n}))).sort((e,t)=>t.count-e.count||e.label.localeCompare(t.label)),a=Array.isArray(e?.recent_unsupported)?e.recent_unsupported:[];return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Agent requests`}),(0,F.jsxs)(L,{id:`refreshAgent`,type:`button`,variant:`outline`,onClick:n,disabled:t.agent,children:[(0,F.jsx)(ee,{}),`Refresh`]})]}),(0,F.jsxs)(Lt,{className:`grid gap-3 md:grid-cols-5`,children:[(0,F.jsx)(gn,{id:`agentMetricTotal`,label:`Total`,value:r.total||0}),(0,F.jsx)(gn,{id:`agentMetricHandled`,label:`Handled`,value:r.handled||0}),(0,F.jsx)(gn,{id:`agentMetricConfirmations`,label:`Confirmations`,value:r.requires_confirmation||0}),(0,F.jsx)(gn,{id:`agentMetricClarifications`,label:`Clarifications`,value:r.needs_clarification||0}),(0,F.jsx)(gn,{id:`agentMetricUnsupported`,label:`Not understood`,value:r.unsupported||0})]})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Request mix`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Recent agent.request audit events.`})]}),(0,F.jsx)(_n,{hidden:i.length!==0,children:`No agent request data found.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`agentBreakdownTable`,className:jt(`min-w-[860px]`,i.length===0&&`hidden`),"aria-label":`Agent request breakdown`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`Dimension`}),(0,F.jsx)(z,{children:`Value`}),(0,F.jsx)(z,{children:`Count`})]})}),(0,F.jsx)(Ut,{id:`agentBreakdownBody`,children:i.map(e=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:e.label}),(0,F.jsx)(B,{children:e.value}),(0,F.jsx)(B,{children:e.count})]},`${e.label}-${e.value}`))})]})})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Not understood`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Sanitized request text only.`})]}),(0,F.jsx)(_n,{hidden:a.length!==0,children:`No unsupported agent requests found.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`agentUnsupportedTable`,className:jt(`min-w-[860px]`,a.length===0&&`hidden`),"aria-label":`Unsupported agent requests`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`Time`}),(0,F.jsx)(z,{children:`Actor`}),(0,F.jsx)(z,{children:`Message`}),(0,F.jsx)(z,{children:`Result`})]})}),(0,F.jsx)(Ut,{id:`agentUnsupportedBody`,children:a.map(e=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:Kt(e.occurred_at)}),(0,F.jsx)(B,{children:e.actor}),(0,F.jsx)(B,{children:e.message_sanitized}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:e.result===`success`?`succeeded`:`failed`,children:e.result||`unknown`})})]},`${e.occurred_at||``}-${e.actor||``}-${e.message_sanitized||``}`))})]})})]})]})}var Wn=document.getElementById(`root`);if(!Wn)throw Error(`Missing #root container`);(0,C.createRoot)(Wn).render((0,F.jsx)(l.StrictMode,{children:(0,F.jsx)(vn,{})})); \ No newline at end of file diff --git a/apps/api/src/five08/backend/static/dashboard/assets/index-CIisEPpj.css b/apps/api/src/five08/backend/static/dashboard/assets/index-CIisEPpj.css new file mode 100644 index 00000000..2a96dc60 --- /dev/null +++ b/apps/api/src/five08/backend/static/dashboard/assets/index-CIisEPpj.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-teal-200:oklch(91% .096 180.426);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{margin:calc(var(--spacing) * 0);min-width:calc(var(--spacing) * 80);background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:calc(var(--spacing) * 0)}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:calc(var(--spacing) * 0)}.right-5{right:calc(var(--spacing) * 5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-5{left:calc(var(--spacing) * 5)}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-full{height:100%}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[78vh\]{max-height:78vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\[22px\]{min-height:22px}.w-\[10\%\]{width:10%}.w-\[12\%\]{width:12%}.w-\[13\%\]{width:13%}.w-\[14\%\]{width:14%}.w-\[15\%\]{width:15%}.w-\[16\%\]{width:16%}.w-\[17\%\]{width:17%}.w-\[18\%\]{width:18%}.w-\[20\%\]{width:20%}.w-\[22\%\]{width:22%}.w-\[24\%\]{width:24%}.w-\[25\%\]{width:25%}.w-\[27\%\]{width:27%}.w-\[28\%\]{width:28%}.w-\[48px\]{width:48px}.w-\[160px\]{width:160px}.w-\[min\(48rem\,calc\(100vw-2\.5rem\)\)\]{width:min(48rem,100vw - 2.5rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\[190px\]{min-width:190px}.min-w-\[760px\]{min-width:760px}.min-w-\[860px\]{min-width:860px}.min-w-\[900px\]{min-width:900px}.min-w-\[920px\]{min-width:920px}.min-w-\[980px\]{min-width:980px}.min-w-\[1100px\]{min-width:1100px}.min-w-\[1180px\]{min-width:1180px}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[minmax\(100px\,1fr\)_auto\]{grid-template-columns:minmax(100px,1fr) auto}.grid-rows-\[auto_minmax\(0\,1fr\)\]{grid-template-rows:auto minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.content-start{align-content:flex-start}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-400\/40{border-color:#fcbb0066}@supports (color:color-mix(in lab, red, red)){.border-amber-400\/40{border-color:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}.border-border{border-color:var(--border)}.border-destructive{border-color:var(--destructive)}.border-emerald-400\/35{border-color:#00d29459}@supports (color:color-mix(in lab, red, red)){.border-emerald-400\/35{border-color:color-mix(in oklab, var(--color-emerald-400) 35%, transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\/40{border-color:color-mix(in oklab, var(--color-emerald-500) 40%, transparent)}}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.border-red-400\/40{border-color:#ff656866}@supports (color:color-mix(in lab, red, red)){.border-red-400\/40{border-color:color-mix(in oklab, var(--color-red-400) 40%, transparent)}}.border-red-500\/25{border-color:#fb2c3640}@supports (color:color-mix(in lab, red, red)){.border-red-500\/25{border-color:color-mix(in oklab, var(--color-red-500) 25%, transparent)}}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-red-500\/40{border-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-teal-400\/40{border-color:#00d3bd66}@supports (color:color-mix(in lab, red, red)){.border-teal-400\/40{border-color:color-mix(in oklab, var(--color-teal-400) 40%, transparent)}}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--accent)}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/15{background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.bg-background,.bg-background\/90{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/90{background-color:color-mix(in oklab, var(--background) 90%, transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab, red, red)){.bg-black\/20{background-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.bg-black\/30{background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.bg-black\/45{background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/15{background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.bg-primary{background-color:var(--primary)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/5{background-color:#fb2c360d}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/5{background-color:color-mix(in oklab, var(--color-red-500) 5%, transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/15{background-color:color-mix(in oklab, var(--color-red-500) 15%, transparent)}}.bg-secondary{background-color:var(--secondary)}.bg-teal-500\/15{background-color:#00baa726}@supports (color:color-mix(in lab, red, red)){.bg-teal-500\/15{background-color:color-mix(in oklab, var(--color-teal-500) 15%, transparent)}}.p-0{padding:calc(var(--spacing) * 0)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-7{padding-block:calc(var(--spacing) * 7)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.text-\[15px\]{font-size:15px}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-300{color:var(--color-amber-300)}.text-card-foreground{color:var(--card-foreground)}.text-emerald-300{color:var(--color-emerald-300)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-100{color:var(--color-red-100)}.text-red-300{color:var(--color-red-300)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-teal-200{color:var(--color-teal-200)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_18px_44px_rgb\(0_0_0\/0\.22\)\]{--tw-shadow:0 18px 44px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.running{animation-play-state:running}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:border-border:hover{border-color:var(--border)}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-muted\/45:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/45:hover{background-color:color-mix(in oklab, var(--muted) 45%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary:hover,.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=48rem){.md\:sticky{position:sticky}.md\:top-24{top:calc(var(--spacing) * 24)}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-5{grid-column:span 5/span 5}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-\[7rem_minmax\(0\,1fr\)\]{grid-template-columns:7rem minmax(0,1fr)}.md\:grid-cols-\[190px_minmax\(0\,1fr\)\]{grid-template-columns:190px minmax(0,1fr)}.md\:grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.md\:grid-cols-\[minmax\(0\,1fr\)_180px_auto_auto_auto\]{grid-template-columns:minmax(0,1fr) 180px auto auto auto}.md\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.md\:grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.md\:grid-cols-\[minmax\(120px\,\.7fr\)_minmax\(150px\,1fr\)_minmax\(150px\,1fr\)_auto\]{grid-template-columns:minmax(120px,.7fr) minmax(150px,1fr) minmax(150px,1fr) auto}.md\:grid-cols-\[minmax\(140px\,\.8fr\)_minmax\(150px\,1fr\)_minmax\(150px\,1fr\)_minmax\(120px\,\.7fr\)_auto\]{grid-template-columns:minmax(140px,.8fr) minmax(150px,1fr) minmax(150px,1fr) minmax(120px,.7fr) auto}.md\:grid-cols-\[minmax\(160px\,1fr\)_auto_auto\]{grid-template-columns:minmax(160px,1fr) auto auto}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-end{align-items:flex-end}.md\:items-start{align-items:flex-start}.md\:justify-between{justify-content:space-between}.md\:justify-end{justify-content:flex-end}}@media (width>=64rem){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr}.lg\:grid-cols-\[minmax\(0\,1fr\)_220px_180px\]{grid-template-columns:minmax(0,1fr) 220px 180px}.lg\:items-start{align-items:flex-start}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--radius:.5rem;--background:oklch(16% .006 160);--foreground:oklch(94% .008 125);--card:oklch(22% .007 155);--card-foreground:oklch(94% .008 125);--popover:oklch(22% .007 155);--popover-foreground:oklch(94% .008 125);--primary:oklch(73% .11 178);--primary-foreground:oklch(17% .018 178);--secondary:oklch(28% .012 155);--secondary-foreground:oklch(94% .008 125);--muted:oklch(28% .012 155);--muted-foreground:oklch(71% .016 135);--accent:oklch(30% .042 178);--accent-foreground:oklch(88% .064 178);--destructive:oklch(67% .18 23);--border:oklch(100% 0 0/.14);--input:oklch(100% 0 0/.16);--ring:oklch(73% .11 178)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false} diff --git a/apps/api/src/five08/backend/static/dashboard/assets/index-Cjc8hvil.css b/apps/api/src/five08/backend/static/dashboard/assets/index-Cjc8hvil.css deleted file mode 100644 index d7360ff8..00000000 --- a/apps/api/src/five08/backend/static/dashboard/assets/index-Cjc8hvil.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-teal-200:oklch(91% .096 180.426);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--leading-tight:1.25;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{margin:calc(var(--spacing) * 0);min-width:calc(var(--spacing) * 80);background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:calc(var(--spacing) * 0)}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:calc(var(--spacing) * 0)}.right-5{right:calc(var(--spacing) * 5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-full{height:100%}.max-h-64{max-height:calc(var(--spacing) * 64)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\[22px\]{min-height:22px}.w-\[10\%\]{width:10%}.w-\[12\%\]{width:12%}.w-\[13\%\]{width:13%}.w-\[14\%\]{width:14%}.w-\[15\%\]{width:15%}.w-\[16\%\]{width:16%}.w-\[17\%\]{width:17%}.w-\[18\%\]{width:18%}.w-\[20\%\]{width:20%}.w-\[22\%\]{width:22%}.w-\[24\%\]{width:24%}.w-\[25\%\]{width:25%}.w-\[27\%\]{width:27%}.w-\[28\%\]{width:28%}.w-\[48px\]{width:48px}.w-\[160px\]{width:160px}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\[190px\]{min-width:190px}.min-w-\[760px\]{min-width:760px}.min-w-\[860px\]{min-width:860px}.min-w-\[900px\]{min-width:900px}.min-w-\[920px\]{min-width:920px}.min-w-\[980px\]{min-width:980px}.min-w-\[1100px\]{min-width:1100px}.min-w-\[1180px\]{min-width:1180px}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-default{cursor:default}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[minmax\(100px\,1fr\)_auto\]{grid-template-columns:minmax(100px,1fr) auto}.grid-rows-\[auto_minmax\(0\,1fr\)\]{grid-template-rows:auto minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.content-start{align-content:flex-start}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-400\/40{border-color:#fcbb0066}@supports (color:color-mix(in lab, red, red)){.border-amber-400\/40{border-color:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}.border-border{border-color:var(--border)}.border-destructive{border-color:var(--destructive)}.border-emerald-400\/35{border-color:#00d29459}@supports (color:color-mix(in lab, red, red)){.border-emerald-400\/35{border-color:color-mix(in oklab, var(--color-emerald-400) 35%, transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\/40{border-color:color-mix(in oklab, var(--color-emerald-500) 40%, transparent)}}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.border-red-400\/40{border-color:#ff656866}@supports (color:color-mix(in lab, red, red)){.border-red-400\/40{border-color:color-mix(in oklab, var(--color-red-400) 40%, transparent)}}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-red-500\/40{border-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-teal-400\/40{border-color:#00d3bd66}@supports (color:color-mix(in lab, red, red)){.border-teal-400\/40{border-color:color-mix(in oklab, var(--color-teal-400) 40%, transparent)}}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--accent)}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/15{background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.bg-background,.bg-background\/90{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/90{background-color:color-mix(in oklab, var(--background) 90%, transparent)}}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.bg-black\/45{background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/15{background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.bg-primary{background-color:var(--primary)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/15{background-color:color-mix(in oklab, var(--color-red-500) 15%, transparent)}}.bg-secondary{background-color:var(--secondary)}.bg-teal-500\/15{background-color:#00baa726}@supports (color:color-mix(in lab, red, red)){.bg-teal-500\/15{background-color:color-mix(in oklab, var(--color-teal-500) 15%, transparent)}}.p-0{padding:calc(var(--spacing) * 0)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-7{padding-block:calc(var(--spacing) * 7)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.text-\[15px\]{font-size:15px}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-300{color:var(--color-amber-300)}.text-card-foreground{color:var(--card-foreground)}.text-emerald-300{color:var(--color-emerald-300)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-teal-200{color:var(--color-teal-200)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_18px_44px_rgb\(0_0_0\/0\.22\)\]{--tw-shadow:0 18px 44px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.running{animation-play-state:running}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:border-border:hover{border-color:var(--border)}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-muted\/45:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/45:hover{background-color:color-mix(in oklab, var(--muted) 45%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary:hover,.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=48rem){.md\:sticky{position:sticky}.md\:top-24{top:calc(var(--spacing) * 24)}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-5{grid-column:span 5/span 5}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-\[190px_minmax\(0\,1fr\)\]{grid-template-columns:190px minmax(0,1fr)}.md\:grid-cols-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-columns:auto minmax(0,1fr) auto}.md\:grid-cols-\[minmax\(0\,1fr\)_180px_auto_auto_auto\]{grid-template-columns:minmax(0,1fr) 180px auto auto auto}.md\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.md\:grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.md\:grid-cols-\[minmax\(120px\,\.7fr\)_minmax\(150px\,1fr\)_minmax\(150px\,1fr\)_auto\]{grid-template-columns:minmax(120px,.7fr) minmax(150px,1fr) minmax(150px,1fr) auto}.md\:grid-cols-\[minmax\(140px\,\.8fr\)_minmax\(150px\,1fr\)_minmax\(150px\,1fr\)_minmax\(120px\,\.7fr\)_auto\]{grid-template-columns:minmax(140px,.8fr) minmax(150px,1fr) minmax(150px,1fr) minmax(120px,.7fr) auto}.md\:grid-cols-\[minmax\(160px\,1fr\)_auto_auto\]{grid-template-columns:minmax(160px,1fr) auto auto}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-end{align-items:flex-end}.md\:items-start{align-items:flex-start}.md\:justify-between{justify-content:space-between}.md\:justify-end{justify-content:flex-end}}@media (width>=64rem){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr}.lg\:grid-cols-\[minmax\(0\,1fr\)_220px_180px\]{grid-template-columns:minmax(0,1fr) 220px 180px}.lg\:items-start{align-items:flex-start}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--radius:.5rem;--background:oklch(16% .006 160);--foreground:oklch(94% .008 125);--card:oklch(22% .007 155);--card-foreground:oklch(94% .008 125);--popover:oklch(22% .007 155);--popover-foreground:oklch(94% .008 125);--primary:oklch(73% .11 178);--primary-foreground:oklch(17% .018 178);--secondary:oklch(28% .012 155);--secondary-foreground:oklch(94% .008 125);--muted:oklch(28% .012 155);--muted-foreground:oklch(71% .016 135);--accent:oklch(30% .042 178);--accent-foreground:oklch(88% .064 178);--destructive:oklch(67% .18 23);--border:oklch(100% 0 0/.14);--input:oklch(100% 0 0/.16);--ring:oklch(73% .11 178)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false} diff --git a/apps/api/src/five08/backend/static/dashboard/assets/index-WxptdPpM.js b/apps/api/src/five08/backend/static/dashboard/assets/index-WxptdPpM.js new file mode 100644 index 00000000..11130839 --- /dev/null +++ b/apps/api/src/five08/backend/static/dashboard/assets/index-WxptdPpM.js @@ -0,0 +1,9 @@ +var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function te(){}var S={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function re(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return re(e.type,t,e.props)}function ae(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function oe(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var se=/\/+/g;function ce(e,t){return typeof e==`object`&&e&&e.key!=null?oe(``+e.key):t.toString(36)}function C(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(te,te):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function le(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,le(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ce(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(se,`$&/`)+`/`),le(o,r,i,``,function(e){return e})):o!=null&&(ae(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(se,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{n.exports=t()})),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},l=n(),u=(0,l.createContext)({}),d=()=>(0,l.useContext)(u),f=(0,l.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:u,...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=d()??{},y=i??g?Number(n??h)*24/Number(t??m):n??h;return(0,l.createElement)(`svg`,{ref:p,...s,width:t??m??s.width,height:t??m??s.height,stroke:e??_,strokeWidth:y,className:r(`lucide`,v,a),...!o&&!c(f)&&{"aria-hidden":`true`},...f},[...u.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(o)?o:[o]])}),p=(e,t)=>{let n=(0,l.forwardRef)(({className:n,...a},s)=>(0,l.createElement)(f,{ref:s,iconNode:t,className:r(`lucide-${i(o(e))}`,`lucide-${e}`,n),...a}));return n.displayName=o(e),n},m=p(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),h=p(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),g=p(`briefcase-business`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),_=p(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),v=p(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),y=p(`file-clock`,[[`path`,{d:`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85`,key:`ryk6xj`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 14v2.2l1.6 1`,key:`6m4bie`}],[`circle`,{cx:`8`,cy:`16`,r:`6`,key:`10v15b`}]]),b=p(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),x=p(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ee=p(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),te=p(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),S=p(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ne=p(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),re=p(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ie=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,ae());else{var t=n(l);t!==null&&ce(x,t.startTime-e)}}var ee=!1,te=-1,S=5,ne=-1;function re(){return g?!0:!(e.unstable_now()-net&&re());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():ee=!1}}}var ae;if(typeof y==`function`)ae=function(){y(ie)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=ie,ae=function(){se.postMessage(null)}}else ae=function(){_(ie,0)};function ce(t,n){te=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ce(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,ae()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ae=e(((e,t)=>{t.exports=ie()})),oe=e((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=oe()})),ce=e((e=>{var t=ae(),r=n(),i=se();function a(e){var t=`https://react.dev/errors/`+e;if(1me||(e.current=pe[me],pe[me]=null,me--)}function O(e,t){me++,pe[me]=e.current,e.current=t}var he=E(null),k=E(null),ge=E(null),_e=E(null);function ve(e,t){switch(O(ge,t),O(k,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}D(he),O(he,e)}function ye(){D(he),D(k),D(ge)}function be(e){e.memoizedState!==null&&O(_e,e);var t=he.current,n=Hd(t,e.type);t!==n&&(O(k,e),O(he,n))}function xe(e){k.current===e&&(D(he),D(k)),_e.current===e&&(D(_e),Qf._currentValue=fe)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,A=262144,Ze=4194304;function Qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $e(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Qe(n))):i=Qe(o):i=Qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Qe(n))):i=Qe(o)):i=Qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 nt(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.textContent,a=i.length;for(e=0;e=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=pn(),fn=dn=un=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Tr=sn&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==It(r)||(r=Er,`selectionStart`in r&&wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Or&&yr(Or,r)||(Or=r,r=Ed(Dr,`onSelect`),0>=o,i-=o,Si=1<<32-Ke(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&wi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),U&&wi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&wi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),U&&wi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&wa(l)===r.type){n(e,r.sibling),c=i(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=wa(o),b(e,r,o,c)}if(de(o))return v(e,r,o,c);if(C(o)){if(l=C(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===x)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Y&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=w.T,s={};w.T=s,Ms(e,!1,t,n);try{var c=i(),l=w.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{T.p=a,o!==null&&s.types!==null&&(o.types=s.types),w.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Cs(e).queue;bs(e,i,t,fe,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:fe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=za(n);var r=Ba(t,e,n);r!==null&&(hu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Qr(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,vr(s,o))return Zr(e,t,i,0),q===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(a(479))}else t=Qr(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ge(!0);try{n(t)}finally{Ge(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,i=Do();if(U){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),q===null)throw Error(a(349));Y&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[pt]=t,o[M]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ge.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ki,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[pt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(a(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[pt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),i=!1}else i=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return ye(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(D(oo),r=t.memoizedState,r===null)return Ic(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return O(oo,oo.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>tu&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}else{if(!i)if(e=so(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*Pe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=oo.current,O(oo,i?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&D(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Rc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(a(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(oo),null;case 4:return ye(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&D(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:D(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&D(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[M]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[pt]=e,t[M]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Cr(e),wr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[pt]=e,Ct(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=xr(s,h),v=xr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,w.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(a(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{T.p=i,w.T=r,Vu(e,t)}}function Wu(e,t,n){t=mi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(it(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=mi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),it(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Pe()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=nt()),e=$r(e,t),e!==null&&(it(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ae(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=$e(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Pe(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=St(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ct(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=ge.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=St(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=St(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=St(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Rt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Rt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,Ct(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ct(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ce()}))();function le(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,w=ue,T=(e,t)=>n=>{if(t?.variants==null)return w(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=de(t)||de(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return w(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},fe=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),me=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),E=`-`,D=[],O=`arbitrary..`,he=e=>{let t=_e(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ge(e);let n=e.split(E);return k(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?fe(i,t):t:i||D}return n[e]||D}}},k=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=k(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(E):e.slice(t).join(E),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?O+r:void 0})(),_e=e=>{let{theme:t,classGroups:n}=e;return ve(n,t)},ve=(e,t)=>{let n=me();for(let r in e){let i=e[r];ye(i,n,r,t)}return n},ye=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){xe(e,t,n);return}if(typeof e==`function`){Se(e,t,n,r);return}Ce(e,t,n,r)},xe=(e,t,n)=>{let r=e===``?t:we(t,e);r.classGroupId=n},Se=(e,t,n,r)=>{if(Te(e)){ye(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pe(n,e))},Ce=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(E),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},De=`!`,Oe=`:`,ke=[],Ae=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),je=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return Ae(t,l,c,u)};if(t){let e=t+Oe,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ae(ke,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Me=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ne=e=>({cache:Ee(e.cacheSize),parseClassName:je(e),sortModifiers:Me(e),postfixLookupClassGroupIds:Pe(e),...he(e)}),Pe=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Fe),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+De:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},Le=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=Ne(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ie(e,n);return i(e,a),a};return a=o,(...e)=>a(Le(...e))},Be=[],Ve=e=>{let t=t=>t[e]||Be;return t.isThemeGetter=!0,t},He=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ue=/^\((?:(\w[\w-]*):)?(.+)\)$/i,We=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ge=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ke=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Je=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xe=e=>We.test(e),A=e=>!!e&&!Number.isNaN(Number(e)),Ze=e=>!!e&&Number.isInteger(Number(e)),Qe=e=>e.endsWith(`%`)&&A(e.slice(0,-1)),$e=e=>Ge.test(e),et=()=>!0,tt=e=>Ke.test(e)&&!qe.test(e),nt=()=>!1,rt=e=>Je.test(e),it=e=>Ye.test(e),at=e=>!j(e)&&!N(e),ot=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),st=e=>bt(e,wt,nt),j=e=>He.test(e),ct=e=>bt(e,Tt,tt),lt=e=>bt(e,Et,A),ut=e=>bt(e,Ot,et),dt=e=>bt(e,Dt,nt),ft=e=>bt(e,St,nt),pt=e=>bt(e,Ct,it),M=e=>bt(e,kt,rt),N=e=>Ue.test(e),P=e=>xt(e,Tt),mt=e=>xt(e,Dt),ht=e=>xt(e,St),gt=e=>xt(e,wt),_t=e=>xt(e,Ct),vt=e=>xt(e,kt,!0),yt=e=>xt(e,Ot,!0),bt=(e,t,n)=>{let r=He.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},xt=(e,t,n=!1)=>{let r=Ue.exec(e);return r?r[1]?t(r[1]):n:!1},St=e=>e===`position`||e===`percentage`,Ct=e=>e===`image`||e===`url`,wt=e=>e===`length`||e===`size`||e===`bg-size`,Tt=e=>e===`length`,Et=e=>e===`number`,Dt=e=>e===`family-name`,Ot=e=>e===`number`||e===`weight`,kt=e=>e===`shadow`,At=ze(()=>{let e=Ve(`color`),t=Ve(`font`),n=Ve(`text`),r=Ve(`font-weight`),i=Ve(`tracking`),a=Ve(`leading`),o=Ve(`breakpoint`),s=Ve(`container`),c=Ve(`spacing`),l=Ve(`radius`),u=Ve(`shadow`),d=Ve(`inset-shadow`),f=Ve(`text-shadow`),p=Ve(`drop-shadow`),m=Ve(`blur`),h=Ve(`perspective`),g=Ve(`aspect`),_=Ve(`ease`),v=Ve(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),N,j],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],te=()=>[`auto`,`contain`,`none`],S=()=>[N,j,c],ne=()=>[Xe,`full`,`auto`,...S()],re=()=>[Ze,`none`,`subgrid`,N,j],ie=()=>[`auto`,{span:[`full`,Ze,N,j]},Ze,N,j],ae=()=>[Ze,`auto`,N,j],oe=()=>[`auto`,`min`,`max`,`fr`,N,j],se=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ce=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],C=()=>[`auto`,...S()],le=()=>[Xe,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...S()],ue=()=>[Xe,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...S()],de=()=>[Xe,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...S()],w=()=>[e,N,j],T=()=>[...b(),ht,ft,{position:[N,j]}],fe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],pe=()=>[`auto`,`cover`,`contain`,gt,st,{size:[N,j]}],me=()=>[Qe,P,ct],E=()=>[``,`none`,`full`,l,N,j],D=()=>[``,A,P,ct],O=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],k=()=>[A,Qe,ht,ft],ge=()=>[``,`none`,m,N,j],_e=()=>[`none`,A,N,j],ve=()=>[`none`,A,N,j],ye=()=>[A,N,j],be=()=>[Xe,`full`,...S()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$e],breakpoint:[$e],color:[et],container:[$e],"drop-shadow":[$e],ease:[`in`,`out`,`in-out`],font:[at],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$e],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$e],shadow:[$e],spacing:[`px`,A],text:[$e],"text-shadow":[$e],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Xe,j,N,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,N,j]}],"container-named":[ot],columns:[{columns:[A,j,N,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ze,`auto`,N,j]}],basis:[{basis:[Xe,`full`,`auto`,s,...S()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[A,Xe,`auto`,`initial`,`none`,j]}],grow:[{grow:[``,A,N,j]}],shrink:[{shrink:[``,A,N,j]}],order:[{order:[Ze,`first`,`last`,`none`,N,j]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...se(),`normal`]}],"justify-items":[{"justify-items":[...ce(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ce()]}],"align-content":[{content:[`normal`,...se()]}],"align-items":[{items:[...ce(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ce(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...ce(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ce()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":S()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":S()}],"space-y-reverse":[`space-y-reverse`],size:[{size:le()}],"inline-size":[{inline:[`auto`,...ue()]}],"min-inline-size":[{"min-inline":[`auto`,...ue()]}],"max-inline-size":[{"max-inline":[`none`,...ue()]}],"block-size":[{block:[`auto`,...de()]}],"min-block-size":[{"min-block":[`auto`,...de()]}],"max-block-size":[{"max-block":[`none`,...de()]}],w:[{w:[s,`screen`,...le()]}],"min-w":[{"min-w":[s,`screen`,`none`,...le()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...le()]}],h:[{h:[`screen`,`lh`,...le()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...le()]}],"max-h":[{"max-h":[`screen`,`lh`,...le()]}],"font-size":[{text:[`base`,n,P,ct]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,yt,ut]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Qe,j]}],"font-family":[{font:[mt,dt,t]}],"font-features":[{"font-features":[j]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,N,j]}],"line-clamp":[{"line-clamp":[A,`none`,N,lt]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":[`none`,N,j]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,N,j]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...O(),`wavy`]}],"text-decoration-thickness":[{decoration:[A,`from-font`,`auto`,N,ct]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[A,`auto`,N,j]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:S()}],"tab-size":[{tab:[Ze,N,j]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,N,j]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,N,j]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ze,N,j],radial:[``,N,j],conic:[Ze,N,j]},_t,pt]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-bs":[{"border-bs":D()}],"border-w-be":[{"border-be":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":D()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...O(),`hidden`,`none`]}],"divide-style":[{divide:[...O(),`hidden`,`none`]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-bs":[{"border-bs":w()}],"border-color-be":[{"border-be":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...O(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[A,N,j]}],"outline-w":[{outline:[``,A,P,ct]}],"outline-color":[{outline:w()}],shadow:[{shadow:[``,`none`,u,vt,M]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":[`none`,d,vt,M]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:D()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[A,ct]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":[`none`,f,vt,M]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[A,N,j]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[A]}],"mask-image-linear-from-pos":[{"mask-linear-from":k()}],"mask-image-linear-to-pos":[{"mask-linear-to":k()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":k()}],"mask-image-t-to-pos":[{"mask-t-to":k()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":k()}],"mask-image-r-to-pos":[{"mask-r-to":k()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":k()}],"mask-image-b-to-pos":[{"mask-b-to":k()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":k()}],"mask-image-l-to-pos":[{"mask-l-to":k()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":k()}],"mask-image-x-to-pos":[{"mask-x-to":k()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":k()}],"mask-image-y-to-pos":[{"mask-y-to":k()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[N,j]}],"mask-image-radial-from-pos":[{"mask-radial-from":k()}],"mask-image-radial-to-pos":[{"mask-radial-to":k()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[A]}],"mask-image-conic-from-pos":[{"mask-conic-from":k()}],"mask-image-conic-to-pos":[{"mask-conic-to":k()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,N,j]}],filter:[{filter:[``,`none`,N,j]}],blur:[{blur:ge()}],brightness:[{brightness:[A,N,j]}],contrast:[{contrast:[A,N,j]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,vt,M]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:[``,A,N,j]}],"hue-rotate":[{"hue-rotate":[A,N,j]}],invert:[{invert:[``,A,N,j]}],saturate:[{saturate:[A,N,j]}],sepia:[{sepia:[``,A,N,j]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,N,j]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[A,N,j]}],"backdrop-contrast":[{"backdrop-contrast":[A,N,j]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,A,N,j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[A,N,j]}],"backdrop-invert":[{"backdrop-invert":[``,A,N,j]}],"backdrop-opacity":[{"backdrop-opacity":[A,N,j]}],"backdrop-saturate":[{"backdrop-saturate":[A,N,j]}],"backdrop-sepia":[{"backdrop-sepia":[``,A,N,j]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,N,j]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[A,`initial`,N,j]}],ease:[{ease:[`linear`,`initial`,_,N,j]}],delay:[{delay:[A,N,j]}],animate:[{animate:[`none`,v,N,j]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,N,j]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":[`scale-3d`],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[N,j,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ze,N,j]}],accent:[{accent:w()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,N,j]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":w()}],"scrollbar-track-color":[{"scrollbar-track":w()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,N,j]}],fill:[{fill:[`none`,...w()]}],"stroke-w":[{stroke:[A,P,ct,lt]}],stroke:[{stroke:[`none`,...w()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function jt(...e){return At(ue(e))}var Mt=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=e(((e,t)=>{t.exports=Mt()}))(),Nt=T(`inline-flex min-h-[22px] items-center rounded-full border px-2 py-0.5 text-[11px] font-extrabold uppercase leading-tight`,{variants:{variant:{neutral:`border-border bg-secondary text-muted-foreground`,succeeded:`border-emerald-400/35 bg-emerald-500/15 text-emerald-300`,failed:`border-red-400/40 bg-red-500/15 text-red-300`,dead:`border-red-400/40 bg-red-500/15 text-red-300`,missing:`border-red-400/40 bg-red-500/15 text-red-300`,running:`border-amber-400/40 bg-amber-500/15 text-amber-300`,queued:`border-teal-400/40 bg-teal-500/15 text-teal-200`,canceled:`border-border bg-secondary text-muted-foreground`}},defaultVariants:{variant:`neutral`}});function I({className:e,variant:t,...n}){return(0,F.jsx)(`span`,{"data-slot":`badge`,className:jt(Nt({variant:t,className:e})),...n})}var Pt=T(`inline-flex min-h-9 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md border text-sm font-semibold transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`border-border bg-secondary text-secondary-foreground hover:bg-secondary/80`,outline:`border-border bg-background hover:bg-accent hover:text-accent-foreground`,ghost:`border-transparent hover:bg-accent hover:text-accent-foreground`,destructive:`border-destructive bg-destructive text-white hover:bg-destructive/90`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,icon:`size-9`}},defaultVariants:{variant:`secondary`,size:`default`}});function L({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,F.jsx)(`button`,{"data-slot":`button`,type:r,className:jt(Pt({variant:t,size:n,className:e})),...i})}function R({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card`,className:jt(`rounded-lg border bg-card text-card-foreground shadow-[0_18px_44px_rgb(0_0_0/0.22)]`,e),...t})}function Ft({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-header`,className:jt(`flex items-center justify-between gap-3 border-b px-4 py-3`,e),...t})}function It({className:e,...t}){return(0,F.jsx)(`h2`,{"data-slot":`card-title`,className:jt(`text-[15px] font-bold`,e),...t})}function Lt({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-content`,className:jt(`p-4`,e),...t})}function Rt({className:e,type:t,...n}){return(0,F.jsx)(`input`,{"data-slot":`input`,type:t,className:jt(`flex min-h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-xs transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function zt({className:e,...t}){return(0,F.jsx)(`label`,{"data-slot":`label`,className:jt(`grid gap-1.5 text-xs font-bold text-muted-foreground`,e),...t})}function Bt({className:e,...t}){return(0,F.jsx)(`select`,{"data-slot":`select`,className:jt(`flex min-h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t})}function Vt({className:e,...t}){return(0,F.jsx)(`table`,{"data-slot":`table`,className:jt(`w-full border-collapse text-sm`,e),...t})}function Ht({className:e,...t}){return(0,F.jsx)(`thead`,{"data-slot":`table-header`,className:e,...t})}function Ut({className:e,...t}){return(0,F.jsx)(`tbody`,{"data-slot":`table-body`,className:e,...t})}function Wt({className:e,...t}){return(0,F.jsx)(`tr`,{"data-slot":`table-row`,className:jt(`border-b transition-colors hover:bg-muted/45`,e),...t})}function z({className:e,...t}){return(0,F.jsx)(`th`,{"data-slot":`table-head`,className:jt(`bg-secondary px-3 py-3 text-left align-middle text-xs font-extrabold text-muted-foreground`,e),...t})}function B({className:e,...t}){return(0,F.jsx)(`td`,{"data-slot":`table-cell`,className:jt(`px-3 py-3 align-middle text-sm`,e),...t})}var Gt={pending:`Needs review`,selected:`Assigned to onboarder`,reachingout:`Reaching out`,awaitingcontribution:`Awaiting contribution`,onboarded:`Onboarded`,waitlist:`Waitlist`,rejected:`Rejected`};function Kt(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function qt(e,t=new Date){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;let r=t.getTime()-n.getTime();return r<0?0:Math.floor(r/864e5)}function Jt(e){return e==null?``:JSON.stringify(e,null,2)}function Yt(e){return e.onboarding_state||e.onboardingState||e.cOnboardingState||``}function Xt(e){let t=String(e||``).trim();if(!t)return`No status`;let n=t.toLowerCase();return Gt[n]?Gt[n]:t.replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function Zt(e){let t=String(e||``).trim().toLowerCase();return!t||t===`pending`?`neutral`:t===`selected`?`queued`:t===`rejected`?`failed`:t===`onboarded`?`succeeded`:t===`waitlist`?`running`:`queued`}function Qt(e){let t=String(e||``).trim();return!t||t.toLowerCase()===`none`?``:t}function $t(e){let t=String(e||``).trim();return t?/^https?:\/\//i.test(t)?t:`https://${t.replace(/^\/+/,``)}`:``}function en(e){try{return new URL($t(e))}catch{return null}}function tn(e,t){let n=e.toLowerCase();return n===t||n.endsWith(`.${t}`)}function nn(e){return e.split(`/`).filter(Boolean).map(e=>encodeURIComponent(e)).join(`/`)}function rn(e){let t=String(e||``).trim();if(!t)return``;let n=en(t);if(n&&tn(n.hostname,`linkedin.com`))return n.href;if(/^https?:\/\//i.test(t))return``;let r=t.replace(/^@/,``).replace(/^\/+|\/+$/g,``).replace(/^in\//i,``);return r?`https://www.linkedin.com/in/${nn(r)}`:``}function an(e){let t=String(e||``).trim().replace(/^@/,``);if(!t)return``;let n=en(t);if(n&&tn(n.hostname,`github.com`))return n.href;if(/^https?:\/\//i.test(t))return``;let r=t.replace(/^\/+|\/+$/g,``);return r?`https://github.com/${nn(r)}`:``}var on={people:`/dashboard/people`,gigs:`/dashboard/gigs`,projects:`/dashboard/projects`,onboarding:`/dashboard/onboarding`,jobs:`/dashboard/jobs`,agent:`/dashboard/agent`,audit:`/dashboard/audit`},sn={people:`people:read`,gigs:`gigs:read`,projects:`projects:read`,onboarding:`onboarding:read`,jobs:`jobs:read`,agent:`audit:read`,audit:`audit:read`},cn={discord:{label:`Discord`,options:[[`linked`,`Linked`],[`missing`,`Missing`]]},email_508:{label:`508 email`,options:[[`present`,`Present`],[`missing`,`Missing`]]},resume:{label:`Resume`,options:[[`present`,`Present`],[`missing`,`Missing`]]},skills:{label:`Skills`,options:[[`present`,`Parsed`],[`missing`,`Not parsed`]]},sync_status:{label:`Sync status`,options:[[`active`,`Active`],[`conflict`,`Conflict`],[`missing_in_crm`,`Missing in CRM`]]}},ln=class extends Error{status;statusText;payload;url;method;constructor(e,t,n,r,i,a){super(e),this.name=`ApiRequestError`,this.status=t,this.statusText=n,this.payload=r,this.url=i,this.method=a}};function un(e,t){let n=e.detail;if(typeof n==`string`&&n.trim())return n;let r=e.error;return typeof r==`string`?r===`person_not_found`?`No CRM person, ERPNext user, or ERPNext supplier matched "${typeof e.person==`string`&&e.person.trim()?e.person:`that person`}". Try an email address or an exact name from CRM/ERPNext.`:r===`candidate_not_found`?`The selected person record is no longer available. Search again and choose one of the current matches.`:r===`ambiguous_person`?`Multiple people matched. Choose the matching person record.`:r||t:t}function dn(e,t){return typeof e==`string`&&e.trim()?e:e instanceof Error&&e.message.trim()?e.message:t}function fn(){return window.location.pathname.split(`/`).filter(Boolean)[1]||``}function pn(){let e=fn();return Object.hasOwn(on,e)?e:`people`}function mn(e=`gigs`){let[,t,n]=window.location.pathname.split(`/`).filter(Boolean);if(t!==e||!n)return``;try{return decodeURIComponent(n)}catch{return``}}async function V(e,t={}){let n=String(t.method||`GET`).toUpperCase(),r=new Headers(t.headers);r.set(`Accept`,`application/json`);let i;try{i=await fetch(e,{credentials:`same-origin`,...t,headers:r})}catch(t){throw new ln(dn(t,`Network request failed`),0,`Network request failed`,null,e,n)}if(i.status===401){let t=`${window.location.pathname}${window.location.search}`||`/dashboard`;throw window.location.assign(`/auth/login?next=${encodeURIComponent(t)}`),new ln(`Session expired`,i.status,i.statusText,null,e,n)}if(!i.ok){let t=i.statusText,r=null;try{r=await i.json(),r&&typeof r==`object`&&(t=un(r,String(t||`Request failed`)))}catch{t=i.statusText}throw new ln(typeof t==`string`?t:JSON.stringify(t),i.status,i.statusText,r,e,n)}return i.json()}function hn(e,t,n){if(e===`gigs`){let e=t;if(n===`title`)return e.title||``;if(n===`status`)return e.status||``;if(n===`applications`)return Number(e.application_count||0);if(n===`activity`)return On(e)}if(e===`projects`){let e=t;if(n===`display_name`)return e.display_name||``;if(n===`customer`)return e.customer||``;if(n===`status`)return e.source_status||``;if(n===`roster_count`)return Number(e.roster_count||0);if(n===`modified`)return e.source_modified_at||e.last_synced_at||``}if(e===`onboarding`){let e=t,r=e.profile_status||{};if(n===`name`)return e.name||e.email_508||e.email||``;if(n===`onboarding_state`){let t=Yt(e);return t.toLowerCase()===`pending`?`zzz-${t}`:t}if(n===`onboarder`)return e.onboarder||``;if(n===`updated`)return e.onboarding_updated_at||``;if(n===`profile_gaps`)return[!r.discord_linked,!r.latest_resume,Number(r.skills_count||0)<=0].filter(Boolean).length}if(e===`people`){let e=t,r=e.profile_status||{};if(n===`name`)return e.name||e.email_508||e.email||``;if(n===`status`)return[r.crm_active,r.is_member,r.discord_linked,r.email_508,r.latest_resume].filter(Boolean).length;if(n===`discord`)return e.discord_username||e.discord_user_id||``;if(n===`resume`)return e.latest_resume_name||e.latest_resume_id||``}if(e===`audit`){let e=t;if(n===`actor`)return e.actor_display_name||e.actor_subject||e.actor_provider||``}return t[n]??``}function gn(e,t,n){let r=n.direction===`asc`?1:-1;return[...t].sort((t,i)=>{let a=hn(e,t,n.key),o=hn(e,i,n.key);return typeof a==`number`&&typeof o==`number`?(a-o)*r:String(a).localeCompare(String(o),void 0,{numeric:!0})*r})}function _n({label:e,scope:t,sort:n,sortKey:r,onSort:i}){let a=n.key===r,o=n.direction===`asc`?`↑`:`↓`;return(0,F.jsx)(`button`,{type:`button`,"data-sort-scope":t,"data-sort-key":r,className:`text-left font-[inherit] text-inherit hover:text-foreground`,onClick:()=>i(t,r),children:a?`${e} ${o}`:e})}function H({className:e,label:t,scope:n,sort:r,sortKey:i,onSort:a}){return(0,F.jsx)(z,{className:e,"aria-sort":r.key===i?r.direction===`asc`?`ascending`:`descending`:`none`,children:(0,F.jsx)(_n,{label:t,scope:n,sort:r,sortKey:i,onSort:a})})}function vn({label:e,value:t,id:n}){return(0,F.jsxs)(R,{className:`p-4`,children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:e}),(0,F.jsx)(`strong`,{id:n,className:`block text-2xl`,children:t})]})}function yn({children:e,hidden:t}){return t?null:(0,F.jsx)(`div`,{className:`px-4 py-7 text-center text-sm text-muted-foreground`,children:e})}function bn(){let e=mn(`projects`),[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)(pn()),[a,o]=(0,l.useState)({message:``}),[s,c]=(0,l.useState)([]),[u,d]=(0,l.useState)(``),[f,p]=(0,l.useState)([]),[m,v]=(0,l.useState)([]),[ee,te]=(0,l.useState)([]),[re,ie]=(0,l.useState)({}),[ae,oe]=(0,l.useState)(null),[se,ce]=(0,l.useState)(null),[C,le]=(0,l.useState)(mn()),[ue,de]=(0,l.useState)(e),[w,T]=(0,l.useState)([]),[fe,pe]=(0,l.useState)(!1),[me,E]=(0,l.useState)([]),[D,O]=(0,l.useState)([]),[he,k]=(0,l.useState)([]),[ge,_e]=(0,l.useState)(null),[ve,ye]=(0,l.useState)(null),[be,xe]=(0,l.useState)({}),[Se,Ce]=(0,l.useState)([]),[we,Te]=(0,l.useState)(null),[Ee,De]=(0,l.useState)({onboarding:{key:`onboarding_state`,direction:`asc`},gigs:{key:`activity`,direction:`desc`},projects:{key:`display_name`,direction:`asc`},jobs:{key:`updated_at`,direction:`desc`},people:{key:`name`,direction:`asc`},agent:{key:`occurred_at`,direction:`desc`},audit:{key:`occurred_at`,direction:`desc`}}),[Oe,ke]=(0,l.useState)(`60`),[Ae,je]=(0,l.useState)(``),[Me,Ne]=(0,l.useState)(``),[Pe,Fe]=(0,l.useState)(``),[Ie,Le]=(0,l.useState)(100),[Re,ze]=(0,l.useState)(``),[Be,Ve]=(0,l.useState)(e?``:`Open`),[He,Ue]=(0,l.useState)(7),[We,Ge]=(0,l.useState)(``),[Ke,qe]=(0,l.useState)(``),[Je,Ye]=(0,l.useState)({}),[Xe,A]=(0,l.useState)(`discord`),[Ze,Qe]=(0,l.useState)(`linked`),[$e,et]=(0,l.useState)(``),[tt,nt]=(0,l.useState)(``),[rt,it]=(0,l.useState)(``),[at,ot]=(0,l.useState)({}),[st,j]=(0,l.useState)(`discord`),[ct,lt]=(0,l.useState)(`linked`),ut=(0,l.useRef)(()=>void 0);function dt(e){return s.includes(e)}function ft(e){return dt(sn[e])}function pt(){return Object.keys(on).find(e=>ft(e))||`people`}function M(e,t){o({message:e,tone:t})}function N(e,t){M(dn(e,t),`error`)}function P(e,t){xe(n=>({...n,[e]:t}))}function mt(e,t=!1){let n=e;ft(n)||(M(`${n[0].toUpperCase()}${n.slice(1)} requires SSO validation`,`error`),n=pt()),n!==`gigs`&&le(``),n!==`projects`&&de(``),n===`gigs`&&t&&le(``),n===`projects`&&t&&de(``),i(n),t?window.history.pushState({view:n},``,on[n]):(!Object.hasOwn(on,fn())||n!==e)&&window.history.replaceState({view:n},``,on[n])}ut.current=mt;function ht(e){return!u||!e?``:`${u}/#Contact/view/${encodeURIComponent(e)}`}function gt(e){return!u||!e?``:`${u}/api/v1/Attachment/file/${encodeURIComponent(e)}`}function _t(e,t){De(n=>{let r=n[e];return{...n,[e]:{key:t,direction:r.key===t&&r.direction===`asc`?`desc`:`asc`}}})}function vt(e){le(e),ce(m.find(t=>t.id===e)||null),i(`gigs`),window.history.pushState({view:`gigs`,gigId:e},``,`/dashboard/gigs/${encodeURIComponent(e)}`)}function yt(){le(``),ce(null),window.history.replaceState({view:`gigs`},``,on.gigs)}function bt(e){de(e),i(`projects`),window.history.pushState({view:`projects`,projectId:e},``,`/dashboard/projects/${encodeURIComponent(e)}`)}function xt(){de(``),window.history.replaceState({view:`projects`},``,on.projects)}async function St(){let e=await V(`/dashboard/api/me`);n(e);let t=Array.isArray(e.permissions)?e.permissions:[];return c(t),d((e.crm_base_url||``).replace(/\/+$/,``)),t}function Ct(){let e=new URLSearchParams({minutes:Oe,limit:`100`});return Ae&&e.set(`status`,Ae),Me.trim()&&e.set(`type`,Me.trim()),`/dashboard/api/jobs?${e.toString()}`}function wt(){let e=new URLSearchParams({limit:String(Ie)});return Pe&&e.set(`status`,Pe),`/dashboard/api/gigs?${e.toString()}`}function Tt(){let e=new URLSearchParams({limit:`100`,status:Be});return Re.trim()&&e.set(`query`,Re.trim()),`/dashboard/api/projects?${e.toString()}`}async function Et(){P(`jobs`,!0),M(`Loading jobs`);try{let e=await V(Ct());p(e),M(`Loaded ${e.length} jobs`,`ok`)}catch(e){N(e,`Unable to load jobs`)}finally{P(`jobs`,!1)}}async function Dt(){P(`gigs`,!0);try{let e=await V(wt());v(e),M(`Loaded ${e.length} gig${e.length===1?``:`s`}`,`ok`),Lt()}catch(e){N(e,`Unable to load gigs`)}finally{P(`gigs`,!1)}}async function Ot(){P(`projects`,!0);try{let e=await V(Tt());te(e.projects||[]),ie(e.summary||{}),M(`Loaded ${(e.projects||[]).length} project${(e.projects||[]).length===1?``:`s`}`,`ok`)}catch(e){N(e,`Unable to load projects`)}finally{P(`projects`,!1)}}async function kt(){P(`syncProjects`,!0),M(`Queueing project sync`);try{M(`Queued project sync ${(await V(`/dashboard/api/sync/projects`,{method:`POST`})).job_id}`,`ok`)}catch(e){N(e,`Unable to queue project sync`)}finally{P(`syncProjects`,!1)}}async function At(e,t){P(`project:${e}:status`,!0);try{let n=await V(`/dashboard/api/projects/${encodeURIComponent(e)}/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:t})});te(t=>t.map(t=>t.id===e?n.project:t)),M(`Updated project status`,`ok`)}catch(e){N(e,`Unable to update project`)}finally{P(`project:${e}:status`,!1)}}async function Mt(e,t){if(e.length===0)return!1;P(`projectsBulkUpdate`,!0);try{let n=await V(`/dashboard/api/projects/bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project_ids:e,...t})}),r=n.projects||[];te(e=>e.map(e=>r.find(t=>t.id===e.id)||e));let i=n.failures||[];return M(i.length?`Updated ${r.length}; ${i.length} failed`:`Updated ${r.length} project${r.length===1?``:`s`}`,i.length?`error`:`ok`),i.length===0}catch(e){return N(e,`Unable to bulk update projects`),!1}finally{P(`projectsBulkUpdate`,!1)}}async function Nt(e,t){let n=t.trim();if(!n)return!1;P(`project:${e}:user`,!0);try{let t=await V(`/dashboard/api/projects/${encodeURIComponent(e)}/users`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({user:n})});return te(n=>n.map(n=>n.id===e?t.project:n)),M(`Added project user`,`ok`),!0}catch(e){return N(e,`Unable to add project user`),!1}finally{P(`project:${e}:user`,!1)}}async function I(e,t,n){let r=t.trim();if(!r)return!1;P(`project:${e}:historical`,!0);try{let t=await V(`/dashboard/api/projects/${encodeURIComponent(e)}/historical-members`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({person:r,candidate_id:n})});return te(n=>n.map(n=>n.id===e?t.project:n)),Te(null),M(`Added historical project member`,`ok`),!0}catch(t){if(t instanceof ln&&t.status===409){let n=t.payload?.candidates||[];if(n.length>0)return Te({projectId:e,person:r,candidates:n}),M(`Choose the matching person record`,`error`),!1}return N(t,`Unable to add historical member`),!1}finally{P(`project:${e}:historical`,!1)}}async function Pt(e,t,n){P(`project:${e}:wiki`,!0);try{await V(`/dashboard/api/projects/${encodeURIComponent(e)}/wiki-match`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:t,row_key:n})}),M(t===`no_row`?`Marked as no wiki row`:`Confirmed wiki match`,`ok`),await R()}catch(e){N(e,`Unable to save wiki match`)}finally{P(`project:${e}:wiki`,!1)}}async function R(){P(`wikiMatches`,!0);try{oe(await V(`/dashboard/api/projects/wiki-matches`)),M(`Loaded wiki match preview`,`ok`)}catch(e){N(e,`Unable to load wiki matches`)}finally{P(`wikiMatches`,!1)}}async function Ft(e){P(`gig:${e}:detail`,!0);try{ce(await V(`/dashboard/api/gigs/${encodeURIComponent(e)}`))}catch(e){ce(null),N(e,`Unable to load gig`)}finally{P(`gig:${e}:detail`,!1)}}async function It(){await Dt(),C&&await Ft(C)}async function Lt(){if(dt(`gigs:read`)){P(`notifications`,!0);try{let e=await V(`/dashboard/api/notifications?limit=20`);Ue(e.stale_days||7),T(e.notifications||[])}catch(e){N(e,`Unable to load notifications`)}finally{P(`notifications`,!1)}}}async function Rt(e,t){P(`gig:${e}:status`,!0);try{let n=(await V(`/dashboard/api/gigs/${encodeURIComponent(e)}/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:t})})).discord_title_sync?.status;M(n===`error`?`Updated gig status; Discord title sync failed`:`Updated gig status`,n===`error`?`error`:`ok`),await Dt(),C===e&&await Ft(e)}catch(e){N(e,`Unable to update gig`)}finally{P(`gig:${e}:status`,!1)}}async function zt(e,t,n){P(`application:${t}:status`,!0);try{await V(`/dashboard/api/gigs/${encodeURIComponent(e)}/applications/${encodeURIComponent(t)}/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:n})}),M(`Updated candidate status`,`ok`),await Dt(),C===e&&await Ft(e)}catch(e){N(e,`Unable to update candidate`)}finally{P(`application:${t}:status`,!1)}}function Bt(){let e=new URLSearchParams({limit:`25`});We.trim()&&e.set(`query`,We.trim()),Ke&&e.set(`is_member`,Ke);for(let[t,n]of Object.entries(Je))n&&e.set(t,n);return`/dashboard/api/people?${e.toString()}`}async function Vt(){P(`people`,!0);try{E(await V(Bt()))}catch(e){N(e,`Unable to load people`)}finally{P(`people`,!1)}}function Ht(){let e=new URLSearchParams({limit:`25`});$e.trim()&&e.set(`query`,$e.trim()),tt&&e.set(`onboarding_state`,tt),rt.trim()&&e.set(`onboarder`,rt.trim());for(let[t,n]of Object.entries(at))n&&e.set(t,n);return`/dashboard/api/onboarding?${e.toString()}`}async function Ut(){P(`onboarding`,!0);try{O(await V(Ht()))}catch(e){N(e,`Unable to load onboarding`)}finally{P(`onboarding`,!1)}}async function Wt(){P(`audit`,!0);try{k(await V(`/dashboard/api/audit-events?limit=25`))}catch(e){N(e,`Unable to load audit events`)}finally{P(`audit`,!1)}}async function z(){P(`agent`,!0);try{_e(await V(`/dashboard/api/agent?limit=100`))}catch(e){N(e,`Unable to load agent report`)}finally{P(`agent`,!1)}}async function B(e){P(`detail:${e}`,!0),M(`Loading ${e}`);try{ye(await V(`/dashboard/api/jobs/${encodeURIComponent(e)}`)),M(`Loaded ${e}`,`ok`)}catch(e){N(e,`Unable to load job detail`)}finally{P(`detail:${e}`,!1)}}async function Gt(e){P(`rerun:${e}`,!0),M(`Rerunning ${e}`);try{M(`Queued rerun ${(await V(`/dashboard/api/jobs/${encodeURIComponent(e)}/rerun`,{method:`POST`})).job_id}`,`ok`),await Et()}catch(e){N(e,`Unable to rerun job`)}finally{P(`rerun:${e}`,!1)}}async function Kt(){P(`syncPeople`,!0),M(`Queueing people sync`);try{M(`Queued people sync ${(await V(`/dashboard/api/sync/people`,{method:`POST`})).job_id}`,`ok`)}catch(e){N(e,`Unable to queue people sync`)}finally{P(`syncPeople`,!1)}}async function qt(e,t){let n=String(e||``).trim(),r=t.trim();if(!n){M(`Missing CRM contact id`,`error`);return}if(!r){M(`Enter a 508 username`,`error`);return}P(`onboarder:${n}`,!0),M(`Assigning ${r}`);try{let e=await V(`/dashboard/api/onboarding/${encodeURIComponent(n)}/onboarder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({onboarder:r})});O(t=>t.map(t=>t.crm_contact_id===e.contact_id?{...t,onboarder:e.onboarder,onboarding_state:e.state_updated&&e.onboarding_state?e.onboarding_state:t.onboarding_state,onboarding_status_label:e.onboarding_status_label||(e.state_updated?void 0:t.onboarding_status_label)}:t)),M(`Assigned ${e.onboarder}`,`ok`)}catch(e){N(e,`Unable to assign onboarder`)}finally{P(`onboarder:${n}`,!1)}}async function Jt(){P(`logout`,!0);try{let e=await V(`/auth/logout`,{method:`POST`});window.location.assign(e.end_session_url||`/dashboard`)}catch(e){N(e,`Unable to log out`),P(`logout`,!1)}}(0,l.useEffect)(()=>{St().then(e=>{let t=pn(),n=e.includes(sn[t])?t:Object.keys(on).find(t=>e.includes(sn[t]))||`people`;le(n===`gigs`?mn():``),de(n===`projects`?mn(`projects`):``),i(n),(!Object.hasOwn(on,fn())||n!==t)&&window.history.replaceState({view:n},``,on[n])}).catch(e=>{N(e,`Dashboard failed to load`)})},[]),(0,l.useEffect)(()=>{let e=()=>{le(mn()),de(mn(`projects`)),ut.current(pn(),!1)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,l.useEffect)(()=>{if(!a.message)return;let e=window.setTimeout(()=>o({message:``}),4500);return()=>window.clearTimeout(e)},[a.message]),(0,l.useEffect)(()=>{},[]),(0,l.useEffect)(()=>{s.length!==0&&(dt(`gigs:read`)&&Lt(),r===`people`&&Vt(),r===`gigs`&&Dt(),r===`projects`&&Ot(),r===`onboarding`&&Ut(),r===`jobs`&&Et(),r===`agent`&&z(),r===`audit`&&Wt())},[r]),(0,l.useEffect)(()=>{s.length!==0&&(dt(`gigs:read`)&&Lt(),r===`people`&&Vt(),r===`gigs`&&Dt(),r===`projects`&&Ot(),r===`onboarding`&&Ut(),r===`jobs`&&Et(),r===`agent`&&z(),r===`audit`&&Wt())},[s]),(0,l.useEffect)(()=>{r===`jobs`&&s.length>0&&Et()},[Oe,Ae]),(0,l.useEffect)(()=>{r===`gigs`&&s.length>0&&Dt()},[Pe,Ie]),(0,l.useEffect)(()=>{r===`projects`&&s.length>0&&Ot()},[Be]),(0,l.useEffect)(()=>{r===`gigs`&&C&&s.length>0&&Ft(C)},[r,C,s]),(0,l.useEffect)(()=>{r===`people`&&s.length>0&&Vt()},[Ke]),(0,l.useEffect)(()=>{r===`people`&&s.length>0&&Vt()},[Je]),(0,l.useEffect)(()=>{r===`onboarding`&&s.length>0&&Ut()},[tt]),(0,l.useEffect)(()=>{r===`onboarding`&&s.length>0&&Ut()},[at]);let Yt=(0,l.useMemo)(()=>gn(`jobs`,f,Ee.jobs),[f,Ee.jobs]),Xt=(0,l.useMemo)(()=>gn(`people`,me,Ee.people),[me,Ee.people]),Zt=(0,l.useMemo)(()=>gn(`onboarding`,D,Ee.onboarding),[D,Ee.onboarding]),Qt=(0,l.useMemo)(()=>gn(`gigs`,m,Ee.gigs),[m,Ee.gigs]),$t=(0,l.useMemo)(()=>gn(`projects`,ee,Ee.projects),[ee,Ee.projects]),en=(0,l.useMemo)(()=>se?.id===C?se:Qt.find(e=>e.id===C)||null,[se,C,Qt]),tn=(0,l.useMemo)(()=>$t.find(e=>e.id===ue)||null,[ue,$t]),nn=(0,l.useMemo)(()=>gn(`audit`,he,Ee.audit),[he,Ee.audit]),rn=(0,l.useMemo)(()=>f.reduce((e,t)=>(e[t.status]=(e[t.status]||0)+1,e),{}),[f]),an=Object.keys(cn).filter(e=>!Je[e]),un=Object.keys(cn).filter(e=>e!==`sync_status`&&e!==`email_508`&&!at[e]);function hn(e){e.type===`stale_recruiting_gig`&&(Fe(`recruiting`),mt(`gigs`,!0)),pe(!1)}(0,l.useEffect)(()=>{!an.includes(Xe)&&an[0]&&A(an[0])},[an,Xe]),(0,l.useEffect)(()=>{let e=cn[Xe]?.options;e?.[0]&&!e.some(([e])=>e===Ze)&&Qe(e[0][0])},[Xe,Ze]),(0,l.useEffect)(()=>{!un.includes(st)&&un[0]&&j(un[0])},[un,st]),(0,l.useEffect)(()=>{let e=cn[st]?.options;e?.[0]&&!e.some(([e])=>e===ct)&<(e[0][0])},[st,ct]);let _n=[t?.email,t?.crm_contact_id?`CRM ${t.crm_contact_id}`:``,t?.actor_provider].filter(Boolean).join(` | `);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`header`,{className:`sticky top-0 z-20 border-b bg-background/90 backdrop-blur`,children:(0,F.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-4 px-5 py-4 md:flex-row md:items-center md:justify-between`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-xl font-bold`,children:`508 Operations Dashboard`}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Operations view for authenticated 508 operators.`})]}),(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[dt(`gigs:read`)?(0,F.jsx)(`div`,{className:`relative`,children:(0,F.jsxs)(L,{id:`notifications`,type:`button`,variant:`outline`,size:`icon`,"aria-label":`Notifications`,"aria-expanded":fe,onClick:()=>pe(e=>!e),children:[(0,F.jsx)(h,{}),w.length>0?(0,F.jsx)(`span`,{className:`absolute -right-1 -top-1 grid min-h-5 min-w-5 place-items-center rounded-full bg-red-500 px-1 text-[11px] font-bold text-white`,children:w.length}):null]})}):null,(0,F.jsxs)(`div`,{className:`grid min-w-0 gap-0.5 text-right text-sm text-muted-foreground`,children:[(0,F.jsx)(`strong`,{id:`userName`,className:`truncate text-foreground`,children:t?.display_name||t?.email||t?.subject||`Loading user`}),(0,F.jsx)(`span`,{id:`userMeta`,className:`truncate`,children:_n||`Checking session`})]}),(0,F.jsxs)(L,{id:`logout`,type:`button`,variant:`outline`,onClick:Jt,disabled:be.logout,children:[(0,F.jsx)(x,{}),`Log out`]})]})]})}),(0,F.jsx)(xn,{open:fe,notifications:w,loading:be.notifications,onClose:()=>pe(!1),onRefresh:Lt,onOpenNotification:hn}),(0,F.jsx)(Cn,{toast:a}),null,(0,F.jsx)(Sn,{choice:we,loading:!!(we&&be[`project:${we.projectId}:historical`]),crmContactUrl:ht,onClose:()=>Te(null),onChoose:e=>{we&&I(we.projectId,we.person,e)}}),(0,F.jsxs)(`main`,{className:`mx-auto grid max-w-7xl grid-cols-1 gap-5 px-5 py-5 md:grid-cols-[190px_minmax(0,1fr)]`,children:[(0,F.jsx)(`nav`,{className:`grid content-start gap-1 md:sticky md:top-24`,"aria-label":`Dashboard sections`,children:[[`people`,`People`,ne],[`gigs`,`Gigs`,g],[`projects`,`Projects`,b],[`onboarding`,`Onboarding`,_],[`jobs`,`Jobs`,g],[`agent`,`Agent`,S],[`audit`,`Audit`,y]].filter(([e])=>ft(e)).map(([e,t,n])=>(0,F.jsxs)(`a`,{className:jt(`flex min-h-10 items-center gap-2 rounded-md border border-transparent px-3 text-sm font-extrabold text-muted-foreground hover:border-border hover:bg-secondary hover:text-foreground`,r===e&&`border-primary bg-accent text-accent-foreground`),"data-view-link":e,"data-permission":sn[e],href:on[e],"aria-current":r===e?`page`:void 0,onClick:t=>{t.preventDefault(),mt(e,!0)},children:[(0,F.jsx)(n,{className:`size-4`}),t]},e))}),(0,F.jsxs)(`div`,{className:`grid min-w-0 gap-5`,children:[r===`people`?(0,F.jsx)(Bn,{crmBaseUrl:u,people:Xt,sort:Ee.people,canSync:dt(`people:sync`),loading:be,peopleQuery:We,peopleMember:Ke,peopleFilters:Je,peopleFilterKind:Xe,peopleFilterValue:Ze,peopleFilterKeys:an,onSearch:Vt,onSync:Kt,onSort:e=>_t(`people`,e),setPeopleQuery:Ge,setPeopleMember:qe,setPeopleFilterKind:A,setPeopleFilterValue:Qe,addFilter:()=>{Ye(e=>({...e,[Xe]:Ze}))},removeFilter:e=>{Ye(t=>{let n={...t};return delete n[e],n})},crmContactUrl:ht,crmAttachmentUrl:gt}):null,r===`gigs`?(0,F.jsx)(Fn,{gigs:Qt,selectedGig:en,selectedGigId:C,sort:Ee.gigs,loading:be,status:Pe,limit:Ie,staleDays:He,canWrite:dt(`gigs:write`),crmContactUrl:ht,crmAttachmentUrl:gt,setStatus:Fe,setLimit:Le,onRefresh:It,onSort:e=>_t(`gigs`,e),onOpenGig:vt,onCloseGig:yt,onUpdateStatus:Rt,onUpdateApplicationStatus:zt}):null,r===`projects`?(0,F.jsx)(Nn,{projects:$t,selectedProject:tn,selectedProjectId:ue,summary:re,wikiMatches:ae,sort:Ee.projects,loading:be,query:Re,status:Be,canSync:dt(`projects:sync`),canWrite:dt(`projects:write`),crmContactUrl:ht,setQuery:ze,setStatus:Ve,onSearch:Ot,onSync:kt,onUpdateStatus:At,onBulkUpdate:Mt,onAddUser:Nt,onAddHistoricalMember:I,onUpdateWikiMatch:Pt,onWikiMatches:R,onOpenProject:bt,onCloseProject:xt,onSort:e=>_t(`projects`,e)}):null,r===`onboarding`?(0,F.jsx)(Vn,{people:Zt,sort:Ee.onboarding,loading:be,onboardingQuery:$e,onboardingState:tt,onboarderFilter:rt,onboardingFilters:at,onboardingFilterKind:st,onboardingFilterValue:ct,onboardingFilterKeys:un,onSearch:Ut,onSort:e=>_t(`onboarding`,e),onAssign:qt,setOnboardingQuery:et,setOnboardingState:nt,setOnboarderFilter:it,setOnboardingFilterKind:j,setOnboardingFilterValue:lt,addFilter:()=>{ot(e=>({...e,[st]:ct}))},removeFilter:e=>{ot(t=>{let n={...t};return delete n[e],n})},crmContactUrl:ht,crmAttachmentUrl:gt}):null,r===`jobs`?(0,F.jsx)(Un,{jobs:Yt,jobDetail:ve,sort:Ee.jobs,loading:be,minutes:Oe,status:Ae,jobType:Me,jobCounts:rn,canWrite:dt(`jobs:write`),setMinutes:ke,setStatus:je,setJobType:Ne,onSearch:Et,onSort:e=>_t(`jobs`,e),onDetail:B,onRerun:Gt}):null,r===`audit`?(0,F.jsx)(Wn,{events:nn,sort:Ee.audit,loading:be,onRefresh:Wt,onSort:e=>_t(`audit`,e)}):null,r===`agent`?(0,F.jsx)(Gn,{report:ge,loading:be,onRefresh:z}):null]})]})]})}function xn({open:e,notifications:t,loading:n,onClose:r,onRefresh:i,onOpenNotification:a}){return e?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-40`,"aria-labelledby":`notificationsTitle`,"aria-modal":`true`,role:`dialog`,children:[(0,F.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default bg-black/45`,"aria-label":`Close notifications`,onClick:r}),(0,F.jsxs)(`aside`,{className:`absolute right-0 top-0 grid h-full w-full max-w-md grid-rows-[auto_minmax(0,1fr)] border-l bg-background shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b p-4`,children:[(0,F.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,F.jsx)(`strong`,{id:`notificationsTitle`,className:`text-base`,children:`Notifications`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t.length===0?`No active notifications`:`${t.length} active`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(L,{type:`button`,variant:`outline`,size:`sm`,onClick:i,disabled:n,children:[(0,F.jsx)(ee,{}),`Refresh`]}),(0,F.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:r,children:(0,F.jsx)(re,{})})]})]}),(0,F.jsx)(`div`,{className:`min-h-0 overflow-auto p-4`,children:t.length===0?(0,F.jsx)(`div`,{className:`rounded-md border border-dashed p-6 text-sm text-muted-foreground`,children:`No active notifications.`}):(0,F.jsx)(`div`,{className:`grid gap-3`,children:t.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`grid gap-2 rounded-md border p-3 text-left hover:bg-secondary`,onClick:()=>a(e),children:[(0,F.jsx)(`span`,{className:`text-sm font-bold`,children:e.title}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.message})]},e.id))})})]})]}):null}function Sn({choice:e,loading:t,crmContactUrl:n,onClose:r,onChoose:i}){return e?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-50 grid place-items-center p-4`,"aria-labelledby":`historicalPersonChoiceTitle`,"aria-modal":`true`,role:`dialog`,children:[(0,F.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default bg-black/45`,"aria-label":`Close person selection`,onClick:r}),(0,F.jsxs)(`div`,{className:`relative grid w-full max-w-2xl gap-4 rounded-md border bg-background p-5 shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{id:`historicalPersonChoiceTitle`,className:`block text-base`,children:`Choose person record`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.person})]}),(0,F.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close person selection`,onClick:r,children:(0,F.jsx)(re,{})})]}),(0,F.jsx)(`div`,{className:`grid gap-2`,children:e.candidates.map(e=>(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border p-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-center`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`strong`,{className:`block truncate`,children:e.label||e.full_name||e.email||`Person`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-sm text-muted-foreground`,children:[e.email?(0,F.jsx)(`span`,{children:e.email}):null,e.sources?.length?(0,F.jsx)(`span`,{children:e.sources.join(`, `)}):null,e.erpnext_user_id?(0,F.jsxs)(`span`,{children:[`ERP `,e.erpnext_user_id]}):null,e.supplier_erpnext_id?(0,F.jsxs)(`span`,{children:[`Supplier `,e.supplier_erpnext_id]}):null,e.crm_contact_id&&n(e.crm_contact_id)?(0,F.jsx)(`a`,{className:`font-semibold text-primary underline-offset-4 hover:underline`,href:n(e.crm_contact_id),target:`_blank`,rel:`noreferrer`,children:`CRM`}):null]})]}),(0,F.jsx)(L,{type:`button`,disabled:t,onClick:()=>i(e.candidate_id),children:`Select`})]},e.candidate_id))})]})]}):null}function Cn({toast:e}){return e.message?(0,F.jsx)(`div`,{id:`toast`,role:`status`,className:jt(`fixed bottom-5 right-5 z-50 max-w-sm rounded-md border bg-background px-4 py-3 text-sm font-semibold shadow-lg`,e.tone===`ok`&&`border-emerald-500/40 text-emerald-300`,e.tone===`error`&&`border-red-500/40 text-red-300`),children:e.message}):null}function wn({filters:e,onRemove:t,suffix:n=`filter`}){return(0,F.jsx)(`fieldset`,{className:`m-0 flex min-h-7 flex-wrap gap-2 border-0 p-0`,"aria-label":`Active filters`,children:Object.entries(e).map(([e,r])=>{let i=cn[e],a=i.options.find(([e])=>e===r),o=`${i.label}: ${a?a[1]:r}`;return(0,F.jsxs)(L,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full`,"aria-label":`Remove ${o} ${n}`,onClick:()=>t(e),children:[o,` x`]},e)})})}var Tn=[`recruiting`,`filled`,`unknown`,`lost`,`outdated`],En=[`suggested`,`interested`,`reviewing`,`contacted`,`accepted`,`rejected`,`withdrawn`];function Dn(e){return String(e||``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase())}function On(e){let t=[e.last_activity_at,e.last_status_changed_at,e.posted_at,e.created_at].map(e=>e?new Date(e).getTime():NaN).filter(e=>!Number.isNaN(e));return t.length>0?new Date(Math.max(...t)).toISOString():``}function kn(e,t){if(e.status!==`recruiting`)return null;let n=qt(On(e));return n===null||ne.projects.map(e=>e.id),[e.projects]),f=(0,l.useMemo)(()=>new Set(d),[d]),p=n.filter(e=>f.has(e)),h=e.projects.length>0&&p.length===e.projects.length;(0,l.useEffect)(()=>{r(e=>e.filter(e=>f.has(e)))},[f]);function g(e,t){r(n=>t?Array.from(new Set([...n,e])):n.filter(t=>t!==e))}async function _(){let t={};i&&(t.status=i),o&&(t.project_type=o),await e.onBulkUpdate(p,t)&&(r([]),a(``),s(``),u(!1))}let y=(0,F.jsxs)(R,{className:`grid gap-3 p-4 md:grid-cols-[minmax(0,1fr)_180px_auto_auto_auto] md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Search projects`,(0,F.jsx)(Rt,{id:`projectQuery`,value:e.query,autoComplete:`off`,placeholder:`Project, customer, ERP id`,onChange:t=>e.setQuery(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`projectStatus`,value:e.status,onChange:t=>e.setStatus(t.target.value),children:[(0,F.jsx)(`option`,{value:`Open`,children:`Open`}),(0,F.jsx)(`option`,{value:``,children:`Any status`})]})]}),(0,F.jsxs)(L,{id:`refreshProjects`,type:`button`,onClick:e.onSearch,disabled:e.loading.projects,children:[(0,F.jsx)(ee,{}),`Refresh`]}),e.canSync?(0,F.jsxs)(L,{id:`syncProjects`,type:`button`,variant:`outline`,onClick:e.onSync,disabled:e.loading.syncProjects,children:[(0,F.jsx)(ee,{}),`Sync ERP`]}):null,(0,F.jsxs)(L,{id:`wikiProjectMatches`,type:`button`,variant:`outline`,onClick:e.onWikiMatches,disabled:e.loading.wikiMatches,children:[(0,F.jsx)(te,{}),`Wiki match`]})]});return e.selectedProjectId&&!e.selectedProject&&e.loading.projects?(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Project detail`})}),(0,F.jsx)(Lt,{className:`text-sm text-muted-foreground`,children:`Loading project.`})]})]}):e.selectedProjectId&&!e.selectedProject?(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Project detail`})}),(0,F.jsxs)(Lt,{className:`grid gap-3`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This project is not in the current result set. Clear filters or refresh the project list.`}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,onClick:e.onCloseProject,children:[(0,F.jsx)(m,{}),`Back to projects`]})]})]})]}):e.selectedProject?(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsx)(Pn,{project:e.selectedProject,loading:e.loading,canWrite:e.canWrite,crmContactUrl:e.crmContactUrl,onBack:e.onCloseProject,onUpdateStatus:e.onUpdateStatus,onAddUser:e.onAddUser,onAddHistoricalMember:e.onAddHistoricalMember})]}):(0,F.jsxs)(F.Fragment,{children:[y,(0,F.jsxs)(`section`,{className:`grid gap-3 md:grid-cols-2`,"aria-label":`Project summary`,children:[(0,F.jsx)(vn,{id:`projectMetricOpen`,label:`Open`,value:e.summary.open_project_count||0}),(0,F.jsx)(vn,{id:`projectMetricTotal`,label:`Projects`,value:e.summary.project_count||0})]}),e.canWrite?(0,F.jsxs)(R,{className:`flex flex-wrap items-center justify-between gap-3 p-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Selected`}),(0,F.jsxs)(`strong`,{className:`block`,children:[p.length,` project(s)`]})]}),(0,F.jsx)(L,{type:`button`,disabled:p.length===0,onClick:()=>u(!0),children:`Bulk edit`})]}):null,c?(0,F.jsxs)(`div`,{className:`fixed inset-0 z-50 grid place-items-center p-4`,"aria-labelledby":`bulkProjectEditTitle`,"aria-modal":`true`,role:`dialog`,children:[(0,F.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default bg-black/45`,"aria-label":`Close bulk project edit`,onClick:()=>u(!1)}),(0,F.jsxs)(`div`,{className:`relative grid w-full max-w-lg gap-4 rounded-md border bg-background p-5 shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`strong`,{id:`bulkProjectEditTitle`,className:`block text-base`,children:`Bulk edit projects`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[p.length,` selected`]})]}),(0,F.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close bulk project edit`,onClick:()=>u(!1),children:(0,F.jsx)(re,{})})]}),(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[(0,F.jsx)(`strong`,{className:`text-sm`,children:`Changes`}),(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{value:i,onChange:e=>a(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`No change`}),(0,F.jsx)(`option`,{value:`Open`,children:`Open`}),(0,F.jsx)(`option`,{value:`Completed`,children:`Completed`}),(0,F.jsx)(`option`,{value:`Cancelled`,children:`Cancelled`})]})]}),(0,F.jsxs)(zt,{children:[`ERP Type`,(0,F.jsxs)(Bt,{value:o,onChange:e=>s(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`No change`}),(0,F.jsx)(`option`,{value:`Internal`,children:`Internal`}),(0,F.jsx)(`option`,{value:`External`,children:`External`})]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,F.jsx)(L,{type:`button`,variant:`outline`,onClick:()=>u(!1),children:`Cancel`}),(0,F.jsx)(L,{type:`button`,disabled:e.loading.projectsBulkUpdate||p.length===0||!i&&!o,onClick:()=>void _(),children:`Apply changes`})]})]})]}):null,(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`ERP projects`}),(0,F.jsx)(`span`,{id:`projectsStatus`,className:`text-sm text-muted-foreground`,children:e.loading.projects?`Loading`:`${e.projects.length} shown | synced ${Kt(e.summary.last_synced_at)}`})]}),(0,F.jsx)(yn,{hidden:e.projects.length!==0,children:`No projects match this view. Sync ERP projects if the cache is empty.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`projectsTable`,className:jt(`min-w-[1100px]`,e.projects.length===0&&`hidden`),"aria-label":`ERP projects`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[e.canWrite?(0,F.jsx)(z,{className:`w-[48px]`,children:(0,F.jsx)(`input`,{type:`checkbox`,"aria-label":`Select all visible projects`,checked:h,onChange:e=>{r(e.target.checked?d:[])}})}):null,(0,F.jsx)(H,{className:`w-[24%]`,label:`Project`,scope:`projects`,sort:e.sort,sortKey:`display_name`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[16%]`,label:`Customer`,scope:`projects`,sort:e.sort,sortKey:`customer`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[10%]`,label:`Status`,scope:`projects`,sort:e.sort,sortKey:`status`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{className:`w-[16%]`,children:`Timeline`}),(0,F.jsx)(H,{className:`w-[10%]`,label:`Roster`,scope:`projects`,sort:e.sort,sortKey:`roster_count`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[14%]`,label:`Modified`,scope:`projects`,sort:e.sort,sortKey:`modified`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{children:`ERP`})]})}),(0,F.jsx)(Ut,{id:`projectsBody`,children:e.projects.map(t=>{let n=t.roster_members||[];return(0,F.jsxs)(Wt,{children:[e.canWrite?(0,F.jsx)(B,{children:(0,F.jsx)(`input`,{type:`checkbox`,"aria-label":`Select ${t.display_name}`,checked:p.includes(t.id),onChange:e=>g(t.id,e.target.checked)})}):null,(0,F.jsxs)(B,{children:[(0,F.jsx)(`button`,{type:`button`,className:`text-left font-bold text-primary underline-offset-4 hover:underline`,onClick:()=>e.onOpenProject(t.id),children:t.display_name}),(0,F.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5`,children:[t.project_type?(0,F.jsx)(I,{variant:`neutral`,children:t.project_type}):null,t.linked_engagement_count?(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[t.linked_engagement_count,` linked gig`]}):null]})]}),(0,F.jsx)(B,{children:t.customer_erpnext_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:t.customer_erpnext_url,target:`_blank`,rel:`noreferrer`,children:[t.customer,(0,F.jsx)(v,{className:`size-3.5`})]}):t.customer||`None`}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:An(t.source_status),children:t.source_status||`Unknown`})}),(0,F.jsx)(B,{children:[t.actual_start_date,t.actual_end_date].filter(Boolean).map(e=>jn(e)).join(` to `)||`Not set`}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`grid gap-1`,children:[(0,F.jsx)(`strong`,{children:n.length}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[n.map(Mn).slice(0,4).join(`, `)||`No ERP roster`,n.length>4?` +${n.length-4}`:``]})]})}),(0,F.jsx)(B,{children:Kt(t.source_modified_at)}),(0,F.jsx)(B,{className:`text-xs`,children:t.erpnext_project_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-mono font-semibold text-primary underline-offset-4 hover:underline`,href:t.erpnext_project_url,target:`_blank`,rel:`noreferrer`,children:[t.erpnext_project_id,(0,F.jsx)(v,{className:`size-3.5`})]}):(0,F.jsx)(`span`,{className:`font-mono`,children:`Unlinked`})})]},t.id)})})]})})]}),e.wikiMatches?(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Wiki match preview`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.wikiMatches.document?.title||`Client & Project Info`,` |`,` `,Kt(e.wikiMatches.document?.updatedAt)]})]}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`wikiMatchesTable`,className:`min-w-[920px]`,"aria-label":`Wiki matches`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`ERP project`}),(0,F.jsx)(z,{children:`Best wiki row`}),(0,F.jsx)(z,{children:`Confidence`}),(0,F.jsx)(z,{children:`Section`}),(0,F.jsx)(z,{children:`Decision`})]})}),(0,F.jsx)(Ut,{children:t.map((t,n)=>{let r=t.project,i=t.best_match?.row||{},a=t.manual_match?.match_status||``,o=r?.id||i.row_key||[i.section,i.Client].filter(Boolean).join(`:`)||`wiki-match-${n}`;return(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:r?.display_name||`Unknown`}),(0,F.jsxs)(B,{children:[(0,F.jsx)(`strong`,{children:i.Client||`No match`}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:[i.DRI,i.Members].filter(Boolean).join(` | `)})]}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:t.best_match?.confidence===`high`?`succeeded`:t.best_match?.confidence===`medium`?`running`:`neutral`,children:t.best_match?`${t.best_match.confidence} ${t.best_match.score}`:`none`})}),(0,F.jsx)(B,{children:i.section||``}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a?(0,F.jsx)(I,{variant:a===`confirmed`?`succeeded`:`neutral`,children:a===`no_row`?`No wiki row`:`Confirmed`}):null,e.canWrite&&r?.id?(0,F.jsxs)(F.Fragment,{children:[i.row_key?(0,F.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,disabled:e.loading[`project:${r.id}:wiki`],onClick:()=>void e.onUpdateWikiMatch(r.id,`confirmed`,i.row_key),children:`Confirm`}):null,(0,F.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,disabled:e.loading[`project:${r.id}:wiki`],onClick:()=>void e.onUpdateWikiMatch(r.id,`no_row`),children:`No row`})]}):null]})})]},o)})})]})})]}):null]})}function Pn(e){let t=e.project,n=t.roster_members||[],[r,i]=(0,l.useState)(``),a=[t.actual_start_date||t.expected_start_date,t.actual_end_date||t.expected_end_date].filter(Boolean).map(e=>jn(e)).join(` to `)||`Not set`,o=typeof t.percent_complete==`number`?`${Math.round(t.percent_complete)}%`:`Not set`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[auto_minmax(0,1fr)_auto] md:items-start`,children:[(0,F.jsxs)(L,{type:`button`,variant:`outline`,onClick:e.onBack,children:[(0,F.jsx)(m,{}),`Projects`]}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(It,{children:t.display_name}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,F.jsx)(I,{variant:An(t.source_status),children:t.source_status||`Unknown`}),t.erpnext_project_id?(0,F.jsx)(`span`,{className:`font-mono`,children:t.erpnext_project_id}):null,t.last_synced_at?(0,F.jsxs)(`span`,{children:[`Synced `,Kt(t.last_synced_at)]}):null]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-start gap-2 md:justify-end`,children:[e.canWrite?(0,F.jsxs)(Bt,{className:`w-[160px]`,"aria-label":`Status for ${t.display_name}`,value:t.source_status||``,disabled:e.loading[`project:${t.id}:status`],onChange:n=>e.onUpdateStatus(t.id,n.target.value),children:[(0,F.jsx)(`option`,{value:`Open`,children:`Open`}),(0,F.jsx)(`option`,{value:`Completed`,children:`Completed`}),(0,F.jsx)(`option`,{value:`Cancelled`,children:`Cancelled`})]}):null,t.erpnext_project_url?(0,F.jsxs)(`a`,{className:`inline-flex min-h-9 items-center justify-center gap-2 rounded-md border bg-secondary px-3 text-sm font-semibold`,href:t.erpnext_project_url,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(v,{className:`size-4`}),`ERP project`]}):null,t.customer_erpnext_url?(0,F.jsxs)(`a`,{className:`inline-flex min-h-9 items-center justify-center gap-2 rounded-md border bg-secondary px-3 text-sm font-semibold`,href:t.customer_erpnext_url,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(v,{className:`size-4`}),`ERP customer`]}):null]})]})}),(0,F.jsxs)(Lt,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Customer`}),(0,F.jsx)(`strong`,{className:`block`,children:t.customer||`None`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Timeline`}),(0,F.jsx)(`strong`,{className:`block`,children:a})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Progress`}),(0,F.jsx)(`strong`,{className:`block`,children:o})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Linked Gigs`}),(0,F.jsx)(`strong`,{className:`block`,children:t.linked_engagement_count||0})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`ERP Type`}),(0,F.jsx)(`div`,{className:`mt-1`,children:t.project_type?(0,F.jsx)(I,{variant:`neutral`,children:t.project_type}):(0,F.jsx)(`strong`,{className:`block`,children:`Not set`})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`ERP Modified`}),(0,F.jsx)(`strong`,{className:`block`,children:Kt(t.source_modified_at)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Cache ID`}),(0,F.jsx)(`strong`,{className:`block break-all font-mono text-xs`,children:t.id})]})]})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Project roster`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.length?`${n.length} synced ERP user${n.length===1?``:`s`}`:`No ERP roster`})]}),e.canWrite?(0,F.jsxs)(Lt,{className:`grid gap-3 border-b md:grid-cols-[minmax(0,1fr)_auto_auto] md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Roster person`,(0,F.jsx)(Rt,{value:r,autoComplete:`off`,placeholder:`name@508.dev or full name`,onChange:e=>i(e.target.value),onKeyDown:n=>{n.key===`Enter`&&(n.preventDefault(),e.onAddUser(t.id,r).then(e=>e&&i(``)))}})]}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,disabled:e.loading[`project:${t.id}:user`]||!r.trim(),onClick:()=>void e.onAddUser(t.id,r).then(e=>{e&&i(``)}),children:[(0,F.jsx)(ne,{}),`Add ERP user`]}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,disabled:e.loading[`project:${t.id}:historical`]||!r.trim(),onClick:()=>void e.onAddHistoricalMember(t.id,r).then(e=>{e&&i(``)}),children:[(0,F.jsx)(ne,{}),`Add historical`]})]}):null,(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{className:`min-w-[760px]`,"aria-label":`Project roster`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`Name`}),(0,F.jsx)(z,{children:`Email`}),(0,F.jsx)(z,{children:`ERP user`}),(0,F.jsx)(z,{children:`Links`}),(0,F.jsx)(z,{children:`Source`}),(0,F.jsx)(z,{children:`Last seen`})]})}),(0,F.jsx)(Ut,{children:n.length?n.map(t=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:(0,F.jsx)(`strong`,{children:t.full_name||t.email||t.source_user_id})}),(0,F.jsx)(B,{children:t.email||`None`}),(0,F.jsx)(B,{className:`font-mono text-xs`,children:t.erpnext_user_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:t.erpnext_user_url,target:`_blank`,rel:`noreferrer`,children:[t.source_user_id||`ERP user`,(0,F.jsx)(v,{className:`size-3.5`})]}):t.source_user_id||`Unknown`}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.supplier_erpnext_url?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:t.supplier_erpnext_url,target:`_blank`,rel:`noreferrer`,children:[`Supplier`,(0,F.jsx)(v,{className:`size-3.5`})]}):null,t.crm_contact_id&&e.crmContactUrl(t.crm_contact_id)?(0,F.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-primary underline-offset-4 hover:underline`,href:e.crmContactUrl(t.crm_contact_id),target:`_blank`,rel:`noreferrer`,children:[`CRM`,(0,F.jsx)(v,{className:`size-3.5`})]}):null,!t.supplier_erpnext_url&&!(t.crm_contact_id&&e.crmContactUrl(t.crm_contact_id))?(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):null]})}),(0,F.jsx)(B,{children:t.roster_kind||t.source||`ERP`}),(0,F.jsx)(B,{children:Kt(t.last_seen_at)})]},`${t.source||``}:${t.source_user_id||t.email}`)):(0,F.jsx)(Wt,{children:(0,F.jsx)(B,{colSpan:6,className:`text-sm text-muted-foreground`,children:`No roster rows have been synced for this project.`})})})]})})]})]})}function Fn(e){let t=e.gigs.reduce((t,n)=>(t.total+=1,t.applications+=Number(n.application_count||0),t.interested+=Number(n.interested_count||0),kn(n,e.staleDays)!==null&&(t.stale+=1),t),{total:0,applications:0,interested:0,stale:0}),n=(0,F.jsxs)(R,{className:`grid gap-3 p-4 md:grid-cols-[minmax(160px,1fr)_auto_auto] md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`gigStatus`,value:e.status,onChange:t=>e.setStatus(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any status`}),Tn.map(e=>(0,F.jsx)(`option`,{value:e,children:Dn(e)},e))]})]}),(0,F.jsxs)(L,{id:`refreshGigs`,type:`button`,onClick:e.onRefresh,disabled:e.loading.gigs,children:[(0,F.jsx)(ee,{}),`Refresh gigs`]}),e.gigs.length>=e.limit?(0,F.jsx)(L,{type:`button`,variant:`outline`,onClick:()=>e.setLimit(Math.min(e.limit+100,500)),disabled:e.loading.gigs||e.limit>=500,children:`Load more`}):null]}),r=e.selectedGigId?e.loading[`gig:${e.selectedGigId}:detail`]:!1;return e.selectedGigId&&!e.selectedGig&&(e.loading.gigs||r)?(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Gig detail`})}),(0,F.jsx)(Lt,{className:`text-sm text-muted-foreground`,children:`Loading gig.`})]})]}):e.selectedGigId&&!e.selectedGig?(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Gig detail`})}),(0,F.jsxs)(Lt,{className:`grid gap-3`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This gig is not in the current result set. Clear filters or refresh the gig list.`}),(0,F.jsxs)(L,{type:`button`,variant:`outline`,onClick:e.onCloseGig,children:[(0,F.jsx)(m,{}),`Back to gigs`]})]})]})]}):e.selectedGig?(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsx)(Rn,{gig:e.selectedGig,loading:e.loading,canWrite:e.canWrite,crmContactUrl:e.crmContactUrl,crmAttachmentUrl:e.crmAttachmentUrl,staleDays:e.staleDays,onBack:e.onCloseGig,onUpdateStatus:e.onUpdateStatus,onUpdateApplicationStatus:e.onUpdateApplicationStatus})]}):(0,F.jsxs)(F.Fragment,{children:[n,(0,F.jsxs)(`section`,{className:`grid gap-3 md:grid-cols-4`,"aria-label":`Gig summary`,children:[(0,F.jsx)(vn,{id:`gigMetricTotal`,label:`Gigs`,value:t.total}),(0,F.jsx)(vn,{id:`gigMetricCandidates`,label:`Candidates`,value:t.applications}),(0,F.jsx)(vn,{id:`gigMetricInterested`,label:`Interested`,value:t.interested}),(0,F.jsx)(vn,{id:`gigMetricStale`,label:`Stale recruiting`,value:t.stale})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Discord gigs`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,F.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onSort(`activity`),"aria-label":`Sort gigs by activity`,children:[`Activity`,` `,e.sort.key===`activity`?e.sort.direction===`asc`?`↑`:`↓`:``]}),(0,F.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onSort(`title`),"aria-label":`Sort gigs by title`,children:[`Title `,e.sort.key===`title`?e.sort.direction===`asc`?`↑`:`↓`:``]}),(0,F.jsx)(`span`,{id:`gigsStatus`,className:`text-sm text-muted-foreground`,children:e.loading.gigs?`Loading`:`${e.gigs.length} shown`})]})]}),(0,F.jsx)(yn,{hidden:e.gigs.length!==0,children:`No gigs match this view.`}),(0,F.jsx)(`div`,{id:`gigsBody`,className:jt(`grid gap-3 p-4`,e.gigs.length===0&&`hidden`),children:e.gigs.map(t=>(0,F.jsx)(In,{gig:t,loading:e.loading,canWrite:e.canWrite,staleDays:e.staleDays,onOpenGig:e.onOpenGig,onUpdateStatus:e.onUpdateStatus},t.id))})]})]})}function In({gig:e,loading:t,canWrite:n,onOpenGig:r,onUpdateStatus:i,staleDays:a}){let o=Array.isArray(e.applications)?e.applications:[],s=e.discord_guild_id&&e.discord_thread_id?`https://discord.com/channels/${encodeURIComponent(e.discord_guild_id)}/${encodeURIComponent(e.discord_thread_id)}`:``,c=kn(e,a);return(0,F.jsxs)(`article`,{className:`grid gap-4 rounded-md border bg-background p-4 lg:grid-cols-[minmax(0,1fr)_220px_180px] lg:items-start`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`a`,{className:`text-base font-extrabold text-primary`,href:`/dashboard/gigs/${encodeURIComponent(e.id)}`,onClick:t=>{t.preventDefault(),r(e.id)},children:e.title||`Untitled gig`}),(0,F.jsx)(I,{variant:e.status===`filled`?`succeeded`:e.status===`lost`?`failed`:`queued`,children:e.status_label||Dn(e.status)}),c===null?null:(0,F.jsxs)(I,{variant:`running`,children:[c,`d stale`]})]}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.posting_type?(0,F.jsx)(I,{variant:`neutral`,children:Dn(e.posting_type)}):null,e.discord_channel_name?(0,F.jsxs)(I,{variant:`neutral`,children:[`#`,e.discord_channel_name]}):null,(e.required_skills||[]).slice(0,5).map(e=>(0,F.jsx)(I,{variant:`queued`,children:e},e)),(e.preferred_skills||[]).slice(0,3).map(e=>(0,F.jsx)(I,{variant:`neutral`,children:e},e))]}),(0,F.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground`,children:[(0,F.jsxs)(`span`,{children:[`Activity `,Kt(On(e))||`unknown`]}),(0,F.jsxs)(`span`,{children:[`Posted `,Kt(e.posted_at)||`unknown`]}),s?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:s,target:`_blank`,rel:`noreferrer`,children:`Open Discord thread`}):null]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm lg:grid-cols-1`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`block text-xs font-bold text-muted-foreground`,children:`People`}),(0,F.jsx)(`strong`,{children:e.application_count||o.length}),(0,F.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[Number(e.interested_count||0),` interested`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`block text-xs font-bold text-muted-foreground`,children:`Top candidates`}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:o.slice(0,3).map(e=>Ln(e)).join(`, `)||`None yet`})]})]}),(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[n?(0,F.jsx)(Bt,{"aria-label":`Status for ${e.title||`gig`}`,value:e.status,disabled:t[`gig:${e.id}:status`],onChange:t=>i(e.id,t.target.value),children:Tn.map(e=>(0,F.jsx)(`option`,{value:e,children:Dn(e)},e))}):null,(0,F.jsx)(L,{type:`button`,onClick:()=>r(e.id),children:`Manage people`})]})]})}function Ln(e){return e.name||e.email_508||e.discord_username||(typeof e.evaluation?.discord_username==`string`?e.evaluation.discord_username:``)||`Candidate`}function Rn({gig:e,loading:t,canWrite:n,crmContactUrl:r,crmAttachmentUrl:i,staleDays:a,onBack:o,onUpdateStatus:s,onUpdateApplicationStatus:c}){let l=Array.isArray(e.applications)?e.applications:[],u=e.discord_guild_id&&e.discord_thread_id?`https://discord.com/channels/${encodeURIComponent(e.discord_guild_id)}/${encodeURIComponent(e.discord_thread_id)}`:``,d=kn(e,a);return(0,F.jsxs)(`div`,{className:`grid gap-5`,children:[(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{className:`items-start`,children:[(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,className:`w-fit`,onClick:o,children:[(0,F.jsx)(m,{}),`Back to gigs`]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(It,{className:`text-xl`,children:e.title||`Untitled gig`}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[(0,F.jsx)(I,{variant:e.status===`filled`?`succeeded`:e.status===`lost`?`failed`:`queued`,children:e.status_label||Dn(e.status)}),d===null?null:(0,F.jsxs)(I,{variant:`running`,children:[d,`d stale`]}),e.posting_type?(0,F.jsx)(I,{variant:`neutral`,children:Dn(e.posting_type)}):null,e.discord_channel_name?(0,F.jsxs)(I,{variant:`neutral`,children:[`#`,e.discord_channel_name]}):null,(e.required_skills||[]).map(e=>(0,F.jsx)(I,{variant:`queued`,children:e},e)),(e.preferred_skills||[]).map(e=>(0,F.jsx)(I,{variant:`neutral`,children:e},e))]})]})]}),(0,F.jsxs)(`div`,{className:`grid min-w-[190px] gap-2`,children:[n?(0,F.jsxs)(zt,{children:[`Gig status`,(0,F.jsx)(Bt,{"aria-label":`Status for ${e.title||`gig`}`,value:e.status,disabled:t[`gig:${e.id}:status`],onChange:t=>s(e.id,t.target.value),children:Tn.map(e=>(0,F.jsx)(`option`,{value:e,children:Dn(e)},e))})]}):null,u?(0,F.jsxs)(`a`,{className:`inline-flex min-h-9 items-center justify-center gap-2 rounded-md border bg-secondary px-3 text-sm font-semibold`,href:u,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(v,{className:`size-4`}),`Discord thread`]}):null]})]}),(0,F.jsxs)(Lt,{className:`grid gap-4 lg:grid-cols-[1fr_1fr_1fr]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Activity`}),(0,F.jsx)(`strong`,{className:`block`,children:Kt(On(e))||`unknown`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[`Posted `,Kt(e.posted_at)||`unknown`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`People`}),(0,F.jsx)(`strong`,{className:`block`,children:e.application_count||l.length}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[Number(e.interested_count||0),` interested`]})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:`Discord`}),(0,F.jsx)(`strong`,{className:`block`,children:e.discord_channel_name||`No channel`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.discord_thread_id?`Thread ${e.discord_thread_id}`:`No thread`})]})]})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`People`}),(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[l.length,` candidate`,l.length===1?``:`s`]})]}),(0,F.jsx)(yn,{hidden:l.length!==0,children:`No suggested or interested people yet.`}),(0,F.jsx)(`div`,{className:jt(`grid gap-3 p-4`,l.length===0&&`hidden`),children:l.map(a=>(0,F.jsx)(zn,{gigId:e.id,application:a,loading:t,canWrite:n,crmContactUrl:r,crmAttachmentUrl:i,onUpdateApplicationStatus:c},a.id))})]})]})}function zn({gigId:e,application:t,loading:n,canWrite:r,crmContactUrl:i,crmAttachmentUrl:a,onUpdateApplicationStatus:o}){let s=Ln(t),c=i(t.crm_contact_id),l=a(t.latest_resume_id),u=typeof t.fit_score==`number`?`${Math.round(t.fit_score)}/100`:typeof t.match_score==`number`?t.match_score.toFixed(1):``,d=typeof t.evaluation?.llm_summary==`string`?t.evaluation.llm_summary:``;return(0,F.jsxs)(`div`,{className:`grid gap-2 rounded-md border bg-background p-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[c?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:c,target:`_blank`,rel:`noopener noreferrer`,children:s}):(0,F.jsx)(`strong`,{children:s}),(0,F.jsx)(I,{variant:t.status===`interested`?`succeeded`:`neutral`,children:Dn(t.status)}),(0,F.jsx)(I,{variant:`neutral`,children:Dn(t.source||`manual_add`)}),u?(0,F.jsxs)(`span`,{className:`text-xs font-bold text-muted-foreground`,children:[`Fit `,u]}):null,c?(0,F.jsx)(`a`,{className:`text-xs font-extrabold text-primary`,href:c,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open ${s} CRM profile`,children:`CRM profile`}):null,l?(0,F.jsx)(`a`,{className:`text-xs font-extrabold text-primary`,href:l,target:`_blank`,rel:`noopener noreferrer`,children:`Resume`}):null]}),d?(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:d}):null,r?(0,F.jsx)(Bt,{"aria-label":`Candidate status for ${s}`,value:t.status||`suggested`,disabled:n[`application:${t.id}:status`],onChange:n=>o(e,t.id,n.target.value),children:En.map(e=>(0,F.jsx)(`option`,{value:e,children:Dn(e)},e))}):null]})}function Bn(e){let t=cn[e.peopleFilterKind]?.options||[];return(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`People lookup`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[e.canSync?(0,F.jsxs)(L,{id:`syncPeople`,"data-permission":`people:sync`,type:`button`,onClick:e.onSync,disabled:e.loading.syncPeople,children:[(0,F.jsx)(ee,{}),`Sync people`]}):null,e.crmBaseUrl?(0,F.jsx)(`a`,{id:`crmHomeLink`,className:`text-sm font-extrabold text-primary`,href:e.crmBaseUrl,target:`_blank`,rel:`noreferrer`,children:`Open CRM`}):null,(0,F.jsx)(`span`,{id:`peopleStatus`,className:`text-sm text-muted-foreground`,children:e.loading.people?`Loading`:`${e.people.length} shown`})]})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b p-4 md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Search CRM people cache`,(0,F.jsx)(Rt,{id:`peopleQuery`,value:e.peopleQuery,autoComplete:`off`,placeholder:`Name, email, CRM id, Discord, resume`,onChange:t=>e.setPeopleQuery(t.target.value),onKeyDown:t=>{t.key===`Enter`&&e.onSearch()}})]}),(0,F.jsxs)(L,{id:`searchPeople`,type:`button`,onClick:e.onSearch,disabled:e.loading.people,children:[(0,F.jsx)(te,{}),`Search`]})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b bg-background p-4 md:grid-cols-[minmax(120px,.7fr)_minmax(150px,1fr)_minmax(150px,1fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Member`,(0,F.jsxs)(Bt,{id:`peopleMember`,value:e.peopleMember,onChange:t=>e.setPeopleMember(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any`}),(0,F.jsx)(`option`,{value:`true`,children:`Member`}),(0,F.jsx)(`option`,{value:`false`,children:`Not member`})]})]}),(0,F.jsxs)(zt,{children:[`Add filter`,(0,F.jsx)(Bt,{id:`peopleFilterKind`,value:e.peopleFilterKind,disabled:e.peopleFilterKeys.length===0,onChange:t=>e.setPeopleFilterKind(t.target.value),children:e.peopleFilterKeys.map(e=>(0,F.jsx)(`option`,{value:e,children:cn[e].label},e))})]}),(0,F.jsxs)(zt,{children:[`Value`,(0,F.jsx)(Bt,{id:`peopleFilterValue`,value:e.peopleFilterValue,onChange:t=>e.setPeopleFilterValue(t.target.value),children:t.map(([e,t])=>(0,F.jsx)(`option`,{value:e,children:t},e))})]}),(0,F.jsx)(L,{id:`addPeopleFilter`,type:`button`,onClick:e.addFilter,disabled:e.peopleFilterKeys.length===0,children:`Add filter`}),(0,F.jsx)(`div`,{id:`activePeopleFilters`,className:`md:col-span-4`,children:(0,F.jsx)(wn,{filters:e.peopleFilters,onRemove:e.removeFilter})})]}),(0,F.jsx)(yn,{hidden:e.people.length!==0,children:`No people match this lookup.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`peopleTable`,className:jt(`min-w-[900px]`,e.people.length===0&&`hidden`),"aria-label":`People lookup results`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[27%]`,label:`Name`,scope:`people`,sort:e.sort,sortKey:`name`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[28%]`,label:`Status`,scope:`people`,sort:e.sort,sortKey:`status`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[20%]`,label:`Discord`,scope:`people`,sort:e.sort,sortKey:`discord`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[25%]`,label:`Resume / skills`,scope:`people`,sort:e.sort,sortKey:`resume`,onSort:(t,n)=>e.onSort(n)})]})}),(0,F.jsx)(Ut,{id:`peopleBody`,children:e.people.map(t=>{let n=t.name||t.email_508||t.email||`CRM contact`,r=e.crmContactUrl(t.crm_contact_id),i=t.profile_status||{},a=Number(i.skills_count||0),o=e.crmAttachmentUrl(t.latest_resume_id);return(0,F.jsxs)(Wt,{children:[(0,F.jsxs)(B,{children:[r?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:r,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${n} in CRM`,children:n}):(0,F.jsx)(`strong`,{children:n}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:[t.email_508||t.email,t.contact_type].filter(Boolean).join(` | `)})]}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[i.crm_active?null:(0,F.jsx)(I,{variant:`missing`,children:t.sync_status||`CRM sync issue`}),(0,F.jsx)(I,{variant:i.is_member?`succeeded`:`missing`,children:i.is_member?`Member`:`Missing Member`}),(0,F.jsx)(I,{variant:i.discord_linked?`succeeded`:`missing`,children:i.discord_linked?`Discord`:`Missing Discord`}),(0,F.jsx)(I,{variant:i.email_508?`succeeded`:`missing`,children:i.email_508?`508 email`:`Missing 508 email`}),i.latest_resume?null:(0,F.jsx)(I,{variant:`missing`,children:`Missing Resume`})]})}),(0,F.jsx)(B,{children:[t.discord_username,t.discord_user_id].filter(Boolean).join(` | `)||`Not linked`}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[o?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:o,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${n} resume`,children:`Resume`}):(0,F.jsx)(`span`,{children:t.latest_resume_name||t.latest_resume_id||`No resume`}),(0,F.jsx)(I,{variant:a>0?`succeeded`:`missing`,children:a>0?`Skills parsed`:`Skills not parsed`})]})})]},t.crm_contact_id||n)})})]})})]})}function Vn(e){let t=cn[e.onboardingFilterKind]?.options||[];return(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Onboarding queue`}),(0,F.jsx)(`span`,{id:`onboardingStatus`,className:`text-sm text-muted-foreground`,children:e.loading.onboarding?`Loading`:`${e.people.length} shown`})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b p-4 md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Search prospects`,(0,F.jsx)(Rt,{id:`onboardingQuery`,value:e.onboardingQuery,autoComplete:`off`,placeholder:`Name, email, Discord, onboarder`,onChange:t=>e.setOnboardingQuery(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(L,{id:`searchOnboarding`,type:`button`,onClick:e.onSearch,disabled:e.loading.onboarding,children:[(0,F.jsx)(te,{}),`Search`]})]}),(0,F.jsxs)(`div`,{className:`grid gap-3 border-b bg-background p-4 md:grid-cols-[minmax(140px,.8fr)_minmax(150px,1fr)_minmax(150px,1fr)_minmax(120px,.7fr)_auto]`,children:[(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`onboardingState`,value:e.onboardingState,onChange:t=>e.setOnboardingState(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any state`}),(0,F.jsx)(`option`,{value:`pending`,children:`Needs review`}),(0,F.jsx)(`option`,{value:`selected`,children:`Assigned to onboarder`}),(0,F.jsx)(`option`,{value:`reachingout`,children:`Reaching out`}),(0,F.jsx)(`option`,{value:`awaitingcontribution`,children:`Awaiting contribution`})]})]}),(0,F.jsxs)(zt,{children:[`Onboarder`,(0,F.jsx)(Rt,{id:`onboarderFilter`,value:e.onboarderFilter,autoComplete:`off`,placeholder:`Any onboarder`,onChange:t=>e.setOnboarderFilter(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(zt,{children:[`Add filter`,(0,F.jsx)(Bt,{id:`onboardingFilterKind`,value:e.onboardingFilterKind,disabled:e.onboardingFilterKeys.length===0,onChange:t=>e.setOnboardingFilterKind(t.target.value),children:e.onboardingFilterKeys.map(e=>(0,F.jsx)(`option`,{value:e,children:cn[e].label},e))})]}),(0,F.jsxs)(zt,{children:[`Value`,(0,F.jsx)(Bt,{id:`onboardingFilterValue`,value:e.onboardingFilterValue,onChange:t=>e.setOnboardingFilterValue(t.target.value),children:t.map(([e,t])=>(0,F.jsx)(`option`,{value:e,children:t},e))})]}),(0,F.jsx)(L,{id:`addOnboardingFilter`,type:`button`,onClick:e.addFilter,disabled:e.onboardingFilterKeys.length===0,children:`Add filter`}),(0,F.jsx)(`div`,{id:`activeOnboardingFilters`,className:`md:col-span-5`,children:(0,F.jsx)(wn,{filters:e.onboardingFilters,onRemove:e.removeFilter,suffix:`onboarding filter`})})]}),(0,F.jsx)(yn,{hidden:e.people.length!==0,children:`No prospects match this queue view.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`onboardingTable`,className:jt(`min-w-[1180px]`,e.people.length===0&&`hidden`),"aria-label":`Onboarding queue`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[20%]`,label:`Name`,scope:`onboarding`,sort:e.sort,sortKey:`name`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[13%]`,label:`Status`,scope:`onboarding`,sort:e.sort,sortKey:`onboarding_state`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[22%]`,label:`Onboarder`,scope:`onboarding`,sort:e.sort,sortKey:`onboarder`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[13%]`,label:`Updated`,scope:`onboarding`,sort:e.sort,sortKey:`updated`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{className:`w-[15%]`,children:`Links`}),(0,F.jsx)(H,{className:`w-[17%]`,label:`Needs`,scope:`onboarding`,sort:e.sort,sortKey:`profile_gaps`,onSort:(t,n)=>e.onSort(n)})]})}),(0,F.jsx)(Ut,{id:`onboardingBody`,children:e.people.map(t=>(0,F.jsx)(Hn,{person:t,loading:e.loading,onAssign:e.onAssign,crmContactUrl:e.crmContactUrl,crmAttachmentUrl:e.crmAttachmentUrl},t.crm_contact_id||t.name))})]})})]})}function Hn({person:e,loading:t,onAssign:n,crmContactUrl:r,crmAttachmentUrl:i}){let a=e.name||e.email_508||e.email||`CRM contact`,[o,s]=(0,l.useState)(Qt(e.onboarder));(0,l.useEffect)(()=>s(Qt(e.onboarder)),[e.onboarder]);let c=e.profile_status||{},u=[[`Discord`,c.discord_linked],[`Resume`,c.latest_resume],[`Skills`,Number(c.skills_count||0)>0]].filter(([,e])=>!e),d=r(e.crm_contact_id),f=i(e.latest_resume_id);return(0,F.jsxs)(Wt,{children:[(0,F.jsxs)(B,{children:[d?(0,F.jsx)(`a`,{className:`font-extrabold text-primary`,href:d,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} in CRM`,children:a}):(0,F.jsx)(`strong`,{children:a}),(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e.email_508||e.email||``})]}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:Zt(Yt(e)),children:e.onboarding_status_label||Xt(Yt(e))})}),(0,F.jsx)(B,{children:(0,F.jsxs)(`form`,{className:`grid max-w-64 grid-cols-[minmax(100px,1fr)_auto] items-center gap-2`,onSubmit:t=>{t.preventDefault(),n(e.crm_contact_id,o)},children:[(0,F.jsx)(Rt,{"aria-label":`Onboarder for ${a}`,value:o,placeholder:`508 username`,onChange:e=>s(e.target.value)}),(0,F.jsx)(L,{type:`submit`,size:`sm`,"aria-label":`Save onboarder for ${a}`,disabled:t[`onboarder:${e.crm_contact_id}`],children:`Save`})]})}),(0,F.jsx)(B,{children:Kt(e.onboarding_updated_at)}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[f?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:f,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} resume`,children:`Resume`}):null,rn(e.linkedin)?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:rn(e.linkedin),target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} LinkedIn`,children:`LinkedIn`}):null,an(e.github_username)?(0,F.jsx)(`a`,{className:`inline-flex min-h-7 items-center rounded-md border bg-secondary px-2 text-xs font-extrabold`,href:an(e.github_username),target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${a} GitHub`,children:e.github_username||`GitHub`}):null,!f&&!rn(e.linkedin)&&!an(e.github_username)?`None`:null]})}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[u.map(([e])=>(0,F.jsxs)(I,{variant:`missing`,children:[`Missing `,e]},String(e))),u.length===0?`None`:null]})})]})}function Un(e){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R,{className:`grid gap-3 p-4 md:grid-cols-4 md:items-end`,children:[(0,F.jsxs)(zt,{children:[`Window`,(0,F.jsxs)(Bt,{id:`minutes`,value:e.minutes,onChange:t=>e.setMinutes(t.target.value),children:[(0,F.jsx)(`option`,{value:`15`,children:`15 minutes`}),(0,F.jsx)(`option`,{value:`60`,children:`1 hour`}),(0,F.jsx)(`option`,{value:`360`,children:`6 hours`}),(0,F.jsx)(`option`,{value:`1440`,children:`24 hours`})]})]}),(0,F.jsxs)(zt,{children:[`Status`,(0,F.jsxs)(Bt,{id:`status`,value:e.status,onChange:t=>e.setStatus(t.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`Any status`}),(0,F.jsx)(`option`,{value:`queued`,children:`Queued`}),(0,F.jsx)(`option`,{value:`running`,children:`Running`}),(0,F.jsx)(`option`,{value:`succeeded`,children:`Succeeded`}),(0,F.jsx)(`option`,{value:`failed`,children:`Failed`}),(0,F.jsx)(`option`,{value:`dead`,children:`Dead`}),(0,F.jsx)(`option`,{value:`canceled`,children:`Canceled`})]})]}),(0,F.jsxs)(zt,{children:[`Type`,(0,F.jsx)(Rt,{id:`jobType`,value:e.jobType,autoComplete:`off`,placeholder:`Any type`,onChange:t=>e.setJobType(t.target.value),onKeyDown:t=>t.key===`Enter`&&e.onSearch()})]}),(0,F.jsxs)(L,{id:`refreshJobs`,type:`button`,onClick:e.onSearch,disabled:e.loading.jobs,children:[(0,F.jsx)(ee,{}),`Refresh jobs`]})]}),(0,F.jsxs)(`section`,{className:`grid gap-3 md:grid-cols-4`,"aria-label":`Job summary`,children:[(0,F.jsx)(vn,{id:`metricTotal`,label:`Total`,value:e.jobs.length}),(0,F.jsx)(vn,{id:`metricQueued`,label:`Queued`,value:e.jobCounts.queued||0}),(0,F.jsx)(vn,{id:`metricRunning`,label:`Running`,value:e.jobCounts.running||0}),(0,F.jsx)(vn,{id:`metricFailed`,label:`Failed`,value:(e.jobCounts.failed||0)+(e.jobCounts.dead||0)})]}),(0,F.jsxs)(R,{children:[(0,F.jsx)(Ft,{children:(0,F.jsx)(It,{children:`Recent jobs`})}),(0,F.jsx)(yn,{hidden:e.jobs.length!==0,children:`No jobs match these filters.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`jobsTable`,className:jt(`min-w-[980px]`,e.jobs.length===0&&`hidden`),"aria-label":`Recent jobs`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[22%]`,label:`Job id`,scope:`jobs`,sort:e.sort,sortKey:`job_id`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[24%]`,label:`Type`,scope:`jobs`,sort:e.sort,sortKey:`type`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[12%]`,label:`Status`,scope:`jobs`,sort:e.sort,sortKey:`status`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[12%]`,label:`Attempts`,scope:`jobs`,sort:e.sort,sortKey:`attempts`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[18%]`,label:`Updated`,scope:`jobs`,sort:e.sort,sortKey:`updated_at`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(z,{children:`Actions`})]})}),(0,F.jsx)(Ut,{id:`jobsBody`,children:e.jobs.map(t=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{className:`font-mono`,children:t.job_id}),(0,F.jsx)(B,{children:t.type}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:t.status||`neutral`,children:t.status})}),(0,F.jsxs)(B,{children:[t.attempts,`/`,t.max_attempts]}),(0,F.jsx)(B,{children:Kt(t.updated_at)}),(0,F.jsx)(B,{children:(0,F.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,F.jsx)(L,{type:`button`,size:`sm`,variant:`outline`,"aria-label":`View details for ${t.type} job ${t.job_id}`,onClick:()=>e.onDetail(t.job_id),disabled:e.loading[`detail:${t.job_id}`],children:`Details`}),e.canWrite?(0,F.jsx)(L,{type:`button`,size:`sm`,"aria-label":`Rerun ${t.type} job ${t.job_id}`,onClick:()=>e.onRerun(t.job_id),disabled:e.loading[`rerun:${t.job_id}`],children:`Rerun`}):null]})})]},t.job_id))})]})})]}),e.jobDetail?(0,F.jsxs)(R,{id:`jobDetailPanel`,children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Job detail`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.jobDetail.job_id})]}),(0,F.jsxs)(Lt,{className:`grid gap-4`,children:[(0,F.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[[`Type`,e.jobDetail.type],[`Status`,e.jobDetail.status],[`Attempts`,`${e.jobDetail.attempts}/${e.jobDetail.max_attempts}`],[`Updated`,Kt(e.jobDetail.updated_at)],[`Created`,Kt(e.jobDetail.created_at)],[`Run after`,Kt(e.jobDetail.run_after)],[`Locked by`,e.jobDetail.locked_by||`None`],[`Last error`,e.jobDetail.last_error||`None`]].map(([e,t])=>(0,F.jsxs)(`div`,{className:`grid gap-1 rounded-md border bg-background p-3`,children:[(0,F.jsx)(`span`,{className:`text-[11px] font-extrabold uppercase text-muted-foreground`,children:e}),(0,F.jsx)(`strong`,{className:`break-words text-sm`,children:t})]},e))}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`mb-2 text-[15px] font-bold`,children:`Payload`}),(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-background p-3 font-mono text-xs`,children:Jt(e.jobDetail.payload)||`No payload`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`mb-2 text-[15px] font-bold`,children:`Result`}),(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-background p-3 font-mono text-xs`,children:Jt(e.jobDetail.result)||`No result`})]})]})]}):null]})}function Wn(e){return(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Recent audit`}),(0,F.jsxs)(L,{id:`refreshAudit`,type:`button`,variant:`outline`,onClick:e.onRefresh,disabled:e.loading.audit,children:[(0,F.jsx)(ee,{}),`Refresh`]})]}),(0,F.jsx)(yn,{hidden:e.events.length!==0,children:`No audit events found.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`auditTable`,className:jt(`min-w-[760px]`,e.events.length===0&&`hidden`),"aria-label":`Recent audit events`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(H,{className:`w-[24%]`,label:`Time`,scope:`audit`,sort:e.sort,sortKey:`occurred_at`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[28%]`,label:`Actor`,scope:`audit`,sort:e.sort,sortKey:`actor`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[28%]`,label:`Action`,scope:`audit`,sort:e.sort,sortKey:`action`,onSort:(t,n)=>e.onSort(n)}),(0,F.jsx)(H,{className:`w-[20%]`,label:`Result`,scope:`audit`,sort:e.sort,sortKey:`result`,onSort:(t,n)=>e.onSort(n)})]})}),(0,F.jsx)(Ut,{id:`auditBody`,children:e.events.map(e=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:Kt(e.occurred_at)}),(0,F.jsx)(B,{children:e.actor_display_name||e.actor_subject||e.actor_provider}),(0,F.jsx)(B,{children:e.action}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:e.result===`success`?`succeeded`:`failed`,children:e.result})})]},e.id||`${e.occurred_at||``}-${e.actor_subject||``}-${e.action||``}`))})]})})]})}function Gn({report:e,loading:t,onRefresh:n}){let r=e?.summary||{},i=[[`Status`,e?.status_counts||{}],[`Intent`,e?.intent_counts||{}],[`Planner`,e?.planner_counts||{}]].flatMap(([e,t])=>Object.entries(t).map(([t,n])=>({label:e,value:t,count:n}))).sort((e,t)=>t.count-e.count||e.label.localeCompare(t.label)),a=Array.isArray(e?.recent_unsupported)?e.recent_unsupported:[];return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Agent requests`}),(0,F.jsxs)(L,{id:`refreshAgent`,type:`button`,variant:`outline`,onClick:n,disabled:t.agent,children:[(0,F.jsx)(ee,{}),`Refresh`]})]}),(0,F.jsxs)(Lt,{className:`grid gap-3 md:grid-cols-5`,children:[(0,F.jsx)(vn,{id:`agentMetricTotal`,label:`Total`,value:r.total||0}),(0,F.jsx)(vn,{id:`agentMetricHandled`,label:`Handled`,value:r.handled||0}),(0,F.jsx)(vn,{id:`agentMetricConfirmations`,label:`Confirmations`,value:r.requires_confirmation||0}),(0,F.jsx)(vn,{id:`agentMetricClarifications`,label:`Clarifications`,value:r.needs_clarification||0}),(0,F.jsx)(vn,{id:`agentMetricUnsupported`,label:`Not understood`,value:r.unsupported||0})]})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Request mix`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Recent agent.request audit events.`})]}),(0,F.jsx)(yn,{hidden:i.length!==0,children:`No agent request data found.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`agentBreakdownTable`,className:jt(`min-w-[860px]`,i.length===0&&`hidden`),"aria-label":`Agent request breakdown`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`Dimension`}),(0,F.jsx)(z,{children:`Value`}),(0,F.jsx)(z,{children:`Count`})]})}),(0,F.jsx)(Ut,{id:`agentBreakdownBody`,children:i.map(e=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:e.label}),(0,F.jsx)(B,{children:e.value}),(0,F.jsx)(B,{children:e.count})]},`${e.label}-${e.value}`))})]})})]}),(0,F.jsxs)(R,{children:[(0,F.jsxs)(Ft,{children:[(0,F.jsx)(It,{children:`Not understood`}),(0,F.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Sanitized request text only.`})]}),(0,F.jsx)(yn,{hidden:a.length!==0,children:`No unsupported agent requests found.`}),(0,F.jsx)(`div`,{className:`overflow-x-auto`,children:(0,F.jsxs)(Vt,{id:`agentUnsupportedTable`,className:jt(`min-w-[860px]`,a.length===0&&`hidden`),"aria-label":`Unsupported agent requests`,children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Wt,{children:[(0,F.jsx)(z,{children:`Time`}),(0,F.jsx)(z,{children:`Actor`}),(0,F.jsx)(z,{children:`Message`}),(0,F.jsx)(z,{children:`Result`})]})}),(0,F.jsx)(Ut,{id:`agentUnsupportedBody`,children:a.map(e=>(0,F.jsxs)(Wt,{children:[(0,F.jsx)(B,{children:Kt(e.occurred_at)}),(0,F.jsx)(B,{children:e.actor}),(0,F.jsx)(B,{children:e.message_sanitized}),(0,F.jsx)(B,{children:(0,F.jsx)(I,{variant:e.result===`success`?`succeeded`:`failed`,children:e.result||`unknown`})})]},`${e.occurred_at||``}-${e.actor||``}-${e.message_sanitized||``}`))})]})})]})]})}var Kn=document.getElementById(`root`);if(!Kn)throw Error(`Missing #root container`);(0,C.createRoot)(Kn).render((0,F.jsx)(l.StrictMode,{children:(0,F.jsx)(bn,{})})); \ No newline at end of file diff --git a/apps/api/src/five08/backend/static/dashboard/index.html b/apps/api/src/five08/backend/static/dashboard/index.html index a1dd3d70..b53bc5ce 100644 --- a/apps/api/src/five08/backend/static/dashboard/index.html +++ b/apps/api/src/five08/backend/static/dashboard/index.html @@ -4,8 +4,8 @@ 508 Operations Dashboard - - + +
diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000..209fa489 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,186 @@ +# Configuration Reference + +Use `.env.example` as the source of truth for defaults and available settings. +This document groups the settings by operational area and calls out the values +that most often matter in local development and deployment. + +## Core Runtime + +- `ENVIRONMENT`: defaults to `local`. Non-local values require explicit runtime + secrets such as `POSTGRES_URL` and `MINIO_ROOT_PASSWORD`. +- `LOG_LEVEL`: defaults to `INFO`. +- `API_SHARED_SECRET`: required for protected non-dashboard API routes and for + `./scripts/dev.sh login`. + +## Queue And Jobs + +- `REDIS_URL` +- `REDIS_QUEUE_NAME` +- `REDIS_KEY_PREFIX` +- `JOB_TIMEOUT_SECONDS` +- `JOB_RESULT_TTL_SECONDS` +- `JOB_MAX_ATTEMPTS` +- `JOB_RETRY_BASE_SECONDS` +- `JOB_RETRY_MAX_SECONDS` +- `GIG_RECRUITING_STALE_DAYS` + +`./scripts/dev.sh` overrides local Redis settings to deterministic per-worktree +localhost ports. Compose injects Docker-network URLs. + +## Postgres + +- `POSTGRES_URL` +- `POSTGRES_DB` +- `POSTGRES_USER` +- `POSTGRES_PASSWORD` +- `POSTGRES_HOST_BIND` +- `POSTGRES_HOST_PORT` + +For local dev, `./scripts/dev.sh` and `./scripts/docker-compose.sh` compute +deterministic per-worktree ports unless values are pinned in `.env` or the +invoking shell. + +## MinIO + +- `MINIO_ENDPOINT` +- `MINIO_INTERNAL_BUCKET` +- `MINIO_ROOT_USER` +- `MINIO_ROOT_PASSWORD` +- `MINIO_HOST_BIND` +- `MINIO_API_HOST_PORT` +- `MINIO_CONSOLE_HOST_PORT` + +Use `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD` as the actual env vars. +`MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` are settings aliases, not env-loaded +fields. + +## Web/API Service + +- `WEB_HOST` +- `WEB_PORT` +- `WEB_HOST_BIND` +- `WEB_HOST_PORT` +- `DASHBOARD_DEFAULT_PATH` +- `DASHBOARD_PUBLIC_BASE_URL` + +Deprecated fallback names still work for now: + +- `WEBHOOK_INGEST_HOST` +- `WEBHOOK_INGEST_PORT` +- `WEBHOOK_INGEST_HOST_BIND` +- `WEBHOOK_INGEST_HOST_PORT` + +Host-run `./scripts/dev.sh` ignores `.env` for `WEB_PORT` and computes a +deterministic per-worktree value unless `WEB_PORT` is exported in the shell. + +## Dashboard Auth + +OIDC settings: + +- `OIDC_ISSUER_URL` +- `OIDC_CLIENT_ID` +- `OIDC_CLIENT_SECRET` +- `OIDC_SCOPE` +- `OIDC_GROUPS_CLAIM` +- `OIDC_ADMIN_GROUPS` +- `OIDC_CALLBACK_PATH` +- `OIDC_REDIRECT_BASE_URL` +- `AUTH_SESSION_COOKIE_NAME` +- `AUTH_SESSION_TTL_SECONDS` + +Discord dashboard-link settings: + +- `DISCORD_SERVER_ID` +- `DISCORD_ADMIN_ROLES` +- `DISCORD_API_TIMEOUT_SECONDS` +- `DISCORD_LINK_TTL_SECONDS` +- `DISCORD_LINK_REQUIRE_OIDC_IDENTITY_CHECKS` +- `DISCORD_BOT_TOKEN` + +Local `.env.example` sets `DISCORD_LINK_REQUIRE_OIDC_IDENTITY_CHECKS=false` so +Discord dashboard links and CLI-created dev links can create sessions without an +OIDC roundtrip. Production should keep identity checks enabled. + +## Worker + +- `WORKER_NAME` +- `WORKER_QUEUE_NAMES` +- `WORKER_BURST` +- `WORKER_API_BASE_URL` +- `DISCORD_BOT_INTERNAL_BASE_URL` + +Worker startup currently resolves to one effective queue name. Keep this explicit +if true multi-queue routing is introduced later. + +## CRM And Resume Processing + +- `ESPO_BASE_URL` +- `ESPO_API_KEY` +- `CRM_SYNC_ENABLED` +- `CRM_SYNC_INTERVAL_SECONDS` +- `CRM_SYNC_PAGE_SIZE` +- `CHECK_EMAIL_WAIT` +- `MAX_ATTACHMENTS_PER_CONTACT` +- `MAX_FILE_SIZE_MB` +- `ALLOWED_FILE_TYPES` +- `RESUME_EXTRACTOR_VERSION` +- `INTAKE_RESUME_FETCH_TIMEOUT_SECONDS` +- `INTAKE_RESUME_MAX_REDIRECTS` +- `INTAKE_RESUME_ALLOWED_HOSTS` + +Worker CRM wiring uses the fixed LinkedIn field `cLinkedIn`, keeps the +intake-completed field unset, and matches resume filenames with +`resume`, `cv`, and `curriculum`. + +## LLM And Observability + +- `OPENAI_API_KEY` +- `OPENAI_BASE_URL` +- `OPENAI_MODEL` +- `OPENAI_DIRECT_API_KEY` / `OPENAI_API_KEY_DIRECT` +- `OPENAI_DIRECT_BASE_URL` +- `OPENAI_DIRECT_MODEL` +- `FIREWORKS_API_KEY` +- `OPENROUTER_API_KEY` +- `LANGFUSE_BASE_URL` +- `RESUME_AI_API_KEY` +- `RESUME_AI_BASE_URL` +- `RESUME_AI_MODEL` + +Resume/profile LLM calls retry matching direct providers after Bifrost request +failures when direct provider credentials are configured. + +## Discord Bot And Agent Gateway + +Discord bot: + +- `DISCORD_BOT_TOKEN` +- `BACKEND_API_BASE_URL` +- `HEALTHCHECK_PORT` +- `DISCORD_DEFAULT_JOB_FORUM_CHANNELS` +- `DISCORD_LOGS_WEBHOOK_URL` +- `DISCORD_LOGS_WEBHOOK_WAIT` + +Agent gateway: + +- `AGENT_API_TIMEOUT_SECONDS` +- `AGENT_FAST_MODEL`, `AGENT_FAST_BASE_URL`, `AGENT_FAST_API_KEY` +- `AGENT_STRONG_MODEL`, `AGENT_STRONG_BASE_URL`, `AGENT_STRONG_API_KEY` +- `AGENT_REASONING_MODEL`, `AGENT_REASONING_BASE_URL`, `AGENT_REASONING_API_KEY` +- `AGENT_FALLBACK_MODEL` +- `AGENT_INTENT_NORMALIZER_ENABLED` +- `AGENT_INTENT_NORMALIZER_TIMEOUT_SECONDS` +- `GITHUB_API_TOKEN` +- `GITHUB_DEFAULT_REPO` +- `GITHUB_ALLOWED_REPOS` + +Agent model base URLs must be HTTPS endpoints on allowed provider hosts, except +the internal Docker-network Bifrost URL `http://bifrost:8080/openai` is allowed +for same-host deployments. + +## Legacy/Deprecating Integrations + +- `KIMAI_BASE_URL` +- `KIMAI_API_TOKEN` + +Kimai settings are still required by the current config model. diff --git a/docs/discord-agent-eval-harness.md b/docs/discord-agent-eval-harness.md index 4d2f3429..5fe63f81 100644 --- a/docs/discord-agent-eval-harness.md +++ b/docs/discord-agent-eval-harness.md @@ -1,6 +1,6 @@ # Discord Agent Eval Harness -This is the PR-gated eval harness for the Discord agent planner/router. +This is the eval harness for the Discord agent planner/router. ## Goals diff --git a/scripts/dev.sh b/scripts/dev.sh index 678c2a8e..b35f6e4d 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -13,6 +13,14 @@ export MINIO_ENDPOINT="http://127.0.0.1:${MINIO_API_HOST_PORT}" export BACKEND_API_BASE_URL="http://127.0.0.1:${WEB_PORT}" export WORKER_API_BASE_URL="http://127.0.0.1:${WEB_PORT}" export DISCORD_BOT_INTERNAL_BASE_URL="http://127.0.0.1:${HEALTHCHECK_PORT}" +if [ -z "${API_SHARED_SECRET-}" ]; then + API_SHARED_SECRET=$(worktree_env_resolve_value API_SHARED_SECRET "" "$WORKTREE_ENV_FILE") + export API_SHARED_SECRET +fi +if [ -z "${DISCORD_ADMIN_ROLES-}" ]; then + DISCORD_ADMIN_ROLES=$(worktree_env_resolve_value DISCORD_ADMIN_ROLES "Admin,Owner" "$WORKTREE_ENV_FILE") + export DISCORD_ADMIN_ROLES +fi if [ -z "${AUDIT_API_BASE_URL-}" ]; then export AUDIT_API_BASE_URL="$BACKEND_API_BASE_URL" fi @@ -36,6 +44,97 @@ run_migrations() { uv run --package worker python3 -c 'from five08.worker.db_migrations import run_job_migrations; run_job_migrations()' } +create_dashboard_login_link() { + next_path=${1:-/dashboard} + if [ -z "${API_SHARED_SECRET-}" ]; then + cat >&2 <&2 + echo "Usage: ./scripts/dev.sh [infra|all|no-bot|web-worker|dashboard|login|migrate|down|ports|env|web|api|worker|discord-bot]" >&2 exit 1 ;; esac diff --git a/scripts/dev_mux.py b/scripts/dev_mux.py index 7f8a5f9c..24f1bce0 100755 --- a/scripts/dev_mux.py +++ b/scripts/dev_mux.py @@ -14,14 +14,19 @@ from urllib.parse import urlparse -PORT_SERVICES: list[tuple[str, str]] = [ - ("web", "BACKEND_API_BASE_URL"), - ("discord-bot", "DISCORD_BOT_INTERNAL_BASE_URL"), -] +PORT_SERVICES: dict[str, str] = { + "web": "BACKEND_API_BASE_URL", + "discord-bot": "DISCORD_BOT_INTERNAL_BASE_URL", +} +ALL_SERVICES = ("web", "worker", "discord-bot") -def _service_commands(env: dict[str, str]) -> list[tuple[str, list[str]]]: - return [ + +def _service_commands( + env: dict[str, str], selected_services: set[str] | None = None +) -> list[tuple[str, list[str]]]: + selected_services = selected_services or set(ALL_SERVICES) + commands = [ ( "web", [ @@ -80,6 +85,7 @@ def _service_commands(env: dict[str, str]) -> list[tuple[str, list[str]]]: ], ), ] + return [(name, command) for name, command in commands if name in selected_services] def _stream_output(name: str, process: subprocess.Popen[str]) -> None: @@ -187,10 +193,16 @@ def _stop_pid(pid: int) -> None: return -def _ensure_ports_available(env: dict[str, str]) -> tuple[bool, str | None]: +def _ensure_ports_available( + env: dict[str, str], selected_services: set[str] | None = None +) -> tuple[bool, str | None]: + selected_services = selected_services or set(ALL_SERVICES) worktree_root = env.get("WORKTREE_ENV_REPO_ROOT", "") - for service_name, env_key in PORT_SERVICES: + for service_name, env_key in PORT_SERVICES.items(): + if service_name not in selected_services: + continue + try: port = _service_port(env, env_key) except ValueError as exc: @@ -244,17 +256,63 @@ def _ensure_ports_available(env: dict[str, str]) -> tuple[bool, str | None]: return True, None +def _selected_services(argv: list[str]) -> set[str] | None: + if not argv: + return set(ALL_SERVICES) + + aliases = { + "api": "web", + "bot": "discord-bot", + "discord_bot": "discord-bot", + } + selected: set[str] = set() + invalid: list[str] = [] + for value in argv: + service = aliases.get(value, value) + if service not in ALL_SERVICES: + invalid.append(value) + continue + selected.add(service) + + if invalid or not selected: + services = "|".join(ALL_SERVICES) + program = os.path.basename(sys.argv[0]) or "dev_mux.py" + print( + f"Usage: {program} [{services} ...]", + file=sys.stderr, + ) + if invalid: + print(f"Unknown service(s): {', '.join(invalid)}", file=sys.stderr) + return None + + return selected + + def main() -> int: + selected_services = _selected_services(sys.argv[1:]) + if selected_services is None: + return 2 + env = os.environ.copy() env.setdefault("PYTHONUNBUFFERED", "1") print("Launching host-run services with shared worktree env:") - print(f" Web/API listener: {env.get('BACKEND_API_BASE_URL', '')}") - print(f" Bot health listener: {env.get('DISCORD_BOT_INTERNAL_BASE_URL', '')}") - print(" Worker listener: none (queue consumer)") + if "web" in selected_services: + print(f" Web/API dashboard: {env.get('BACKEND_API_BASE_URL', '')}") + else: + print(" Web/API dashboard: skipped") + if "discord-bot" in selected_services: + print(f" Bot health listener: {env.get('DISCORD_BOT_INTERNAL_BASE_URL', '')}") + else: + print(" Bot health listener: skipped") + print( + " Worker listener: none (queue consumer)" + if "worker" in selected_services + else " Worker listener: skipped" + ) print() - ports_ok, port_error = _ensure_ports_available(env) + ports_ok, port_error = _ensure_ports_available(env, selected_services) if not ports_ok: print(port_error, file=sys.stderr) return 1 @@ -276,7 +334,7 @@ def handle_signal(signum: int, _frame: object) -> None: signal.signal(signal.SIGTERM, handle_signal) try: - for name, command in _service_commands(env): + for name, command in _service_commands(env, selected_services): process = subprocess.Popen( command, cwd=env.get("WORKTREE_ENV_REPO_ROOT") or None, diff --git a/tests/unit/test_backend_api.py b/tests/unit/test_backend_api.py index edd52b4a..b89a0235 100644 --- a/tests/unit/test_backend_api.py +++ b/tests/unit/test_backend_api.py @@ -3214,10 +3214,67 @@ def test_dashboard_add_project_historical_member_returns_ambiguous_candidates( assert response.status_code == 409 assert response.json()["error"] == "ambiguous_person" + assert response.json()["person"] == "sam" + assert response.json()["detail"] == ( + 'Multiple people matched "sam". Choose the matching person record.' + ) assert response.json()["candidates"] == candidates mock_audit.assert_not_awaited() +def test_dashboard_add_project_historical_member_returns_person_not_found_detail( + client: TestClient, +) -> None: + project_id = "11111111-1111-4111-8111-111111111111" + session = api.AuthSession( + subject="steering-1", + email="steering@508.dev", + display_name="Steering User", + groups=["Steering Committee"], + is_admin=False, + id_token="", + expires_at=4_102_444_800, + actor_provider=api.ActorProvider.DISCORD.value, + ) + cached_project = {"id": project_id, "display_name": "Visible Project"} + + with ( + patch( + "five08.backend.api._current_session", + new_callable=AsyncMock, + return_value=("session-1", session), + ), + patch( + "five08.backend.api._cached_dashboard_project_by_id", + return_value=cached_project, + ), + patch( + "five08.backend.api._add_historical_project_member", + side_effect=api.HistoricalProjectMemberResolutionError("person_not_found"), + ), + patch( + "five08.backend.api._write_auth_audit_event", + new_callable=AsyncMock, + ) as mock_audit, + ): + response = client.post( + f"/dashboard/api/projects/{project_id}/historical-members", + json={"person": " dddd "}, + ) + + assert response.status_code == 400 + assert response.json() == { + "error": "person_not_found", + "detail": ( + 'No CRM person, ERPNext user, or ERPNext supplier matched "dddd". ' + "Try an email address or an exact name from CRM/ERPNext." + ), + "person": "dddd", + "candidates": [], + } + mock_audit.assert_not_awaited() + + def test_resolve_historical_project_member_merges_crm_erp_and_supplier( monkeypatch: pytest.MonkeyPatch, ) -> None: