From 82183d9bcaff6d9fb14fda3ad5b26aefb2d3bb95 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Aug 2026 15:43:19 +0000 Subject: [PATCH] Stop tracking the built web UI; build it in the Docker image instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/handler/api/static/ was a committed build artifact: Next's content-hashed chunk names churn on every build, so any two branches touching frontend/ were guaranteed merge conflicts there, PR diffs drowned in generated churn, and a forgotten `npm run export` could silently ship a UI older than its source. - gitignore the export (plus frontend/out and .next were already covered) and remove the 52 tracked files. - Dockerfile grows a `ui` stage (npm ci + npm run build) whose output is copied into the packaged tree before pip install, so the image published by docker.yml always carries a UI built from exactly that commit's source — the frontend build is now effectively part of CI with no new workflow. - .dockerignore excludes frontend artifacts and any stale local export: COPY into src/handler/api/static merges, so a checkout copy must never leak in. - pyproject: hatchling skips VCS-ignored files, so `artifacts` re-includes the export when present; absent it, the wheel builds fine and the API just runs headless (it only mounts static/ when the directory exists). - README documents the two build paths (Docker stage vs `npm run export` for source installs) and the headless fallback. Verified: wheel with the export present ships all 52 files (memory page included); wheel without it builds clean and create_app() skips the UI mount. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01WYqkoYPX8NAo1V2KyXr1pk --- .dockerignore | 10 +++++++++- .gitignore | 6 ++++++ Dockerfile | 16 ++++++++++++++++ README.md | 19 +++++++++++++++---- frontend/.gitignore | 7 ++++--- pyproject.toml | 10 ++++++++-- src/handler/api/static/404.html | 1 - src/handler/api/static/404/index.html | 1 - .../2k28Zwu9jDxUf-5jNvRk4/_buildManifest.js | 1 - .../2k28Zwu9jDxUf-5jNvRk4/_ssgManifest.js | 1 - .../static/chunks/117-6366a47b51d22677.js | 2 -- .../static/chunks/171-7adbcaabf9d14cdf.js | 1 - .../static/chunks/258-022159d3c3089cd0.js | 1 - .../app/_not-found/page-34168ac570dc8992.js | 1 - .../app/activity/page-809b415dd18cb14e.js | 1 - .../app/agents/page-65cc70b94cb9abd3.js | 1 - .../app/approvals/page-8d5622be330f4d01.js | 1 - .../app/claude/page-235e137771d99edc.js | 1 - .../chunks/app/layout-21ca3d760368e2b4.js | 1 - .../chunks/app/login/page-b08c6695be5632dd.js | 1 - .../app/memory/page-2d205a5c1ee769c1.js | 1 - .../chunks/app/page-cf68f34e95b90a40.js | 1 - .../app/repositories/page-fb0c29b8dc7ed817.js | 1 - .../app/schedules/page-4398c9c829e1b9fd.js | 1 - .../app/servers/page-7cfc66d88412e3d1.js | 1 - .../app/shared/page-dc7068fcf86ab8e4.js | 1 - .../chunks/fd9d1056-e47440ca368281f5.js | 1 - .../chunks/framework-f66176bb897dc684.js | 1 - .../static/chunks/main-286aa4e0bec03155.js | 1 - .../chunks/main-app-8321800782c5a11e.js | 1 - .../chunks/pages/_app-72b849fbd24ac258.js | 1 - .../chunks/pages/_error-7ba65e1336b92748.js | 1 - .../chunks/polyfills-42372ed130431b0a.js | 1 - .../static/chunks/webpack-03f7c6bc932ce1e3.js | 1 - .../_next/static/css/bbd6ee1e7265be74.css | 1 - src/handler/api/static/activity/index.html | 1 - src/handler/api/static/activity/index.txt | 8 -------- src/handler/api/static/agents/index.html | 1 - src/handler/api/static/agents/index.txt | 8 -------- src/handler/api/static/approvals/index.html | 1 - src/handler/api/static/approvals/index.txt | 8 -------- src/handler/api/static/claude/index.html | 1 - src/handler/api/static/claude/index.txt | 8 -------- src/handler/api/static/icon.svg | 10 ---------- src/handler/api/static/index.html | 1 - src/handler/api/static/index.txt | 8 -------- src/handler/api/static/login/index.html | 1 - src/handler/api/static/login/index.txt | 8 -------- src/handler/api/static/memory/index.html | 1 - src/handler/api/static/memory/index.txt | 8 -------- .../api/static/repositories/index.html | 1 - src/handler/api/static/repositories/index.txt | 8 -------- src/handler/api/static/schedules/index.html | 1 - src/handler/api/static/schedules/index.txt | 8 -------- src/handler/api/static/servers/index.html | 1 - src/handler/api/static/servers/index.txt | 8 -------- src/handler/api/static/shared/index.html | 1 - src/handler/api/static/shared/index.txt | 8 -------- 58 files changed, 58 insertions(+), 149 deletions(-) delete mode 100644 src/handler/api/static/404.html delete mode 100644 src/handler/api/static/404/index.html delete mode 100644 src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_buildManifest.js delete mode 100644 src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_ssgManifest.js delete mode 100644 src/handler/api/static/_next/static/chunks/117-6366a47b51d22677.js delete mode 100644 src/handler/api/static/_next/static/chunks/171-7adbcaabf9d14cdf.js delete mode 100644 src/handler/api/static/_next/static/chunks/258-022159d3c3089cd0.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/_not-found/page-34168ac570dc8992.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/activity/page-809b415dd18cb14e.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/agents/page-65cc70b94cb9abd3.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/approvals/page-8d5622be330f4d01.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/claude/page-235e137771d99edc.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/layout-21ca3d760368e2b4.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/login/page-b08c6695be5632dd.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/memory/page-2d205a5c1ee769c1.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/page-cf68f34e95b90a40.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/repositories/page-fb0c29b8dc7ed817.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/schedules/page-4398c9c829e1b9fd.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/servers/page-7cfc66d88412e3d1.js delete mode 100644 src/handler/api/static/_next/static/chunks/app/shared/page-dc7068fcf86ab8e4.js delete mode 100644 src/handler/api/static/_next/static/chunks/fd9d1056-e47440ca368281f5.js delete mode 100644 src/handler/api/static/_next/static/chunks/framework-f66176bb897dc684.js delete mode 100644 src/handler/api/static/_next/static/chunks/main-286aa4e0bec03155.js delete mode 100644 src/handler/api/static/_next/static/chunks/main-app-8321800782c5a11e.js delete mode 100644 src/handler/api/static/_next/static/chunks/pages/_app-72b849fbd24ac258.js delete mode 100644 src/handler/api/static/_next/static/chunks/pages/_error-7ba65e1336b92748.js delete mode 100644 src/handler/api/static/_next/static/chunks/polyfills-42372ed130431b0a.js delete mode 100644 src/handler/api/static/_next/static/chunks/webpack-03f7c6bc932ce1e3.js delete mode 100644 src/handler/api/static/_next/static/css/bbd6ee1e7265be74.css delete mode 100644 src/handler/api/static/activity/index.html delete mode 100644 src/handler/api/static/activity/index.txt delete mode 100644 src/handler/api/static/agents/index.html delete mode 100644 src/handler/api/static/agents/index.txt delete mode 100644 src/handler/api/static/approvals/index.html delete mode 100644 src/handler/api/static/approvals/index.txt delete mode 100644 src/handler/api/static/claude/index.html delete mode 100644 src/handler/api/static/claude/index.txt delete mode 100644 src/handler/api/static/icon.svg delete mode 100644 src/handler/api/static/index.html delete mode 100644 src/handler/api/static/index.txt delete mode 100644 src/handler/api/static/login/index.html delete mode 100644 src/handler/api/static/login/index.txt delete mode 100644 src/handler/api/static/memory/index.html delete mode 100644 src/handler/api/static/memory/index.txt delete mode 100644 src/handler/api/static/repositories/index.html delete mode 100644 src/handler/api/static/repositories/index.txt delete mode 100644 src/handler/api/static/schedules/index.html delete mode 100644 src/handler/api/static/schedules/index.txt delete mode 100644 src/handler/api/static/servers/index.html delete mode 100644 src/handler/api/static/servers/index.txt delete mode 100644 src/handler/api/static/shared/index.html delete mode 100644 src/handler/api/static/shared/index.txt diff --git a/.dockerignore b/.dockerignore index a8b1914..95cdf8b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ # Keep the build context to what the image actually needs: pyproject.toml, -# README.md (referenced by pyproject), src/, alembic.ini, docker-entrypoint.sh. +# README.md (referenced by pyproject), src/, frontend/ (source only — the ui stage +# builds it), alembic.ini, docker-entrypoint.sh. .git .github .venv @@ -19,3 +20,10 @@ Dockerfile.control docker-compose.yml .dockerignore .mise.toml +# Frontend artifacts: the ui stage runs npm ci / npm run build itself, and a stale +# local export must never leak in — COPY into src/handler/api/static merges, so any +# checkout copy would ship alongside the fresh build. +frontend/node_modules +frontend/out +frontend/.next +src/handler/api/static diff --git a/.gitignore b/.gitignore index ff72444..9a94144 100644 --- a/.gitignore +++ b/.gitignore @@ -223,3 +223,9 @@ __marimo__/ # Handler runtime artifacts /handler.db + +# Built web UI — a generated artifact, never committed. Local/manual installs produce it +# with `npm run export` (see README "Frontend"); the Docker image builds it in its own +# node stage. Tracking it caused guaranteed merge conflicts: Next's content-hashed chunk +# names churn on every build, so any two branches touching frontend/ collided here. +/src/handler/api/static/ diff --git a/Dockerfile b/Dockerfile index dd59914..511e72b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,17 @@ # syntax=docker/dockerfile:1 +# ---- ui stage: build the dashboard's static export ---- +# The export is a generated artifact (gitignored), so the image builds it here rather +# than trusting the checkout to carry it. package*.json is copied alone first so the +# npm ci layer caches until the lockfile actually changes. +FROM node:20-slim AS ui + +WORKDIR /ui +COPY frontend/package.json frontend/package-lock.json ./ +RUN npm ci --no-audit --no-fund +COPY frontend ./ +RUN npm run build + # ---- build stage: install the package + deps into an isolated venv ---- FROM python:3.11-slim AS builder @@ -12,6 +24,10 @@ ENV PATH="/opt/venv/bin:$PATH" WORKDIR /build COPY pyproject.toml README.md ./ COPY src ./src +# Drop the built UI into the packaged tree before pip install: hatchling ships every +# non-.py file under src/handler, so the wheel carries the export and FastAPI serves it +# same-origin — exactly what committing src/handler/api/static used to provide. +COPY --from=ui /ui/out ./src/handler/api/static RUN pip install . # ---- runtime stage ---- diff --git a/README.md b/README.md index b53ff0e..2b5edb2 100644 --- a/README.md +++ b/README.md @@ -498,9 +498,17 @@ the API (same contract as `curl`): the browser prompts for the token once, store `localStorage`, and attaches it to every call. All API values render as React text (never `dangerouslySetInnerHTML`) so agent-authored strings can't inject markup. -The build output is committed to `src/handler/api/static/` so the Python wheel ships it and -FastAPI serves it same-origin — there is no separate frontend server and no node step in the -Docker image. Rebuild after changing the UI: +The build output lands in `src/handler/api/static/`, which FastAPI serves same-origin — +there is no separate frontend server. The export is a **generated artifact and is +gitignored**, not committed: tracked builds guaranteed merge conflicts (Next's +content-hashed chunk names churn on every build) and let the served UI drift from its +source. It gets built in one of two places: + +- **Docker** (the normal path): the [`Dockerfile`](Dockerfile)'s `ui` stage runs + `npm ci && npm run build` and copies the export into the packaged tree, so the image + published by [`docker.yml`](.github/workflows/docker.yml) always carries a UI built + from exactly the source in that commit. +- **Source installs**: build it yourself before (or after) `pip install`: ```bash cd frontend @@ -509,6 +517,9 @@ npm run build # static export → frontend/out/ npm run export # build, then sync frontend/out/ → src/handler/api/static/ ``` +Without that step a source install still works — the API only mounts `static/` when the +directory exists, so it just runs headless (API-only). + `npm run dev` runs the UI against a live API on another origin — set `NEXT_PUBLIC_API_BASE=http://127.0.0.1:8000` and enable `CORS_ORIGINS` on the API. @@ -523,7 +534,7 @@ src/handler/ # forge/gitops seams, credentials, skills_gen, CI poller hooks/ # Stop/SessionEnd, PreToolUse gate (push + approval), Notification migrations/ # Alembic env + versions - api/static/ # built Next.js export (generated — see frontend/) + api/static/ # built Next.js export (generated + gitignored — see frontend/) frontend/ # Next.js dashboard source (builds to api/static/) tests/ # DB, API, hook, and control tests (SQLite) docs/PLAN.md # full design + phased roadmap (the original plan of action) diff --git a/frontend/.gitignore b/frontend/.gitignore index dbc14e7..a18a9f8 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,6 +1,7 @@ -# Frontend build artifacts. The *built* static export is committed under -# src/handler/api/static/ (that is what the Python package ships and FastAPI serves); -# everything below is regenerated by `npm install` / `npm run build`. +# Frontend build artifacts — all regenerated by `npm install` / `npm run build`. The +# static export under src/handler/api/static/ is generated too (gitignored at the repo +# root): `npm run export` produces it for source installs, and the Docker image builds +# it in its own node stage. /node_modules /.next /out diff --git a/pyproject.toml b/pyproject.toml index 776a96c..3d4019b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,9 +32,15 @@ dev = [ handler = "handler.control.cli:main" [tool.hatch.build.targets.wheel] -# The bundled web UI (src/handler/api/static/*) ships automatically: it lives inside the -# packaged `src/handler` tree, and hatchling includes non-.py files there by default. +# The web UI ships whenever src/handler/api/static/ exists at build time: hatchling +# includes non-.py files in the packaged `src/handler` tree by default. The export is a +# generated artifact (gitignored) — `npm run export` produces it for source installs, +# and the Docker image's ui stage builds it before pip install. Absent the directory, +# the API simply runs headless (it only mounts static/ when present). packages = ["src/handler"] +# Hatchling skips VCS-ignored files; `artifacts` re-includes the (gitignored) export so +# a build that has one still ships it. +artifacts = ["/src/handler/api/static"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/handler/api/static/404.html b/src/handler/api/static/404.html deleted file mode 100644 index 22b0a6a..0000000 --- a/src/handler/api/static/404.html +++ /dev/null @@ -1 +0,0 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/404/index.html b/src/handler/api/static/404/index.html deleted file mode 100644 index 22b0a6a..0000000 --- a/src/handler/api/static/404/index.html +++ /dev/null @@ -1 +0,0 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_buildManifest.js b/src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_buildManifest.js deleted file mode 100644 index e183940..0000000 --- a/src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-7ba65e1336b92748.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_ssgManifest.js b/src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_ssgManifest.js deleted file mode 100644 index 5b3ff59..0000000 --- a/src/handler/api/static/_next/static/2k28Zwu9jDxUf-5jNvRk4/_ssgManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/117-6366a47b51d22677.js b/src/handler/api/static/_next/static/chunks/117-6366a47b51d22677.js deleted file mode 100644 index f56b942..0000000 --- a/src/handler/api/static/_next/static/chunks/117-6366a47b51d22677.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[117],{5157:function(e,t){"use strict";function n(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return n}})},1572:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},1634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return u}});let r=n(8498),o=n(8521);function u(e,t){return(0,o.normalizePathTrailingSlash)((0,r.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5266:function(e,t){"use strict";function n(e){var t,n;t=self.__next_s,n=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[n,r]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");if(r)for(let e in r)"children"!==e&&o.setAttribute(e,r[e]);n?(o.src=n,o.onload=()=>e(),o.onerror=t):r&&(o.innerHTML=r.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{n()}):n()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return n}}),window.next={version:"14.2.15",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return o}});let r=n(2846);async function o(e,t){let n=(0,r.getServerActionDispatcher)();if(!n)throw Error("Invariant: missing action dispatcher.");return new Promise((r,o)=>{n({actionId:e,actionArgs:t,resolve:r,reject:o})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2304:function(e,t,n){"use strict";let r,o;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return x}});let u=n(7043),l=n(3099),a=n(7437);n(1572);let i=u._(n(4040)),c=l._(n(2265)),s=n(6671),f=n(8701),d=u._(n(1404)),p=n(3079),h=n(9721),y=n(2103);n(647);let _=window.console.error;window.console.error=function(){for(var e=arguments.length,t=Array(e),n=0;n{if((0,h.isNextRouterError)(e.error)){e.preventDefault();return}});let v=document,b=new TextEncoder,g=!1,m=!1,R=null;function P(e){if(0===e[0])r=[];else if(1===e[0]){if(!r)throw Error("Unexpected server data: missing bootstrap script.");o?o.enqueue(b.encode(e[1])):r.push(e[1])}else 2===e[0]&&(R=e[1])}let j=function(){o&&!m&&(o.close(),m=!0,r=void 0),g=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",j,!1):j();let O=self.__next_f=self.__next_f||[];O.forEach(P),O.push=P;let S=new ReadableStream({start(e){r&&(r.forEach(t=>{e.enqueue(b.encode(t))}),g&&!m&&(e.close(),m=!0,r=void 0)),o=e}}),E=(0,s.createFromReadableStream)(S,{callServer:p.callServer});function w(){return(0,c.use)(E)}let T=c.default.StrictMode;function M(e){let{children:t}=e;return t}function x(){let e=(0,y.createMutableActionQueue)(),t=(0,a.jsx)(T,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(y.ActionQueueContext.Provider,{value:e,children:(0,a.jsx)(M,{children:(0,a.jsx)(w,{})})})})}),n=window.__next_root_layout_missing_tags,r=!!(null==n?void 0:n.length),o={onRecoverableError:d.default};"__next_error__"===document.documentElement.id||r?i.default.createRoot(v,o).render(t):c.default.startTransition(()=>i.default.hydrateRoot(v,t,{...o,formState:R}))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4278:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(9506),(0,n(5266).appBootstrap)(()=>{let{hydrate:e}=n(2304);n(2846),n(4707),e()}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(5157);{let e=n.u;n.u=function(){for(var t=arguments.length,n=Array(t),r=0;r(l(function(){var e;let t=document.getElementsByName(u)[0];if(null==t?void 0:null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(u);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(u)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,r.useState)(""),c=(0,r.useRef)();return(0,r.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),n?(0,o.createPortal)(a,n):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6866:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION:function(){return r},FLIGHT_PARAMETERS:function(){return i},NEXT_DID_POSTPONE_HEADER:function(){return s},NEXT_ROUTER_PREFETCH_HEADER:function(){return u},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return a},RSC_HEADER:function(){return n}});let n="RSC",r="Next-Action",o="Next-Router-State-Tree",u="Next-Router-Prefetch",l="Next-Url",a="text/x-component",i=[[n],[o],[u]],c="_rsc",s="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2846:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createEmptyCacheNode:function(){return C},default:function(){return I},getServerActionDispatcher:function(){return E},urlToUrlWithoutFlightMarker:function(){return T}});let r=n(3099),o=n(7437),u=r._(n(2265)),l=n(1956),a=n(4673),i=n(3456),c=n(9060),s=n(7744),f=n(1060),d=n(2952),p=n(6146),h=n(1634),y=n(6495),_=n(4123),v=n(9320),b=n(8137),g=n(6866),m=n(5076),R=n(1283),P=n(4541),j="undefined"==typeof window,O=j?null:new Map,S=null;function E(){return S}let w={};function T(e){let t=new URL(e,location.origin);if(t.searchParams.delete(g.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,n=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-n)}return t}function M(e){return e.origin!==window.location.origin}function x(e){let{appRouterState:t,sync:n}=e;return(0,u.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:o}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,i.createHrefFromUrl)(new URL(window.location.href))!==o?(r.pendingPush=!1,window.history.pushState(u,"",o)):window.history.replaceState(u,"",o),n(t)},[t,n]),null}function C(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null}}function A(e){null==e&&(e={});let t=window.history.state,n=null==t?void 0:t.__NA;n&&(e.__NA=n);let r=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return r&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=r),e}function N(e){let{headCacheNode:t}=e,n=null!==t?t.head:null,r=null!==t?t.prefetchHead:null,o=null!==r?r:n;return(0,u.useDeferredValue)(n,o)}function D(e){let t,{buildId:n,initialHead:r,initialTree:i,urlParts:f,initialSeedData:g,couldBeIntercepted:E,assetPrefix:T,missingSlots:C}=e,D=(0,u.useMemo)(()=>(0,d.createInitialRouterState)({buildId:n,initialSeedData:g,urlParts:f,initialTree:i,initialParallelRoutes:O,location:j?null:window.location,initialHead:r,couldBeIntercepted:E}),[n,g,f,i,r,E]),[I,U,k]=(0,s.useReducerWithReduxDevtools)(D);(0,u.useEffect)(()=>{O=null},[]);let{canonicalUrl:F}=(0,s.useUnwrapState)(I),{searchParams:L,pathname:H}=(0,u.useMemo)(()=>{let e=new URL(F,"undefined"==typeof window?"http://n":window.location.href);return{searchParams:e.searchParams,pathname:(0,R.hasBasePath)(e.pathname)?(0,m.removeBasePath)(e.pathname):e.pathname}},[F]),$=(0,u.useCallback)(e=>{let{previousTree:t,serverResponse:n}=e;(0,u.startTransition)(()=>{U({type:a.ACTION_SERVER_PATCH,previousTree:t,serverResponse:n})})},[U]),G=(0,u.useCallback)((e,t,n)=>{let r=new URL((0,h.addBasePath)(e),location.href);return U({type:a.ACTION_NAVIGATE,url:r,isExternalUrl:M(r),locationSearch:location.search,shouldScroll:null==n||n,navigateType:t})},[U]);S=(0,u.useCallback)(e=>{(0,u.startTransition)(()=>{U({...e,type:a.ACTION_SERVER_ACTION})})},[U]);let z=(0,u.useMemo)(()=>({back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let n;if(!(0,p.isBot)(window.navigator.userAgent)){try{n=new URL((0,h.addBasePath)(e),window.location.href)}catch(t){throw Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL.")}M(n)||(0,u.startTransition)(()=>{var e;U({type:a.ACTION_PREFETCH,url:n,kind:null!=(e=null==t?void 0:t.kind)?e:a.PrefetchKind.FULL})})}},replace:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"replace",null==(n=t.scroll)||n)})},push:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"push",null==(n=t.scroll)||n)})},refresh:()=>{(0,u.startTransition)(()=>{U({type:a.ACTION_REFRESH,origin:window.location.origin})})},fastRefresh:()=>{throw Error("fastRefresh can only be used in development mode. Please use refresh instead.")}}),[U,G]);(0,u.useEffect)(()=>{window.next&&(window.next.router=z)},[z]),(0,u.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(w.pendingMpaPath=void 0,U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[U]);let{pushRef:B}=(0,s.useUnwrapState)(I);if(B.mpaNavigation){if(w.pendingMpaPath!==F){let e=window.location;B.pendingPush?e.assign(F):e.replace(F),w.pendingMpaPath=F}(0,u.use)(b.unresolvedThenable)}(0,u.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),n=e=>{var t;let n=window.location.href,r=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(null!=e?e:n,n),tree:r})})};window.history.pushState=function(t,r,o){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=A(t),o&&n(o)),e(t,r,o)},window.history.replaceState=function(e,r,o){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=A(e),o&&n(o)),t(e,r,o)};let r=e=>{let{state:t}=e;if(t){if(!t.__NA){window.location.reload();return}(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:t.__PRIVATE_NEXTJS_INTERNALS_TREE})})}};return window.addEventListener("popstate",r),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",r)}},[U]);let{cache:W,tree:K,nextUrl:V,focusAndScrollRef:Y}=(0,s.useUnwrapState)(I),X=(0,u.useMemo)(()=>(0,v.findHeadInCache)(W,K[1]),[W,K]),q=(0,u.useMemo)(()=>(function e(t,n){for(let r of(void 0===n&&(n={}),Object.values(t[1]))){let t=r[0],o=Array.isArray(t),u=o?t[1]:t;!u||u.startsWith(P.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?n[t[0]]=t[1].split("/"):o&&(n[t[0]]=t[1]),n=e(r,n))}return n})(K),[K]);if(null!==X){let[e,n]=X;t=(0,o.jsx)(N,{headCacheNode:e},n)}else t=null;let J=(0,o.jsxs)(_.RedirectBoundary,{children:[t,W.rsc,(0,o.jsx)(y.AppRouterAnnouncer,{tree:K})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{appRouterState:(0,s.useUnwrapState)(I),sync:k}),(0,o.jsx)(c.PathParamsContext.Provider,{value:q,children:(0,o.jsx)(c.PathnameContext.Provider,{value:H,children:(0,o.jsx)(c.SearchParamsContext.Provider,{value:L,children:(0,o.jsx)(l.GlobalLayoutRouterContext.Provider,{value:{buildId:n,changeByServerResponse:$,tree:K,focusAndScrollRef:Y,nextUrl:V},children:(0,o.jsx)(l.AppRouterContext.Provider,{value:z,children:(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{childNodes:W.parallelRoutes,tree:K,url:F,loading:W.loading},children:J})})})})})})]})}function I(e){let{globalErrorComponent:t,...n}=e;return(0,o.jsx)(f.ErrorBoundary,{errorComponent:t,children:(0,o.jsx)(D,{...n})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bailoutToClientRendering",{enumerable:!0,get:function(){return u}});let r=n(8993),o=n(1845);function u(e){let t=o.staticGenerationAsyncStorage.getStore();if((null==t||!t.forceStatic)&&(null==t?void 0:t.isStaticGeneration))throw new r.BailoutToCSRError(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let r=n(7437),o=n(4535);function u(e){let{Component:t,props:n}=e;return n.searchParams=(0,o.createDynamicallyTrackedSearchParams)(n.searchParams||{}),(0,r.jsx)(t,{...n})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ErrorBoundary:function(){return h},ErrorBoundaryHandler:function(){return f},GlobalError:function(){return d},default:function(){return p}});let r=n(7043),o=n(7437),u=r._(n(2265)),l=n(5475),a=n(9721),i=n(1845),c={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}};function s(e){let{error:t}=e,n=i.staticGenerationAsyncStorage.getStore();if((null==n?void 0:n.isRevalidate)||(null==n?void 0:n.isStaticGeneration))throw console.error(t),t;return null}class f extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,o.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function d(e){let{error:t}=e,n=null==t?void 0:t.digest;return(0,o.jsxs)("html",{id:"__next_error__",children:[(0,o.jsx)("head",{}),(0,o.jsxs)("body",{children:[(0,o.jsx)(s,{error:t}),(0,o.jsx)("div",{style:c.error,children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{style:c.text,children:"Application error: a "+(n?"server":"client")+"-side exception has occurred (see the "+(n?"server logs":"browser console")+" for more information)."}),n?(0,o.jsx)("p",{style:c.text,children:"Digest: "+n}):null]})})]})]})}let p=d;function h(e){let{errorComponent:t,errorStyles:n,errorScripts:r,children:u}=e,a=(0,l.usePathname)();return t?(0,o.jsx)(f,{pathname:a,errorComponent:t,errorStyles:n,errorScripts:r,children:u}):(0,o.jsx)(o.Fragment,{children:u})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6177:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DynamicServerError:function(){return r},isDynamicServerError:function(){return o}});let n="DYNAMIC_SERVER_USAGE";class r extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9721:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return u}});let r=n(8200),o=n(8968);function u(e){return e&&e.digest&&((0,o.isRedirectError)(e)||(0,r.isNotFoundError)(e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4707:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return S}});let r=n(7043),o=n(3099),u=n(7437),l=o._(n(2265)),a=r._(n(4887)),i=n(1956),c=n(4848),s=n(8137),f=n(1060),d=n(6015),p=n(7092),h=n(4123),y=n(80),_=n(3171),v=n(8505),b=n(8077),g=["bottom","height","left","right","top","width","x","y"];function m(e,t){let n=e.getBoundingClientRect();return n.top>=0&&n.top<=t}class R extends l.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){var n;if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,n)=>(0,d.matchSegment)(t,e[n]))))return;let r=null,o=e.hashFragment;if(o&&(r="top"===o?document.body:null!=(n=document.getElementById(o))?n:document.getElementsByName(o)[0]),r||(r="undefined"==typeof window?null:a.default.findDOMNode(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return g.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,p.handleSmoothScroll)(()=>{if(o){r.scrollIntoView();return}let e=document.documentElement,t=e.clientHeight;!m(r,t)&&(e.scrollTop=0,m(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function P(e){let{segmentPath:t,children:n}=e,r=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,u.jsx)(R,{segmentPath:t,focusAndScrollRef:r.focusAndScrollRef,children:n})}function j(e){let{parallelRouterKey:t,url:n,childNodes:r,segmentPath:o,tree:a,cacheKey:f}=e,p=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!p)throw Error("invariant global layout router not mounted");let{buildId:h,changeByServerResponse:y,tree:_}=p,v=r.get(f);if(void 0===v){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};v=e,r.set(f,e)}let g=null!==v.prefetchRsc?v.prefetchRsc:v.rsc,m=(0,l.useDeferredValue)(v.rsc,g),R="object"==typeof m&&null!==m&&"function"==typeof m.then?(0,l.use)(m):m;if(!R){let e=v.lazyData;if(null===e){let t=function e(t,n){if(t){let[r,o]=t,u=2===t.length;if((0,d.matchSegment)(n[0],r)&&n[1].hasOwnProperty(o)){if(u){let t=e(void 0,n[1][o]);return[n[0],{...n[1],[o]:[t[0],t[1],t[2],"refetch"]}]}return[n[0],{...n[1],[o]:e(t.slice(2),n[1][o])}]}}return n}(["",...o],_),r=(0,b.hasInterceptionRouteInCurrentTree)(_);v.lazyData=e=(0,c.fetchServerResponse)(new URL(n,location.origin),t,r?p.nextUrl:null,h),v.lazyDataResolved=!1}let t=(0,l.use)(e);v.lazyDataResolved||(setTimeout(()=>{(0,l.startTransition)(()=>{y({previousTree:_,serverResponse:t})})}),v.lazyDataResolved=!0),(0,l.use)(s.unresolvedThenable)}return(0,u.jsx)(i.LayoutRouterContext.Provider,{value:{tree:a[1][t],childNodes:v.parallelRoutes,url:n,loading:v.loading},children:R})}function O(e){let{children:t,hasLoading:n,loading:r,loadingStyles:o,loadingScripts:a}=e;return n?(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(u.Fragment,{children:[o,a,r]}),children:t}):(0,u.jsx)(u.Fragment,{children:t})}function S(e){let{parallelRouterKey:t,segmentPath:n,error:r,errorStyles:o,errorScripts:a,templateStyles:c,templateScripts:s,template:d,notFound:p,notFoundStyles:b}=e,g=(0,l.useContext)(i.LayoutRouterContext);if(!g)throw Error("invariant expected layout router to be mounted");let{childNodes:m,tree:R,url:S,loading:E}=g,w=m.get(t);w||(w=new Map,m.set(t,w));let T=R[1][t][0],M=(0,_.getSegmentValue)(T),x=[T];return(0,u.jsx)(u.Fragment,{children:x.map(e=>{let l=(0,_.getSegmentValue)(e),g=(0,v.createRouterCacheKey)(e);return(0,u.jsxs)(i.TemplateContext.Provider,{value:(0,u.jsx)(P,{segmentPath:n,children:(0,u.jsx)(f.ErrorBoundary,{errorComponent:r,errorStyles:o,errorScripts:a,children:(0,u.jsx)(O,{hasLoading:!!E,loading:null==E?void 0:E[0],loadingStyles:null==E?void 0:E[1],loadingScripts:null==E?void 0:E[2],children:(0,u.jsx)(y.NotFoundBoundary,{notFound:p,notFoundStyles:b,children:(0,u.jsx)(h.RedirectBoundary,{children:(0,u.jsx)(j,{parallelRouterKey:t,url:S,tree:R,childNodes:w,segmentPath:n,cacheKey:g,isActive:M===l})})})})})}),children:[c,s,d]},(0,v.createRouterCacheKey)(e,!0))})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6015:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{canSegmentBeOverridden:function(){return u},matchSegment:function(){return o}});let r=n(7417),o=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1],u=(e,t)=>{var n;return!Array.isArray(e)&&!!Array.isArray(t)&&(null==(n=(0,r.getSegmentParam)(e))?void 0:n.param)===t[0]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5475:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},useParams:function(){return p},usePathname:function(){return f},useRouter:function(){return d},useSearchParams:function(){return s},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return h},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let r=n(2265),o=n(1956),u=n(9060),l=n(3171),a=n(4541),i=n(2646),c=n(5501);function s(){let e=(0,r.useContext)(u.SearchParamsContext),t=(0,r.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e]);if("undefined"==typeof window){let{bailoutToClientRendering:e}=n(6149);e("useSearchParams()")}return t}function f(){return(0,r.useContext)(u.PathnameContext)}function d(){let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function p(){return(0,r.useContext)(u.PathParamsContext)}function h(e){void 0===e&&(e="children");let t=(0,r.useContext)(o.LayoutRouterContext);return t?function e(t,n,r,o){let u;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)u=t[1][n];else{var i;let e=t[1];u=null!=(i=e.children)?i:Object.values(e)[0]}if(!u)return o;let c=u[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?o:(o.push(s),e(u,n,!1,o))}(t.tree,e):null}function y(e){void 0===e&&(e="children");let t=h(e);if(!t||0===t.length)return null;let n="children"===e?t[0]:t[t.length-1];return n===a.DEFAULT_SEGMENT_KEY?null:n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return l},RedirectType:function(){return r.RedirectType},notFound:function(){return o.notFound},permanentRedirect:function(){return r.permanentRedirect},redirect:function(){return r.redirect}});let r=n(8968),o=n(8200);class u extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class l extends URLSearchParams{append(){throw new u}delete(){throw new u}set(){throw new u}sort(){throw new u}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NotFoundBoundary",{enumerable:!0,get:function(){return s}});let r=n(3099),o=n(7437),u=r._(n(2265)),l=n(5475),a=n(8200);n(1765);let i=n(1956);class c extends u.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isNotFoundError)(e))return{notFoundTriggered:!0};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.notFoundTriggered?{notFoundTriggered:!1,previousPathname:e.pathname}:{notFoundTriggered:t.notFoundTriggered,previousPathname:e.pathname}}render(){return this.state.notFoundTriggered?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,this.props.notFoundStyles,this.props.notFound]}):this.props.children}constructor(e){super(e),this.state={notFoundTriggered:!!e.asNotFound,previousPathname:e.pathname}}}function s(e){let{notFound:t,notFoundStyles:n,asNotFound:r,children:a}=e,s=(0,l.usePathname)(),f=(0,u.useContext)(i.MissingSlotContext);return t?(0,o.jsx)(c,{pathname:s,notFound:t,notFoundStyles:n,asNotFound:r,missingSlots:f,children:a}):(0,o.jsx)(o.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8200:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isNotFoundError:function(){return o},notFound:function(){return r}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let r=n(2522),o=n(675);var u=o._("_maxConcurrency"),l=o._("_runningCount"),a=o._("_queue"),i=o._("_processNext");class c{enqueue(e){let t,n;let o=new Promise((e,r)=>{t=e,n=r}),u=async()=>{try{r._(this,l)[l]++;let n=await e();t(n)}catch(e){n(e)}finally{r._(this,l)[l]--,r._(this,i)[i]()}};return r._(this,a)[a].push({promiseFn:o,task:u}),r._(this,i)[i](),o}bump(e){let t=r._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=r._(this,a)[a].splice(t,1)[0];r._(this,a)[a].unshift(e),r._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),r._(this,u)[u]=e,r._(this,l)[l]=0,r._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(r._(this,l)[l]0){var t;null==(t=r._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectBoundary:function(){return s},RedirectErrorBoundary:function(){return c}});let r=n(3099),o=n(7437),u=r._(n(2265)),l=n(5475),a=n(8968);function i(e){let{redirect:t,reset:n,redirectType:r}=e,o=(0,l.useRouter)();return(0,u.useEffect)(()=>{u.default.startTransition(()=>{r===a.RedirectType.push?o.push(t,{}):o.replace(t,{}),n()})},[t,r,n,o]),null}class c extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,o.jsx)(i,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function s(e){let{children:t}=e,n=(0,l.useRouter)();return(0,o.jsx)(c,{router:n,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5001:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}}),(r=n||(n={}))[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8968:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return c},getRedirectStatusCodeFromError:function(){return y},getRedirectTypeFromError:function(){return h},getURLFromRedirectError:function(){return p},isRedirectError:function(){return d},permanentRedirect:function(){return f},redirect:function(){return s}});let u=n(544),l=n(295),a=n(5001),i="NEXT_REDIRECT";function c(e,t,n){void 0===n&&(n=a.RedirectStatusCode.TemporaryRedirect);let r=Error(i);r.digest=i+";"+t+";"+e+";"+n+";";let o=u.requestAsyncStorage.getStore();return o&&(r.mutableCookies=o.mutableCookies),r}function s(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function f(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function d(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,n,r,o]=e.digest.split(";",4),u=Number(o);return t===i&&("replace"===n||"push"===n)&&"string"==typeof r&&!isNaN(u)&&u in a.RedirectStatusCode}function p(e){return d(e)?e.digest.split(";",3)[2]:null}function h(e){if(!d(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function y(e){if(!d(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(3099),o=n(7437),u=r._(n(2265)),l=n(1956);function a(){let e=(0,u.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},544:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getExpectedRequestStore:function(){return o},requestAsyncStorage:function(){return r.requestAsyncStorage}});let r=n(9134);function o(e){let t=r.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2356:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return u}});let r=n(7420),o=n(2576);function u(e,t,n,u){let[l,a,i]=n.slice(-3);if(null===a)return!1;if(3===n.length){let n=a[2],o=a[3];t.loading=o,t.rsc=n,t.prefetchRsc=null,(0,r.fillLazyItemsTillLeafWithHead)(t,e,l,a,i,u)}else t.rsc=e.rsc,t.prefetchRsc=e.prefetchRsc,t.parallelRoutes=new Map(e.parallelRoutes),t.loading=e.loading,(0,o.fillCacheWithNewSubTreeData)(t,e,n,u);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,n,r,a){let i;let[c,s,f,d,p]=n;if(1===t.length){let e=l(n,r,t);return(0,u.addRefreshMarkerToActiveParallelSegments)(e,a),e}let[h,y]=t;if(!(0,o.matchSegment)(h,c))return null;if(2===t.length)i=l(s[y],r,t);else if(null===(i=e(t.slice(2),s[y],r,a)))return null;let _=[t[0],{...s,[y]:i},f,d];return p&&(_[4]=!0),(0,u.addRefreshMarkerToActiveParallelSegments)(_,a),_}}});let r=n(4541),o=n(6015),u=n(232);function l(e,t,n){let[u,a]=e,[i,c]=t;if(i===r.DEFAULT_SEGMENT_KEY&&u!==r.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(u,i)){let t={};for(let e in a)void 0!==c[e]?t[e]=l(a[e],c[e],n):t[e]=a[e];for(let e in c)t[e]||(t[e]=c[e]);let r=[u,t];return e[2]&&(r[2]=e[2]),e[3]&&(r[3]=e[3]),e[4]&&(r[4]=e[4]),r}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5556:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l),s=t.parallelRoutes.get(l);s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s));let f=null==c?void 0:c.get(i),d=s.get(i);if(u){d&&d.lazyData&&d!==f||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}if(!d||!f){d||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}return d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved,loading:d.loading},s.set(i,d)),e(d,f,o.slice(2))}}});let r=n(8505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5410:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{computeChangedPath:function(){return s},extractPathFromFlightRouterState:function(){return c}});let r=n(1182),o=n(4541),u=n(6015),l=e=>"/"===e[0]?e.slice(1):e,a=e=>"string"==typeof e?"children"===e?"":e:e[1];function i(e){return e.reduce((e,t)=>""===(t=l(t))||(0,o.isGroupSegment)(t)?e:e+"/"+t,"")||"/"}function c(e){var t;let n=Array.isArray(e[0])?e[0][1]:e[0];if(n===o.DEFAULT_SEGMENT_KEY||r.INTERCEPTION_ROUTE_MARKERS.some(e=>n.startsWith(e)))return;if(n.startsWith(o.PAGE_SEGMENT_KEY))return"";let u=[a(n)],l=null!=(t=e[1])?t:{},s=l.children?c(l.children):void 0;if(void 0!==s)u.push(s);else for(let[e,t]of Object.entries(l)){if("children"===e)continue;let n=c(t);void 0!==n&&u.push(n)}return i(u)}function s(e,t){let n=function e(t,n){let[o,l]=t,[i,s]=n,f=a(o),d=a(i);if(r.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,u.matchSegment)(o,i)){var p;return null!=(p=c(n))?p:""}for(let t in l)if(s[t]){let n=e(l[t],s[t]);if(null!==n)return a(i)+"/"+n}return null}(e,t);return null==n||"/"===n?n:i(n.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3456:function(e,t){"use strict";function n(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2952:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return c}});let r=n(3456),o=n(7420),u=n(5410),l=n(305),a=n(4673),i=n(232);function c(e){var t;let{buildId:n,initialTree:c,initialSeedData:s,urlParts:f,initialParallelRoutes:d,location:p,initialHead:h,couldBeIntercepted:y}=e,_=f.join("/"),v=!p,b={lazyData:null,rsc:s[2],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:v?new Map:d,lazyDataResolved:!1,loading:s[3]},g=p?(0,r.createHrefFromUrl)(p):_;(0,i.addRefreshMarkerToActiveParallelSegments)(c,g);let m=new Map;(null===d||0===d.size)&&(0,o.fillLazyItemsTillLeafWithHead)(b,void 0,c,s,h);let R={buildId:n,tree:c,cache:b,prefetchCache:m,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:g,nextUrl:null!=(t=(0,u.extractPathFromFlightRouterState)(c)||(null==p?void 0:p.pathname))?t:null};if(p){let e=new URL(""+p.pathname+p.search,p.origin),t=[["",c,null,null]];(0,l.createPrefetchCacheEntryForInitialLoad)({url:e,kind:a.PrefetchKind.AUTO,data:[t,void 0,!1,y],tree:R.tree,prefetchCache:R.prefetchCache,nextUrl:R.nextUrl})}return R}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return o}});let r=n(4541);function o(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(r.PAGE_SEGMENT_KEY)?r.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fetchServerResponse",{enumerable:!0,get:function(){return s}});let r=n(6866),o=n(2846),u=n(3079),l=n(4673),a=n(7207),{createFromFetch:i}=n(6671);function c(e){return[(0,o.urlToUrlWithoutFlightMarker)(e).toString(),void 0,!1,!1]}async function s(e,t,n,s,f){let d={[r.RSC_HEADER]:"1",[r.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(t))};f===l.PrefetchKind.AUTO&&(d[r.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(d[r.NEXT_URL]=n);let p=(0,a.hexHash)([d[r.NEXT_ROUTER_PREFETCH_HEADER]||"0",d[r.NEXT_ROUTER_STATE_TREE],d[r.NEXT_URL]].join(","));try{var h;let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="index.txt":t.pathname+=".txt",t.searchParams.set(r.NEXT_RSC_UNION_QUERY,p);let n=await fetch(t,{credentials:"same-origin",headers:d}),l=(0,o.urlToUrlWithoutFlightMarker)(n.url),a=n.redirected?l:void 0,f=n.headers.get("content-type")||"",y=!!n.headers.get(r.NEXT_DID_POSTPONE_HEADER),_=!!(null==(h=n.headers.get("vary"))?void 0:h.includes(r.NEXT_URL)),v=f===r.RSC_CONTENT_TYPE_HEADER;if(v||(v=f.startsWith("text/plain")),!v||!n.ok)return e.hash&&(l.hash=e.hash),c(l.toString());let[b,g]=await i(Promise.resolve(n),{callServer:u.callServer});if(s!==b)return c(n.url);return[g,a,y,_]}catch(t){return console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),[e.toString(),void 0,!1,!1]}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithNewSubTreeData",{enumerable:!0,get:function(){return function e(t,n,l,a){let i=l.length<=5,[c,s]=l,f=(0,u.createRouterCacheKey)(s),d=n.parallelRoutes.get(c);if(!d)return;let p=t.parallelRoutes.get(c);p&&p!==d||(p=new Map(d),t.parallelRoutes.set(c,p));let h=d.get(f),y=p.get(f);if(i){if(!y||!y.lazyData||y===h){let e=l[3];y={lazyData:null,rsc:e[2],prefetchRsc:null,head:null,prefetchHead:null,loading:e[3],parallelRoutes:h?new Map(h.parallelRoutes):new Map,lazyDataResolved:!1},h&&(0,r.invalidateCacheByRouterState)(y,h,l[2]),(0,o.fillLazyItemsTillLeafWithHead)(y,h,l[2],e,l[4],a),p.set(f,y)}return}y&&h&&(y===h&&(y={lazyData:y.lazyData,rsc:y.rsc,prefetchRsc:y.prefetchRsc,head:y.head,prefetchHead:y.prefetchHead,parallelRoutes:new Map(y.parallelRoutes),lazyDataResolved:!1,loading:y.loading},p.set(f,y)),e(y,h,l.slice(2),a))}}});let r=n(4377),o=n(7420),u=n(8505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,n,u,l,a,i){if(0===Object.keys(u[1]).length){t.head=a;return}for(let c in u[1]){let s;let f=u[1][c],d=f[0],p=(0,r.createRouterCacheKey)(d),h=null!==l&&void 0!==l[1][c]?l[1][c]:null;if(n){let r=n.parallelRoutes.get(c);if(r){let n;let u=(null==i?void 0:i.kind)==="auto"&&i.status===o.PrefetchCacheEntryStatus.reusable,l=new Map(r),s=l.get(p);n=null!==h?{lazyData:null,rsc:h[2],prefetchRsc:null,head:null,prefetchHead:null,loading:h[3],parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1}:u&&s?{lazyData:s.lazyData,rsc:s.rsc,prefetchRsc:s.prefetchRsc,head:s.head,prefetchHead:s.prefetchHead,parallelRoutes:new Map(s.parallelRoutes),lazyDataResolved:s.lazyDataResolved,loading:s.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1,loading:null},l.set(p,n),e(n,s,f,h||null,a,i),t.parallelRoutes.set(c,l);continue}}if(null!==h){let e=h[2],t=h[3];s={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:t}}else s={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};let y=t.parallelRoutes.get(c);y?y.set(p,s):t.parallelRoutes.set(c,new Map([[p,s]])),e(s,void 0,f,h,a,i)}}}});let r=n(8505),o=n(4673);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4510:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return u}});let r=n(5410);function o(e){return void 0!==e}function u(e,t){var n,u,l;let a=null==(u=t.shouldScroll)||u,i=e.nextUrl;if(o(t.patchedTree)){let n=(0,r.computeChangedPath)(e.tree,t.patchedTree);n?i=n:i||(i=e.canonicalUrl)}return{buildId:e.buildId,canonicalUrl:o(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:o(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:o(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:o(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!a&&(!!o(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:!!t.hashFragment&&e.canonicalUrl.split("#",1)[0]===(null==(n=t.canonicalUrl)?void 0:n.split("#",1)[0]),hashFragment:a?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:a?null!=(l=null==t?void 0:t.scrollableSegments)?l:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:o(t.patchedTree)?t.patchedTree:e.tree,nextUrl:i}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7831:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return o}});let r=n(5967);function o(e,t,n){return(0,r.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l);if(!c)return;let s=t.parallelRoutes.get(l);if(s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s)),u){s.delete(i);return}let f=c.get(i),d=s.get(i);d&&f&&(d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved},s.set(i,d)),e(d,f,o.slice(2)))}}});let r=n(8505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4377:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return o}});let r=n(8505);function o(e,t,n){for(let o in n[1]){let u=n[1][o][0],l=(0,r.createRouterCacheKey)(u),a=t.parallelRoutes.get(o);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(o,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3237:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,n){let r=t[0],o=n[0];if(Array.isArray(r)&&Array.isArray(o)){if(r[0]!==o[0]||r[2]!==o[2])return!0}else if(r!==o)return!0;if(t[4])return!n[4];if(n[4])return!0;let u=Object.values(t[1])[0],l=Object.values(n[1])[0];return!u||!l||e(u,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{abortTask:function(){return c},listenForDynamicRequest:function(){return a},updateCacheNodeOnNavigation:function(){return function e(t,n,a,c,s){let f=n[1],d=a[1],p=c[1],h=t.parallelRoutes,y=new Map(h),_={},v=null;for(let t in d){let n;let a=d[t],c=f[t],b=h.get(t),g=p[t],m=a[0],R=(0,u.createRouterCacheKey)(m),P=void 0!==c?c[0]:void 0,j=void 0!==b?b.get(R):void 0;if(null!==(n=m===r.PAGE_SEGMENT_KEY?l(a,void 0!==g?g:null,s):m===r.DEFAULT_SEGMENT_KEY?void 0!==c?{route:c,node:null,children:null}:l(a,void 0!==g?g:null,s):void 0!==P&&(0,o.matchSegment)(m,P)&&void 0!==j&&void 0!==c?null!=g?e(j,c,a,g,s):function(e){let t=i(e,null,null);return{route:e,node:t,children:null}}(a):l(a,void 0!==g?g:null,s))){null===v&&(v=new Map),v.set(t,n);let e=n.node;if(null!==e){let n=new Map(b);n.set(R,e),y.set(t,n)}_[t]=n.route}else _[t]=a}if(null===v)return null;let b={lazyData:null,rsc:t.rsc,prefetchRsc:t.prefetchRsc,head:t.head,prefetchHead:t.prefetchHead,loading:t.loading,parallelRoutes:y,lazyDataResolved:!1};return{route:function(e,t){let n=[e[0],t];return 2 in e&&(n[2]=e[2]),3 in e&&(n[3]=e[3]),4 in e&&(n[4]=e[4]),n}(a,_),node:b,children:v}}},updateCacheNodeOnPopstateRestoration:function(){return function e(t,n){let r=n[1],o=t.parallelRoutes,l=new Map(o);for(let t in r){let n=r[t],a=n[0],i=(0,u.createRouterCacheKey)(a),c=o.get(t);if(void 0!==c){let r=c.get(i);if(void 0!==r){let o=e(r,n),u=new Map(c);u.set(i,o),l.set(t,u)}}}let a=t.rsc,i=d(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:null,prefetchRsc:i?t.prefetchRsc:null,loading:i?t.loading:null,parallelRoutes:l,lazyDataResolved:!1}}}});let r=n(4541),o=n(6015),u=n(8505);function l(e,t,n){let r=i(e,t,n);return{route:e,node:r,children:null}}function a(e,t){t.then(t=>{for(let n of t[0]){let t=n.slice(0,-3),r=n[n.length-3],l=n[n.length-2],a=n[n.length-1];"string"!=typeof t&&function(e,t,n,r,l){let a=e;for(let e=0;e{c(e,t)})}function i(e,t,n){let r=e[1],o=null!==t?t[1]:null,l=new Map;for(let e in r){let t=r[e],a=null!==o?o[e]:null,c=t[0],s=(0,u.createRouterCacheKey)(c),f=i(t,void 0===a?null:a,n),d=new Map;d.set(s,f),l.set(e,d)}let a=0===l.size,c=null!==t?t[2]:null,s=null!==t?t[3]:null;return{lazyData:null,parallelRoutes:l,prefetchRsc:void 0!==c?c:null,prefetchHead:a?n:null,loading:void 0!==s?s:null,rsc:p(),head:a?p():null,lazyDataResolved:!1}}function c(e,t){let n=e.node;if(null===n)return;let r=e.children;if(null===r)s(e.route,n,t);else for(let e of r.values())c(e,t);e.node=null}function s(e,t,n){let r=e[1],o=t.parallelRoutes;for(let e in r){let t=r[e],l=o.get(e);if(void 0===l)continue;let a=t[0],i=(0,u.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&s(t,c,n)}let l=t.rsc;d(l)&&(null===n?l.resolve(null):l.reject(n));let a=t.head;d(a)&&a.resolve(null)}let f=Symbol();function d(e){return e&&e.tag===f}function p(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.status="pending",n.resolve=t=>{"pending"===n.status&&(n.status="fulfilled",n.value=t,e(t))},n.reject=e=>{"pending"===n.status&&(n.status="rejected",n.reason=e,t(e))},n.tag=f,n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},305:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createPrefetchCacheEntryForInitialLoad:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let r=n(3456),o=n(4848),u=n(4673),l=n(4819);function a(e,t){let n=(0,r.createHrefFromUrl)(e,!1);return t?t+"%"+n:n}function i(e){let t,{url:n,nextUrl:r,tree:o,buildId:l,prefetchCache:i,kind:c}=e,f=a(n,r),d=i.get(f);if(d)t=d;else{let e=a(n),r=i.get(e);r&&(t=r)}return t?(t.status=h(t),t.kind!==u.PrefetchKind.FULL&&c===u.PrefetchKind.FULL)?s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:null!=c?c:u.PrefetchKind.TEMPORARY}):(c&&t.kind===u.PrefetchKind.TEMPORARY&&(t.kind=c),t):s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:c||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:n,prefetchCache:r,url:o,kind:l,data:i}=e,[,,,c]=i,s=c?a(o,t):a(o),f={treeAtTimeOfPrefetch:n,data:Promise.resolve(i),kind:l,prefetchTime:Date.now(),lastUsedTime:Date.now(),key:s,status:u.PrefetchCacheEntryStatus.fresh};return r.set(s,f),f}function s(e){let{url:t,kind:n,tree:r,nextUrl:i,buildId:c,prefetchCache:s}=e,f=a(t),d=l.prefetchQueue.enqueue(()=>(0,o.fetchServerResponse)(t,r,i,c,n).then(e=>{let[,,,n]=e;return n&&function(e){let{url:t,nextUrl:n,prefetchCache:r}=e,o=a(t),u=r.get(o);if(!u)return;let l=a(t,n);r.set(l,u),r.delete(o)}({url:t,nextUrl:i,prefetchCache:s}),e})),p={treeAtTimeOfPrefetch:r,data:d,kind:n,prefetchTime:Date.now(),lastUsedTime:null,key:f,status:u.PrefetchCacheEntryStatus.fresh};return s.set(f,p),p}function f(e){for(let[t,n]of e)h(n)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("30"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:n,lastUsedTime:r}=e;return Date.now()<(null!=r?r:n)+d?r?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:"auto"===t&&Date.now(){let[n,f]=t,h=!1;if(S.lastUsedTime||(S.lastUsedTime=Date.now(),h=!0),"string"==typeof n)return _(e,R,n,O);if(document.getElementById("__next-page-redirect"))return _(e,R,j,O);let b=e.tree,g=e.cache,w=[];for(let t of n){let n=t.slice(0,-4),r=t.slice(-3)[0],c=["",...n],f=(0,u.applyRouterStatePatchToTree)(c,b,r,j);if(null===f&&(f=(0,u.applyRouterStatePatchToTree)(c,E,r,j)),null!==f){if((0,a.isNavigatingToNewRootLayout)(b,f))return _(e,R,j,O);let u=(0,d.createEmptyCacheNode)(),m=!1;for(let e of(S.status!==i.PrefetchCacheEntryStatus.stale||h?m=(0,s.applyFlightData)(g,u,t,S):(m=function(e,t,n,r){let o=!1;for(let u of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),v(r).map(e=>[...n,...e])))(0,y.clearCacheNodeDataForSegmentPath)(e,t,u),o=!0;return o}(u,g,n,r),S.lastUsedTime=Date.now()),(0,l.shouldHardNavigate)(c,b)?(u.rsc=g.rsc,u.prefetchRsc=g.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(u,g,n),R.cache=u):m&&(R.cache=u,g=u),b=f,v(r))){let t=[...n,...e];t[t.length-1]!==p.DEFAULT_SEGMENT_KEY&&w.push(t)}}}return R.patchedTree=b,R.canonicalUrl=f?(0,r.createHrefFromUrl)(f):j,R.pendingPush=O,R.scrollableSegments=w,R.hashFragment=P,R.shouldScroll=m,(0,c.handleMutable)(e,R)},()=>e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4819:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{prefetchQueue:function(){return l},prefetchReducer:function(){return a}});let r=n(6866),o=n(9744),u=n(305),l=new o.PromiseQueue(5);function a(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:n}=t;return n.searchParams.delete(r.NEXT_RSC_UNION_QUERY),(0,u.getOrCreatePrefetchCacheEntry)({url:n,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,buildId:e.buildId}),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9601:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let r=n(4848),o=n(3456),u=n(1935),l=n(3237),a=n(5967),i=n(4510),c=n(7420),s=n(2846),f=n(7831),d=n(8077),p=n(232);function h(e,t){let{origin:n}=t,h={},y=e.canonicalUrl,_=e.tree;h.preserveCustomHistoryState=!1;let v=(0,s.createEmptyCacheNode)(),b=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);return v.lazyData=(0,r.fetchServerResponse)(new URL(y,n),[_[0],_[1],_[2],"refetch"],b?e.nextUrl:null,e.buildId),v.lazyData.then(async n=>{let[r,s]=n;if("string"==typeof r)return(0,a.handleExternalUrl)(e,h,r,e.pushRef.pendingPush);for(let n of(v.lazyData=null,r)){if(3!==n.length)return console.log("REFRESH FAILED"),e;let[r]=n,i=(0,u.applyRouterStatePatchToTree)([""],_,r,e.canonicalUrl);if(null===i)return(0,f.handleSegmentMismatch)(e,t,r);if((0,l.isNavigatingToNewRootLayout)(_,i))return(0,a.handleExternalUrl)(e,h,y,e.pushRef.pendingPush);let d=s?(0,o.createHrefFromUrl)(s):void 0;s&&(h.canonicalUrl=d);let[g,m]=n.slice(-2);if(null!==g){let e=g[2];v.rsc=e,v.prefetchRsc=null,(0,c.fillLazyItemsTillLeafWithHead)(v,void 0,r,g,m),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({state:e,updatedTree:i,updatedCache:v,includeNextUrl:b,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=v,h.patchedTree=i,h.canonicalUrl=y,_=i}return(0,i.handleMutable)(e,h)},()=>e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return u}});let r=n(3456),o=n(5410);function u(e,t){var n;let{url:u,tree:l}=t,a=(0,r.createHrefFromUrl)(u),i=l||e.tree,c=e.cache;return{buildId:e.buildId,canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(n=(0,o.extractPathFromFlightRouterState)(i))?n:u.pathname}}n(6118),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3722:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return g}});let r=n(3079),o=n(6866),u=n(1634),l=n(3456),a=n(5967),i=n(1935),c=n(3237),s=n(4510),f=n(7420),d=n(2846),p=n(8077),h=n(7831),y=n(232),{createFromFetch:_,encodeReply:v}=n(6671);async function b(e,t,n){let l,{actionId:a,actionArgs:i}=n,c=await v(i),s=await fetch("",{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION]:a,[o.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(e.tree)),...t?{[o.NEXT_URL]:t}:{}},body:c}),f=s.headers.get("x-action-redirect");try{let e=JSON.parse(s.headers.get("x-action-revalidated")||"[[],0,0]");l={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){l={paths:[],tag:!1,cookie:!1}}let d=f?new URL((0,u.addBasePath)(f),new URL(e.canonicalUrl,window.location.href)):void 0;if(s.headers.get("content-type")===o.RSC_CONTENT_TYPE_HEADER){let e=await _(Promise.resolve(s),{callServer:r.callServer});if(f){let[,t]=null!=e?e:[];return{actionFlightData:t,redirectLocation:d,revalidatedParts:l}}let[t,[,n]]=null!=e?e:[];return{actionResult:t,actionFlightData:n,redirectLocation:d,revalidatedParts:l}}return{redirectLocation:d,revalidatedParts:l}}function g(e,t){let{resolve:n,reject:r}=t,o={},u=e.canonicalUrl,_=e.tree;o.preserveCustomHistoryState=!1;let v=e.nextUrl&&(0,p.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null;return o.inFlightServerAction=b(e,v,t),o.inFlightServerAction.then(async r=>{let{actionResult:p,actionFlightData:b,redirectLocation:g}=r;if(g&&(e.pushRef.pendingPush=!0,o.pendingPush=!0),!b)return(n(p),g)?(0,a.handleExternalUrl)(e,o,g.href,e.pushRef.pendingPush):e;if("string"==typeof b)return(0,a.handleExternalUrl)(e,o,b,e.pushRef.pendingPush);if(o.inFlightServerAction=null,g){let e=(0,l.createHrefFromUrl)(g,!1);o.canonicalUrl=e}for(let n of b){if(3!==n.length)return console.log("SERVER ACTION APPLY FAILED"),e;let[r]=n,s=(0,i.applyRouterStatePatchToTree)([""],_,r,g?(0,l.createHrefFromUrl)(g):e.canonicalUrl);if(null===s)return(0,h.handleSegmentMismatch)(e,t,r);if((0,c.isNavigatingToNewRootLayout)(_,s))return(0,a.handleExternalUrl)(e,o,u,e.pushRef.pendingPush);let[p,b]=n.slice(-2),m=null!==p?p[2]:null;if(null!==m){let t=(0,d.createEmptyCacheNode)();t.rsc=m,t.prefetchRsc=null,(0,f.fillLazyItemsTillLeafWithHead)(t,void 0,r,p,b),await (0,y.refreshInactiveParallelSegments)({state:e,updatedTree:s,updatedCache:t,includeNextUrl:!!v,canonicalUrl:o.canonicalUrl||e.canonicalUrl}),o.cache=t,o.prefetchCache=new Map}o.patchedTree=s,_=s}return n(p),(0,s.handleMutable)(e,o)},t=>(r(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return f}});let r=n(3456),o=n(1935),u=n(3237),l=n(5967),a=n(2356),i=n(4510),c=n(2846),s=n(7831);function f(e,t){let{serverResponse:n}=t,[f,d]=n,p={};if(p.preserveCustomHistoryState=!1,"string"==typeof f)return(0,l.handleExternalUrl)(e,p,f,e.pushRef.pendingPush);let h=e.tree,y=e.cache;for(let n of f){let i=n.slice(0,-4),[f]=n.slice(-3,-2),_=(0,o.applyRouterStatePatchToTree)(["",...i],h,f,e.canonicalUrl);if(null===_)return(0,s.handleSegmentMismatch)(e,t,f);if((0,u.isNavigatingToNewRootLayout)(h,_))return(0,l.handleExternalUrl)(e,p,e.canonicalUrl,e.pushRef.pendingPush);let v=d?(0,r.createHrefFromUrl)(d):void 0;v&&(p.canonicalUrl=v);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(y,b,n),p.patchedTree=_,p.cache=b,y=b,h=_}return(0,i.handleMutable)(e,p)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},232:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,n){let[r,o,,l]=t;for(let a in r.includes(u.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=n,t[3]="refresh"),o)e(o[a],n)}},refreshInactiveParallelSegments:function(){return l}});let r=n(2356),o=n(4848),u=n(4541);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{state:t,updatedTree:n,updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c=n,canonicalUrl:s}=e,[,f,d,p]=n,h=[];if(d&&d!==s&&"refresh"===p&&!i.has(d)){i.add(d);let e=(0,o.fetchServerResponse)(new URL(d,location.origin),[c[0],c[1],c[2],"refetch"],l?t.nextUrl:null,t.buildId).then(e=>{let t=e[0];if("string"!=typeof t)for(let e of t)(0,r.applyFlightData)(u,u,e)});h.push(e)}for(let e in f){let n=a({state:t,updatedTree:f[e],updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c,canonicalUrl:s});h.push(n)}await Promise.all(h)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4673:function(e,t){"use strict";var n,r,o,u;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_FAST_REFRESH:function(){return f},ACTION_NAVIGATE:function(){return a},ACTION_PREFETCH:function(){return s},ACTION_REFRESH:function(){return l},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return c},PrefetchCacheEntryStatus:function(){return r},PrefetchKind:function(){return n},isThenable:function(){return p}});let l="refresh",a="navigate",i="restore",c="server-patch",s="prefetch",f="fast-refresh",d="server-action";function p(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}(o=n||(n={})).AUTO="auto",o.FULL="full",o.TEMPORARY="temporary",(u=r||(r={})).fresh="fresh",u.reusable="reusable",u.expired="expired",u.stale="stale",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1450:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let r=n(4673),o=n(5967),u=n(8448),l=n(7784),a=n(9601),i=n(4819),c=n(4529),s=n(3722),f="undefined"==typeof window?function(e,t){return e}:function(e,t){switch(t.type){case r.ACTION_NAVIGATE:return(0,o.navigateReducer)(e,t);case r.ACTION_SERVER_PATCH:return(0,u.serverPatchReducer)(e,t);case r.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case r.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case r.ACTION_FAST_REFRESH:return(0,c.fastRefreshReducer)(e,t);case r.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case r.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Error("Unknown action")}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3728:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,n){let[o,u]=n,[l,a]=t;return(0,r.matchSegment)(l,o)?!(t.length<=2)&&e(t.slice(2),u[a]):!!Array.isArray(l)}}});let r=n(6015);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createDynamicallyTrackedSearchParams:function(){return a},createUntrackedSearchParams:function(){return l}});let r=n(1845),o=n(6999),u=n(650);function l(e){let t=r.staticGenerationAsyncStorage.getStore();return t&&t.forceStatic?{}:e}function a(e){let t=r.staticGenerationAsyncStorage.getStore();return t?t.forceStatic?{}:t.isStaticGeneration||t.dynamicShouldError?new Proxy({},{get:(e,n,r)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),u.ReflectAdapter.get(e,n,r)),has:(e,n)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),Reflect.has(e,n)),ownKeys:e=>((0,o.trackDynamicDataAccessed)(t,"searchParams"),Reflect.ownKeys(e))}):e:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r.staticGenerationAsyncStorage}});let r=n(30);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6864:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{StaticGenBailoutError:function(){return r},isStaticGenBailoutError:function(){return o}});let n="NEXT_STATIC_GEN_BAILOUT";class r extends Error{constructor(...e){super(...e),this.code=n}}function o(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8137:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return n}});let n={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{useReducerWithReduxDevtools:function(){return i},useUnwrapState:function(){return a}});let r=n(3099)._(n(2265)),o=n(4673),u=n(2103);function l(e){if(e instanceof Map){let t={};for(let[n,r]of e.entries()){if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r._bundlerConfig){t[n]="FlightData";continue}}t[n]=l(r)}return t}if("object"==typeof e&&null!==e){let t={};for(let n in e){let r=e[n];if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r.hasOwnProperty("_bundlerConfig")){t[n]="FlightData";continue}}t[n]=l(r)}return t}return Array.isArray(e)?e.map(l):e}function a(e){return(0,o.isThenable)(e)?(0,r.use)(e):e}let i="undefined"!=typeof window?function(e){let[t,n]=r.default.useState(e),o=(0,r.useContext)(u.ActionQueueContext);if(!o)throw Error("Invariant: Missing ActionQueueContext");let a=(0,r.useRef)(),i=(0,r.useRef)();return(0,r.useEffect)(()=>{if(!a.current&&!1!==i.current){if(void 0===i.current&&void 0===window.__REDUX_DEVTOOLS_EXTENSION__){i.current=!1;return}return a.current=window.__REDUX_DEVTOOLS_EXTENSION__.connect({instanceId:8e3,name:"next-router"}),a.current&&(a.current.init(l(e)),o&&(o.devToolsInstance=a.current)),()=>{a.current=void 0}}},[e,o]),[t,(0,r.useCallback)(t=>{o.state||(o.state=e),o.dispatch(t,n)},[o,e]),(0,r.useCallback)(e=>{a.current&&a.current.send({type:"RENDER_SYNC"},l(e))},[])]}:function(e){return[e,()=>{},()=>{}]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1283:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});let r=n(580);function o(e){return(0,r.pathHasPrefix)(e,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8521:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return u}});let r=n(6674),o=n(3381),u=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:n,hash:u}=(0,o.parsePath)(e);return/\.[^/]+\/?$/.test(t)?""+(0,r.removeTrailingSlash)(t)+n+u:t.endsWith("/")?""+t+n+u:t+"/"+n+u};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(8993);function o(e){let t="function"==typeof reportError?reportError:e=>{window.console.error(e)};(0,r.isBailoutToCSRError)(e)||t(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5076:function(e,t,n){"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return r}}),n(1283),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2010:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0>>1,o=e[r];if(0>>1;ru(i,n))cu(s,i)?(e[r]=s,e[c]=n,r=c):(e[r]=i,e[a]=n,r=a);else if(cu(s,n))e[r]=s,e[c]=n,r=c;else break}}return t}function u(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,y=!1,_=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=r(f);null!==t;){if(null===t.callback)o(f);else if(t.startTime<=e)o(f),t.sortIndex=t.expirationTime,n(s,t);else break;t=r(f)}}function P(e){if(v=!1,R(e),!_){if(null!==r(s))_=!0,C();else{var t=r(f);null!==t&&A(P,t.startTime-e)}}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var j=!1,O=-1,S=5,E=-1;function w(){return!(t.unstable_now()-Ee&&w());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),n=!0;break t}p===r(s)&&o(s),R(e)}else o(s);p=r(s)}if(null!==p)n=!0;else{var c=r(f);null!==c&&A(P,c.startTime-e),n=!1}}break e}finally{p=null,h=u,y=!1}n=void 0}}finally{n?l():j=!1}}}if("function"==typeof m)l=function(){m(T)};else if("undefined"!=typeof MessageChannel){var M=new MessageChannel,x=M.port2;M.port1.onmessage=T,l=function(){x.postMessage(null)}}else l=function(){b(T,0)};function C(){j||(j=!0,l())}function A(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||y||(_=!0,C())},t.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=u,n(f,e),null===r(s)&&e===r(f)&&(v?(g(O),O=-1):v=!0,A(P,u-l))):(e.sortIndex=a,n(s,e),_||y||(_=!0,C())),e},t.unstable_shouldYield=w,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},1767:function(e,t,n){"use strict";e.exports=n(2010)},934:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getPathname:function(){return r},isFullStringUrl:function(){return o},parseUrl:function(){return u}});let n="http://n";function r(e){return new URL(e,n).pathname}function o(e){return/https?:\/\//.test(e)}function u(e){let t;try{t=new URL(e,n)}catch{}return t}},6999:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{Postpone:function(){return d},createPostponedAbortSignal:function(){return b},createPrerenderState:function(){return c},formatDynamicAPIAccesses:function(){return _},markCurrentScopeAsDynamic:function(){return s},trackDynamicDataAccessed:function(){return f},trackDynamicFetch:function(){return p},usedDynamicAPIs:function(){return y}});let o=(r=n(2265))&&r.__esModule?r:{default:r},u=n(6177),l=n(6864),a=n(934),i="function"==typeof o.default.unstable_postpone;function c(e){return{isDebugSkeleton:e,dynamicAccesses:[]}}function s(e,t){let n=(0,a.getPathname)(e.urlPathname);if(!e.isUnstableCacheCallback){if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}}function f(e,t){let n=(0,a.getPathname)(e.urlPathname);if(e.isUnstableCacheCallback)throw Error(`Route ${n} used "${t}" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "${t}" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}function d({reason:e,prerenderState:t,pathname:n}){h(t,e,n)}function p(e,t){e.prerenderState&&h(e.prerenderState,t,e.urlPathname)}function h(e,t,n){v();let r=`Route ${n} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;e.dynamicAccesses.push({stack:e.isDebugSkeleton?Error().stack:void 0,expression:t}),o.default.unstable_postpone(r)}function y(e){return e.dynamicAccesses.length>0}function _(e){return e.dynamicAccesses.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" ()")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}: -${t}`))}function v(){if(!i)throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js")}function b(e){v();let t=new AbortController;try{o.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}},7417:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentParam",{enumerable:!0,get:function(){return o}});let r=n(1182);function o(e){let t=r.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith("[[...")&&e.endsWith("]]"))?{type:"optional-catchall",param:e.slice(5,-2)}:e.startsWith("[...")&&e.endsWith("]")?{type:t?"catchall-intercepted":"catchall",param:e.slice(4,-1)}:e.startsWith("[")&&e.endsWith("]")?{type:t?"dynamic-intercepted":"dynamic",param:e.slice(1,-1)}:null}},647:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HMR_ACTIONS_SENT_TO_BROWSER",{enumerable:!0,get:function(){return n}}),(r=n||(n={})).ADDED_PAGE="addedPage",r.REMOVED_PAGE="removedPage",r.RELOAD_PAGE="reloadPage",r.SERVER_COMPONENT_CHANGES="serverComponentChanges",r.MIDDLEWARE_CHANGES="middlewareChanges",r.CLIENT_CHANGES="clientChanges",r.SERVER_ONLY_CHANGES="serverOnlyChanges",r.SYNC="sync",r.BUILT="built",r.BUILDING="building",r.DEV_PAGES_MANIFEST_UPDATE="devPagesManifestUpdate",r.TURBOPACK_MESSAGE="turbopack-message",r.SERVER_ERROR="serverError",r.TURBOPACK_CONNECTED="turbopack-connected"},1182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return u}});let r=n(926),o=["(..)(..)","(.)","(..)","(...)"];function u(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function l(e){let t,n,u;for(let r of e.split("/"))if(n=o.find(e=>r.startsWith(e))){[t,u]=e.split(n,2);break}if(!t||!n||!u)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,r.normalizeAppPath)(t),n){case"(.)":u="/"===t?`/${u}`:t+"/"+u;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);u=t.split("/").slice(0,-1).concat(u).join("/");break;case"(...)":u="/"+u;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);u=l.slice(0,-2).concat(u).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:u}}},650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,n){let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},1956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return u},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let r=n(7043)._(n(2265)),o=r.default.createContext(null),u=r.default.createContext(null),l=r.default.createContext(null),a=r.default.createContext(null),i=r.default.createContext(new Set)},7207:function(e,t){"use strict";function n(e){let t=5381;for(let n=0;n>>0}function r(e){return n(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{djb2Hash:function(){return n},hexHash:function(){return r}})},8701:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});let r=n(7043)._(n(2265)).default.createContext({})},9060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return u},SearchParamsContext:function(){return o}});let r=n(2265),o=(0,r.createContext)(null),u=(0,r.createContext)(null),l=(0,r.createContext)(null)},8993:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return o}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},8162:function(e,t){"use strict";function n(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return n}})},2103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ActionQueueContext:function(){return a},createMutableActionQueue:function(){return s}});let r=n(3099),o=n(4673),u=n(1450),l=r._(n(2265)),a=l.default.createContext(null);function i(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?c({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:o.ACTION_REFRESH,origin:window.location.origin},t)))}async function c(e){let{actionQueue:t,action:n,setState:r}=e,u=t.state;if(!u)throw Error("Invariant: Router state not initialized");t.pending=n;let l=n.payload,a=t.action(u,l);function c(e){n.discarded||(t.state=e,t.devToolsInstance&&t.devToolsInstance.send(l,e),i(t,r),n.resolve(e))}(0,o.isThenable)(a)?a.then(c,e=>{i(t,r),n.reject(e)}):c(a)}function s(){let e={state:null,dispatch:(t,n)=>(function(e,t,n){let r={resolve:n,reject:()=>{}};if(t.type!==o.ACTION_RESTORE){let e=new Promise((e,t)=>{r={resolve:e,reject:t}});(0,l.startTransition)(()=>{n(e)})}let u={payload:t,next:null,resolve:r.resolve,reject:r.reject};null===e.pending?(e.last=u,c({actionQueue:e,action:u,setState:n})):t.type===o.ACTION_NAVIGATE||t.type===o.ACTION_RESTORE?(e.pending.discarded=!0,e.last=u,e.pending.payload.type===o.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),c({actionQueue:e,action:u,setState:n})):(null!==e.last&&(e.last.next=u),e.last=u)})(e,t,n),action:async(e,t)=>{if(null===e)throw Error("Invariant: Router state not initialized");return(0,u.reducer)(e,t)},pending:null,last:null};return e}},8498:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let r=n(3381);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:n,query:o,hash:u}=(0,r.parsePath)(e);return""+t+n+o+u}},926:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{normalizeAppPath:function(){return u},normalizeRscURL:function(){return l}});let r=n(8162),o=n(4541);function u(e){return(0,r.ensureLeadingSlash)(e.split("/").reduce((e,t,n,r)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&n===r.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},7092:function(e,t){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let n=document.documentElement,r=n.style.scrollBehavior;n.style.scrollBehavior="auto",t.dontForceLayout||n.getClientRects(),e(),n.style.scrollBehavior=r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return n}})},6146:function(e,t){"use strict";function n(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return n}})},3381:function(e,t){"use strict";function n(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return n}})},580:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let r=n(3381);function o(e,t){if("string"!=typeof e)return!1;let{pathname:n}=(0,r.parsePath)(e);return n===t||n.startsWith(t+"/")}},6674:function(e,t){"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},4541:function(e,t){"use strict";function n(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});let r="__PAGE__",o="__DEFAULT__"},5501:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return o},useServerInsertedHTML:function(){return u}});let r=n(3099)._(n(2265)),o=r.default.createContext(null);function u(e){let t=(0,r.useContext)(o);t&&t(e)}},1765:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},7149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(4832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4832:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return u}});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}}let o=globalThis.AsyncLocalStorage;function u(){return o?new o:new r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9134:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(4832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(4832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4040:function(e,t,n){"use strict";var r=n(4887);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},4887:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(4417)},7950:function(e,t,n){"use strict";var r=n(4887),o={stream:!0},u=new Map;function l(e){var t=n(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function a(){}var i=new Map,c=n.u;n.u=function(e){var t=i.get(e);return void 0!==t?t:c(e)};var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,f=Symbol.for("react.element"),d=Symbol.for("react.lazy"),p=Symbol.iterator,h=Array.isArray,y=Object.getPrototypeOf,_=Object.prototype,v=new WeakMap;function b(e,t,n,r){this.status=e,this.value=t,this.reason=n,this._response=r}function g(e){switch(e.status){case"resolved_model":E(e);break;case"resolved_module":w(e)}switch(e.status){case"fulfilled":return e.value;case"pending":case"blocked":case"cyclic":throw e;default:throw e.reason}}function m(e,t){for(var n=0;nh?(_=h,h=3,p++):(_=0,h=3);continue;case 2:44===(m=d[p++])?h=4:v=v<<4|(96d.length&&(m=-1)}var O=d.byteOffset+p;if(-1(function(e,t){async function a(a,r){var n;let c=(null==r?void 0:r.body)!==void 0&&(null==r?void 0:r.body)!==null,i=await fetch(s+a,{method:null!==(n=null==r?void 0:r.method)&&void 0!==n?n:c?"POST":"GET",headers:{Authorization:"Bearer ".concat(e),...c?{"Content-Type":"application/json"}:{}},body:c?JSON.stringify(r.body):void 0});if(401===i.status)throw t(),new o;if(!i.ok){let e=i.statusText;try{let t=await i.json();t&&void 0!==t.detail&&(e="string"==typeof t.detail?t.detail:JSON.stringify(t.detail))}catch(e){}let t=Error(e);throw t.status=i.status,t}if(204===i.status)return;let l=await i.text();return l?JSON.parse(l):void 0}async function r(e,t){var r,n;let c=null!==(r=null==t?void 0:t.attempts)&&void 0!==r?r:60,s=null!==(n=null==t?void 0:t.intervalMs)&&void 0!==n?n:500;for(let t=0;tsetTimeout(e,s))}return null}return{api:a,trackCommand:r}})(t,a),[t,a]),d=(0,c.useRef)(u);d.current=u;let[m,p]=(0,c.useState)(r),[y,h]=(0,c.useState)([]),[b,g]=(0,c.useState)([]),[k,w]=(0,c.useState)(""),[f,v]=(0,c.useState)(null),[C,_]=(0,c.useState)(null),[x,S]=(0,c.useState)(!1),[E,T]=(0,c.useState)([]),[I,P]=(0,c.useState)(0),[j,R]=(0,c.useState)([]),U=(0,c.useRef)([]);U.current=j;let A=(0,c.useRef)(0),[O,L]=(0,c.useState)([]),[D,N]=(0,c.useState)([]),[H,z]=(0,c.useState)([]),[J,B]=(0,c.useState)([]),[M,q]=(0,c.useState)({log:[],context:[]}),[F,G]=(0,c.useState)({notes:[],links:[]}),[Q,X]=(0,c.useState)({text:"",error:!1,busy:!1}),[K,V]=(0,c.useState)(""),[W,Y]=(0,c.useState)(!0),[Z,$]=(0,c.useState)({status:"idle",url:"",message:""}),[ee,et]=(0,c.useState)([]),[ea,er]=(0,c.useState)([]),[en,ec]=(0,c.useState)([]),[es,eo]=(0,c.useState)(null),[ei,el]=(0,c.useState)([]),eu=(0,c.useRef)(m);eu.current=m;let ed=(0,c.useRef)(k);ed.current=k;let em=(0,c.useRef)(f);em.current=f;let ep=(0,c.useRef)(I);ep.current=I;let ey=e=>{e instanceof o||V(e.message)},eh=(0,c.useCallback)(async()=>{try{let e=await d.current.api("/projects");h(e),V(""),w(t=>{var a,r;return t||(null!==(r=null===(a=e[0])||void 0===a?void 0:a.id)&&void 0!==r?r:"")})}catch(e){ey(e)}},[]),eb=(0,c.useCallback)(async e=>{try{let t=await Promise.all(e.map(e=>d.current.api("/projects/".concat(encodeURIComponent(e.id),"/agents")).catch(()=>[])));g(t.flat())}catch(e){ey(e)}},[]),eg=(0,c.useCallback)(async(e,t)=>{let a="/projects/".concat(encodeURIComponent(e),"/agents/").concat(encodeURIComponent(t)),r=A.current;try{let e=await d.current.api("".concat(a,"/checkmark"));if(r!==A.current)return;_(e),S(!1)}catch(e){if(e instanceof o||r!==A.current)return;404===e.status?(_(null),S(!0)):ey(e)}try{let e=await d.current.api("".concat(a,"/log?limit=").concat(100,"&offset=").concat(ep.current));if(r!==A.current)return;T(e)}catch(e){r!==A.current||ey(e)}try{let e=U.current,t=e.length?e[e.length-1].id:0,n=await d.current.api("".concat(a,"/events?after_id=").concat(t,"&limit=500"));if(r!==A.current||0===n.length)return;R(e=>{let t=e.length?e[e.length-1].id:0,a=n.filter(e=>e.id>t);return a.length?[...e,...a]:e})}catch(e){r!==A.current||ey(e)}},[]),ek=(0,c.useCallback)(async e=>{if(!e){L([]);return}try{L(await d.current.api("/projects/".concat(encodeURIComponent(e),"/approvals")))}catch(e){ey(e)}},[]),ew=(0,c.useCallback)(async()=>{try{N(await d.current.api("/hosts"))}catch(e){ey(e)}},[]),ef=(0,c.useCallback)(async()=>{try{z(await d.current.api("/commands?limit=50"))}catch(e){ey(e)}},[]),ev=(0,c.useCallback)(async()=>{try{B(await d.current.api("/schedules"))}catch(e){ey(e)}},[]),eC=(0,c.useCallback)(async()=>{try{let[e,t]=await Promise.all([d.current.api("/shared/log"),d.current.api("/shared/context")]);q({log:e,context:t})}catch(e){ey(e)}},[]),e_=(0,c.useCallback)(async()=>{try{G(await d.current.api("/memory/graph"))}catch(e){ey(e)}},[]),ex=(0,c.useCallback)(async()=>{try{el(await d.current.api("/claude/models"))}catch(e){ey(e)}},[]),eS=(0,c.useCallback)(async()=>{try{let[e,t,a,r]=await Promise.all([d.current.api("/claude/skills"),d.current.api("/claude/connectors"),d.current.api("/claude/plugins"),d.current.api("/claude/permissions")]);et(e),er(t),ec(a),eo(r),await ex()}catch(e){ey(e)}},[ex]),eE=(0,c.useCallback)(async()=>{let e=await d.current.api("/projects").catch(e=>(ey(e),null));e&&(h(e),w(t=>{var a,r;return t||(null!==(r=null===(a=e[0])||void 0===a?void 0:a.id)&&void 0!==r?r:"")}),await eb(e));let t=eu.current,a=em.current;a&&await eg(a.projectId,a.name),("agents"===t||"schedules"===t)&&await ex(),"approvals"===t&&await ek(ed.current),"servers"===t&&await ew(),"activity"===t&&await ef(),"schedules"===t&&await ev(),"shared"===t&&await eC(),"memory"===t&&await e_(),"claude"===t&&await eS()},[eb,eg,ek,ew,ef,ev,eC,e_,eS,ex]);(0,c.useEffect)(()=>{let e=!0;(async()=>{Y(!0),await eE(),e&&Y(!1)})();let t=setInterval(()=>{document.hidden||eE()},5e3);return()=>{e=!1,clearInterval(t)}},[eE]);let eT=(0,c.useCallback)(e=>{p(e),X({text:"",error:!1,busy:!1}),("agents"===e||"schedules"===e)&&ex(),"approvals"===e&&ek(ed.current),"servers"===e&&ew(),"activity"===e&&ef(),"schedules"===e&&ev(),"shared"===e&&eC(),"memory"===e&&e_(),"claude"===e&&eS()},[ek,ew,ef,ev,eC,e_,eS,ex]),eI=(0,c.useCallback)(e=>{w(e),"approvals"===eu.current&&ek(e)},[ek]),eP=(0,c.useCallback)((e,t)=>{A.current+=1,v({projectId:e,name:t}),P(0),ep.current=0,_(null),S(!1),T([]),R([]),U.current=[],eg(e,t)},[eg]),ej=(0,c.useCallback)(e=>{let t=Math.max(0,I+100*e);if(t===I)return;P(t),ep.current=t;let a=em.current;a&&eg(a.projectId,a.name)},[I,eg]),eR=(0,c.useCallback)(()=>{eE()},[eE]),eU=(0,c.useCallback)(async(e,t,a)=>{X({text:"".concat(a,": queued…"),error:!1,busy:!0});try{let r=await d.current.api(e,{method:"POST",body:t}),n=await d.current.trackCommand(r.id);if(!n)return X({text:"".concat(a,": still running (see Activity). Is the worker up?"),error:!1,busy:!1}),null;let c="done"===n.status,s=n.error||(n.result?JSON.stringify(n.result):"");return X({text:"".concat(a," ").concat(c?"done":"failed").concat(s?" — "+s:""),error:!c,busy:!1}),n}catch(e){if(e instanceof o)return null;return X({text:"".concat(a," failed: ").concat(e.message),error:!0,busy:!1}),null}},[]),eA=(0,c.useCallback)(async e=>{let t={name:e.name.trim(),role:e.role||null,task:e.task.trim()||null};"worktree"===e.placement&&e.worktree.trim()&&(t.worktree=e.worktree.trim()),"subdir"===e.placement&&e.subdir.trim()&&(t.subdir=e.subdir.trim()),e.model_id&&(t.model_id=Number(e.model_id));let a=encodeURIComponent(ed.current),r=await eU("/projects/".concat(a,"/agents/spawn"),t,"spawn ".concat(t.name));return await eb(y),(null==r?void 0:r.status)==="done"},[eU,eb,y]),eO=(0,c.useCallback)(async(e,t)=>{let a=encodeURIComponent(e);await eU("/projects/".concat(a,"/agents/").concat(encodeURIComponent(t),"/kill"),void 0,"kill ".concat(t)),await eb(y)},[eU,eb,y]),eL=(0,c.useCallback)(async(e,t)=>{let a=encodeURIComponent(e);try{var r;await d.current.api("/projects/".concat(a,"/agents/").concat(encodeURIComponent(t)),{method:"DELETE"}),X({text:"agent '".concat(t,"' row deleted"),error:!1,busy:!1}),(null===(r=em.current)||void 0===r?void 0:r.name)===t&&v(null),await eb(y)}catch(e){if(e instanceof o)return;X({text:e.message,error:!0,busy:!1})}},[eb,y]),eD=(0,c.useCallback)(async(e,t)=>{let a=em.current;if(!a)return!1;let r="/projects/".concat(encodeURIComponent(a.projectId),"/agents/").concat(encodeURIComponent(a.name));try{return await d.current.api("".concat(r,"/answer"),{method:"POST",body:{answer:e}}),t?await eU("".concat(r,"/resume"),{answer:e},"resume"):X({text:"Answer saved (agent still paused).",error:!1,busy:!1}),await eb(y),await eg(a.projectId,a.name),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[eU,eb,eg,y]),eN=(0,c.useCallback)(async e=>{try{var t,a;let r="server"===e.mode?{git_server:e.git_server,repo:e.repo.trim(),id:e.id.trim()||null,credential_ref:e.credential_ref.trim()||null,init_mise:e.init_mise}:{id:e.id.trim(),root_dir:e.root_dir.trim(),git_remote:e.git_remote.trim()||null,credential_ref:e.credential_ref.trim()||null,init_mise:e.init_mise},n=await d.current.api("/projects",{method:"POST",body:r});if(await eh(),null!=n.sync_command_id){X({text:"repository '".concat(n.id,"': cloning…"),error:!1,busy:!0});let e=await d.current.trackCommand(n.sync_command_id);e?"done"===e.status?X({text:"repository '".concat(n.id,"' registered and cloned"),error:!1,busy:!1}):X({text:"repository '".concat(n.id,"' registered but the clone failed — ").concat(null!==(t=e.error)&&void 0!==t?t:""),error:!0,busy:!1}):X({text:"repository '".concat(n.id,"' registered; clone still running (see Activity). Is the worker up?"),error:!1,busy:!1})}else X({text:"repository '".concat(n.id,"' registered"),error:!1,busy:!1});if(null!=n.mise_init_command_id){X({text:"repository '".concat(n.id,"': launching a mise-init agent to create .mise.toml…"),error:!1,busy:!0});let e=await d.current.trackCommand(n.mise_init_command_id);e?"done"===e.status?X({text:"repository '".concat(n.id,"' registered; a mise-init agent is now writing, committing, and pushing .mise.toml (watch it in Runs)."),error:!1,busy:!1}):X({text:"repository '".concat(n.id,"' registered but the mise-init agent failed to launch — ").concat(null!==(a=e.error)&&void 0!==a?a:""),error:!0,busy:!1}):X({text:"repository '".concat(n.id,"' registered; mise-init still starting (see Activity). Is the worker up?"),error:!1,busy:!1})}return!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[eh]),eH=(0,c.useCallback)(async e=>{await eU("/projects/".concat(encodeURIComponent(e),"/sync"),void 0,"pull ".concat(e))},[eU]),ez=(0,c.useCallback)(async(e,t)=>{try{return await d.current.api("/projects/".concat(encodeURIComponent(e)),{method:"PATCH",body:{root_dir:t.root_dir.trim(),git_remote:t.git_remote.trim()||null,credential_ref:t.credential_ref.trim()||null}}),X({text:"repository '".concat(e,"' updated"),error:!1,busy:!1}),await eh(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[eh]),eJ=(0,c.useCallback)(async e=>{try{await d.current.api("/projects/".concat(encodeURIComponent(e)),{method:"DELETE"}),X({text:"repository '".concat(e,"' removed"),error:!1,busy:!1}),w(t=>t===e?"":t),await eh()}catch(e){if(e instanceof o)return;X({text:e.message,error:!0,busy:!1})}},[eh]),eB=(0,c.useCallback)(async e=>{let t=encodeURIComponent(ed.current);await eU("/projects/".concat(t,"/approvals"),{branch:e.branch.trim(),status:e.status,agent_name:e.agent_name.trim()||null,sha:e.sha.trim()||null,note:e.note.trim()||null},"".concat(e.status," ").concat(e.branch)),await ek(ed.current)},[eU,ek]),eM=(0,c.useCallback)(async e=>{try{return await d.current.api("/hosts",{method:"POST",body:{hostname:e.hostname.trim(),forge_type:e.forge_type,token_env_var:e.token_env_var.trim()||null,base_url:e.base_url.trim()||null,token:e.token.trim()||null,generate_ssh_key:e.generate_ssh_key}}),X({text:"git server '".concat(e.hostname,"' added"),error:!1,busy:!1}),await ew(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[ew]),eq=(0,c.useCallback)(async(e,t)=>{try{let a={forge_type:t.forge_type,token_env_var:t.token_env_var.trim()||null,base_url:t.base_url.trim()||null};return t.token.trim()&&(a.token=t.token.trim()),t.generate_ssh_key&&(a.regenerate_ssh_key=!0),await d.current.api("/hosts/".concat(encodeURIComponent(e)),{method:"PATCH",body:a}),X({text:"git server '".concat(e,"' updated"),error:!1,busy:!1}),await ew(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[ew]),eF=(0,c.useCallback)(async(e,t)=>{try{return await d.current.api("/projects/".concat(encodeURIComponent(e),"/schedules"),{method:"POST",body:{name_prefix:t.name_prefix.trim(),task:t.task.trim(),interval_seconds:t.interval_seconds,role:t.role||null,model_id:t.model_id?Number(t.model_id):null}}),X({text:"schedule '".concat(t.name_prefix,"' created — first run on the worker's next pass"),error:!1,busy:!1}),await ev(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[ev]),eG=(0,c.useCallback)(async(e,t)=>{try{return await d.current.api("/schedules/".concat(e),{method:"PATCH",body:t}),await ev(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[ev]),eQ=(0,c.useCallback)(async e=>{try{await d.current.api("/schedules/".concat(e),{method:"DELETE"}),X({text:"schedule ".concat(e," removed"),error:!1,busy:!1}),await ev()}catch(e){if(e instanceof o)return;X({text:e.message,error:!0,busy:!1})}},[ev]),eX=(0,c.useCallback)(async e=>{try{await d.current.api("/hosts/".concat(encodeURIComponent(e)),{method:"DELETE"}),X({text:"git server '".concat(e,"' removed"),error:!1,busy:!1}),await ew()}catch(e){if(e instanceof o)return;X({text:e.message,error:!0,busy:!1})}},[ew]),eK=(0,c.useCallback)(async()=>{await eU("/poll-ci",void 0,"poll-ci (all projects)"),await ef()},[eU,ef]),eV=(0,c.useCallback)(async()=>{$({status:"starting",url:"",message:"Opening `claude /login` in the control container and selecting the subscription account…"});try{let e=await d.current.api("/login/start",{method:"POST"}),t=await d.current.trackCommand(e.id,{attempts:180});if(!t){$({status:"error",url:"",message:"Still starting (see Activity). Is the control worker running?"});return}if("done"!==t.status){$({status:"error",url:"",message:t.error||"Failed to start login."});return}let a=t.result&&"string"==typeof t.result.url?t.result.url:"";if(!a){$({status:"error",url:"",message:"No login URL was returned by claude."});return}$({status:"awaiting",url:a,message:"Authorize in the window below (or open it in a new tab), then paste the code claude gives you."})}catch(e){if(e instanceof o)return;$({status:"error",url:"",message:e.message})}},[]),eW=(0,c.useCallback)(async e=>{let t=e.trim();if(!t)return!1;$(e=>({...e,status:"submitting",message:"Submitting the authorization code…"}));try{let e=await d.current.api("/login/submit",{method:"POST",body:{code:t}}),a=await d.current.trackCommand(e.id,{attempts:60});if(!a)return $(e=>({...e,status:"awaiting",message:"Submit still running (see Activity). Is the control worker running?"})),!1;if("done"===a.status)return $({status:"done",url:"",message:"Claude Code is now logged in on the host — new agents will use this account."}),!0;return $(e=>({...e,status:"awaiting",message:a.error||"Login was not confirmed. Re-check the code, or restart the flow."})),!1}catch(e){if(e instanceof o)return!1;return $(t=>({...t,status:"awaiting",message:e.message})),!1}},[]),eY=(0,c.useCallback)(()=>{$({status:"idle",url:"",message:""})},[]),eZ=(0,c.useCallback)(async(e,t)=>{try{return await e(),X({text:t,error:!1,busy:!1}),await eS(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[eS]),e$=(0,c.useCallback)(e=>eZ(()=>d.current.api("/claude/skills",{method:"POST",body:{name:e.name.trim(),description:e.description.trim()||null,content:e.content,enabled:e.enabled}}),"skill '".concat(e.name.trim(),"' saved — applies to the next agent launch")),[eZ]),e0=(0,c.useCallback)((e,t)=>eZ(()=>d.current.api("/claude/skills/".concat(e),{method:"PATCH",body:t}),"skill updated — applies to the next agent launch"),[eZ]),e1=(0,c.useCallback)(async e=>{await eZ(()=>d.current.api("/claude/skills/".concat(e),{method:"DELETE"}),"skill removed — gone from workers at the next launch")},[eZ]),e5=(0,c.useCallback)(async e=>{X({text:"skill install: running the marketplace prompt through headless claude on the worker…",error:!1,busy:!0});try{var t,a,r;let n=await d.current.api("/claude/skills/install",{method:"POST",body:{prompt:e}}),c=await d.current.trackCommand(n.id,{attempts:600});if(!c)return X({text:"skill install: still running (see Activity). Is the control worker running?",error:!1,busy:!1}),!1;if("done"!==c.status)return X({text:"skill install failed — ".concat(null!==(a=c.error)&&void 0!==a?a:"unknown error"),error:!0,busy:!1}),!1;let s=(null!==(r=null===(t=c.result)||void 0===t?void 0:t.skills)&&void 0!==r?r:[]).map(e=>"".concat(e.name," (").concat(e.action,")")).join(", ");return X({text:"skill install done: ".concat(s||"no skills"," — review the import below; Claude's report of the choices it made is in Activity."),error:!1,busy:!1}),await eS(),!0}catch(e){if(e instanceof o)return!1;return X({text:"skill install failed: ".concat(e.message),error:!0,busy:!1}),!1}},[eS]),e4=(0,c.useCallback)(e=>eZ(()=>d.current.api("/claude/connectors",{method:"POST",body:{...e,name:e.name.trim()}}),"connector '".concat(e.name.trim(),"' saved — applies to the next agent launch")),[eZ]),e7=(0,c.useCallback)((e,t)=>eZ(()=>d.current.api("/claude/connectors/".concat(e),{method:"PATCH",body:t}),"connector updated — applies to the next agent launch"),[eZ]),e2=(0,c.useCallback)(async e=>{await eZ(()=>d.current.api("/claude/connectors/".concat(e),{method:"DELETE"}),"connector removed — applies to the next agent launch")},[eZ]),e6=(0,c.useCallback)(e=>eZ(()=>d.current.api("/claude/plugins",{method:"POST",body:{name:e.name.trim(),marketplace:e.marketplace.trim(),marketplace_repo:e.marketplace_repo.trim(),enabled:e.enabled}}),"plugin '".concat(e.name.trim(),"' saved — installs on the next agent launch")),[eZ]),e3=(0,c.useCallback)((e,t)=>eZ(()=>d.current.api("/claude/plugins/".concat(e),{method:"PATCH",body:t}),"plugin updated — applies to the next agent launch"),[eZ]),e8=(0,c.useCallback)(async e=>{await eZ(()=>d.current.api("/claude/plugins/".concat(e),{method:"DELETE"}),"plugin removed — applies to the next agent launch")},[eZ]),e9=(0,c.useCallback)(e=>eZ(()=>d.current.api("/claude/permissions",{method:"PUT",body:e}),"permissions saved — apply to the next agent launch"),[eZ]),te=(0,c.useCallback)(e=>eZ(()=>d.current.api("/claude/models",{method:"POST",body:{...e,name:e.name.trim()}}),"model '".concat(e.name.trim(),"' saved — pick it from the spawn dropdown")),[eZ]),tt=(0,c.useCallback)((e,t)=>eZ(()=>d.current.api("/claude/models/".concat(e),{method:"PATCH",body:t}),"model updated — applies to the next agent launch"),[eZ]),ta=(0,c.useCallback)(async e=>{await eZ(()=>d.current.api("/claude/models/".concat(e),{method:"DELETE"}),"model removed — agents pinned to it can no longer resume")},[eZ]),tr=(0,c.useCallback)(async(e,t)=>{try{return await d.current.api("/shared/context/".concat(encodeURIComponent(e)),{method:"PUT",body:{value:t}}),X({text:"shared context '".concat(e,"' set"),error:!1,busy:!1}),await eC(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[eC]),tn=(0,c.useCallback)(async(e,t)=>{try{return await e(),X({text:t,error:!1,busy:!1}),await e_(),!0}catch(e){if(e instanceof o)return!1;return X({text:e.message,error:!0,busy:!1}),!1}},[e_]),tc=(0,c.useCallback)(e=>tn(()=>d.current.api("/memory/notes",{body:{title:e.title,body:e.body,kind:e.kind,project_id:e.project_id||null,tags:e.tags.length?e.tags:null}}),"note saved"),[tn]),ts=(0,c.useCallback)((e,t)=>tn(()=>d.current.api("/memory/notes/".concat(e),{method:"PATCH",body:{...void 0!==t.title?{title:t.title}:{},...void 0!==t.body?{body:t.body}:{},...void 0!==t.kind?{kind:t.kind}:{},...void 0!==t.project_id?{project_id:t.project_id||null}:{},...void 0!==t.tags?{tags:t.tags.length?t.tags:null}:{}}}),"note updated"),[tn]),to=(0,c.useCallback)(async e=>{await tn(()=>d.current.api("/memory/notes/".concat(e),{method:"DELETE"}),"note deleted")},[tn]),ti=(0,c.useCallback)((e,t,a)=>tn(()=>d.current.api("/memory/links",{body:{src_note_id:e,dst_note_id:t,relation:a||"relates_to"}}),"notes linked"),[tn]),tl=(0,c.useCallback)(async e=>{await tn(()=>d.current.api("/memory/links/".concat(e),{method:"DELETE"}),"link removed")},[tn]);return(0,n.jsx)(i.Provider,{value:{section:m,setSection:eT,projects:y,agents:b,selectedProjectId:k,selectProject:eI,selectedRun:f,selectRun:eP,checkmark:C,checkmarkMissing:x,log:E,logOffset:I,pageLog:ej,events:j,approvals:O,hosts:D,commands:H,schedules:J,shared:M,memory:F,cmd:Q,lastError:K,loading:W,refresh:eR,spawnAgent:eA,killAgent:eO,deleteAgent:eL,submitAnswer:eD,createProject:eN,updateProject:ez,deleteProject:eJ,syncProject:eH,submitApproval:eB,createHost:eM,updateHost:eq,deleteHost:eX,createSchedule:eF,updateSchedule:eG,deleteSchedule:eQ,pollCi:eK,setSharedKey:tr,createMemoryNote:tc,updateMemoryNote:ts,deleteMemoryNote:to,createMemoryLink:ti,deleteMemoryLink:tl,claudeLogin:Z,startClaudeLogin:eV,submitClaudeCode:eW,resetClaudeLogin:eY,claudeSkills:ee,claudeConnectors:ea,claudePlugins:en,claudePermissions:es,createClaudeSkill:e$,updateClaudeSkill:e0,deleteClaudeSkill:e1,installClaudeSkill:e5,createClaudeConnector:e4,updateClaudeConnector:e7,deleteClaudeConnector:e2,createClaudePlugin:e6,updateClaudePlugin:e3,deleteClaudePlugin:e8,saveClaudePermissions:e9,claudeModels:ei,createClaudeModel:te,updateClaudeModel:tt,deleteClaudeModel:ta},children:l})}}}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/258-022159d3c3089cd0.js b/src/handler/api/static/_next/static/chunks/258-022159d3c3089cd0.js deleted file mode 100644 index e0a75b5..0000000 --- a/src/handler/api/static/_next/static/chunks/258-022159d3c3089cd0.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[258],{7648:function(e,t,r){"use strict";r.d(t,{default:function(){return o.a}});var n=r(2972),o=r.n(n)},9376:function(e,t,r){"use strict";var n=r(5475);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}})},257:function(e,t,r){"use strict";var n,o;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(o=r.g.process)?void 0:o.env)?r.g.process:r(4227)},5449:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return n}}),r(8521);let n=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;ni?e.prefetch(t,o):e.prefetch(t,r,n))().catch(e=>{})}}function v(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let P=i.default.forwardRef(function(e,t){let r,n;let{href:l,as:y,children:P,prefetch:_=null,passHref:R,replace:O,shallow:j,scroll:E,locale:w,onClick:x,onMouseEnter:S,onTouchStart:M,legacyBehavior:N=!1,...T}=e;r=P,N&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let C=i.default.useContext(f.RouterContext),k=i.default.useContext(d.AppRouterContext),I=null!=C?C:k,L=!C,A=!1!==_,U=null===_?g.PrefetchKind.AUTO:g.PrefetchKind.FULL,{href:W,as:D}=i.default.useMemo(()=>{if(!C){let e=v(l);return{href:e,as:y?v(y):e}}let[e,t]=(0,u.resolveHref)(C,l,!0);return{href:e,as:y?(0,u.resolveHref)(C,y):t||e}},[C,l,y]),z=i.default.useRef(W),K=i.default.useRef(D);N&&(n=i.default.Children.only(r));let q=N?n&&"object"==typeof n&&n.ref:t,[F,$,B]=(0,p.useIntersection)({rootMargin:"200px"}),Y=i.default.useCallback(e=>{(K.current!==D||z.current!==W)&&(B(),K.current=D,z.current=W),F(e),q&&("function"==typeof q?q(e):"object"==typeof q&&(q.current=e))},[D,q,W,B,F]);i.default.useEffect(()=>{I&&$&&A&&b(I,W,D,{locale:w},{kind:U},L)},[D,W,$,w,A,null==C?void 0:C.locale,I,L,U]);let Q={ref:Y,onClick(e){N||"function"!=typeof x||x(e),N&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),I&&!e.defaultPrevented&&function(e,t,r,n,o,u,l,s,c){let{nodeName:f}=e.currentTarget;if("A"===f.toUpperCase()&&(function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!c&&!(0,a.isLocalURL)(r)))return;e.preventDefault();let d=()=>{let e=null==l||l;"beforePopState"in t?t[o?"replace":"push"](r,n,{shallow:u,locale:s,scroll:e}):t[o?"replace":"push"](n||r,{scroll:e})};c?i.default.startTransition(d):d()}(e,I,W,D,O,j,E,w,L)},onMouseEnter(e){N||"function"!=typeof S||S(e),N&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),I&&(A||!L)&&b(I,W,D,{locale:w,priority:!0,bypassPrefetchedCheck:!0},{kind:U},L)},onTouchStart:function(e){N||"function"!=typeof M||M(e),N&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),I&&(A||!L)&&b(I,W,D,{locale:w,priority:!0,bypassPrefetchedCheck:!0},{kind:U},L)}};if((0,s.isAbsoluteUrl)(D))Q.href=D;else if(!N||R||"a"===n.type&&!("href"in n.props)){let e=void 0!==w?w:null==C?void 0:C.locale,t=(null==C?void 0:C.isLocaleDomain)&&(0,h.getDomainLocale)(D,e,null==C?void 0:C.locales,null==C?void 0:C.domainLocales);Q.href=t||(0,m.addBasePath)((0,c.addLocale)(D,e,null==C?void 0:C.defaultLocale))}return N?i.default.cloneElement(n,Q):(0,o.jsx)("a",{...T,...Q,children:r})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3515:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{cancelIdleCallback:function(){return n},requestIdleCallback:function(){return r}});let r="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5246:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return f}});let n=r(8637),o=r(7497),i=r(7053),u=r(3987),a=r(8521),l=r(3552),s=r(6279),c=r(7205);function f(e,t,r){let f;let d="string"==typeof t?t:(0,o.formatWithValidation)(t),p=d.match(/^[a-zA-Z]{1,}:\/\//),h=p?d.slice(p[0].length):d;if((h.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+d+"' passed to next/router in page: '"+e.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");let t=(0,u.normalizeRepeatedSlashes)(h);d=(p?p[0]:"")+t}if(!(0,l.isLocalURL)(d))return r?[d]:d;try{f=new URL(d.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){f=new URL("/","http://n")}try{let e=new URL(d,f);e.pathname=(0,a.normalizePathTrailingSlash)(e.pathname);let t="";if((0,s.isDynamicRoute)(e.pathname)&&e.searchParams&&r){let r=(0,n.searchParamsToUrlQuery)(e.searchParams),{result:u,params:a}=(0,c.interpolateAs)(e.pathname,e.pathname,r);u&&(t=(0,o.formatWithValidation)({pathname:u,hash:e.hash,query:(0,i.omit)(r,a)}))}let u=e.origin===f.origin?e.href.slice(e.origin.length):e.href;return r?[u,t||u]:u}catch(e){return r?[d]:d}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6081:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return l}});let n=r(2265),o=r(3515),i="function"==typeof IntersectionObserver,u=new Map,a=[];function l(e){let{rootRef:t,rootMargin:r,disabled:l}=e,s=l||!i,[c,f]=(0,n.useState)(!1),d=(0,n.useRef)(null),p=(0,n.useCallback)(e=>{d.current=e},[]);return(0,n.useEffect)(()=>{if(i){if(s||c)return;let e=d.current;if(e&&e.tagName)return function(e,t,r){let{id:n,observer:o,elements:i}=function(e){let t;let r={root:e.root||null,margin:e.rootMargin||""},n=a.find(e=>e.root===r.root&&e.margin===r.margin);if(n&&(t=u.get(n)))return t;let o=new Map;return t={id:r,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e),elements:o},a.push(r),u.set(r,t),t}(r);return i.set(e,t),o.observe(e),function(){if(i.delete(e),o.unobserve(e),0===i.size){o.disconnect(),u.delete(n);let e=a.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&a.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:r})}else if(!c){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[s,r,t,c,d.current]),[p,c,(0,n.useCallback)(()=>{f(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4227:function(e){!function(){var t={229:function(e){var t,r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var l=[],s=!1,c=-1;function f(){s&&n&&(s=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!s){var e=a(f);s=!0;for(var t=l.length;t;){for(n=l,l=[];++c1)for(var r=1;r{let t=l[e]||"",{repeat:r,optional:n}=a[e],o="["+(r?"...":"")+e+"]";return n&&(o=(t?"":"/")+"["+o+"]"),r&&!Array.isArray(t)&&(t=[t]),(n||e in l)&&(i=i.replace(o,r?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(i=""),{params:s,result:i}}},8104:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return i}});let n=r(1182),o=/\/\[[^/]+?\](?=\/|$)/;function i(e){return(0,n.isInterceptionRouteAppPath)(e)&&(e=(0,n.extractInterceptionRouteInformation)(e).interceptedRoute),o.test(e)}},3552:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=r(3987),o=r(1283);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},7053:function(e,t){"use strict";function r(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return r}})},8637:function(e,t){"use strict";function r(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function n(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,o]=e;Array.isArray(o)?o.forEach(e=>t.append(r,n(e))):t.set(r,n(o))}),t}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return i},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}})},4199:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return o}});let n=r(3987);function o(e){let{re:t,groups:r}=e;return e=>{let o=t.exec(e);if(!o)return!1;let i=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},u={};return Object.keys(r).forEach(e=>{let t=r[e],n=o[t.pos];void 0!==n&&(u[e]=~n.indexOf("/")?n.split("/").map(e=>i(e)):t.repeat?[i(n)]:i(n))}),u}}},9964:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getNamedMiddlewareRegex:function(){return d},getNamedRouteRegex:function(){return f},getRouteRegex:function(){return l},parseParameter:function(){return u}});let n=r(1182),o=r(42),i=r(6674);function u(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function a(e){let t=(0,i.removeTrailingSlash)(e).slice(1).split("/"),r={},a=1;return{parameterizedRoute:t.map(e=>{let t=n.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&i){let{key:e,optional:n,repeat:l}=u(i[1]);return r[e]={pos:a++,repeat:l,optional:n},"/"+(0,o.escapeStringRegexp)(t)+"([^/]+?)"}if(!i)return"/"+(0,o.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:n}=u(i[1]);return r[e]={pos:a++,repeat:t,optional:n},t?n?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function l(e){let{parameterizedRoute:t,groups:r}=a(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function s(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:n,routeKeys:i,keyPrefix:a}=e,{key:l,optional:s,repeat:c}=u(n),f=l.replace(/\W/g,"");a&&(f=""+a+f);let d=!1;(0===f.length||f.length>30)&&(d=!0),isNaN(parseInt(f.slice(0,1)))||(d=!0),d&&(f=r()),a?i[f]=""+a+l:i[f]=l;let p=t?(0,o.escapeStringRegexp)(t):"";return c?s?"(?:/"+p+"(?<"+f+">.+?))?":"/"+p+"(?<"+f+">.+?)":"/"+p+"(?<"+f+">[^/]+?)"}function c(e,t){let r;let u=(0,i.removeTrailingSlash)(e).slice(1).split("/"),a=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={};return{namedParameterizedRoute:u.map(e=>{let r=n.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&i){let[r]=e.split(i[0]);return s({getSafeRouteKey:a,interceptionMarker:r,segment:i[1],routeKeys:l,keyPrefix:t?"nxtI":void 0})}return i?s({getSafeRouteKey:a,segment:i[1],routeKeys:l,keyPrefix:t?"nxtP":void 0}):"/"+(0,o.escapeStringRegexp)(e)}).join(""),routeKeys:l}}function f(e,t){let r=c(e,t);return{...l(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}function d(e,t){let{parameterizedRoute:r}=a(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/"+(n?".*":"")+"$"};let{namedParameterizedRoute:o}=c(e,!1);return{namedRegex:"^"+o+(n?"(?:(/.*)?)":"")+"$"}}},4777:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class r{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),r}_insert(e,t,n){if(0===e.length){this.placeholder=!1;return}if(n)throw Error("Catch-all must be the last part of the URL.");let o=e[0];if(o.startsWith("[")&&o.endsWith("]")){let r=o.slice(1,-1),u=!1;if(r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1),u=!0),r.startsWith("...")&&(r=r.substring(3),n=!0),r.startsWith("[")||r.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+r+"').");if(r.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+r+"').");function i(e,r){if(null!==e&&e!==r)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+r+"').");t.forEach(e=>{if(e===r)throw Error('You cannot have the same slug name "'+r+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===o.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+r+'" differ only by non-word symbols within a single dynamic path')}),t.push(r)}if(n){if(u){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');i(this.optionalRestSlugName,r),this.optionalRestSlugName=r,o="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');i(this.restSlugName,r),this.restSlugName=r,o="[...]"}}else{if(u)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');i(this.slugName,r),this.slugName=r,o="[]"}}this.children.has(o)||this.children.set(o,new r),this.children.get(o)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(e){let t=new r;return e.forEach(e=>t.insert(e)),t.smoosh()}},3987:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return y},NormalizeError:function(){return m},PageNotFoundError:function(){return g},SP:function(){return d},ST:function(){return p},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return l},getLocationOrigin:function(){return u},getURL:function(){return a},isAbsoluteUrl:function(){return i},isResSent:function(){return s},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return v}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),i=0;io.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function a(){let{href:e}=window.location,t=u();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&s(r))return n;if(!n)throw Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.');return n}let d="undefined"!=typeof performance,p=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class m extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class y extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function v(e){return JSON.stringify({message:e.message,stack:e.stack})}}}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/app/_not-found/page-34168ac570dc8992.js b/src/handler/api/static/_next/static/chunks/app/_not-found/page-34168ac570dc8992.js deleted file mode 100644 index 4c5b984..0000000 --- a/src/handler/api/static/_next/static/chunks/app/_not-found/page-34168ac570dc8992.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{7589:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(3634)}])},3634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(7043);let i=n(7437);n(2265);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[971,117,744],function(){return e(e.s=7589)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/app/activity/page-809b415dd18cb14e.js b/src/handler/api/static/_next/static/chunks/app/activity/page-809b415dd18cb14e.js deleted file mode 100644 index 4a8e9ce..0000000 --- a/src/handler/api/static/_next/static/chunks/app/activity/page-809b415dd18cb14e.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[263],{3642:function(e,t,n){Promise.resolve().then(n.bind(n,7839))},7839:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var r=n(7437),c=n(171),s=n(8280),a=n(6039);function i(){let e=(0,c.Q)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"section-head",children:(0,r.jsxs)("div",{className:"hstack",style:{justifyContent:"space-between"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"section-title",children:"Activity"}),(0,r.jsx)("div",{className:"section-desc",children:"Control commands the worker drains from the queue."})]}),(0,r.jsx)(s.zx,{variant:"secondary",disabled:e.cmd.busy,onClick:()=>e.pollCi(),children:"Sweep CI now"})]})}),(0,r.jsx)("div",{className:"section-body",children:0===e.commands.length?(0,r.jsx)("div",{className:"empty",children:"No commands yet."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Type"}),(0,r.jsx)("th",{children:"Repository"}),(0,r.jsx)("th",{children:"Agent"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Result / Error"})]})}),(0,r.jsx)("tbody",{children:e.commands.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,a.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.type}),(0,r.jsx)("td",{className:"mono",children:e.project_id||"—"}),(0,r.jsx)("td",{className:"mono",children:e.agent_name||"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(s.OE,{status:e.status})}),(0,r.jsx)("td",{className:"mono faint",style:{fontSize:"var(--text-xs)"},children:e.error||(e.result?JSON.stringify(e.result):"—")})]},e.id))})]})})})]})}function o(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(i,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return a},Ph:function(){return f},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return h},zx:function(){return o}});var r=n(7437),c=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:c=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[c&&(0,r.jsx)("span",{className:"dot"}),s]})}function a(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,c.FH)(t),children:(0,c.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:c,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:c,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function o(e){let{variant:t="secondary",size:n="md",onClick:c,disabled:s,type:a="button",children:i}=e;return(0,r.jsx)("button",{type:a,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:c,disabled:s,children:i})}function l(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:c,placeholder:s,type:a="text",disabled:i}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("input",{className:"input",type:a,value:n,placeholder:s,disabled:i,onChange:e=>c(e.target.value)})})}function d(e){let{label:t,value:n,onChange:c,placeholder:s,rows:a=3}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:a,placeholder:s,onChange:e=>c(e.target.value)})})}function f(e){let{label:t,value:n,onChange:c,options:s}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>c(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function h(e){let{tabs:t,value:n,onChange:c}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>c(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:c,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),c&&(0,r.jsx)("div",{className:"stat-sub",children:c})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return a},FH:function(){return r},Q6:function(){return i},Sy:function(){return o}});let c={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return c[n]?c[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function a(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function o(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let c=Math.floor(r/60);if(c<24)return"".concat(c,"h");let s=Math.floor(c/24);if(s<30)return"".concat(s,"d");let a=Math.floor(s/30);return a<12?"".concat(a,"mo"):"".concat(Math.floor(a/12),"y")}},257:function(e,t,n){"use strict";var r,c;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(c=n.g.process)?void 0:c.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,c=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var o=[],l=!1,u=-1;function d(){l&&r&&(l=!1,r.length?o=r.concat(o):u=-1,o.length&&f())}function f(){if(!l){var e=i(d);l=!0;for(var t=o.length;t;){for(r=o,o=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),h=(0,a.useMemo)(()=>[{value:"",label:"Claude (subscription)"},...e.claudeModels.filter(e=>e.enabled).map(e=>({value:String(e.id),label:"".concat(e.name," (").concat(e.model,")")}))],[e.claudeModels]),m=(0,a.useMemo)(()=>{let t=new Map(e.claudeModels.map(e=>[e.id,e.name]));return e=>{var n;return null==e?null:null!==(n=t.get(e))&&void 0!==n?n:"#".concat(e)}},[e.claudeModels]),f=(0,a.useMemo)(()=>e.agents.filter(t=>t.project_id===e.selectedProjectId),[e.agents,e.selectedProjectId]),p=async()=>{await e.spawnAgent(t)&&n(u)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Agents"}),(0,r.jsx)("div",{className:"section-desc",children:"Spawn agents into a repository and manage running sessions."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(s.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:d})})}),(0,r.jsxs)(s.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Spawn an agent"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(s.II,{label:"Name",value:t.name,onChange:e=>n({...t,name:e}),placeholder:"junior"}),(0,r.jsx)(s.Ph,{label:"Role",value:t.role,onChange:e=>n({...t,role:e}),options:c}),(0,r.jsx)(s.Ph,{label:"Placement",value:t.placement,onChange:e=>n({...t,placement:e}),options:o}),"worktree"===t.placement?(0,r.jsx)(s.II,{label:"Branch",value:t.worktree,onChange:e=>n({...t,worktree:e}),placeholder:"feat/auth"}):(0,r.jsx)(s.II,{label:"Subdir",value:t.subdir,onChange:e=>n({...t,subdir:e}),placeholder:"api"}),(0,r.jsx)(s.Ph,{label:"Model",value:t.model_id,onChange:e=>n({...t,model_id:e}),options:h})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(s.gx,{label:"Initial task",value:t.task,onChange:e=>n({...t,task:e}),rows:2,placeholder:"initial task / prompt (optional)"})}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(s.zx,{variant:"primary",disabled:e.cmd.busy||!t.name.trim(),onClick:p,children:"Spawn"})})]}),0===f.length?(0,r.jsx)("div",{className:"empty",children:"No agents in this repository."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Role"}),(0,r.jsx)("th",{children:"Model"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Working dir"}),(0,r.jsx)("th",{children:"Created"}),(0,r.jsx)("th",{})]})}),(0,r.jsx)("tbody",{children:f.map(t=>{var n;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"mono",children:t.name}),(0,r.jsx)("td",{children:t.role?(0,r.jsx)(s.Ct,{tone:"info",children:t.role}):"—"}),(0,r.jsx)("td",{children:null!=t.model_id?(0,r.jsx)(s.Ct,{tone:"warning",children:m(t.model_id)}):(0,r.jsx)(s.Ct,{tone:"neutral",children:"claude"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.OE,{status:t.status})}),(0,r.jsx)("td",{className:"mono faint",children:t.working_dir}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(t.created_at)}),(0,r.jsx)("td",{className:"nowrap",children:(0,r.jsxs)("div",{className:"hstack",children:[(0,r.jsx)(s.zx,{size:"sm",variant:"ghost",onClick:()=>e.selectRun(t.project_id,t.name),children:"Open"}),(0,r.jsx)(s.zx,{size:"sm",variant:"secondary",onClick:()=>e.killAgent(t.project_id,t.name),children:"Kill"}),(0,r.jsx)(s.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteAgent(t.project_id,t.name),children:"Delete"})]})})]}),("working"===t.status||"crashed"===t.status)&&(null===(n=t.last_output)||void 0===n?void 0:n.trim())&&(0,r.jsx)("tr",{children:(0,r.jsxs)("td",{colSpan:7,style:{paddingTop:0},children:[(0,r.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-xs)",marginBottom:4},children:["crashed"===t.status?"last output before crash":"live output",t.output_at?" \xb7 ".concat((0,i.Sy)(t.output_at)):""]}),(0,r.jsx)("pre",{className:"mono",style:{margin:0,padding:"8px 10px",background:"var(--surface-2, rgba(0,0,0,0.25))",borderRadius:6,fontSize:"var(--text-xs)",lineHeight:1.4,maxHeight:220,overflow:"auto",whiteSpace:"pre"},children:t.last_output})]})})]},t.id)})})]})})]})})]})}function h(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(d,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return l},II:function(){return u},OE:function(){return s},Ph:function(){return h},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return f},mQ:function(){return m},zx:function(){return c}});var r=n(7437),a=n(6039);function l(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:l}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),l]})}function s(e){let{status:t}=e;return(0,r.jsx)(l,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:l=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(l).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:l,type:s="button",children:i}=e;return(0,r.jsx)("button",{type:s,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:l,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:l,type:s="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:s,value:n,placeholder:l,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:l,rows:s=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:s,placeholder:l,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:l}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:l.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:a,accent:l=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(l?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return l},Eh:function(){return s},FH:function(){return r},Q6:function(){return i},Sy:function(){return c}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function l(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function s(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let l=Math.floor(a/24);if(l<30)return"".concat(l,"d");let s=Math.floor(l/30);return s<12?"".concat(s,"mo"):"".concat(Math.floor(s/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:l}catch(e){t=l}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=c.length;t;){for(r=c,c=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),d=async()=>{await e.submitApproval(t),n(o)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Approvals"}),(0,r.jsx)("div",{className:"section-desc",children:"A merge is denied unless a standing approval exists — made by a different agent, pinned to the reviewed commit."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(c.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:u})})}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Record a verdict"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(c.II,{label:"Branch",value:t.branch,onChange:e=>n({...t,branch:e}),placeholder:"feat/auth"}),(0,r.jsx)(c.Ph,{label:"Verdict",value:t.status,onChange:e=>n({...t,status:e}),options:l}),(0,r.jsx)(c.II,{label:"Agent",value:t.agent_name,onChange:e=>n({...t,agent_name:e}),placeholder:"reads its HEAD (optional)"}),(0,r.jsx)(c.II,{label:"SHA",value:t.sha,onChange:e=>n({...t,sha:e}),placeholder:"pins the approval (optional)"})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(c.II,{label:"Note",value:t.note,onChange:e=>n({...t,note:e}),placeholder:"optional"})}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(c.zx,{variant:"primary",disabled:e.cmd.busy||!t.branch.trim(),onClick:d,children:"Enqueue verdict"})})]}),0===e.approvals.length?(0,r.jsx)("div",{className:"empty",children:"No approvals recorded."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Branch"}),(0,r.jsx)("th",{children:"Verdict"}),(0,r.jsx)("th",{children:"By"}),(0,r.jsx)("th",{children:"SHA"}),(0,r.jsx)("th",{children:"Note"})]})}),(0,r.jsx)("tbody",{children:e.approvals.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.branch}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.status})}),(0,r.jsx)("td",{children:e.approved_by_agent_id?"agent ".concat(e.approved_by_agent_id):e.actor||"—"}),(0,r.jsx)("td",{className:"mono",children:(0,i.Q6)(e.approved_sha)}),(0,r.jsx)("td",{children:e.note||"—"})]},e.id))})]})})]})})]})}function d(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return c},Ph:function(){return h},UW:function(){return m},ZD:function(){return v},Zb:function(){return i},gx:function(){return d},kN:function(){return p},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function c(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:c="button",children:i}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:c="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:c,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:c=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:c,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function m(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return c},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let c=Math.floor(s/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var l=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n{if("awaiting"===n&&a&&u.current&&!u.current.closed)try{u.current.location.href=a}catch(e){}if("done"===n||"error"===n){var e;null===(e=u.current)||void 0===e||e.close(),u.current=null}},[n,a]);let p=()=>{u.current=i("about:blank"),e.startClaudeLogin()},x=async()=>{await e.submitClaudeCode(c)&&d("")};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-sm)"},children:["Log Claude Code in on the host so agents can run. This drives"," ",(0,l.jsx)("span",{className:"mono",children:"claude /login"})," in the control container and picks the Claude account with a subscription."]}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:14},children:[o&&(0,l.jsx)(r.UW,{tone:"error"===n?"danger":"done"===n?"success":"info",children:o}),"done"===n?(0,l.jsx)("div",{children:(0,l.jsx)(r.zx,{variant:"secondary",onClick:e.resetClaudeLogin,children:"Log in again"})}):h?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.UW,{tone:"info",children:"A Claude sign-in window should have opened. Authorize there, copy the code Claude shows you, and paste it below. If the window didn't open (popups blocked), use the button."}),(0,l.jsxs)("div",{className:"hstack",style:{gap:10,flexWrap:"wrap"},children:[(0,l.jsx)(r.zx,{variant:"secondary",disabled:!a,onClick:()=>{a&&(u.current=i(a))},children:"Open Claude sign-in window ↗"}),a&&(0,l.jsx)("a",{className:"btn btn-ghost",href:a,target:"_blank",rel:"noopener noreferrer",children:"Open in a new tab"}),(0,l.jsx)(r.zx,{variant:"ghost",disabled:m,onClick:p,children:"Restart"})]}),(0,l.jsxs)("div",{className:"hstack",style:{gap:10,alignItems:"flex-end",flexWrap:"wrap"},children:[(0,l.jsx)("div",{style:{flex:"1 1 320px"},children:(0,l.jsx)(r.II,{label:"Authorization code",value:c,onChange:d,placeholder:"Paste the code from claude.com",disabled:"submitting"===n})}),(0,l.jsx)(r.zx,{variant:"primary",disabled:"submitting"===n||!c.trim(),onClick:x,children:"submitting"===n?"Submitting…":"Finish login"})]})]}):(0,l.jsxs)("div",{className:"hstack",style:{gap:10},children:[(0,l.jsx)(r.zx,{variant:"primary",disabled:m,onClick:p,children:"starting"===n?"Starting…":"Log in to Claude"}),"error"===n&&(0,l.jsx)(r.zx,{variant:"ghost",disabled:m,onClick:p,children:"Retry"})]})]})]})}function c(e){let n={};for(let a of e.split("\n")){let e=a.trim();if(!e)continue;let l=e.indexOf("=");l<=0||(n[e.slice(0,l).trim()]=e.slice(l+1).trim())}return n}function d(e){return Object.entries(null!=e?e:{}).map(e=>{let[n,a]=e;return"".concat(n,"=").concat(a)}).join("\n")}function u(e){return e.split("\n").map(e=>e.trim()).filter(Boolean)}let m={name:"",description:"",content:"",enabled:!0};function h(){let e=(0,s.Q)(),[n,a]=(0,t.useState)(""),i=async()=>{await e.installClaudeSkill(n.trim())&&a("")};return(0,l.jsxs)(r.Zb,{children:[(0,l.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,l.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Install from a marketplace prompt"})}),(0,l.jsx)(r.gx,{label:"Paste the skill's install prompt (from SkillsMP or any marketplace page)",value:n,onChange:a,rows:5,placeholder:"Install the pdf-tools skill from https://…\n(the whole prompt the marketplace tells you to paste into Claude)"}),(0,l.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:["Runs headlessly on the worker — nobody can answer questions mid-install, so when the instructions offer choices (user vs repo scope, optional variants) Claude picks the defaults itself: skills here are always ",(0,l.jsx)("b",{children:"user scope"})," (Handler syncs them to every worker), and recommended options win. What it chose is reported in the result — review the imported skill below and edit or disable it if a choice was wrong."]}),(0,l.jsx)("div",{className:"hstack mt14",children:(0,l.jsx)(r.zx,{variant:"primary",disabled:e.cmd.busy||!n.trim(),onClick:i,children:e.cmd.busy?"Installing…":"Run install"})})]})}function p(){let e=(0,s.Q)(),[n,a]=(0,t.useState)(m),[i,o]=(0,t.useState)(null),c=()=>{a(m),o(null)},d=async()=>{let a={...n};(null!=i?await e.updateClaudeSkill(i,a):await e.createClaudeSkill(a))&&c()},u=e=>{var n;a({name:e.name,description:null!==(n=e.description)&&void 0!==n?n:"",content:e.content,enabled:e.enabled}),o(e.id)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-sm)",marginBottom:14},children:["Custom Claude Code skills, synced to every worker's"," ",(0,l.jsx)("span",{className:"mono",children:"~/.claude/skills"})," at each launch. The description is what makes Claude pick the skill up — say when to use it. Install one from a marketplace prompt, or author one by hand below."]}),(0,l.jsx)(h,{}),(0,l.jsxs)(r.Zb,{children:[(0,l.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,l.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:null!=i?"Edit skill \xb7 ".concat(n.name):"Add a skill"})}),(0,l.jsxs)("div",{className:"form-grid",children:[(0,l.jsx)(r.II,{label:"Name (slug — becomes the skill directory)",value:n.name,onChange:e=>a({...n,name:e}),placeholder:"deploy-checklist"}),(0,l.jsx)(r.II,{label:"Description (when should Claude use it?)",value:n.description,onChange:e=>a({...n,description:e}),placeholder:"Use when preparing or reviewing a deploy."})]}),(0,l.jsx)("div",{style:{marginTop:10},children:(0,l.jsx)(r.gx,{label:"SKILL.md body (markdown)",value:n.content,onChange:e=>a({...n,content:e}),rows:8,placeholder:"# Deploy checklist\n\n1. ..."})}),(0,l.jsxs)("div",{className:"hstack mt14",children:[(0,l.jsx)(r.zx,{variant:"primary",disabled:!n.name.trim()||!n.content.trim(),onClick:d,children:null!=i?"Save changes":"Add skill"}),null!=i&&(0,l.jsx)(r.zx,{variant:"ghost",onClick:c,children:"Cancel"})]})]}),0===e.claudeSkills.length&&(0,l.jsx)("div",{className:"empty",children:"No custom skills yet."}),e.claudeSkills.map(n=>(0,l.jsxs)(r.Zb,{children:[(0,l.jsxs)("div",{className:"card-head",children:[(0,l.jsx)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:n.name}),(0,l.jsxs)("div",{className:"hstack",children:[(0,l.jsx)(r.Ct,{tone:n.enabled?"success":"neutral",children:n.enabled?"enabled":"disabled"}),(0,l.jsx)(r.ZD,{on:n.enabled,onClick:()=>e.updateClaudeSkill(n.id,{enabled:!n.enabled})}),(0,l.jsx)(r.zx,{size:"sm",variant:"secondary",onClick:()=>u(n),children:"Edit"}),(0,l.jsx)(r.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteClaudeSkill(n.id),children:"Remove"})]})]}),n.description&&(0,l.jsx)("div",{className:"faint",style:{fontSize:"var(--text-sm)",marginTop:8},children:n.description}),n.files.length>0&&(0,l.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:["ships with: ",n.files.join(" \xb7 ")]})]},n.id))]})}let x=[{value:"stdio",label:"stdio (run a command)"},{value:"http",label:"http (remote server)"},{value:"sse",label:"sse (remote server, legacy)"}],v={name:"",transport:"stdio",command:"",args:"",env:"",url:"",headers:"",enabled:!0};function g(){let e=(0,s.Q)(),[n,a]=(0,t.useState)(v),[i,o]=(0,t.useState)(null),m=()=>{a(v),o(null)},h=async()=>{let a={name:n.name,transport:n.transport,command:n.command.trim()||null,args:u(n.args),env:c(n.env),url:n.url.trim()||null,headers:c(n.headers),enabled:n.enabled};(null!=i?await e.updateClaudeConnector(i,a):await e.createClaudeConnector(a))&&m()},p=e=>{var n,l,t;a({name:e.name,transport:e.transport,command:null!==(n=e.command)&&void 0!==n?n:"",args:(null!==(l=e.args)&&void 0!==l?l:[]).join("\n"),env:d(e.env),url:null!==(t=e.url)&&void 0!==t?t:"",headers:d(e.headers),enabled:e.enabled}),o(e.id)},g="stdio"===n.transport;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-sm)",marginBottom:14},children:["MCP servers agents can reach. Passed to each run as its"," ",(0,l.jsx)("span",{className:"mono",children:"--mcp-config"})," file, so nothing lands in the repository tree. stdio commands run inside the control container."]}),(0,l.jsxs)(r.Zb,{children:[(0,l.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,l.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:null!=i?"Edit connector \xb7 ".concat(n.name):"Add a connector"})}),(0,l.jsxs)("div",{className:"form-grid",children:[(0,l.jsx)(r.II,{label:"Name",value:n.name,onChange:e=>a({...n,name:e}),placeholder:"github"}),(0,l.jsx)(r.Ph,{label:"Transport",value:n.transport,onChange:e=>a({...n,transport:e}),options:x}),g?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.II,{label:"Command",value:n.command,onChange:e=>a({...n,command:e}),placeholder:"npx"}),(0,l.jsx)(r.gx,{label:"Arguments (one per line)",value:n.args,onChange:e=>a({...n,args:e}),rows:3,placeholder:"-y\n@modelcontextprotocol/server-github"}),(0,l.jsx)(r.gx,{label:"Environment (KEY=VALUE per line)",value:n.env,onChange:e=>a({...n,env:e}),rows:3,placeholder:"GITHUB_TOKEN=ghp_..."})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.II,{label:"URL",value:n.url,onChange:e=>a({...n,url:e}),placeholder:"https://mcp.example.com/mcp"}),(0,l.jsx)(r.gx,{label:"Headers (KEY=VALUE per line)",value:n.headers,onChange:e=>a({...n,headers:e}),rows:3,placeholder:"Authorization=Bearer ..."})]})]}),(0,l.jsxs)("div",{className:"hstack mt14",children:[(0,l.jsx)(r.zx,{variant:"primary",disabled:!n.name.trim()||(g?!n.command.trim():!n.url.trim()),onClick:h,children:null!=i?"Save changes":"Add connector"}),null!=i&&(0,l.jsx)(r.zx,{variant:"ghost",onClick:m,children:"Cancel"})]})]}),0===e.claudeConnectors.length&&(0,l.jsx)("div",{className:"empty",children:"No connectors yet."}),e.claudeConnectors.map(n=>{var a;return(0,l.jsxs)(r.Zb,{children:[(0,l.jsxs)("div",{className:"card-head",children:[(0,l.jsx)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:n.name}),(0,l.jsxs)("div",{className:"hstack",children:[(0,l.jsx)(r.Ct,{tone:"info",children:n.transport}),(0,l.jsx)(r.Ct,{tone:n.enabled?"success":"neutral",children:n.enabled?"enabled":"disabled"}),(0,l.jsx)(r.ZD,{on:n.enabled,onClick:()=>e.updateClaudeConnector(n.id,{enabled:!n.enabled})}),(0,l.jsx)(r.zx,{size:"sm",variant:"secondary",onClick:()=>p(n),children:"Edit"}),(0,l.jsx)(r.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteClaudeConnector(n.id),children:"Remove"})]})]}),(0,l.jsx)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:"stdio"===n.transport?[n.command,...null!==(a=n.args)&&void 0!==a?a:[]].join(" "):n.url})]},n.id)})]})}let f={name:"",marketplace:"",marketplace_repo:"",enabled:!0};function b(){let e=(0,s.Q)(),[n,a]=(0,t.useState)(f),[i,o]=(0,t.useState)(null),c=()=>{a(f),o(null)},d=async()=>{let a={...n};(null!=i?await e.updateClaudePlugin(i,a):await e.createClaudePlugin(a))&&c()},u=e=>{a({name:e.name,marketplace:e.marketplace,marketplace_repo:e.marketplace_repo,enabled:e.enabled}),o(e.id)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"faint",style:{fontSize:"var(--text-sm)",marginBottom:14},children:"Claude Code plugins, pinned to the marketplace serving them. Generated settings declare the marketplace and enable the plugin, so headless runs install both on boot."}),(0,l.jsxs)(r.Zb,{children:[(0,l.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,l.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:null!=i?"Edit plugin \xb7 ".concat(n.name):"Add a plugin"})}),(0,l.jsxs)("div",{className:"form-grid",children:[(0,l.jsx)(r.II,{label:"Plugin name",value:n.name,onChange:e=>a({...n,name:e}),placeholder:"code-reviewer"}),(0,l.jsx)(r.II,{label:"Marketplace key",value:n.marketplace,onChange:e=>a({...n,marketplace:e}),placeholder:"acme-tools"}),(0,l.jsx)(r.II,{label:"Marketplace repo (owner/repo or git URL)",value:n.marketplace_repo,onChange:e=>a({...n,marketplace_repo:e}),placeholder:"acme/claude-marketplace"})]}),(0,l.jsxs)("div",{className:"hstack mt14",children:[(0,l.jsx)(r.zx,{variant:"primary",disabled:!n.name.trim()||!n.marketplace.trim()||!n.marketplace_repo.trim(),onClick:d,children:null!=i?"Save changes":"Add plugin"}),null!=i&&(0,l.jsx)(r.zx,{variant:"ghost",onClick:c,children:"Cancel"})]})]}),0===e.claudePlugins.length&&(0,l.jsx)("div",{className:"empty",children:"No plugins yet."}),e.claudePlugins.map(n=>(0,l.jsxs)(r.Zb,{children:[(0,l.jsxs)("div",{className:"card-head",children:[(0,l.jsxs)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:[n.name,"@",n.marketplace]}),(0,l.jsxs)("div",{className:"hstack",children:[(0,l.jsx)(r.Ct,{tone:n.enabled?"success":"neutral",children:n.enabled?"enabled":"disabled"}),(0,l.jsx)(r.ZD,{on:n.enabled,onClick:()=>e.updateClaudePlugin(n.id,{enabled:!n.enabled})}),(0,l.jsx)(r.zx,{size:"sm",variant:"secondary",onClick:()=>u(n),children:"Edit"}),(0,l.jsx)(r.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteClaudePlugin(n.id),children:"Remove"})]})]}),(0,l.jsx)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:n.marketplace_repo})]},n.id))]})}let j={name:"",base_url:"",model:"",small_fast_model:"",api_key:"",env:"",enabled:!0};function k(){let e=(0,s.Q)(),[n,a]=(0,t.useState)(j),[i,o]=(0,t.useState)(null),u=()=>{a(j),o(null)},m=async()=>{let a={name:n.name,base_url:n.base_url.trim(),model:n.model.trim(),small_fast_model:n.small_fast_model.trim()||null,api_key:n.api_key.trim()||null,env:c(n.env),enabled:n.enabled};(null!=i?await e.updateClaudeModel(i,a):await e.createClaudeModel(a))&&u()},h=e=>{var n;a({name:e.name,base_url:e.base_url,model:e.model,small_fast_model:null!==(n=e.small_fast_model)&&void 0!==n?n:"",api_key:"",env:d(e.env),enabled:e.enabled}),o(e.id)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-sm)",marginBottom:14},children:["Alternative model backends the spawn dropdown offers next to the Claude subscription — the same ",(0,l.jsx)("span",{className:"mono",children:"claude"})," binary pointed at a different endpoint via ",(0,l.jsx)("span",{className:"mono",children:"ANTHROPIC_BASE_URL"}),", so skills, connectors, hooks, and gates apply unchanged. The endpoint must speak the"," ",(0,l.jsx)("b",{children:"Anthropic Messages API including tool use"})," — a bare OpenAI-compatible server (Ollama, llama.cpp, LM Studio) breaks tool calling; front it with LiteLLM or claude-code-router and enable the backend's native tool parser. See"," ",(0,l.jsx)("span",{className:"mono",children:"docs/local-models.md"})," for working Qwen-Coder stacks."]}),(0,l.jsxs)(r.Zb,{children:[(0,l.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,l.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:null!=i?"Edit model \xb7 ".concat(n.name):"Add a model backend"})}),(0,l.jsxs)("div",{className:"form-grid",children:[(0,l.jsx)(r.II,{label:"Name (what the spawn dropdown shows)",value:n.name,onChange:e=>a({...n,name:e}),placeholder:"qwen3-coder"}),(0,l.jsx)(r.II,{label:"Base URL (Anthropic-compatible /v1/messages endpoint)",value:n.base_url,onChange:e=>a({...n,base_url:e}),placeholder:"http://llm.lan:4000"}),(0,l.jsx)(r.II,{label:"Model id (as the endpoint serves it)",value:n.model,onChange:e=>a({...n,model:e}),placeholder:"qwen3-coder-30b"}),(0,l.jsx)(r.II,{label:"Small/fast model id (optional — defaults to the main model)",value:n.small_fast_model,onChange:e=>a({...n,small_fast_model:e}),placeholder:"qwen3-1.7b"}),(0,l.jsx)(r.II,{label:null!=i?"API key (blank = keep stored key)":"API key (optional)",value:n.api_key,onChange:e=>a({...n,api_key:e}),placeholder:"sk-… (encrypted at rest, never shown again)"}),(0,l.jsx)(r.gx,{label:"Extra env overrides (KEY=VALUE per line, optional)",value:n.env,onChange:e=>a({...n,env:e}),rows:3,placeholder:"API_TIMEOUT_MS=600000\nCLAUDE_CODE_MAX_OUTPUT_TOKENS=8192"})]}),(0,l.jsxs)("div",{className:"hstack mt14",children:[(0,l.jsx)(r.zx,{variant:"primary",disabled:!n.name.trim()||!n.base_url.trim()||!n.model.trim(),onClick:m,children:null!=i?"Save changes":"Add model"}),null!=i&&(0,l.jsx)(r.zx,{variant:"ghost",onClick:u,children:"Cancel"})]})]}),0===e.claudeModels.length&&(0,l.jsx)("div",{className:"empty",children:"No model backends yet — agents run on the Claude subscription."}),e.claudeModels.map(n=>(0,l.jsxs)(r.Zb,{children:[(0,l.jsxs)("div",{className:"card-head",children:[(0,l.jsx)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:n.name}),(0,l.jsxs)("div",{className:"hstack",children:[n.has_api_key&&(0,l.jsx)(r.Ct,{tone:"info",children:"key stored"}),(0,l.jsx)(r.Ct,{tone:n.enabled?"success":"neutral",children:n.enabled?"enabled":"disabled"}),(0,l.jsx)(r.ZD,{on:n.enabled,onClick:()=>e.updateClaudeModel(n.id,{enabled:!n.enabled})}),(0,l.jsx)(r.zx,{size:"sm",variant:"secondary",onClick:()=>h(n),children:"Edit"}),(0,l.jsx)(r.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteClaudeModel(n.id),children:"Remove"})]})]}),(0,l.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:[n.model,n.small_fast_model?" (fast: ".concat(n.small_fast_model,")"):""," @ ",n.base_url]})]},n.id))]})}let y=[{value:"",label:"(keep server baseline)"},{value:"default",label:"default"},{value:"acceptEdits",label:"acceptEdits"},{value:"plan",label:"plan"},{value:"bypassPermissions",label:"bypassPermissions"}];function C(){let e=(0,s.Q)(),n=e.claudePermissions,[a,i]=(0,t.useState)(null);if(null===a&&null!==n){var o;return i({mode:null!==(o=n.default_mode)&&void 0!==o?o:"",allow:n.allow.join("\n"),deny:n.deny.join("\n"),ask:n.ask.join("\n")}),null}return null===a||null===n?(0,l.jsx)("div",{className:"empty",children:"Loading permissions…"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-sm)",marginBottom:14},children:["Overrides merged over the server baseline into every generated"," ",(0,l.jsx)("span",{className:"mono",children:"settings.json"}),". Headless runs auto-deny anything that would prompt, so allow rules are what let work proceed; the PreToolUse/Stop hooks stay the hard gate regardless."]}),(0,l.jsxs)(r.Zb,{children:[(0,l.jsxs)("div",{className:"form-grid",children:[(0,l.jsx)(r.Ph,{label:"Default mode (baseline: ".concat(n.base_mode,")"),value:a.mode,onChange:e=>i({...a,mode:e}),options:y}),(0,l.jsxs)("div",{className:"field",children:[(0,l.jsx)("span",{className:"field-label",children:"Baseline allow rules (from server env)"}),(0,l.jsx)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",padding:"6px 0"},children:n.base_allow.length?n.base_allow.join(" \xb7 "):"—"})]}),(0,l.jsx)(r.gx,{label:"Extra allow rules (one per line)",value:a.allow,onChange:e=>i({...a,allow:e}),rows:4,placeholder:"Bash(npm *)\nWebFetch(domain:docs.example.com)"}),(0,l.jsx)(r.gx,{label:"Deny rules (one per line)",value:a.deny,onChange:e=>i({...a,deny:e}),rows:4,placeholder:"Bash(rm -rf *)\nRead(./secrets/**)"}),(0,l.jsx)(r.gx,{label:"Ask rules (one per line — headless runs deny these)",value:a.ask,onChange:e=>i({...a,ask:e}),rows:4,placeholder:"Bash(git push *)"})]}),(0,l.jsx)("div",{className:"hstack mt14",children:(0,l.jsx)(r.zx,{variant:"primary",onClick:()=>e.saveClaudePermissions({default_mode:a.mode||null,allow:u(a.allow),deny:u(a.deny),ask:u(a.ask)}),children:"Save permissions"})})]})]})}let w=[{value:"account",label:"Account"},{value:"models",label:"Models"},{value:"skills",label:"Skills"},{value:"connectors",label:"Connectors"},{value:"plugins",label:"Plugins"},{value:"permissions",label:"Permissions"}];function N(){let[e,n]=(0,t.useState)("account");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"section-head",children:[(0,l.jsx)("div",{className:"section-title",children:"Claude"}),(0,l.jsx)("div",{className:"section-desc",children:"Manage the Claude Code install agents run on: the account login, alternative model backends, plus skills, MCP connectors, plugins, and permissions. Changes apply to the next launch of every agent."})]}),(0,l.jsxs)("div",{className:"section-body",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsx)(r.mQ,{tabs:w,value:e,onChange:n})}),"account"===e&&(0,l.jsx)(o,{}),"models"===e&&(0,l.jsx)(k,{}),"skills"===e&&(0,l.jsx)(p,{}),"connectors"===e&&(0,l.jsx)(g,{}),"plugins"===e&&(0,l.jsx)(b,{}),"permissions"===e&&(0,l.jsx)(C,{})]})]})}function _(){return(0,l.jsx)("div",{className:"main-scroll",children:(0,l.jsx)(N,{})})}},8280:function(e,n,a){"use strict";a.d(n,{Ct:function(){return s},II:function(){return d},OE:function(){return r},Ph:function(){return m},UW:function(){return x},ZD:function(){return v},Zb:function(){return i},gx:function(){return u},kN:function(){return p},mQ:function(){return h},zx:function(){return o}});var l=a(7437),t=a(6039);function s(e){let{tone:n="neutral",pill:a=!1,dot:t=!1,children:s}=e;return(0,l.jsxs)("span",{className:"badge badge-".concat(n).concat(a?" pill":""),children:[t&&(0,l.jsx)("span",{className:"dot"}),s]})}function r(e){let{status:n}=e;return(0,l.jsx)(s,{tone:(0,t.FH)(n),children:(0,t.Cf)(n)})}function i(e){let{children:n,interactive:a=!1,onClick:t,className:s=""}=e;return(0,l.jsx)("div",{className:"card".concat(a?" interactive":""," ").concat(s).trim(),onClick:t,role:a?"button":void 0,tabIndex:a?0:void 0,children:n})}function o(e){let{variant:n="secondary",size:a="md",onClick:t,disabled:s,type:r="button",children:i}=e;return(0,l.jsx)("button",{type:r,className:"btn btn-".concat(n).concat("sm"===a?" btn-sm":""),onClick:t,disabled:s,children:i})}function c(e){let{label:n,children:a}=e;return(0,l.jsxs)("label",{className:"field",children:[n&&(0,l.jsx)("span",{className:"field-label",children:n}),a]})}function d(e){let{label:n,value:a,onChange:t,placeholder:s,type:r="text",disabled:i}=e;return(0,l.jsx)(c,{label:n,children:(0,l.jsx)("input",{className:"input",type:r,value:a,placeholder:s,disabled:i,onChange:e=>t(e.target.value)})})}function u(e){let{label:n,value:a,onChange:t,placeholder:s,rows:r=3}=e;return(0,l.jsx)(c,{label:n,children:(0,l.jsx)("textarea",{className:"textarea",value:a,rows:r,placeholder:s,onChange:e=>t(e.target.value)})})}function m(e){let{label:n,value:a,onChange:t,options:s}=e;return(0,l.jsx)(c,{label:n,children:(0,l.jsx)("select",{className:"select",value:a,onChange:e=>t(e.target.value),children:s.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})})}function h(e){let{tabs:n,value:a,onChange:t}=e;return(0,l.jsx)("div",{className:"tabs",role:"tablist",children:n.map(e=>(0,l.jsx)("button",{role:"tab","aria-selected":a===e.value,className:"tab".concat(a===e.value?" active":""),onClick:()=>t(e.value),children:e.label},e.value))})}function p(e){let{value:n,label:a,sub:t,accent:s=!1}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:n}),(0,l.jsx)("div",{className:"stat-label",children:a}),t&&(0,l.jsx)("div",{className:"stat-sub",children:t})]})}function x(e){let{tone:n="info",children:a}=e;return(0,l.jsx)("div",{className:"callout callout-".concat(n),children:a})}function v(e){let{on:n,onClick:a}=e;return(0,l.jsx)("button",{type:"button",className:"toggle".concat(n?" on":""),"aria-pressed":n,onClick:a,children:(0,l.jsx)("span",{className:"knob"})})}},6039:function(e,n,a){"use strict";function l(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}a.d(n,{Cf:function(){return s},Eh:function(){return r},FH:function(){return l},Q6:function(){return i},Sy:function(){return o}});let t={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let n=(null!=e?e:"").trim();if(!n)return"—";let a=n.toLowerCase();return t[a]?t[a]:a.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function r(e){if(!e)return"—";let n=new Date(e);return Number.isNaN(n.getTime())?String(e):n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function o(e){if(!e)return"—";let n=new Date(e).getTime();if(Number.isNaN(n))return"—";let a=Math.max(0,Math.floor((Date.now()-n)/1e3));if(a<60)return"".concat(a,"s");let l=Math.floor(a/60);if(l<60)return"".concat(l,"m");let t=Math.floor(l/60);if(t<24)return"".concat(t,"h");let s=Math.floor(t/24);if(s<30)return"".concat(s,"d");let r=Math.floor(s/30);return r<12?"".concat(r,"mo"):"".concat(Math.floor(r/12),"y")}},257:function(e,n,a){"use strict";var l,t;e.exports=(null==(l=a.g.process)?void 0:l.env)&&"object"==typeof(null==(t=a.g.process)?void 0:t.env)?a.g.process:a(4227)},4227:function(e){!function(){var n={229:function(e){var n,a,l,t=e.exports={};function s(){throw Error("setTimeout has not been defined")}function r(){throw Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(a){try{return n.call(null,e,0)}catch(a){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{a="function"==typeof clearTimeout?clearTimeout:r}catch(e){a=r}}();var o=[],c=!1,d=-1;function u(){c&&l&&(c=!1,l.length?o=l.concat(o):d=-1,o.length&&m())}function m(){if(!c){var e=i(u);c=!0;for(var n=o.length;n;){for(l=o,o=[];++d1)for(var a=1;ae.href===t))||void 0===a?void 0:a.key)&&void 0!==n?n:"runs"}let u={runs:{count:e=>e.agents.length,accent:e=>e.agents.some(e=>"paused_for_input"===e.status)},repositories:{count:e=>e.projects.length},agents:{count:e=>e.agents.length},schedules:{count:e=>e.schedules.length},approvals:{count:e=>e.approvals.length},servers:{count:e=>e.hosts.length},activity:{count:e=>e.commands.length},shared:{count:e=>e.shared.context.length},claude:{count:e=>e.claudeSkills.length+e.claudeConnectors.length+e.claudePlugins.length,accent:e=>"done"!==e.claudeLogin.status}};function d(e){let{onSignOut:a,children:n}=e,d=(0,r.Q)(),h=c((0,l.usePathname)()),{setSection:m}=d;return(0,s.useEffect)(()=>{m(h)},[h,m]),(0,t.jsxs)("div",{className:"app",children:[(0,t.jsxs)("aside",{className:"sidebar",children:[(0,t.jsxs)("div",{className:"brand",children:[(0,t.jsx)("span",{className:"logo"}),"Claude Monitor"]}),i.map(e=>{var a,n,s;let l=u[e.key],r=null!==(n=null==l?void 0:l.count(d))&&void 0!==n?n:0,i=null!==(s=null==l?void 0:null===(a=l.accent)||void 0===a?void 0:a.call(l,d))&&void 0!==s&&s;return(0,t.jsxs)(o.default,{href:e.href,className:"nav-item".concat(h===e.key?" active":""),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"count",style:i?{color:"var(--lw-warning-fg)"}:void 0,children:r||""})]},e.key)}),(0,t.jsx)("div",{className:"sidebar-spacer"}),(0,t.jsxs)("div",{className:"sidebar-foot",children:[(0,t.jsxs)("button",{className:"nav-item",onClick:d.refresh,title:"Refresh now",children:[(0,t.jsx)("span",{children:"Refresh"}),(0,t.jsx)("span",{className:"count",children:"↻"})]}),(0,t.jsx)("button",{className:"nav-item",onClick:a,title:"Sign out / change token",children:(0,t.jsx)("span",{children:"Sign out"})})]})]}),(0,t.jsxs)("main",{className:"main",children:[d.cmd.text&&(0,t.jsx)("p",{className:"banner ".concat(d.cmd.error?"err":"ok"),style:{marginTop:16},children:d.cmd.text}),d.lastError&&(0,t.jsx)("p",{className:"banner err",style:{marginTop:12},children:d.lastError}),n]})]})}function h(e){let{error:a,onSubmit:n}=e,[l,r]=(0,s.useState)("");return(0,t.jsx)("div",{className:"gate",children:(0,t.jsxs)("form",{className:"gate-card",onSubmit:e=>{e.preventDefault();let a=l.trim();a&&n(a)},children:[(0,t.jsxs)("div",{className:"gate-brand",children:[(0,t.jsx)("span",{className:"logo",style:{width:26,height:26,borderRadius:7}}),"Claude Monitor"]}),(0,t.jsx)("p",{className:"muted",style:{fontSize:"var(--text-sm)",margin:0},children:"Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token."}),(0,t.jsx)("input",{className:"input",type:"password",autoComplete:"current-password",placeholder:"API token",value:l,onChange:e=>r(e.target.value),autoFocus:!0}),a&&(0,t.jsx)("p",{className:"callout callout-danger",style:{margin:0},children:a}),(0,t.jsx)("button",{className:"btn btn-primary",type:"submit",children:"Continue"})]})})}let m="handler_token";function p(e){let{children:a}=e,[n,o]=(0,s.useState)(null),[i,u]=(0,s.useState)(""),p=(0,l.usePathname)();(0,s.useEffect)(()=>{let e=window.localStorage.getItem(m);e&&o(e)},[]);let g=(0,s.useCallback)(e=>{window.localStorage.setItem(m,e),u(""),o(e)},[]),v=(0,s.useCallback)(()=>{window.localStorage.removeItem(m),o(null)},[]),f=(0,s.useCallback)(()=>{window.localStorage.removeItem(m),o(null),u("Invalid token — please try again.")},[]);return n?(0,t.jsx)(r._,{token:n,onUnauthorized:f,initialSection:c(p),children:(0,t.jsx)(d,{onSignOut:v,children:a})}):(0,t.jsx)(h,{error:i,onSubmit:g})}},7960:function(){}},function(e){e.O(0,[587,258,171,971,117,744],function(){return e(e.s=3471)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/app/login/page-b08c6695be5632dd.js b/src/handler/api/static/_next/static/chunks/app/login/page-b08c6695be5632dd.js deleted file mode 100644 index bf837f7..0000000 --- a/src/handler/api/static/_next/static/chunks/app/login/page-b08c6695be5632dd.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[626],{6258:function(e,u,n){Promise.resolve().then(n.bind(n,6374))},6374:function(e,u,n){"use strict";n.r(u),n.d(u,{default:function(){return s}});var t=n(2265),r=n(9376);function s(){let e=(0,r.useRouter)();return(0,t.useEffect)(()=>{e.replace("/claude")},[e]),null}},9376:function(e,u,n){"use strict";var t=n(5475);n.o(t,"usePathname")&&n.d(u,{usePathname:function(){return t.usePathname}}),n.o(t,"useRouter")&&n.d(u,{useRouter:function(){return t.useRouter}})}},function(e){e.O(0,[971,117,744],function(){return e(e.s=6258)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/app/memory/page-2d205a5c1ee769c1.js b/src/handler/api/static/_next/static/chunks/app/memory/page-2d205a5c1ee769c1.js deleted file mode 100644 index 32ab069..0000000 --- a/src/handler/api/static/_next/static/chunks/app/memory/page-2d205a5c1ee769c1.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[872],{3944:function(e,t,n){Promise.resolve().then(n.bind(n,9244))},9244:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var a=n(7437),r=n(2265),i=n(171),l=n(8280),s=n(6039);let o={fact:"var(--lw-blue-400)",decision:"var(--lw-indigo-400)",gotcha:"var(--lw-warning-fg)",runbook:"var(--lw-success-fg)"},c=["fact","decision","gotcha","runbook"],d={title:"",body:"",kind:"fact",project_id:"",tags:[]};function u(){var e,t,n;let u=(0,i.Q)(),[h,m]=(0,r.useState)(""),[f,x]=(0,r.useState)(null),[p,v]=(0,r.useState)(null),[g,y]=(0,r.useState)(d),[j,b]=(0,r.useState)(""),[_,w]=(0,r.useState)(!1),[k,N]=(0,r.useState)(""),[M,C]=(0,r.useState)("relates_to"),S=(0,r.useMemo)(()=>h?"global"===h?u.memory.notes.filter(e=>!e.project_id):u.memory.notes.filter(e=>e.project_id===h||!e.project_id):u.memory.notes,[u.memory.notes,h]),T=(0,r.useMemo)(()=>{let e=new Set(S.map(e=>e.id));return u.memory.links.filter(t=>e.has(t.src_note_id)&&e.has(t.dst_note_id))},[u.memory.links,S]),z=(0,r.useMemo)(()=>S.map(e=>e.id).join(",")+"|"+T.map(e=>e.id).join(","),[S,T]),E=(0,r.useMemo)(()=>(function(e,t){let n=new Map,a=e.length;if(0===a)return n;e.forEach((e,t)=>{let r=2*Math.PI*t/a;n.set(e.id,{x:450+200*Math.cos(r),y:280+200*Math.sin(r)})});let r=e.map(e=>e.id),i=a>150?80:250;for(let e=0;e[e,{x:0,y:0}]));for(let e=0;e{let e=new Map;for(let a of T){var t,n;e.set(a.src_note_id,(null!==(t=e.get(a.src_note_id))&&void 0!==t?t:0)+1),e.set(a.dst_note_id,(null!==(n=e.get(a.dst_note_id))&&void 0!==n?n:0)+1)}return e},[T]),I=null!==(t=S.find(e=>e.id===f))&&void 0!==t?t:null,P=null!=p?p:f,A=(0,r.useMemo)(()=>{if(null==P)return null;let e=new Set([P]);for(let t of T)t.src_note_id===P&&e.add(t.dst_note_id),t.dst_note_id===P&&e.add(t.src_note_id);return e},[P,T]),B=(0,r.useMemo)(()=>I?T.filter(e=>e.src_note_id===I.id||e.dst_note_id===I.id):[],[I,T]),D=e=>{var t,n;return null!==(n=null===(t=u.memory.notes.find(t=>t.id===e))||void 0===t?void 0:t.title)&&void 0!==n?n:"#".concat(e)},Z=e=>e.split(",").map(e=>e.trim()).filter(Boolean),q=async()=>{let e={...g,tags:Z(j)};(_&&I?await u.updateMemoryNote(I.id,e):await u.createMemoryNote(e))&&(y(d),b(""),w(!1))},O=async()=>{I&&k&&await u.createMemoryLink(I.id,Number(k),M.trim())&&N("")},W=[{value:"",label:"All projects"},{value:"global",label:"Global only"},...u.projects.map(e=>({value:e.id,label:e.id}))];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"section-head",children:[(0,a.jsx)("div",{className:"section-title",children:"Memory"}),(0,a.jsx)("div",{className:"section-desc",children:"The web of notes agents and operators leave behind — facts, decisions, gotchas, runbooks — and how they connect."})]}),(0,a.jsxs)("div",{className:"section-body",children:[(0,a.jsxs)("div",{className:"hstack wrap",style:{alignItems:"flex-end",gap:12},children:[(0,a.jsx)("div",{style:{width:220},children:(0,a.jsx)(l.Ph,{label:"Scope",value:h,onChange:m,options:W})}),(0,a.jsx)("div",{className:"hstack",style:{gap:8,paddingBottom:6},children:c.map(e=>(0,a.jsxs)("span",{className:"hstack",style:{gap:5,alignItems:"center"},children:[(0,a.jsx)("span",{style:{width:9,height:9,borderRadius:"50%",background:o[e],display:"inline-block"}}),(0,a.jsx)("span",{className:"faint",style:{fontSize:"var(--text-xs)"},children:e})]},e))})]}),0===S.length?(0,a.jsx)("div",{className:"empty",children:"No memory notes yet. Agents write them with the handler-memory MCP tools (memory_save / memory_link); you can add one below."}):(0,a.jsx)(l.Zb,{children:(0,a.jsxs)("svg",{viewBox:"0 0 ".concat(900," ").concat(560),style:{width:"100%",height:"auto",display:"block"},role:"img","aria-label":"Graph of memory notes and their links",children:[T.map(e=>{let t=E.get(e.src_note_id),n=E.get(e.dst_note_id);if(!t||!n)return null;let r=null!=P&&(e.src_note_id===P||e.dst_note_id===P);return(0,a.jsxs)("g",{children:[(0,a.jsx)("line",{x1:t.x,y1:t.y,x2:n.x,y2:n.y,stroke:r?"var(--lw-blue-300)":"var(--border-strong)",strokeWidth:r?1.6:1,opacity:A&&!r?.25:.8}),r&&(0,a.jsx)("text",{x:(t.x+n.x)/2,y:(t.y+n.y)/2-4,textAnchor:"middle",fill:"var(--text-faint)",fontSize:10,children:e.relation})]},e.id)}),S.map(e=>{var t,n;let r=E.get(e.id);if(!r)return null;let i=6+Math.min(null!==(t=L.get(e.id))&&void 0!==t?t:0,6),l=null!=A&&!A.has(e.id),s=e.id===f;return(0,a.jsxs)("g",{transform:"translate(".concat(r.x,",").concat(r.y,")"),style:{cursor:"pointer"},opacity:l?.3:1,onMouseEnter:()=>v(e.id),onMouseLeave:()=>v(null),onClick:()=>{x(e.id===f?null:e.id),w(!1)},children:[(0,a.jsx)("circle",{r:i,fill:null!==(n=o[e.kind])&&void 0!==n?n:"var(--lw-neutral-fg)",stroke:s?"var(--lw-white)":"var(--surface-page)",strokeWidth:s?2:1}),(0,a.jsx)("text",{y:i+12,textAnchor:"middle",fill:l?"var(--text-faint)":"var(--text-muted)",fontSize:10.5,children:e.title.length>24?e.title.slice(0,24)+"…":e.title})]},e.id)})]})}),I&&(0,a.jsxs)(l.Zb,{children:[(0,a.jsxs)("div",{className:"card-head",style:{marginBottom:10},children:[(0,a.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:I.title}),(0,a.jsxs)("span",{className:"hstack",style:{gap:8},children:[(0,a.jsx)(l.Ct,{children:I.kind}),(0,a.jsx)(l.Ct,{children:null!==(n=I.project_id)&&void 0!==n?n:"global"})]})]}),(0,a.jsx)("p",{style:{whiteSpace:"pre-wrap",margin:0},children:I.body}),(0,a.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:[null!=I.agent_id?"written by agent ".concat(I.agent_id):"operator-authored"," \xb7 updated ",(0,s.Eh)(I.updated_at),(null===(e=I.tags)||void 0===e?void 0:e.length)?" \xb7 tags: ".concat(I.tags.join(", ")):""]}),B.length>0&&(0,a.jsxs)("div",{style:{marginTop:12},children:[(0,a.jsx)("div",{className:"eyebrow",style:{marginBottom:6},children:"Links"}),B.map(e=>{let t=e.src_note_id===I.id?e.dst_note_id:e.src_note_id,n=e.src_note_id===I.id;return(0,a.jsxs)("div",{className:"hstack",style:{gap:8,marginBottom:4},children:[(0,a.jsx)("span",{className:"faint",style:{fontSize:"var(--text-xs)"},children:n?"".concat(e.relation," →"):"← ".concat(e.relation)}),(0,a.jsx)("a",{href:"#",onClick:e=>{e.preventDefault(),x(t)},children:D(t)}),(0,a.jsx)(l.zx,{size:"sm",variant:"ghost",onClick:()=>u.deleteMemoryLink(e.id),children:"remove"})]},e.id)})]}),(0,a.jsxs)("div",{className:"hstack wrap mt14",style:{gap:8,alignItems:"flex-end"},children:[(0,a.jsx)("div",{style:{width:260},children:(0,a.jsx)(l.Ph,{label:"Link to",value:k,onChange:N,options:[{value:"",label:"— pick a note —"},...S.filter(e=>e.id!==I.id).map(e=>({value:String(e.id),label:e.title}))]})}),(0,a.jsx)("div",{style:{width:160},children:(0,a.jsx)(l.II,{label:"Relation",value:M,onChange:C})}),(0,a.jsx)(l.zx,{disabled:!k,onClick:O,children:"Link"}),(0,a.jsx)(l.zx,{variant:"secondary",onClick:()=>{var e,t,n;I&&(y({title:I.title,body:I.body,kind:c.includes(I.kind)?I.kind:"fact",project_id:null!==(e=I.project_id)&&void 0!==e?e:"",tags:null!==(t=I.tags)&&void 0!==t?t:[]}),b((null!==(n=I.tags)&&void 0!==n?n:[]).join(", ")),w(!0))},children:"Edit"}),(0,a.jsx)(l.zx,{variant:"danger",onClick:async()=>{await u.deleteMemoryNote(I.id),x(null)},children:"Delete"})]})]}),(0,a.jsxs)(l.Zb,{children:[(0,a.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,a.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:_&&I?"Edit note: ".concat(I.title):"New note"})}),(0,a.jsxs)("div",{className:"form-grid",children:[(0,a.jsx)(l.II,{label:"Title",value:g.title,onChange:e=>y(t=>({...t,title:e})),placeholder:"Short, searchable headline"}),(0,a.jsx)(l.Ph,{label:"Kind",value:g.kind,onChange:e=>y(t=>({...t,kind:e})),options:c.map(e=>({value:e,label:e}))}),(0,a.jsx)(l.Ph,{label:"Project",value:g.project_id,onChange:e=>y(t=>({...t,project_id:e})),options:[{value:"",label:"Global"},...u.projects.map(e=>({value:e.id,label:e.id}))]}),(0,a.jsx)(l.II,{label:"Tags (comma-separated)",value:j,onChange:b,placeholder:"auth, deploy"})]}),(0,a.jsx)(l.gx,{label:"Body",value:g.body,onChange:e=>y(t=>({...t,body:e})),rows:5,placeholder:"The knowledge itself — written for a reader with no context."}),(0,a.jsxs)("div",{className:"hstack mt14",style:{gap:8},children:[(0,a.jsx)(l.zx,{variant:"primary",disabled:!g.title.trim()||!g.body.trim(),onClick:q,children:_?"Save changes":"Add note"}),_&&(0,a.jsx)(l.zx,{variant:"ghost",onClick:()=>{w(!1),y(d),b("")},children:"Cancel"})]}),(0,a.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Writes require the admin token. Agents add notes themselves through the bundled handler-memory MCP server."})]})]})]})}function h(){return(0,a.jsx)("div",{className:"main-scroll",children:(0,a.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return i},II:function(){return d},OE:function(){return l},Ph:function(){return h},UW:function(){return x},ZD:function(){return p},Zb:function(){return s},gx:function(){return u},kN:function(){return f},mQ:function(){return m},zx:function(){return o}});var a=n(7437),r=n(6039);function i(e){let{tone:t="neutral",pill:n=!1,dot:r=!1,children:i}=e;return(0,a.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[r&&(0,a.jsx)("span",{className:"dot"}),i]})}function l(e){let{status:t}=e;return(0,a.jsx)(i,{tone:(0,r.FH)(t),children:(0,r.Cf)(t)})}function s(e){let{children:t,interactive:n=!1,onClick:r,className:i=""}=e;return(0,a.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(i).trim(),onClick:r,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function o(e){let{variant:t="secondary",size:n="md",onClick:r,disabled:i,type:l="button",children:s}=e;return(0,a.jsx)("button",{type:l,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:r,disabled:i,children:s})}function c(e){let{label:t,children:n}=e;return(0,a.jsxs)("label",{className:"field",children:[t&&(0,a.jsx)("span",{className:"field-label",children:t}),n]})}function d(e){let{label:t,value:n,onChange:r,placeholder:i,type:l="text",disabled:s}=e;return(0,a.jsx)(c,{label:t,children:(0,a.jsx)("input",{className:"input",type:l,value:n,placeholder:i,disabled:s,onChange:e=>r(e.target.value)})})}function u(e){let{label:t,value:n,onChange:r,placeholder:i,rows:l=3}=e;return(0,a.jsx)(c,{label:t,children:(0,a.jsx)("textarea",{className:"textarea",value:n,rows:l,placeholder:i,onChange:e=>r(e.target.value)})})}function h(e){let{label:t,value:n,onChange:r,options:i}=e;return(0,a.jsx)(c,{label:t,children:(0,a.jsx)("select",{className:"select",value:n,onChange:e=>r(e.target.value),children:i.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:r}=e;return(0,a.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,a.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>r(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:r,accent:i=!1}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"stat-value".concat(i?" accent":""),children:t}),(0,a.jsx)("div",{className:"stat-label",children:n}),r&&(0,a.jsx)("div",{className:"stat-sub",children:r})]})}function x(e){let{tone:t="info",children:n}=e;return(0,a.jsx)("div",{className:"callout callout-".concat(t),children:n})}function p(e){let{on:t,onClick:n}=e;return(0,a.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,a.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function a(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return i},Eh:function(){return l},FH:function(){return a},Q6:function(){return s},Sy:function(){return o}});let r={paused_for_input:"Needs input",not_applicable:"N/A"};function i(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return r[n]?r[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function l(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function s(e){return e?e.slice(0,7):"—"}function o(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let a=Math.floor(n/60);if(a<60)return"".concat(a,"m");let r=Math.floor(a/60);if(r<24)return"".concat(r,"h");let i=Math.floor(r/24);if(i<30)return"".concat(i,"d");let l=Math.floor(i/30);return l<12?"".concat(l,"mo"):"".concat(Math.floor(l/12),"y")}},257:function(e,t,n){"use strict";var a,r;e.exports=(null==(a=n.g.process)?void 0:a.env)&&"object"==typeof(null==(r=n.g.process)?void 0:r.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,a,r=e.exports={};function i(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var o=[],c=!1,d=-1;function u(){c&&a&&(c=!1,a.length?o=a.concat(o):d=-1,o.length&&h())}function h(){if(!c){var e=s(u);c=!0;for(var t=o.length;t;){for(a=o,o=[];++d1)for(var n=1;n[...e.agents.filter(e=>{var n;return n=e.status,"all"===t||("needs"===t?"paused_for_input"===n:"working"===t?"working"===n||"running"===n:"done"===t?"done"===n||"completed"===n:"crashed"!==t||"crashed"===n||"blocked"===n)})].sort((e,t)=>e.created_at"paused_for_input"===e.status).length,p=e.agents.filter(e=>"working"===e.status||"running"===e.status).length;return(0,s.jsxs)("div",{className:"runs",children:[(0,s.jsx)("div",{className:"runs-stats",children:(0,s.jsxs)("div",{className:"stat-row",children:[(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:e.agents.length,label:"Runs tracked"})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:x,label:"Needs input",accent:!0})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:p,label:"Working"})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:e.projects.length,label:"Repositories"})})]})}),(0,s.jsxs)("div",{className:"split",children:[(0,s.jsxs)("div",{className:"split-list",children:[(0,s.jsxs)("div",{className:"split-list-head",children:[(0,s.jsx)("div",{className:"section-title",style:{fontSize:"var(--text-lg)"},children:"Runs"}),(0,s.jsx)(a.mQ,{tabs:c,value:t,onChange:n})]}),(0,s.jsxs)("div",{className:"split-list-scroll",children:[0===i.length&&(0,s.jsx)(a.UW,{tone:"info",children:"No runs match this filter."}),i.map(t=>(0,s.jsx)(d,{agent:t,selected:(null==o?void 0:o.projectId)===t.project_id&&(null==o?void 0:o.name)===t.name,onSelect:()=>e.selectRun(t.project_id,t.name)},"".concat(t.project_id,"/").concat(t.name)))]})]}),(0,s.jsx)("div",{className:"split-detail",children:o?(0,s.jsx)(h,{}):(0,s.jsx)(u,{})})]})]})}function d(e){let{agent:t,selected:n,onSelect:r}=e;return(0,s.jsxs)("button",{className:"run-row".concat(n?" selected":""),onClick:r,children:[(0,s.jsxs)("div",{className:"run-row-top",children:[(0,s.jsx)("span",{className:"run-project",children:t.project_id}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:(0,i.Sy)(t.created_at)})]}),(0,s.jsxs)("div",{className:"truncate muted",style:{fontSize:"var(--text-sm)"},children:[t.name,t.role?" \xb7 ".concat(t.role):""]}),(0,s.jsx)("div",{className:"hstack",style:{gap:8},children:(0,s.jsx)(a.OE,{status:t.status})})]})}function u(){return(0,s.jsx)("div",{style:{padding:"60px 32px",color:"var(--text-muted)"},children:"Select a run to see its checkmark, log, and any open question."})}function h(){var e;let t=(0,l.Q)(),n=t.selectedRun,c=t.agents.find(e=>e.project_id===n.projectId&&e.name===n.name),o=t.checkmark,[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!1),f=(null==c?void 0:c.status)==="paused_for_input",m=async e=>{if(!d.trim())return;p(!0);let n=await t.submitAnswer(d.trim(),e);p(!1),n&&u("")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{padding:"24px 28px",borderBottom:"1px solid var(--border-default)",display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsxs)("div",{className:"hstack",children:[(0,s.jsx)("span",{style:{color:"var(--accent)",fontWeight:"var(--fw-bold)",fontSize:"var(--text-xl)"},children:n.projectId}),(0,s.jsx)("span",{className:"faint",children:"/"}),(0,s.jsx)("span",{style:{color:"var(--text-heading)",fontWeight:"var(--fw-semibold)",fontSize:"var(--text-lg)"},children:n.name}),(0,s.jsx)(a.OE,{status:null==c?void 0:c.status}),(null==c?void 0:c.role)&&(0,s.jsx)(a.Ct,{tone:"info",children:c.role}),(0,s.jsx)("span",{className:"spacer"}),(0,s.jsx)(a.zx,{size:"sm",variant:"secondary",onClick:()=>t.killAgent(n.projectId,n.name),children:"Kill"}),(0,s.jsx)(a.zx,{size:"sm",variant:"danger",onClick:()=>t.deleteAgent(n.projectId,n.name),children:"Delete row"})]}),(0,s.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)"},children:[null!==(e=null==c?void 0:c.working_dir)&&void 0!==e?e:"—"," \xb7 created ",(0,i.Eh)(null==c?void 0:c.created_at)]})]}),(0,s.jsxs)("div",{style:{padding:"20px 28px",display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"eyebrow",style:{marginBottom:10},children:"Checkmark"}),t.checkmarkMissing&&(0,s.jsx)(a.UW,{tone:"info",children:"No checkpoint recorded yet."}),o&&!t.checkmarkMissing&&(0,s.jsxs)("dl",{className:"kv",children:[(0,s.jsx)("dt",{children:"Status"}),(0,s.jsx)("dd",{children:(0,s.jsx)(a.OE,{status:o.status})}),(0,s.jsx)("dt",{children:"Where it stopped"}),(0,s.jsx)("dd",{children:o.where_it_stopped||"—"}),(0,s.jsx)("dt",{children:"Open question"}),(0,s.jsx)("dd",{children:o.open_question||"—"}),(0,s.jsx)("dt",{children:"Next steps"}),(0,s.jsx)("dd",{children:o.next_steps&&o.next_steps.length>0?(0,s.jsx)("ul",{children:o.next_steps.map((e,t)=>(0,s.jsx)("li",{children:e},t))}):"—"}),(0,s.jsx)("dt",{children:"Tests"}),(0,s.jsxs)("dd",{className:"hstack",children:[(0,s.jsx)(a.Ct,{tone:(0,i.FH)(o.tests_status),children:o.tests_status}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:o.tested_at?(0,i.Eh)(o.tested_at):""})]}),(0,s.jsx)("dt",{children:"Build"}),(0,s.jsxs)("dd",{className:"hstack",children:[(0,s.jsx)(a.Ct,{tone:(0,i.FH)(o.build_status),children:o.build_status}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:o.built_at?(0,i.Eh)(o.built_at):""})]}),(0,s.jsx)("dt",{children:"Checkpoint at"}),(0,s.jsx)("dd",{className:"faint",children:(0,i.Eh)(o.checkpoint_at)})]})]}),f&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsx)("div",{className:"eyebrow",children:"Answer this question"}),(0,s.jsx)(a.UW,{tone:"danger",children:(null==o?void 0:o.open_question)||"(no question text on the checkmark)"}),(0,s.jsx)(a.gx,{value:d,onChange:u,rows:3,placeholder:"Your answer…"}),(0,s.jsxs)("div",{className:"hstack",children:[(0,s.jsx)(a.zx,{variant:"secondary",disabled:h||!d.trim(),onClick:()=>m(!1),children:"Answer"}),(0,s.jsx)(a.zx,{variant:"primary",disabled:h||!d.trim(),onClick:()=>m(!0),children:"Answer & Resume"})]})]}),(null==c?void 0:c.session_id)&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsxs)("div",{className:"eyebrow",children:["Run events",c.worker_id?(0,s.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)",marginLeft:8},children:["on ",c.worker_id]}):null]}),0===t.events.length?(0,s.jsx)("div",{className:"empty",children:"No events yet."}):(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:420,overflow:"auto",padding:"10px 12px",background:"var(--surface-2, rgba(0,0,0,0.25))",borderRadius:6},children:t.events.map(e=>(0,s.jsx)(x,{e:e},e.id))})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsx)("div",{className:"eyebrow",children:"Log \xb7 newest first"}),0===t.log.length?(0,s.jsx)("div",{className:"empty",children:"No log entries."}):(0,s.jsx)("div",{className:"table-wrap",children:(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"When"}),(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"Summary"}),(0,s.jsx)("th",{children:"Q / A"}),(0,s.jsx)("th",{children:"Push"}),(0,s.jsx)("th",{children:"CI"})]})}),(0,s.jsx)("tbody",{children:t.log.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,s.jsx)("td",{children:(0,s.jsx)(a.OE,{status:e.status})}),(0,s.jsx)("td",{children:e.summary||"—"}),(0,s.jsxs)("td",{children:[e.question&&(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Q:"})," ",e.question]}),e.answer&&(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"A:"})," ",e.answer]}),!e.question&&!e.answer&&"—"]}),(0,s.jsx)("td",{className:"mono",children:(0,i.Q6)(e.push_sha)}),(0,s.jsx)("td",{children:(0,s.jsx)(a.Ct,{tone:(0,i.FH)(e.ci_status),children:e.ci_status})})]},e.id))})]})}),(0,s.jsxs)("div",{className:"pager",children:[(0,s.jsx)(a.zx,{size:"sm",variant:"ghost",disabled:0===t.logOffset,onClick:()=>t.pageLog(-1),children:"‹ Newer"}),(0,s.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:["offset ",t.logOffset]}),(0,s.jsx)(a.zx,{size:"sm",variant:"ghost",disabled:t.log.length<100,onClick:()=>t.pageLog(1),children:"Older ›"})]})]})]})]})}function x(e){var t,n,r,l;let{e:i}=e,c=null!==(t=i.payload)&&void 0!==t?t:{},o={fontSize:"var(--text-xs)"};if("system"===i.type)return(0,s.jsxs)("div",{className:"faint mono",style:o,children:["▸ session ",null!==(n=c.subtype)&&void 0!==n?n:"event",c.session_id?" \xb7 ".concat(String(c.session_id).slice(0,8)):"",Array.isArray(c.tools)?" \xb7 ".concat(c.tools.length," tools"):""]});if("assistant"===i.type){let e=null===(r=c.message)||void 0===r?void 0:r.content,t=Array.isArray(e)?e:[],n=t.filter(e=>(null==e?void 0:e.type)==="text"&&e.text).map(e=>e.text).join("\n"),l=t.filter(e=>(null==e?void 0:e.type)==="tool_use");return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[n&&(0,s.jsx)("div",{style:{fontSize:"var(--text-sm)",whiteSpace:"pre-wrap"},children:n}),l.length>0&&(0,s.jsx)("div",{className:"hstack",style:{gap:6,flexWrap:"wrap"},children:l.map((e,t)=>(0,s.jsxs)(a.Ct,{tone:"info",children:[e.name,e.input?": ".concat(function(e){let t="string"==typeof e?e:(null==e?void 0:e.command)?String(e.command):JSON.stringify(e);return t.length>80?"".concat(t.slice(0,77),"…"):t}(e.input)):""]},t))})]})}if("result"===i.type){let e=!!c.is_error;return(0,s.jsxs)("div",{className:"hstack",style:{gap:8,flexWrap:"wrap"},children:[(0,s.jsx)(a.Ct,{tone:e?"danger":"success",children:e?"run errored":"run finished"}),(0,s.jsxs)("span",{className:"faint mono",style:o,children:[null!=c.num_turns?"".concat(c.num_turns," turns"):"",null!=c.total_cost_usd?" \xb7 $".concat(Number(c.total_cost_usd).toFixed(4)):""]}),"string"==typeof c.result&&c.result&&(0,s.jsx)("span",{className:"muted",style:{...o,whiteSpace:"pre-wrap",width:"100%"},children:c.result})]})}return"worker"===i.type?(0,s.jsxs)(a.UW,{tone:"danger",children:[null!==(l=c.notice)&&void 0!==l?l:"runner notice",c.stderr_tail?(0,s.jsx)("pre",{className:"mono",style:{...o,margin:"6px 0 0",whiteSpace:"pre-wrap"},children:c.stderr_tail}):null]}):"raw"===i.type?(0,s.jsx)("div",{className:"faint mono",style:{...o,whiteSpace:"pre-wrap"},children:"string"==typeof c.line?c.line.trimEnd():JSON.stringify(c)}):(0,s.jsxs)("div",{className:"faint mono",style:o,children:["▸ ",i.type]})}function p(){return(0,s.jsx)(o,{})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return l},II:function(){return d},OE:function(){return a},Ph:function(){return h},UW:function(){return f},ZD:function(){return m},Zb:function(){return i},gx:function(){return u},kN:function(){return p},mQ:function(){return x},zx:function(){return c}});var s=n(7437),r=n(6039);function l(e){let{tone:t="neutral",pill:n=!1,dot:r=!1,children:l}=e;return(0,s.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[r&&(0,s.jsx)("span",{className:"dot"}),l]})}function a(e){let{status:t}=e;return(0,s.jsx)(l,{tone:(0,r.FH)(t),children:(0,r.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:r,className:l=""}=e;return(0,s.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(l).trim(),onClick:r,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:r,disabled:l,type:a="button",children:i}=e;return(0,s.jsx)("button",{type:a,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:r,disabled:l,children:i})}function o(e){let{label:t,children:n}=e;return(0,s.jsxs)("label",{className:"field",children:[t&&(0,s.jsx)("span",{className:"field-label",children:t}),n]})}function d(e){let{label:t,value:n,onChange:r,placeholder:l,type:a="text",disabled:i}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("input",{className:"input",type:a,value:n,placeholder:l,disabled:i,onChange:e=>r(e.target.value)})})}function u(e){let{label:t,value:n,onChange:r,placeholder:l,rows:a=3}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("textarea",{className:"textarea",value:n,rows:a,placeholder:l,onChange:e=>r(e.target.value)})})}function h(e){let{label:t,value:n,onChange:r,options:l}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("select",{className:"select",value:n,onChange:e=>r(e.target.value),children:l.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})})}function x(e){let{tabs:t,value:n,onChange:r}=e;return(0,s.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,s.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>r(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:r,accent:l=!1}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"stat-value".concat(l?" accent":""),children:t}),(0,s.jsx)("div",{className:"stat-label",children:n}),r&&(0,s.jsx)("div",{className:"stat-sub",children:r})]})}function f(e){let{tone:t="info",children:n}=e;return(0,s.jsx)("div",{className:"callout callout-".concat(t),children:n})}function m(e){let{on:t,onClick:n}=e;return(0,s.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,s.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function s(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return l},Eh:function(){return a},FH:function(){return s},Q6:function(){return i},Sy:function(){return c}});let r={paused_for_input:"Needs input",not_applicable:"N/A"};function l(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return r[n]?r[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function a(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let s=Math.floor(n/60);if(s<60)return"".concat(s,"m");let r=Math.floor(s/60);if(r<24)return"".concat(r,"h");let l=Math.floor(r/24);if(l<30)return"".concat(l,"d");let a=Math.floor(l/30);return a<12?"".concat(a,"mo"):"".concat(Math.floor(a/12),"y")}},257:function(e,t,n){"use strict";var s,r;e.exports=(null==(s=n.g.process)?void 0:s.env)&&"object"==typeof(null==(r=n.g.process)?void 0:r.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,s,r=e.exports={};function l(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:l}catch(e){t=l}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c=[],o=!1,d=-1;function u(){o&&s&&(o=!1,s.length?c=s.concat(c):d=-1,c.length&&h())}function h(){if(!o){var e=i(u);o=!0;for(var t=c.length;t;){for(s=c,c=[];++d1)for(var n=1;n{var t;let n=new Map;for(let r of e.agents)n.set(r.project_id,(null!==(t=n.get(r.project_id))&&void 0!==t?t:0)+1);return n},[e.agents]),h=(0,a.useMemo)(()=>[{value:"",label:e.hosts.length?"Pick a git server…":"No git servers configured"},...e.hosts.map(e=>({value:e.hostname,label:"".concat(e.hostname," (").concat(e.forge_type,")")}))],[e.hosts]),m=()=>{n(l),u(!1)},f=async()=>{(c?await e.updateProject(t.id,t):await e.createProject(t))&&m()},p=e=>{var t,r;n({...l,mode:"manual",id:e.id,root_dir:e.root_dir,git_remote:null!==(t=e.git_remote)&&void 0!==t?t:"",credential_ref:null!==(r=e.credential_ref)&&void 0!==r?r:""}),u(!0)},v=c?!!t.root_dir.trim():"server"===t.mode?!!t.git_server&&/^[\w.-]+\/[\w.-]+$/.test(t.repo.trim()):!!t.id.trim()&&!!t.root_dir.trim();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Repositories"}),(0,r.jsx)("div",{className:"section-desc",children:"Repos Handler manages. Each carries its own agents, history, and credentials."})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)(i.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:c?"Edit repository \xb7 ".concat(t.id):"Add a repository"})}),!c&&(0,r.jsx)("div",{style:{marginBottom:14},children:(0,r.jsx)(i.mQ,{tabs:[{value:"server",label:"From a git server"},{value:"manual",label:"Manual (existing checkout)"}],value:t.mode,onChange:e=>n({...t,mode:e})})}),c||"server"!==t.mode?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(i.II,{label:"ID / slug",value:t.id,onChange:e=>n({...t,id:e}),placeholder:"leeworks-api",disabled:c}),(0,r.jsx)(i.II,{label:"Root dir",value:t.root_dir,onChange:e=>n({...t,root_dir:e}),placeholder:"/var/lib/handler/projects/leeworks"}),(0,r.jsx)(i.II,{label:"Git remote",value:t.git_remote,onChange:e=>n({...t,git_remote:e}),placeholder:"git@github.com:user/repo.git (optional)"}),(0,r.jsx)(i.II,{label:"Credential ref",value:t.credential_ref,onChange:e=>n({...t,credential_ref:e}),placeholder:"env:VAR / file:/path / db:host:github.com"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Optional override — projects on a configured git server use its stored token automatically. credential_ref is a pointer, never the token (env: / file: / db:host:)."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(i.Ph,{label:"Git server",value:t.git_server,onChange:e=>n({...t,git_server:e}),options:h}),(0,r.jsx)(i.II,{label:"Repository (owner/name)",value:t.repo,onChange:e=>n({...t,repo:e}),placeholder:"me/coolproj"}),(0,r.jsx)(i.II,{label:"ID / slug (optional — defaults to the repo name)",value:t.id,onChange:e=>n({...t,id:e}),placeholder:"coolproj"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"The repo is always pulled: Handler derives the remote from the server (ssh when it has a deploy key, https via the stored token otherwise), clones it under PROJECTS_ROOT, and keeps it fresh before every run."})]}),!c&&(0,r.jsxs)("label",{className:"hstack",style:{gap:8,cursor:"pointer",marginTop:14},children:[(0,r.jsx)("input",{type:"checkbox",checked:t.init_mise,onChange:e=>n({...t,init_mise:e.target.checked})}),(0,r.jsxs)("span",{style:{fontSize:"var(--text-sm)"},children:["Initialize mise — after the clone, run an agent that writes a"," ",(0,r.jsx)("span",{className:"mono",children:".mise.toml"})," with a"," ",(0,r.jsx)("span",{className:"mono",children:"[tasks.test]"})," task for this repo’s stack, then commits and pushes it. Needed for repos that don’t define one yet."]})]}),!c&&t.init_mise&&"manual"===t.mode&&!t.git_remote.trim()&&(0,r.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"6px 0 0"},children:["A git remote is required to push the new ",(0,r.jsx)("span",{className:"mono",children:".mise.toml"})," — add one above, or mise won’t be initialized."]}),(0,r.jsxs)("div",{className:"hstack mt14",children:[(0,r.jsx)(i.zx,{variant:"primary",disabled:e.cmd.busy||!v,onClick:f,children:c?"Save changes":"server"===t.mode?"Add & pull":"Register"}),c&&(0,r.jsx)(i.zx,{variant:"ghost",onClick:m,children:"Cancel"})]})]}),0===e.projects.length&&(0,r.jsx)("div",{className:"empty",children:"No repositories registered."}),e.projects.map(t=>{var n,a;return(0,r.jsxs)(i.Zb,{children:[(0,r.jsxs)("div",{className:"card-head",children:[(0,r.jsx)("span",{className:"card-title",children:t.id}),(0,r.jsxs)(i.Ct,{tone:"info",pill:!0,children:[null!==(n=d.get(t.id))&&void 0!==n?n:0," ",(null!==(a=d.get(t.id))&&void 0!==a?a:0)===1?"agent":"agents"]})]}),(0,r.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:4},children:[t.root_dir,t.git_remote?" \xb7 ".concat(t.git_remote):""]}),(0,r.jsxs)("div",{className:"hstack",style:{marginTop:12,justifyContent:"space-between"},children:[(0,r.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:["cred ",t.credential_ref||"server default"," \xb7 added ",(0,o.Eh)(t.created_at)]}),(0,r.jsxs)("div",{className:"hstack",children:[t.git_remote&&(0,r.jsx)(i.zx,{size:"sm",variant:"secondary",onClick:()=>e.syncProject(t.id),children:"Pull now"}),(0,r.jsx)(i.zx,{size:"sm",variant:"secondary",onClick:()=>p(t),children:"Edit"}),(0,r.jsx)(i.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteProject(t.id),children:"Remove"})]})]})]},t.id)})]})]})}function u(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(c,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return i},Ph:function(){return h},UW:function(){return p},ZD:function(){return v},Zb:function(){return o},gx:function(){return d},kN:function(){return f},mQ:function(){return m},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function i(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function o(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:i="button",children:o}=e;return(0,r.jsx)("button",{type:i,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:o})}function c(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:i="text",disabled:o}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("input",{className:"input",type:i,value:n,placeholder:s,disabled:o,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:i=3}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:i,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return i},FH:function(){return r},Q6:function(){return o},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function i(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function o(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let i=Math.floor(s/30);return i<12?"".concat(i,"mo"):"".concat(Math.floor(i/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),h=(0,a.useMemo)(()=>[{value:"",label:"Claude (subscription)"},...e.claudeModels.filter(e=>e.enabled).map(e=>({value:String(e.id),label:"".concat(e.name," (").concat(e.model,")")}))],[e.claudeModels]),f=(0,a.useMemo)(()=>{let n=new Map(e.claudeModels.map(e=>[e.id,e.name]));return e=>{var t;return null==e?null:null!==(t=n.get(e))&&void 0!==t?t:"#".concat(e)}},[e.claudeModels]),m=async()=>{await e.createSchedule(e.selectedProjectId,{name_prefix:n.name_prefix,task:n.task,interval_seconds:Number(n.interval),role:n.role,model_id:n.model_id})&&t(u)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Schedules"}),(0,r.jsx)("div",{className:"section-desc",children:"Spawn a fresh agent on an interval. Each run is stateless — keep continuity in a file the prompt reads and overwrites."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(s.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:d})})}),(0,r.jsxs)(s.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"New schedule"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(s.II,{label:"Name prefix",value:n.name_prefix,onChange:e=>t({...n,name_prefix:e}),placeholder:"nightly"}),(0,r.jsx)(s.Ph,{label:"Interval",value:n.interval,onChange:e=>t({...n,interval:e}),options:o}),(0,r.jsx)(s.Ph,{label:"Role",value:n.role,onChange:e=>t({...n,role:e}),options:c}),(0,r.jsx)(s.Ph,{label:"Model",value:n.model_id,onChange:e=>t({...n,model_id:e}),options:h})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(s.gx,{label:"Prompt (the task every run starts with)",value:n.task,onChange:e=>t({...n,task:e}),rows:3,placeholder:"Read @notes.md and continue from where it left off. Before finishing, overwrite @notes.md with the current state so the next run can pick up from there."})}),(0,r.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:["Runs are named ",(0,r.jsxs)("span",{className:"mono",children:[n.name_prefix.trim()||"prefix","-YYYYMMDD-HHMMSS"]}),". The repo is pulled before every run; the first run fires on the worker's next pass."]}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(s.zx,{variant:"primary",disabled:e.cmd.busy||!n.name_prefix.trim()||!n.task.trim(),onClick:m,children:"Create schedule"})})]}),0===e.schedules.length?(0,r.jsx)("div",{className:"empty",children:"No schedules yet."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"On"}),(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Repository"}),(0,r.jsx)("th",{children:"Interval"}),(0,r.jsx)("th",{children:"Prompt"}),(0,r.jsx)("th",{children:"Next run"}),(0,r.jsx)("th",{children:"Last run"}),(0,r.jsx)("th",{})]})}),(0,r.jsx)("tbody",{children:e.schedules.map(n=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)(s.ZD,{on:n.enabled,onClick:()=>e.updateSchedule(n.id,{enabled:!n.enabled})})}),(0,r.jsxs)("td",{className:"mono",children:[n.name_prefix,n.role?(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(s.Ct,{tone:"info",children:n.role})]}):null,null!=n.model_id?(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(s.Ct,{tone:"warning",children:f(n.model_id)})]}):null]}),(0,r.jsx)("td",{className:"mono faint",children:n.project_id}),(0,r.jsx)("td",{className:"nowrap",children:function(e){let n=o.find(n=>Number(n.value)===e);return n?n.label:e%3600==0?"every ".concat(e/3600,"h"):e%60==0?"every ".concat(e/60,"m"):"every ".concat(e,"s")}(n.interval_seconds)}),(0,r.jsx)("td",{className:"faint",style:{maxWidth:340},children:(0,r.jsx)("span",{className:"truncate",style:{display:"block"},title:n.task,children:n.task})}),(0,r.jsx)("td",{className:"faint nowrap",children:n.enabled?(0,i.Eh)(n.next_run_at):"paused"}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(n.last_run_at)}),(0,r.jsx)("td",{className:"nowrap",children:(0,r.jsx)(s.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteSchedule(n.id),children:"Delete"})})]},n.id))})]})})]})})]})}function h(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(d,{})})}},8280:function(e,n,t){"use strict";t.d(n,{Ct:function(){return l},II:function(){return u},OE:function(){return s},Ph:function(){return h},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return f},zx:function(){return c}});var r=t(7437),a=t(6039);function l(e){let{tone:n="neutral",pill:t=!1,dot:a=!1,children:l}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(n).concat(t?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),l]})}function s(e){let{status:n}=e;return(0,r.jsx)(l,{tone:(0,a.FH)(n),children:(0,a.Cf)(n)})}function i(e){let{children:n,interactive:t=!1,onClick:a,className:l=""}=e;return(0,r.jsx)("div",{className:"card".concat(t?" interactive":""," ").concat(l).trim(),onClick:a,role:t?"button":void 0,tabIndex:t?0:void 0,children:n})}function c(e){let{variant:n="secondary",size:t="md",onClick:a,disabled:l,type:s="button",children:i}=e;return(0,r.jsx)("button",{type:s,className:"btn btn-".concat(n).concat("sm"===t?" btn-sm":""),onClick:a,disabled:l,children:i})}function o(e){let{label:n,children:t}=e;return(0,r.jsxs)("label",{className:"field",children:[n&&(0,r.jsx)("span",{className:"field-label",children:n}),t]})}function u(e){let{label:n,value:t,onChange:a,placeholder:l,type:s="text",disabled:i}=e;return(0,r.jsx)(o,{label:n,children:(0,r.jsx)("input",{className:"input",type:s,value:t,placeholder:l,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:n,value:t,onChange:a,placeholder:l,rows:s=3}=e;return(0,r.jsx)(o,{label:n,children:(0,r.jsx)("textarea",{className:"textarea",value:t,rows:s,placeholder:l,onChange:e=>a(e.target.value)})})}function h(e){let{label:n,value:t,onChange:a,options:l}=e;return(0,r.jsx)(o,{label:n,children:(0,r.jsx)("select",{className:"select",value:t,onChange:e=>a(e.target.value),children:l.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:n,value:t,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:n.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":t===e.value,className:"tab".concat(t===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function m(e){let{value:n,label:t,sub:a,accent:l=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(l?" accent":""),children:n}),(0,r.jsx)("div",{className:"stat-label",children:t}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:n="info",children:t}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(n),children:t})}function x(e){let{on:n,onClick:t}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(n?" on":""),"aria-pressed":n,onClick:t,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,n,t){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}t.d(n,{Cf:function(){return l},Eh:function(){return s},FH:function(){return r},Q6:function(){return i},Sy:function(){return c}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function l(e){let n=(null!=e?e:"").trim();if(!n)return"—";let t=n.toLowerCase();return a[t]?a[t]:t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function s(e){if(!e)return"—";let n=new Date(e);return Number.isNaN(n.getTime())?String(e):n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let n=new Date(e).getTime();if(Number.isNaN(n))return"—";let t=Math.max(0,Math.floor((Date.now()-n)/1e3));if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let l=Math.floor(a/24);if(l<30)return"".concat(l,"d");let s=Math.floor(l/30);return s<12?"".concat(s,"mo"):"".concat(Math.floor(s/12),"y")}},257:function(e,n,t){"use strict";var r,a;e.exports=(null==(r=t.g.process)?void 0:r.env)&&"object"==typeof(null==(a=t.g.process)?void 0:a.env)?t.g.process:t(4227)},4227:function(e){!function(){var n={229:function(e){var n,t,r,a=e.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===l||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:l}catch(e){n=l}try{t="function"==typeof clearTimeout?clearTimeout:s}catch(e){t=s}}();var c=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var n=c.length;n;){for(r=c,c=[];++u1)for(var t=1;t{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch(e){}};return(0,r.jsxs)("div",{style:{marginTop:10},children:[(0,r.jsxs)("div",{className:"hstack",style:{justifyContent:"space-between"},children:[(0,r.jsx)("span",{className:"eyebrow",children:"SSH public key — add it to the forge (deploy key)"}),(0,r.jsx)(o.zx,{size:"sm",variant:"secondary",onClick:i,children:n?"Copied":"Copy"})]}),(0,r.jsx)("pre",{className:"mono",style:{fontSize:"var(--text-xs)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:"6px 0 0",padding:8,border:"1px solid var(--border-default)",borderRadius:6,userSelect:"all"},children:t})]})}function u(){let e=(0,s.Q)(),[t,n]=(0,a.useState)(l),[u,d]=(0,a.useState)(!1),h=()=>{n(l),d(!1)},f=async()=>{(u?await e.updateHost(t.hostname,t):await e.createHost(t))&&h()},p=e=>{var t,r;n({hostname:e.hostname,forge_type:e.forge_type,token_env_var:null!==(t=e.token_env_var)&&void 0!==t?t:"",base_url:null!==(r=e.base_url)&&void 0!==r?r:"",token:"",generate_ssh_key:!1}),d(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Git Servers"}),(0,r.jsxs)("div",{className:"section-desc",children:["Each server carries its own credentials: a forge token (encrypted at rest, used by agents' ",(0,r.jsx)("span",{className:"mono",children:"forge"})," + git) and an SSH deploy key — paste the public key into the forge. New repositories are added by picking a server and typing owner/name."]})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)(o.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:u?"Edit server \xb7 ".concat(t.hostname):"Add a git server"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(o.II,{label:"Hostname",value:t.hostname,onChange:e=>n({...t,hostname:e}),placeholder:"github.com",disabled:u}),(0,r.jsx)(o.Ph,{label:"Type",value:t.forge_type,onChange:e=>n({...t,forge_type:e}),options:i}),(0,r.jsx)(o.II,{label:u?"Forge token (blank = keep current)":"Forge token",type:"password",value:t.token,onChange:e=>n({...t,token:e}),placeholder:"stored encrypted; used by forge + git"}),(0,r.jsx)(o.II,{label:"Base URL (optional)",value:t.base_url,onChange:e=>n({...t,base_url:e}),placeholder:"https://git.corp.internal:8443"}),(0,r.jsx)(o.II,{label:"Token env var override (optional)",value:t.token_env_var,onChange:e=>n({...t,token_env_var:e}),placeholder:"GITEA_TOKEN"}),(0,r.jsxs)("label",{className:"field",children:[(0,r.jsx)("span",{className:"field-label",children:"SSH deploy key"}),(0,r.jsxs)("label",{className:"hstack",style:{gap:8,cursor:"pointer"},children:[(0,r.jsx)("input",{type:"checkbox",checked:t.generate_ssh_key,onChange:e=>n({...t,generate_ssh_key:e.target.checked})}),(0,r.jsx)("span",{style:{fontSize:"var(--text-sm)"},children:u?"Regenerate keypair (replaces the current key)":"Generate a keypair"})]})]})]}),(0,r.jsxs)("div",{className:"hstack mt14",children:[(0,r.jsx)(o.zx,{variant:"primary",disabled:e.cmd.busy||!t.hostname.trim(),onClick:f,children:u?"Save changes":"Add server"}),u&&(0,r.jsx)(o.zx,{variant:"ghost",onClick:h,children:"Cancel"})]})]}),0===e.hosts.length&&(0,r.jsx)("div",{className:"empty",children:"No git servers registered (built-in host map still applies)."}),e.hosts.map(t=>(0,r.jsxs)(o.Zb,{children:[(0,r.jsxs)("div",{className:"card-head",children:[(0,r.jsx)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:t.hostname}),(0,r.jsxs)("div",{className:"hstack",children:[(0,r.jsx)(o.Ct,{tone:"info",children:t.forge_type}),(0,r.jsx)(o.Ct,{tone:t.has_token?"success":"neutral",children:t.has_token?"token stored":"no token"}),(0,r.jsx)(o.Ct,{tone:t.ssh_public_key?"success":"neutral",children:t.ssh_public_key?"ssh key":"no ssh key"}),(0,r.jsx)(o.zx,{size:"sm",variant:"secondary",onClick:()=>p(t),children:"Edit"}),(0,r.jsx)(o.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteHost(t.hostname),children:"Remove"})]})]}),(0,r.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:["token env ",t.token_env_var||"—",t.base_url?" \xb7 ".concat(t.base_url):""]}),t.ssh_public_key&&(0,r.jsx)(c,{value:t.ssh_public_key})]},t.hostname))]})]})}function d(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return o},Ph:function(){return h},UW:function(){return m},ZD:function(){return v},Zb:function(){return i},gx:function(){return d},kN:function(){return p},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function o(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:o="button",children:i}=e;return(0,r.jsx)("button",{type:o,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function c(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:o="text",disabled:i}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("input",{className:"input",type:o,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:o=3}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:o,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function m(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return o},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function o(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let o=Math.floor(s/30);return o<12?"".concat(o,"mo"):"".concat(Math.floor(o/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=i(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n{t.trim()&&l.trim()&&await e.setSharedKey(t.trim(),l.trim())&&(n(""),o(""))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Shared"}),(0,r.jsx)("div",{className:"section-desc",children:"The cross-project global feed and shared facts."})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"eyebrow",style:{marginBottom:10},children:"Global feed"}),0===e.shared.log.length?(0,r.jsx)("div",{className:"empty",children:"No global log entries."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Agent"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Summary"}),(0,r.jsx)("th",{children:"CI"})]})}),(0,r.jsx)("tbody",{children:e.shared.log.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.agent_id}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.status})}),(0,r.jsx)("td",{children:e.summary||"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.ci_status})})]},e.id))})]})})]}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Set a shared key"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(c.II,{label:"Key",value:t,onChange:n,placeholder:"key"}),(0,r.jsx)(c.II,{label:"Value",value:l,onChange:o,placeholder:"value"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Requires the shared-context write token (or admin/global if unset)."}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(c.zx,{variant:"primary",disabled:!t.trim()||!l.trim(),onClick:u,children:"Set"})})]}),e.shared.context.length>0&&(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Key"}),(0,r.jsx)("th",{children:"Value"}),(0,r.jsx)("th",{children:"Updated"})]})}),(0,r.jsx)("tbody",{children:e.shared.context.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"mono",children:e.key}),(0,r.jsx)("td",{children:e.value}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.updated_at)})]},e.key))})]})})]})]})}function o(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(l,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return c},Ph:function(){return h},UW:function(){return x},ZD:function(){return p},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function c(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:c="button",children:i}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:c="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:c,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:c=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:c,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function x(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function p(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return c},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let c=Math.floor(s/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var l=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;np||(e.current=d[p],d[p]=null,p--)}function g(e,t){d[++p]=e.current,e.current=t}var y=Symbol.for("react.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen"),F=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.cache");Symbol.for("react.tracing_marker");var O=Symbol.iterator;function R(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D=m(null),A=m(null),I=m(null),U=m(null),B={$$typeof:E,_currentValue:null,_currentValue2:null,_threadCount:0,Provider:null,Consumer:null};function V(e,t){switch(g(I,t),g(A,e),g(D,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?s2(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=s3(e=s2(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}h(D),g(D,t)}function Q(){h(D),h(A),h(I)}function $(e){null!==e.memoizedState&&g(U,e);var t=D.current,n=s3(t,e.type);t!==n&&(g(A,e),g(D,n))}function j(e){A.current===e&&(h(D),h(A)),U.current===e&&(h(U),B._currentValue=null)}var W=a.unstable_scheduleCallback,H=a.unstable_cancelCallback,q=a.unstable_shouldYield,K=a.unstable_requestPaint,Y=a.unstable_now,X=a.unstable_getCurrentPriorityLevel,G=a.unstable_ImmediatePriority,Z=a.unstable_UserBlockingPriority,J=a.unstable_NormalPriority,ee=a.unstable_LowPriority,et=a.unstable_IdlePriority,en=a.log,er=a.unstable_setDisableYieldValue,el=null,ea=null;function eo(e){if("function"==typeof en&&er(e),ea&&"function"==typeof ea.setStrictMode)try{ea.setStrictMode(el,e)}catch(e){}}var ei=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(eu(e)/es|0)|0},eu=Math.log,es=Math.LN2,ec=128,ef=4194304;function ed(e){var t=42&e;if(0!==t)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: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 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ep(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,l=e.suspendedLanes;e=e.pingedLanes;var a=134217727&n;return 0!==a?0!=(n=a&~l)?r=ed(n):0!=(e&=a)&&(r=ed(e)):0!=(n&=~l)?r=ed(n):0!==e&&(r=ed(e)),0===r?0:0!==t&&t!==r&&0==(t&l)&&((l=r&-r)>=(e=t&-t)||32===l&&0!=(4194176&e))?t:r}function em(e,t){return e.errorRecoveryDisabledLanes&t?0:0!=(e=-536870913&e.pendingLanes)?e:536870912&e?536870912:0}function eh(){var e=ec;return 0==(4194176&(ec<<=1))&&(ec=128),e}function eg(){var e=ef;return 0==(62914560&(ef<<=1))&&(ef=4194304),e}function ey(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ev(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ei(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function eb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ei(n),l=1<l||u[r]!==s[l]){var c="\n"+u[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{eG=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?eX(n):""}function eJ(e){try{var t="";do t+=function(e){switch(e.tag){case 26:case 27:case 5:return eX(e.type);case 16:return eX("Lazy");case 13:return eX("Suspense");case 19:return eX("SuspenseList");case 0:case 2:case 15:return e=eZ(e.type,!1);case 11:return e=eZ(e.type.render,!1);case 1:return e=eZ(e.type,!0);default:return""}}(e),e=e.return;while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var e0=Symbol.for("react.client.reference");function e1(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function e2(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function e3(e){e._valueTracker||(e._valueTracker=function(e){var t=e2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function e4(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e2(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e6(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var e8=/[\n"\\]/g;function e5(e){return e.replace(e8,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function e7(e,t,n,r,l,a,o,i){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+e1(t)):e.value!==""+e1(t)&&(e.value=""+e1(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?te(e,o,e1(t)):null!=n?te(e,o,e1(n)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.name=""+e1(i):e.removeAttribute("name")}function e9(e,t,n,r,l,a,o,i){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||null!=t))return;n=null!=n?""+e1(n):"",t=null!=t?""+e1(t):n,i||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=i?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function te(e,t,n){"number"===t&&e6(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}var tt=Array.isArray;function tn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=iX.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}var to=ta;"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(to=function(e,t){return MSApp.execUnsafeLocalFunction(function(){return ta(e,t)})});var ti=to;function tu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var ts=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tc(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||ts.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tf(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&n[l]!==r&&tc(e,l,r)}else for(var a in t)t.hasOwnProperty(a)&&tc(e,a,t[a])}function td(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tm=null;function th(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tg=null,ty=null;function tv(e){var t=eO(e);if(t&&(e=t.stateNode)){var n=eD(e);switch(e=t.stateNode,t.type){case"input":if(e7(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+e5(""+t)+'"][type="radio"]'),t=0;t>=o,l-=o,tj=1<<32-ei(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),tZ&&tH(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),tZ&&tH(l,g),c;if(null===h){for(;!v.done;g++,v=u.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return tZ&&tH(l,g),c}for(h=r(l,h);!v.done;g++,v=u.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),tZ&&tH(l,g),c}(s,c,f,h);if("function"==typeof f.then)return u(s,c,nJ(f),h);if(f.$$typeof===E)return u(s,c,ai(s,f,h),h);n1(s,f)}return"string"==typeof f&&""!==f||"number"==typeof f?(f=""+f,null!==c&&6===c.tag?(n(s,c.sibling),(c=l(c,f)).return=s):(n(s,c),(c=i_(f,s.mode,h)).return=s),o(s=c)):n(s,c)}(u,s,c,f),nG=null,u}}var n4=n3(!0),n6=n3(!1),n8=m(null),n5=m(0);function n7(e,t){g(n5,e=oz),g(n8,t),oz=e|t.baseLanes}function n9(){g(n5,oz),g(n8,n8.current)}function re(){oz=n5.current,h(n8),h(n5)}var rt=m(null),rn=null;function rr(e){var t=e.alternate;g(ri,1&ri.current),g(rt,e),null===rn&&(null===t||null!==n8.current?rn=e:null!==t.memoizedState&&(rn=e))}function rl(e){if(22===e.tag){if(g(ri,ri.current),g(rt,e),null===rn){var t=e.alternate;null!==t&&null!==t.memoizedState&&(rn=e)}}else ra(e)}function ra(){g(ri,ri.current),g(rt,rt.current)}function ro(e){h(rt),rn===e&&(rn=null),h(ri)}var ri=m(0);function ru(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rs=s.ReactCurrentDispatcher,rc=s.ReactCurrentBatchConfig,rf=0,rd=null,rp=null,rm=null,rh=!1,rg=!1,ry=!1,rv=0,rb=0,rk=null,rw=0;function rS(){throw Error(i(321))}function rC(e,t){if(null===t)return!1;for(var n=0;na?a:8;var o=rc.transition,i={_callbacks:new Set};rc.transition=i,lf(e,!1,t,n);try{var u=l();if(null!==u&&"object"==typeof u&&"function"==typeof u.then){av(i,u);var s,c,f=(s=[],c={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},u.then(function(){c.status="fulfilled",c.value=r;for(var e=0;e title"))),sG(l,n,r),l[eE]=e,eI(l),n=l;break e;case"link":var a=cE("link","href",t).get(n+(r.href||""));if(a){for(var o=0;o",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?l.createElement(n,{is:r.is}):l.createElement(n)}}e[eE]=t,e[ex]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(t.stateNode=e,sG(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break;case"img":e=!0;break;default:e=!1}e&&aC(t)}}return aP(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&aC(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=I.current,t9(t)){e:{if(e=t.stateNode,n=t.memoizedProps,e[eE]=t,(r=e.nodeValue!==n)&&null!==(l=tX))switch(l.tag){case 3:if(l=0!=(1&l.mode),sq(e.nodeValue,n,l),l){e=!1;break e}break;case 27:case 5:var a=0!=(1&l.mode);if(!0!==l.memoizedProps.suppressHydrationWarning&&sq(e.nodeValue,n,a),a){e=!1;break e}}e=r}e&&aC(t)}else(e=s1(e).createTextNode(r))[eE]=t,t.stateNode=e}return aP(t),null;case 13:if(ro(t),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(tZ&&null!==tG&&0!=(1&t.mode)&&0==(128&t.flags))ne(),nt(),t.flags|=384,l=!1;else if(l=t9(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(i(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(i(317));l[eE]=t}else nt(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;aP(t),l=!1}else null!==tJ&&(o0(tJ),tJ=null),l=!0;if(!l)return 256&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ax(t,t.updateQueue),aP(t),null;case 4:return Q(),null===e&&sA(t.stateNode.containerInfo),aP(t),null;case 10:return an(t.type._context),aP(t),null;case 19:if(h(ri),null===(l=t.memoizedState))return aP(t),null;if(r=0!=(128&t.flags),null===(a=l.rendering)){if(r)az(l,!1);else{if(0!==oP||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=ru(e))){for(t.flags|=128,az(l,!1),e=a.updateQueue,t.updateQueue=e,ax(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)ix(n,e),n=n.sibling;return g(ri,1&ri.current|2),t.child}e=e.sibling}null!==l.tail&&Y()>oI&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=ru(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ax(t,e),az(l,!0),null===l.tail&&"hidden"===l.tailMode&&!a.alternate&&!tZ)return aP(t),null}else 2*Y()-l.renderingStartTime>oI&&536870912!==n&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}l.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=l.last)?e.sibling=a:t.child=a,l.last=a)}if(null!==l.tail)return t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,e=ri.current,g(ri,r?1&e|2:1&e),t;return aP(t),null;case 22:case 23:return ro(t),re(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(536870912&n)&&0==(128&t.flags)&&(aP(t),6&t.subtreeFlags&&(t.flags|=8192)):aP(t),null!==(n=t.updateQueue)&&ax(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&h(ab),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),an(ad),aP(t),null;case 25:return null}throw Error(i(156,t.tag))}(t.alternate,t,oz);if(null!==n){ow=n;return}if(null!==(t=t.sibling)){ow=t;return}ow=t=e}while(null!==t);0===oP&&(oP=5)}function is(e,t,n,r,l){var a=ek,o=ov.transition;try{ov.transition=null,ek=2,function(e,t,n,r,l,a){do id();while(null!==oj);if(0!=(6&ob))throw Error(i(327));var o,u=e.finishedWork,s=e.finishedLanes;if(null!==u){if(e.finishedWork=null,e.finishedLanes=0,u===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var c=u.lanes|u.childLanes;if(function(e,t,n){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0,t=e.entanglements;for(var l=e.expirationTimes,a=e.hiddenUpdates;0r&&(l=r,r=a,a=l),l=si(n,a);var o=si(n,r);l&&o&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;nn?32:n;n=ov.transition;var l=ek;try{if(ov.transition=null,ek=r,null===oj)var a=!1;else{r=oq,oq=null;var o=oj,u=oW;if(oj=null,oW=0,0!=(6&ob))throw Error(i(331));var s=ob;if(ob|=4,of(o.current),ol(o,o.current,u,r),ob=s,nb(!1),ea&&"function"==typeof ea.onPostCommitFiberRoot)try{ea.onPostCommitFiberRoot(el,o)}catch(e){}a=!0}return a}finally{ek=l,ov.transition=n,ic(e,t)}}return!1}function ip(e,t,n){t=lL(e,t=lP(n,t),2),null!==(e=nO(e,t,2))&&(o2(e,2),nv(e))}function im(e,t,n){if(3===e.tag)ip(e,e,n);else for(;null!==t;){if(3===t.tag){ip(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oQ||!oQ.has(r))){e=lT(t,e=lP(n,e),2),null!==(t=nO(t,e,2))&&(o2(t,2),nv(t));break}}t=t.return}}function ih(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new om;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(ox=!0,l.add(n),e=ig.bind(null,e,t,n),t.then(e,e))}function ig(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,2&ob?oR=!0:4&ob&&(oD=!0),ik(),ok===e&&(oS&n)===n&&(4===oP||3===oP&&(62914560&oS)===oS&&300>Y()-oA?0==(2&ob)&&o5(e,0):oT|=n),nv(e)}function iy(e,t){0===t&&(t=0==(1&e.mode)?2:eg()),null!==(e=ns(e,t))&&(o2(e,t),nv(e))}function iv(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iy(e,n)}function ib(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iy(e,n)}function ik(){if(50=uH),uY=!1;function uX(e,t){switch(e){case"keyup":return -1!==uj.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uG(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var uZ=!1,uJ={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!uJ[e.type]:"textarea"===t}function u1(e,t,n,r){tb(r),0<(t=sV(t,"onChange")).length&&(n=new i3("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var u2=null,u3=null;function u4(e){sM(e,0)}function u6(e){if(e4(eR(e)))return e}function u8(e,t){if("change"===e)return t}var u5=!1;if(e$){if(e$){var u7="oninput"in document;if(!u7){var u9=document.createElement("div");u9.setAttribute("oninput","return;"),u7="function"==typeof u9.oninput}r=u7}else r=!1;u5=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=so(r)}}function su(){for(var e=window,t=e6();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e6(e.document)}return t}function ss(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sc=e$&&"documentMode"in document&&11>=document.documentMode,sf=null,sd=null,sp=null,sm=!1;function sh(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;sm||null==sf||sf!==e6(r)||(r="selectionStart"in(r=sf)&&ss(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sp&&nQ(sp,r)||(sp=r,0<(r=sV(sd,"onSelect")).length&&(t=new i3("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sf)))}function sg(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sy={animationend:sg("Animation","AnimationEnd"),animationiteration:sg("Animation","AnimationIteration"),animationstart:sg("Animation","AnimationStart"),transitionend:sg("Transition","TransitionEnd")},sv={},sb={};function sk(e){if(sv[e])return sv[e];if(!sy[e])return e;var t,n=sy[e];for(t in n)if(n.hasOwnProperty(t)&&t in sb)return sv[e]=n[t];return e}e$&&(sb=document.createElement("div").style,"AnimationEvent"in window||(delete sy.animationend.animation,delete sy.animationiteration.animation,delete sy.animationstart.animation),"TransitionEvent"in window||delete sy.transitionend.transition);var sw=sk("animationend"),sS=sk("animationiteration"),sC=sk("animationstart"),sE=sk("transitionend"),sx=new Map,sz="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function sP(e,t){sx.set(e,t),eV(t,[e])}for(var sN=0;sN title"):null)}var cz=null;function cP(){}function cN(){if(this.count--,0===this.count){if(this.stylesheets)cL(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var c_=null;function cL(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,c_=new Map,t.forEach(cT,e),c_=null,cN.call(e))}function cT(e,t){if(!(4&t.state.loading)){var n=c_.get(e);if(n)var r=n.get(null);else{n=new Map,c_.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a