@@ -1444,11 +1475,13 @@ function RefreshButton({ onClick, compactOnMobile = false }: { onClick: () => vo
export {
ActorFilter,
+ ProductMeta,
StatusBadge,
buildJobQuery,
groupSessionEvents,
groupTranscriptEntries,
selectedJobIdFromPath,
+ shouldRefreshJobForSessionEvent,
};
const root = document.getElementById("root");
diff --git a/docs/dashboard-github-oauth.md b/docs/dashboard-github-oauth.md
index df5aadd..195bf04 100644
--- a/docs/dashboard-github-oauth.md
+++ b/docs/dashboard-github-oauth.md
@@ -44,9 +44,10 @@ loopback-only unless it is behind HTTPS and an authenticated reverse proxy.
6. Create the app, then copy the **Client ID**.
7. Generate a **Client secret** and copy it into the private environment file.
-The dashboard currently requests `read:user read:org`. `read:org` is required
-when access is granted by `GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_ORGS`,
-especially for private organization membership.
+The dashboard requests `read:user` by default. It also requests `read:org` when
+access is granted by `GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_ORGS` or
+`GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_TEAMS`, especially for private
+organization and team membership.
## Configure the Dashboard Environment
@@ -59,6 +60,7 @@ GITHUB_OAUTH_CLIENT_ID=replace-with-github-oauth-client-id
GITHUB_OAUTH_CLIENT_SECRET=replace-with-github-oauth-client-secret
GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_USERS=your-github-login
GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_ORGS=
+GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_TEAMS=
EOF
chmod 600 ~/.config/github-agent-bridge/env
```
@@ -77,12 +79,14 @@ Use at least one authorization allowlist:
- `GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_USERS`: comma-separated GitHub logins.
- `GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_ORGS`: comma-separated GitHub
organizations whose members may access the dashboard.
+- `GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_TEAMS`: comma-separated GitHub teams in
+ `org/team-slug` form whose members may access the dashboard.
-If both allowlists are empty, any authenticated GitHub user is accepted. That is
+If all allowlists are empty, any authenticated GitHub user is accepted. That is
only appropriate for isolated local development.
-Team-level allowlists and per-repository dashboard scopes are part of the issue
-#4 architecture but are not implemented in the current dashboard backend.
+Per-repository dashboard scopes are part of the issue #4 architecture but are
+not implemented in the current dashboard backend.
## Start the Service
diff --git a/docs/installation.md b/docs/installation.md
index f612f3c..8386931 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -245,6 +245,7 @@ GITHUB_AGENT_BRIDGE_DASHBOARD_SECRET_KEY=replace-with-random-secret
GITHUB_OAUTH_CLIENT_ID=replace-with-github-oauth-client-id
GITHUB_OAUTH_CLIENT_SECRET=replace-with-github-oauth-client-secret
GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_USERS=your-github-login
+GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_TEAMS=
EOF
```
diff --git a/docs/operations.md b/docs/operations.md
index 2280335..2b87a76 100644
--- a/docs/operations.md
+++ b/docs/operations.md
@@ -127,6 +127,7 @@ GITHUB_OAUTH_CLIENT_ID=replace-with-github-oauth-client-id
GITHUB_OAUTH_CLIENT_SECRET=replace-with-github-oauth-client-secret
GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_USERS=alice,bob
GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_ORGS=example-org
+GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_TEAMS=example-org/platform
```
See [`dashboard-github-oauth.md`](dashboard-github-oauth.md) for the GitHub
@@ -221,6 +222,19 @@ before it is returned to the authenticated dashboard. The process activity panel
uses persisted process samples for a compact CPU history line chart when monitor
samples exist, and falls back to the live executor snapshot otherwise.
+When publishing the dashboard through nginx, disable buffering for the proxied
+dashboard location so SSE events flush immediately:
+
+```nginx
+location / {
+ proxy_pass http://127.0.0.1:8765;
+ proxy_http_version 1.1;
+ proxy_buffering off;
+ proxy_cache off;
+ proxy_read_timeout 1h;
+}
+```
+
## Operational SLOs
| Signal | Target |
diff --git a/docs/policy-reference.md b/docs/policy-reference.md
index 9e92fa9..3353656 100644
--- a/docs/policy-reference.md
+++ b/docs/policy-reference.md
@@ -44,11 +44,12 @@ gab --policy ~/.config/github-agent-bridge/policy.json enqueue-comment-url ...
```json
{
"source": {
- "from": "notifications@github.com",
+ "from": ["notifications@github.com", "giscebot@gisce.net"],
"requiredAuth": ["spf=pass", "dkim=pass", "dmarc=pass"],
"requiredUrlPrefix": "https://github.com/",
"messageIdDomain": "github.com"
},
+ "botLogins": ["pilipilisbot"],
"trustedRepos": ["your-org/your-repo"],
"trustedOrgs": ["your-org"],
"enabledRepos": ["your-org/your-repo"],
@@ -97,6 +98,7 @@ gab --policy ~/.config/github-agent-bridge/policy.json enqueue-comment-url ...
| `orgRoutes` | object | `{}` | Per-owner delivery routes used when no `repoRoutes` entry matches. |
| `repoRoles` | object | `{}` | Exact per-repo operating role. Takes precedence over `orgRoles`. |
| `orgRoles` | object | `{}` | Per-owner operating role used when no `repoRoles` entry matches. |
+| `botLogins` | array of strings | `["pilipilisbot"]` | GitHub login names that should count as addressed bots when classifying mentions, assignments, and review requests. |
| `actions` | object | built-in action defaults | Maps classified notification actions to policy decisions. |
| `promptOverrides` | object | `{}` | Optional Markdown files that replace selected packaged prompt resources. |
| `feedbackLearning` | object | `{ "enabled": true, "minConfidence": 0.5, "autoApproveConfidence": 0.8 }` | Controls candidate capture, autonomous learning, and prompt threshold for feedback rules. |
@@ -109,7 +111,7 @@ Unknown top-level keys are ignored by the current implementation.
| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
-| `from` | string | `notifications@github.com` | Required substring in the decoded email `From` header. |
+| `from` | string or array of strings | `notifications@github.com` | Required substring in the decoded email `From` header. Use an array when GitHub notifications are forwarded or rewritten by a trusted mail gateway while GitHub reply headers and message ids are preserved. |
| `requiredUrlPrefix` | string | `https://github.com/` | At least one extracted URL must start with this prefix. |
| `messageIdDomain` | string | `github.com` | Required substring in the email `Message-ID`. |
| `requiredAuth` | array of strings | currently documented only | Intended SPF/DKIM/DMARC requirements. See note below. |
@@ -123,7 +125,7 @@ Current auth behavior:
Source trust fails when any of these are false:
```text
-source.from is in From header
+any configured source.from value is in From header
AND auth is OK
AND at least one GitHub URL has source.requiredUrlPrefix
AND Message-ID contains source.messageIdDomain
@@ -131,6 +133,44 @@ AND Message-ID contains source.messageIdDomain
If source trust fails, the decision is always `deny`.
+Example with Google Groups or similar forwarded GitHub notifications:
+
+```json
+{
+ "source": {
+ "from": ["notifications@github.com", "giscebot@gisce.net"],
+ "requiredUrlPrefix": "https://github.com/",
+ "messageIdDomain": "github.com"
+ }
+}
+```
+
+The parser still requires GitHub-specific headers, a GitHub reply address, GitHub message id content, and normal source trust before forwarded messages are accepted.
+
+## `botLogins`
+
+`botLogins` defines the GitHub accounts that count as the addressed bot for mention, assignment, and review-request classification.
+
+Default:
+
+```json
+{
+ "botLogins": ["pilipilisbot"]
+}
+```
+
+Configured names are case-insensitive and may include or omit the leading `@`.
+
+Example:
+
+```json
+{
+ "botLogins": ["pilipilisbot", "giscebot"]
+}
+```
+
+With this policy, comments that mention `@giscebot`, assignments to `@giscebot`, and review requests from `@giscebot` are classified the same way as the default `@pilipilisbot` notifications. Set an explicit empty array only if the deployment should rely on GitHub footer text such as “You are receiving this because you were mentioned” instead of login matching.
+
## `trustedRepos`
Exact repositories trusted for `trustedAuto` actions.
diff --git a/docs/screenshots/issue-50/version-link-desktop.png b/docs/screenshots/issue-50/version-link-desktop.png
new file mode 100644
index 0000000..7ba9166
Binary files /dev/null and b/docs/screenshots/issue-50/version-link-desktop.png differ
diff --git a/docs/screenshots/issue-50/version-link-mobile.png b/docs/screenshots/issue-50/version-link-mobile.png
new file mode 100644
index 0000000..5050a9b
Binary files /dev/null and b/docs/screenshots/issue-50/version-link-mobile.png differ
diff --git a/policy.example.json b/policy.example.json
index 24940cd..5f7edf0 100644
--- a/policy.example.json
+++ b/policy.example.json
@@ -1,6 +1,9 @@
{
"source": {
- "from": "notifications@github.com",
+ "from": [
+ "notifications@github.com",
+ "giscebot@gisce.net"
+ ],
"requiredAuth": [
"spf=pass",
"dkim=pass",
@@ -10,6 +13,9 @@
"messageIdDomain": "github.com"
},
"trustedRepos": [],
+ "botLogins": [
+ "pilipilisbot"
+ ],
"trustedOrgs": [
"your-org"
],
diff --git a/pyproject.toml b/pyproject.toml
index 454b4f7..0001ad4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "github-agent-bridge"
-version = "0.18.7"
+version = "0.20.0"
description = "GitHub notification to OpenClaw agent bridge for Pilipilis"
readme = "README.md"
requires-python = ">=3.11"
diff --git a/src/github_agent_bridge/__init__.py b/src/github_agent_bridge/__init__.py
index 4bea608..b758930 100644
--- a/src/github_agent_bridge/__init__.py
+++ b/src/github_agent_bridge/__init__.py
@@ -1,3 +1,18 @@
"""GitHub Agent Bridge."""
-__version__ = "0.1.0"
+from importlib.metadata import PackageNotFoundError, version
+from pathlib import Path
+import tomllib
+
+
+def _version_from_pyproject() -> str:
+ pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
+ if not pyproject.exists():
+ return "0.0.0"
+ return str(tomllib.loads(pyproject.read_text(encoding="utf-8")).get("project", {}).get("version", "0.0.0"))
+
+
+try:
+ __version__ = version("github-agent-bridge")
+except PackageNotFoundError:
+ __version__ = _version_from_pyproject()
diff --git a/src/github_agent_bridge/actors.py b/src/github_agent_bridge/actors.py
index 4e6a457..94f916e 100644
--- a/src/github_agent_bridge/actors.py
+++ b/src/github_agent_bridge/actors.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import json
+import os
import re
import sqlite3
import subprocess
@@ -11,10 +12,14 @@
from .models import GitHubContext, Notification
-LOGIN_RE = re.compile(r"^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$")
+LOGIN_RE = re.compile(r"^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?(?:\[bot\])?$")
RESERVED_SENDERS = {"github", "notifications"}
+def default_gh_bin() -> str:
+ return os.getenv("GITHUB_AGENT_BRIDGE_GH_BIN", "gh")
+
+
@dataclass(frozen=True)
class TriggerActor:
login: str
@@ -43,7 +48,8 @@ def trigger_actor_details_from_notification(notification: Notification) -> Trigg
return TriggerActor(login=login, avatar_url=github_avatar_url(login)) if login else None
-def trigger_actor_details_for_enqueue(notification: Notification, ctx: GitHubContext, *, gh_bin: str = "gh") -> TriggerActor | None:
+def trigger_actor_details_for_enqueue(notification: Notification, ctx: GitHubContext, *, gh_bin: str | None = None) -> TriggerActor | None:
+ gh_bin = gh_bin or default_gh_bin()
return github_actor_details_for_context(ctx, gh_bin=gh_bin) or trigger_actor_details_from_notification(notification)
@@ -86,7 +92,8 @@ def actor_endpoint(ctx: GitHubContext) -> str | None:
return None
-def github_actor_details_for_context(ctx: GitHubContext, *, gh_bin: str = "gh") -> TriggerActor | None:
+def github_actor_details_for_context(ctx: GitHubContext, *, gh_bin: str | None = None) -> TriggerActor | None:
+ gh_bin = gh_bin or default_gh_bin()
endpoint = actor_endpoint(ctx)
if endpoint is None:
return None
@@ -103,12 +110,13 @@ def github_actor_details_for_context(ctx: GitHubContext, *, gh_bin: str = "gh")
return actor_details_from_github_payload(payload if isinstance(payload, dict) else {})
-def github_actor_for_context(ctx: GitHubContext, *, gh_bin: str = "gh") -> str | None:
+def github_actor_for_context(ctx: GitHubContext, *, gh_bin: str | None = None) -> str | None:
actor = github_actor_details_for_context(ctx, gh_bin=gh_bin)
return actor.login if actor else None
-def backfill_trigger_actors(db: str | Path, *, gh_bin: str = "gh", limit: int | None = None, dry_run: bool = False) -> dict[str, Any]:
+def backfill_trigger_actors(db: str | Path, *, gh_bin: str | None = None, limit: int | None = None, dry_run: bool = False) -> dict[str, Any]:
+ gh_bin = gh_bin or default_gh_bin()
path = Path(db).expanduser()
if not path.exists():
return {"db_exists": False, "checked": 0, "updated": 0, "missing": 0, "dry_run": dry_run}
diff --git a/src/github_agent_bridge/backend.py b/src/github_agent_bridge/backend.py
index 102c862..f18a80d 100644
--- a/src/github_agent_bridge/backend.py
+++ b/src/github_agent_bridge/backend.py
@@ -19,6 +19,7 @@
from fastapi.responses import FileResponse, JSONResponse, RedirectResponse, StreamingResponse
from fastapi.staticfiles import StaticFiles
+from . import __version__
from .cli import DEFAULT_DB
from .dashboard_data import (
get_job_detail,
@@ -43,6 +44,8 @@
GITHUB_AUTHORIZE_URL = "https://github.com/login/oauth/authorize"
GITHUB_TOKEN_URL = "https://github.com/login/oauth/access_token"
GITHUB_USER_URL = "https://api.github.com/user"
+GITHUB_TEAMS_URL = "https://api.github.com/user/teams"
+PROJECT_REPOSITORY_URL = "https://github.com/pilipilisbot/github-agent-bridge"
SESSION_VERSION = 1
@@ -56,6 +59,7 @@ def __init__(
oauth_client_secret: str | None = None,
allowed_users: set[str] | None = None,
allowed_orgs: set[str] | None = None,
+ allowed_teams: set[str] | None = None,
require_auth: bool = True,
static_dir: str | Path | None = None,
) -> None:
@@ -65,6 +69,7 @@ def __init__(
self.oauth_client_secret = oauth_client_secret or os.getenv("GITHUB_OAUTH_CLIENT_SECRET", "")
self.allowed_users = allowed_users if allowed_users is not None else _csv_env("GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_USERS")
self.allowed_orgs = allowed_orgs if allowed_orgs is not None else _csv_env("GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_ORGS")
+ self.allowed_teams = allowed_teams if allowed_teams is not None else _csv_env("GITHUB_AGENT_BRIDGE_DASHBOARD_ALLOWED_TEAMS")
self.require_auth = require_auth
self.static_dir = Path(static_dir or os.getenv("GITHUB_AGENT_BRIDGE_DASHBOARD_STATIC_DIR", Path(__file__).with_name("dashboard_static"))).expanduser()
@@ -74,7 +79,7 @@ def oauth_ready(self) -> bool:
@property
def has_authorization_policy(self) -> bool:
- return bool(self.allowed_users or self.allowed_orgs)
+ return bool(self.allowed_users or self.allowed_orgs or self.allowed_teams)
def _csv_env(name: str) -> set[str]:
@@ -191,12 +196,23 @@ def _profile_from_login(login: str) -> dict[str, str]:
}
-def _github_json(url: str, token: str) -> dict[str, Any]:
+def _github_json(url: str, token: str) -> Any:
req = urllib.request.Request(url, headers={"Accept": "application/vnd.github+json", "Authorization": f"Bearer {token}", "User-Agent": "github-agent-bridge-dashboard"})
with urllib.request.urlopen(req, timeout=10) as response:
return json.loads(response.read().decode("utf-8"))
+def _team_key(team: dict[str, Any]) -> str | None:
+ org = team.get("organization")
+ if not isinstance(org, dict):
+ return None
+ org_login = str(org.get("login", "")).lower()
+ slug = str(team.get("slug", "")).lower()
+ if not org_login or not slug:
+ return None
+ return f"{org_login}/{slug}"
+
+
def _exchange_code(config: DashboardConfig, code: str) -> str:
data = urllib.parse.urlencode({
"client_id": config.oauth_client_id,
@@ -221,7 +237,14 @@ def _is_allowed(config: DashboardConfig, login: str, token: str | None = None) -
orgs = _github_json("https://api.github.com/user/orgs", token)
except (urllib.error.URLError, TimeoutError):
return False
- return any(str(org.get("login", "")).lower() in config.allowed_orgs for org in orgs if isinstance(org, dict))
+ if any(str(org.get("login", "")).lower() in config.allowed_orgs for org in orgs if isinstance(org, dict)):
+ return True
+ if config.allowed_teams and token:
+ try:
+ teams = _github_json(GITHUB_TEAMS_URL, token)
+ except (urllib.error.URLError, TimeoutError):
+ return False
+ return any(key in config.allowed_teams for key in (_team_key(team) for team in teams if isinstance(team, dict)) if key)
return not config.has_authorization_policy
@@ -250,6 +273,15 @@ async def current_profile(request: Request) -> dict[str, Any]:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="not_authorized")
return profile
+ async def require_dashboard_profile_or_login(request: Request) -> RedirectResponse | None:
+ try:
+ await current_profile(request)
+ except HTTPException as exc:
+ if exc.status_code == status.HTTP_401_UNAUTHORIZED and config.oauth_ready:
+ return RedirectResponse("/auth/login", status_code=status.HTTP_302_FOUND)
+ raise
+ return None
+
@app.exception_handler(sqlite3.OperationalError)
async def database_unavailable(_: Request, exc: sqlite3.OperationalError) -> JSONResponse:
return JSONResponse({"error": "database_unavailable", "detail": str(exc)}, status_code=status.HTTP_503_SERVICE_UNAVAILABLE, headers=_redacted_headers())
@@ -273,17 +305,31 @@ def dashboard_index() -> FileResponse:
return FileResponse(index, headers=_redacted_headers())
@app.get("/")
- def dashboard(_: str = Depends(current_user)) -> FileResponse:
+ async def dashboard(request: Request) -> Response:
+ redirect = await require_dashboard_profile_or_login(request)
+ if redirect is not None:
+ return redirect
return dashboard_index()
@app.get("/jobs/{job_path:path}")
- def dashboard_job(job_path: str, _: str = Depends(current_user)) -> FileResponse:
+ async def dashboard_job(job_path: str, request: Request) -> Response:
+ redirect = await require_dashboard_profile_or_login(request)
+ if redirect is not None:
+ return redirect
return dashboard_index()
@app.get("/api/status")
def api_status(_: str = Depends(current_user)) -> dict[str, Any]:
return {"service": "github-agent-bridge-dashboard", "read_only": True, "metrics": inspect_db_read_only(config.db)}
+ @app.get("/api/about")
+ def api_about(_: str = Depends(current_user)) -> dict[str, Any]:
+ return {
+ "service": "github-agent-bridge-dashboard",
+ "version": __version__,
+ "repository_url": PROJECT_REPOSITORY_URL,
+ }
+
@app.get("/api/me")
def api_me(profile: dict[str, Any] = Depends(current_profile)) -> dict[str, Any]:
return {"user": profile}
@@ -410,7 +456,7 @@ def login() -> RedirectResponse:
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="oauth_not_configured")
state = secrets.token_urlsafe(24)
scopes = ["read:user"]
- if config.allowed_orgs:
+ if config.allowed_orgs or config.allowed_teams:
scopes.append("read:org")
params = urllib.parse.urlencode({"client_id": config.oauth_client_id, "scope": " ".join(scopes), "state": state})
response = RedirectResponse(f"{GITHUB_AUTHORIZE_URL}?{params}", status_code=status.HTTP_302_FOUND)
diff --git a/src/github_agent_bridge/cli.py b/src/github_agent_bridge/cli.py
index e4511f2..fb084ff 100644
--- a/src/github_agent_bridge/cli.py
+++ b/src/github_agent_bridge/cli.py
@@ -18,7 +18,7 @@
from .models import Notification, utc_now
from .monitor import MonitorThresholds, monitor, report_json
from .observability import DEFAULT_PROCESS_SAMPLE_RETENTION_SECONDS
-from .parser import decode_header_value, extract_body_text, parse_auth_results
+from .parser import decode_header_value, extract_body_text, is_github_notification_message, parse_auth_results
from .policy import Policy
from .queue import JobQueue
from .reader import ImapConfig, ImapReader, imap_mailbox_arg
@@ -34,7 +34,7 @@ def load_policy(path: str | None) -> Policy:
def msg_to_notification(msg, uid: int | None = None) -> Notification | None:
from_addr = decode_header_value(msg.get("From", ""))
- if "notifications@github.com" not in from_addr.lower():
+ if not is_github_notification_message(msg, from_addr):
return None
return Notification(
uid=uid,
diff --git a/src/github_agent_bridge/dashboard_static/assets/index-BZrEZTtS.js b/src/github_agent_bridge/dashboard_static/assets/index-BZrEZTtS.js
new file mode 100644
index 0000000..a2cd7ab
--- /dev/null
+++ b/src/github_agent_bridge/dashboard_static/assets/index-BZrEZTtS.js
@@ -0,0 +1,110 @@
+var vs=e=>{throw TypeError(e)};var qt=(e,t,s)=>t.has(e)||vs("Cannot "+s);var a=(e,t,s)=>(qt(e,t,"read from private field"),s?s.call(e):t.get(e)),w=(e,t,s)=>t.has(e)?vs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),m=(e,t,s,n)=>(qt(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),C=(e,t,s)=>(qt(e,t,"access private method"),s);var St=(e,t,s,n)=>({set _(i){m(e,t,i,s)},get _(){return a(e,t,n)}});import{e as Fr,f as Er,g as Tr,r as D,R as W,c as rs,b as Ar,C as ns,X as is,Y as as,T as os,L as Ir,a as er,B as tr,d as qr}from"./charts-DRWoArYU.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();var Lt={exports:{}},ut={};/**
+ * @license React
+ * react-jsx-runtime.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var ws;function Lr(){if(ws)return ut;ws=1;var e=Fr(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(l,d,u){var h,b={},j=null,v=null;u!==void 0&&(j=""+u),d.key!==void 0&&(j=""+d.key),d.ref!==void 0&&(v=d.ref);for(h in d)n.call(d,h)&&!o.hasOwnProperty(h)&&(b[h]=d[h]);if(l&&l.defaultProps)for(h in d=l.defaultProps,d)b[h]===void 0&&(b[h]=d[h]);return{$$typeof:t,type:l,key:j,ref:v,props:b,_owner:i.current}}return ut.Fragment=s,ut.jsx=c,ut.jsxs=c,ut}var js;function Dr(){return js||(js=1,Lt.exports=Lr()),Lt.exports}var r=Dr(),Rt={},Ns;function Qr(){if(Ns)return Rt;Ns=1;var e=Er();return Rt.createRoot=e.createRoot,Rt.hydrateRoot=e.hydrateRoot,Rt}var $r=Qr();const Ur=Tr($r);var kt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ae,we,Je,Ks,zr=(Ks=class extends kt{constructor(){super();w(this,Ae);w(this,we);w(this,Je);m(this,Je,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){a(this,we)||this.setEventListener(a(this,Je))}onUnsubscribe(){var t;this.hasListeners()||((t=a(this,we))==null||t.call(this),m(this,we,void 0))}setEventListener(t){var s;m(this,Je,t),(s=a(this,we))==null||s.call(this),m(this,we,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){a(this,Ae)!==t&&(m(this,Ae,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof a(this,Ae)=="boolean"?a(this,Ae):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ae=new WeakMap,we=new WeakMap,Je=new WeakMap,Ks),ls=new zr,Kr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},je,ss,Gs,Gr=(Gs=class{constructor(){w(this,je,Kr);w(this,ss,!1)}setTimeoutProvider(e){m(this,je,e)}setTimeout(e,t){return a(this,je).setTimeout(e,t)}clearTimeout(e){a(this,je).clearTimeout(e)}setInterval(e,t){return a(this,je).setInterval(e,t)}clearInterval(e){a(this,je).clearInterval(e)}},je=new WeakMap,ss=new WeakMap,Gs),Te=new Gr;function Br(e){setTimeout(e,0)}var Hr=typeof window>"u"||"Deno"in globalThis;function J(){}function Jr(e,t){return typeof e=="function"?e(t):e}function $t(e){return typeof e=="number"&&e>=0&&e!==1/0}function sr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pe(e,t){return typeof e=="function"?e(t):e}function X(e,t){return typeof e=="function"?e(t):e}function ks(e,t){const{type:s="all",exact:n,fetchStatus:i,predicate:o,queryKey:c,stale:l}=e;if(c){if(n){if(t.queryHash!==cs(c,t.options))return!1}else if(!gt(t.queryKey,c))return!1}if(s!=="all"){const d=t.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function Cs(e,t){const{exact:s,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(s){if(xt(t.options.mutationKey)!==xt(o))return!1}else if(!gt(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function cs(e,t){return((t==null?void 0:t.queryKeyHashFn)||xt)(e)}function xt(e){return JSON.stringify(e,(t,s)=>zt(s)?Object.keys(s).sort().reduce((n,i)=>(n[i]=s[i],n),{}):s)}function gt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>gt(e[s],t[s])):!1}var Wr=Object.prototype.hasOwnProperty;function rr(e,t,s=0){if(e===t)return e;if(s>500)return t;const n=Ss(e)&&Ss(t);if(!n&&!(zt(e)&&zt(t)))return t;const o=(n?e:Object.keys(e)).length,c=n?t:Object.keys(t),l=c.length,d=n?new Array(l):{};let u=0;for(let h=0;h
{Te.setTimeout(t,e)})}function Kt(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?rr(e,t):t}function Xr(e,t,s=0){const n=[...e,t];return s&&n.length>s?n.slice(1):n}function Zr(e,t,s=0){const n=[t,...e];return s&&n.length>s?n.slice(0,-1):n}var ds=Symbol();function nr(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ds?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ir(e,t){return typeof e=="function"?e(...t):!!e}function Yr(e,t,s){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var bt=(()=>{let e=()=>Hr;return{isServer(){return e()},setIsServer(t){e=t}}})();function Gt(){let e,t;const s=new Promise((i,o)=>{e=i,t=o});s.status="pending",s.catch(()=>{});function n(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},s.reject=i=>{n({status:"rejected",reason:i}),t(i)},s}var en=Br;function tn(){let e=[],t=0,s=l=>{l()},n=l=>{l()},i=en;const o=l=>{t?e.push(l):i(()=>{s(l)})},c=()=>{const l=e;e=[],l.length&&i(()=>{n(()=>{l.forEach(d=>{s(d)})})})};return{batch:l=>{let d;t++;try{d=l()}finally{t--,t||c()}return d},batchCalls:l=>(...d)=>{o(()=>{l(...d)})},schedule:o,setNotifyFunction:l=>{s=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{i=l}}}var L=tn(),We,Ne,Ve,Bs,sn=(Bs=class extends kt{constructor(){super();w(this,We,!0);w(this,Ne);w(this,Ve);m(this,Ve,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}}})}onSubscribe(){a(this,Ne)||this.setEventListener(a(this,Ve))}onUnsubscribe(){var t;this.hasListeners()||((t=a(this,Ne))==null||t.call(this),m(this,Ne,void 0))}setEventListener(t){var s;m(this,Ve,t),(s=a(this,Ne))==null||s.call(this),m(this,Ne,t(this.setOnline.bind(this)))}setOnline(t){a(this,We)!==t&&(m(this,We,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return a(this,We)}},We=new WeakMap,Ne=new WeakMap,Ve=new WeakMap,Bs),Ot=new sn;function rn(e){return Math.min(1e3*2**e,3e4)}function ar(e){return(e??"online")==="online"?Ot.isOnline():!0}var Bt=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function or(e){let t=!1,s=0,n;const i=Gt(),o=()=>i.status!=="pending",c=x=>{var g;if(!o()){const f=new Bt(x);j(f),(g=e.onCancel)==null||g.call(e,f)}},l=()=>{t=!0},d=()=>{t=!1},u=()=>ls.isFocused()&&(e.networkMode==="always"||Ot.isOnline())&&e.canRun(),h=()=>ar(e.networkMode)&&e.canRun(),b=x=>{o()||(n==null||n(),i.resolve(x))},j=x=>{o()||(n==null||n(),i.reject(x))},v=()=>new Promise(x=>{var g;n=f=>{(o()||u())&&x(f)},(g=e.onPause)==null||g.call(e)}).then(()=>{var x;n=void 0,o()||(x=e.onContinue)==null||x.call(e)}),p=()=>{if(o())return;let x;const g=s===0?e.initialPromise:void 0;try{x=g??e.fn()}catch(f){x=Promise.reject(f)}Promise.resolve(x).then(b).catch(f=>{var T;if(o())return;const k=e.retry??(bt.isServer()?0:3),R=e.retryDelay??rn,y=typeof R=="function"?R(s,f):R,F=k===!0||typeof k=="number"&&su()?void 0:v()).then(()=>{t?j(f):p()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(n==null||n(),i),cancelRetry:l,continueRetry:d,canStart:h,start:()=>(h()?p():v().then(p),i)}}var Ie,Hs,lr=(Hs=class{constructor(){w(this,Ie)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$t(this.gcTime)&&m(this,Ie,Te.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(bt.isServer()?1/0:300*1e3))}clearGcTimeout(){a(this,Ie)!==void 0&&(Te.clearTimeout(a(this,Ie)),m(this,Ie,void 0))}},Ie=new WeakMap,Hs);function nn(e){return{onFetch:(t,s)=>{var h,b,j,v,p;const n=t.options,i=(j=(b=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:b.fetchMore)==null?void 0:j.direction,o=((v=t.state.data)==null?void 0:v.pages)||[],c=((p=t.state.data)==null?void 0:p.pageParams)||[];let l={pages:[],pageParams:[]},d=0;const u=async()=>{let x=!1;const g=R=>{Yr(R,()=>t.signal,()=>x=!0)},f=nr(t.options,t.fetchOptions),k=async(R,y,F)=>{if(x)return Promise.reject(t.signal.reason);if(y==null&&R.pages.length)return Promise.resolve(R);const Q=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:y,direction:F?"backward":"forward",meta:t.options.meta};return g($),$})(),_=await f(Q),{maxPages:M}=t.options,I=F?Zr:Xr;return{pages:I(R.pages,_,M),pageParams:I(R.pageParams,y,M)}};if(i&&o.length){const R=i==="backward",y=R?an:_s,F={pages:o,pageParams:c},T=y(n,F);l=await k(F,T,R)}else{const R=e??o.length;do{const y=d===0?c[0]??n.initialPageParam:_s(n,l);if(d>0&&y==null)break;l=await k(l,y),d++}while(d{var x,g;return(g=(x=t.options).persister)==null?void 0:g.call(x,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=u}}}function _s(e,{pages:t,pageParams:s}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,s[n],s):void 0}function an(e,{pages:t,pageParams:s}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,s[0],s):void 0}var Xe,qe,Ze,te,Le,q,yt,De,V,cr,he,Js,on=(Js=class extends lr{constructor(t){super();w(this,V);w(this,Xe);w(this,qe);w(this,Ze);w(this,te);w(this,Le);w(this,q);w(this,yt);w(this,De);m(this,De,!1),m(this,yt,t.defaultOptions),this.setOptions(t.options),this.observers=[],m(this,Le,t.client),m(this,te,a(this,Le).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,m(this,qe,Ms(this.options)),this.state=t.state??a(this,qe),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return a(this,Xe)}get promise(){var t;return(t=a(this,q))==null?void 0:t.promise}setOptions(t){if(this.options={...a(this,yt),...t},t!=null&&t._type&&m(this,Xe,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Ms(this.options);s.data!==void 0&&(this.setState(Ps(s.data,s.dataUpdatedAt)),m(this,qe,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&a(this,te).remove(this)}setData(t,s){const n=Kt(this.state.data,t,this.options);return C(this,V,he).call(this,{data:n,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),n}setState(t){C(this,V,he).call(this,{type:"setState",state:t})}cancel(t){var n,i;const s=(n=a(this,q))==null?void 0:n.promise;return(i=a(this,q))==null||i.cancel(t),s?s.then(J).catch(J):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return a(this,qe)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>X(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ds||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Pe(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!sr(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=a(this,q))==null||s.continue()}onOnline(){var s;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=a(this,q))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),a(this,te).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(a(this,q)&&(a(this,De)||C(this,V,cr).call(this)?a(this,q).cancel({revert:!0}):a(this,q).cancelRetry()),this.scheduleGc()),a(this,te).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||C(this,V,he).call(this,{type:"invalidate"})}async fetch(t,s){var u,h,b,j,v,p,x,g,f,k,R;if(this.state.fetchStatus!=="idle"&&((u=a(this,q))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(a(this,q))return a(this,q).continueRetry(),a(this,q).promise}if(t&&this.setOptions(t),!this.options.queryFn){const y=this.observers.find(F=>F.options.queryFn);y&&this.setOptions(y.options)}const n=new AbortController,i=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(m(this,De,!0),n.signal)})},o=()=>{const y=nr(this.options,s),T=(()=>{const Q={client:a(this,Le),queryKey:this.queryKey,meta:this.meta};return i(Q),Q})();return m(this,De,!1),this.options.persister?this.options.persister(y,T,this):y(T)},l=(()=>{const y={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:a(this,Le),state:this.state,fetchFn:o};return i(y),y})(),d=a(this,Xe)==="infinite"?nn(this.options.pages):this.options.behavior;d==null||d.onFetch(l,this),m(this,Ze,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&C(this,V,he).call(this,{type:"fetch",meta:(b=l.fetchOptions)==null?void 0:b.meta}),m(this,q,or({initialPromise:s==null?void 0:s.initialPromise,fn:l.fetchFn,onCancel:y=>{y instanceof Bt&&y.revert&&this.setState({...a(this,Ze),fetchStatus:"idle"}),n.abort()},onFail:(y,F)=>{C(this,V,he).call(this,{type:"failed",failureCount:y,error:F})},onPause:()=>{C(this,V,he).call(this,{type:"pause"})},onContinue:()=>{C(this,V,he).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const y=await a(this,q).start();if(y===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(y),(v=(j=a(this,te).config).onSuccess)==null||v.call(j,y,this),(x=(p=a(this,te).config).onSettled)==null||x.call(p,y,this.state.error,this),y}catch(y){if(y instanceof Bt){if(y.silent)return a(this,q).promise;if(y.revert){if(this.state.data===void 0)throw y;return this.state.data}}throw C(this,V,he).call(this,{type:"error",error:y}),(f=(g=a(this,te).config).onError)==null||f.call(g,y,this),(R=(k=a(this,te).config).onSettled)==null||R.call(k,this.state.data,y,this),y}finally{this.scheduleGc()}}},Xe=new WeakMap,qe=new WeakMap,Ze=new WeakMap,te=new WeakMap,Le=new WeakMap,q=new WeakMap,yt=new WeakMap,De=new WeakMap,V=new WeakSet,cr=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},he=function(t){const s=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...dr(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...Ps(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return m(this,Ze,t.manual?i:void 0),i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=s(this.state),L.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),a(this,te).notify({query:this,type:"updated",action:t})})},Js);function dr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ar(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ps(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ms(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,n=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var H,S,vt,B,Qe,Ye,fe,ke,wt,et,tt,$e,Ue,Ce,st,O,mt,Ht,Jt,Wt,Vt,Xt,Zt,Yt,ur,Ws,ln=(Ws=class extends kt{constructor(t,s){super();w(this,O);w(this,H);w(this,S);w(this,vt);w(this,B);w(this,Qe);w(this,Ye);w(this,fe);w(this,ke);w(this,wt);w(this,et);w(this,tt);w(this,$e);w(this,Ue);w(this,Ce);w(this,st,new Set);this.options=s,m(this,H,t),m(this,ke,null),m(this,fe,Gt()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(a(this,S).addObserver(this),Os(a(this,S),this.options)?C(this,O,mt).call(this):this.updateResult(),C(this,O,Vt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return es(a(this,S),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return es(a(this,S),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,C(this,O,Xt).call(this),C(this,O,Zt).call(this),a(this,S).removeObserver(this)}setOptions(t){const s=this.options,n=a(this,S);if(this.options=a(this,H).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof X(this.options.enabled,a(this,S))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");C(this,O,Yt).call(this),a(this,S).setOptions(this.options),s._defaulted&&!Ut(this.options,s)&&a(this,H).getQueryCache().notify({type:"observerOptionsUpdated",query:a(this,S),observer:this});const i=this.hasListeners();i&&Fs(a(this,S),n,this.options,s)&&C(this,O,mt).call(this),this.updateResult(),i&&(a(this,S)!==n||X(this.options.enabled,a(this,S))!==X(s.enabled,a(this,S))||Pe(this.options.staleTime,a(this,S))!==Pe(s.staleTime,a(this,S)))&&C(this,O,Ht).call(this);const o=C(this,O,Jt).call(this);i&&(a(this,S)!==n||X(this.options.enabled,a(this,S))!==X(s.enabled,a(this,S))||o!==a(this,Ce))&&C(this,O,Wt).call(this,o)}getOptimisticResult(t){const s=a(this,H).getQueryCache().build(a(this,H),t),n=this.createResult(s,t);return dn(this,n)&&(m(this,B,n),m(this,Ye,this.options),m(this,Qe,a(this,S).state)),n}getCurrentResult(){return a(this,B)}trackResult(t,s){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),s==null||s(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&a(this,fe).status==="pending"&&a(this,fe).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){a(this,st).add(t)}getCurrentQuery(){return a(this,S)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=a(this,H).defaultQueryOptions(t),n=a(this,H).getQueryCache().build(a(this,H),s);return n.fetch().then(()=>this.createResult(n,s))}fetch(t){return C(this,O,mt).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),a(this,B)))}createResult(t,s){var M;const n=a(this,S),i=this.options,o=a(this,B),c=a(this,Qe),l=a(this,Ye),u=t!==n?t.state:a(this,vt),{state:h}=t;let b={...h},j=!1,v;if(s._optimisticResults){const I=this.hasListeners(),$=!I&&Os(t,s),P=I&&Fs(t,n,s,i);($||P)&&(b={...b,...dr(h.data,t.options)}),s._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:p,errorUpdatedAt:x,status:g}=b;v=b.data;let f=!1;if(s.placeholderData!==void 0&&v===void 0&&g==="pending"){let I;o!=null&&o.isPlaceholderData&&s.placeholderData===(l==null?void 0:l.placeholderData)?(I=o.data,f=!0):I=typeof s.placeholderData=="function"?s.placeholderData((M=a(this,tt))==null?void 0:M.state.data,a(this,tt)):s.placeholderData,I!==void 0&&(g="success",v=Kt(o==null?void 0:o.data,I,s),j=!0)}if(s.select&&v!==void 0&&!f)if(o&&v===(c==null?void 0:c.data)&&s.select===a(this,wt))v=a(this,et);else try{m(this,wt,s.select),v=s.select(v),v=Kt(o==null?void 0:o.data,v,s),m(this,et,v),m(this,ke,null)}catch(I){m(this,ke,I)}a(this,ke)&&(p=a(this,ke),v=a(this,et),x=Date.now(),g="error");const k=b.fetchStatus==="fetching",R=g==="pending",y=g==="error",F=R&&k,T=v!==void 0,_={status:g,fetchStatus:b.fetchStatus,isPending:R,isSuccess:g==="success",isError:y,isInitialLoading:F,isLoading:F,data:v,dataUpdatedAt:b.dataUpdatedAt,error:p,errorUpdatedAt:x,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:b.dataUpdateCount>u.dataUpdateCount||b.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!R,isLoadingError:y&&!T,isPaused:b.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:y&&T,isStale:us(t,s),refetch:this.refetch,promise:a(this,fe),isEnabled:X(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=_.data!==void 0,$=_.status==="error"&&!I,P=oe=>{$?oe.reject(_.error):I&&oe.resolve(_.data)},xe=()=>{const oe=m(this,fe,_.promise=Gt());P(oe)},Z=a(this,fe);switch(Z.status){case"pending":t.queryHash===n.queryHash&&P(Z);break;case"fulfilled":($||_.data!==Z.value)&&xe();break;case"rejected":(!$||_.error!==Z.reason)&&xe();break}}return _}updateResult(){const t=a(this,B),s=this.createResult(a(this,S),this.options);if(m(this,Qe,a(this,S).state),m(this,Ye,this.options),a(this,Qe).data!==void 0&&m(this,tt,a(this,S)),Ut(s,t))return;m(this,B,s);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!a(this,st).size)return!0;const c=new Set(o??a(this,st));return this.options.throwOnError&&c.add("error"),Object.keys(a(this,B)).some(l=>{const d=l;return a(this,B)[d]!==t[d]&&c.has(d)})};C(this,O,ur).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&C(this,O,Vt).call(this)}},H=new WeakMap,S=new WeakMap,vt=new WeakMap,B=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,fe=new WeakMap,ke=new WeakMap,wt=new WeakMap,et=new WeakMap,tt=new WeakMap,$e=new WeakMap,Ue=new WeakMap,Ce=new WeakMap,st=new WeakMap,O=new WeakSet,mt=function(t){C(this,O,Yt).call(this);let s=a(this,S).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(J)),s},Ht=function(){C(this,O,Xt).call(this);const t=Pe(this.options.staleTime,a(this,S));if(bt.isServer()||a(this,B).isStale||!$t(t))return;const n=sr(a(this,B).dataUpdatedAt,t)+1;m(this,$e,Te.setTimeout(()=>{a(this,B).isStale||this.updateResult()},n))},Jt=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(a(this,S)):this.options.refetchInterval)??!1},Wt=function(t){C(this,O,Zt).call(this),m(this,Ce,t),!(bt.isServer()||X(this.options.enabled,a(this,S))===!1||!$t(a(this,Ce))||a(this,Ce)===0)&&m(this,Ue,Te.setInterval(()=>{(this.options.refetchIntervalInBackground||ls.isFocused())&&C(this,O,mt).call(this)},a(this,Ce)))},Vt=function(){C(this,O,Ht).call(this),C(this,O,Wt).call(this,C(this,O,Jt).call(this))},Xt=function(){a(this,$e)!==void 0&&(Te.clearTimeout(a(this,$e)),m(this,$e,void 0))},Zt=function(){a(this,Ue)!==void 0&&(Te.clearInterval(a(this,Ue)),m(this,Ue,void 0))},Yt=function(){const t=a(this,H).getQueryCache().build(a(this,H),this.options);if(t===a(this,S))return;const s=a(this,S);m(this,S,t),m(this,vt,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},ur=function(t){L.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(a(this,B))}),a(this,H).getQueryCache().notify({query:a(this,S),type:"observerResultsUpdated"})})},Ws);function cn(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&X(t.retryOnMount,e)===!1)}function Os(e,t){return cn(e,t)||e.state.data!==void 0&&es(e,t,t.refetchOnMount)}function es(e,t,s){if(X(t.enabled,e)!==!1&&Pe(t.staleTime,e)!=="static"){const n=typeof s=="function"?s(e):s;return n==="always"||n!==!1&&us(e,t)}return!1}function Fs(e,t,s,n){return(e!==t||X(n.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&us(e,s)}function us(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(Pe(t.staleTime,e))}function dn(e,t){return!Ut(e.getCurrentResult(),t)}var jt,le,z,ze,ce,ve,Vs,un=(Vs=class extends lr{constructor(t){super();w(this,ce);w(this,jt);w(this,le);w(this,z);w(this,ze);m(this,jt,t.client),this.mutationId=t.mutationId,m(this,z,t.mutationCache),m(this,le,[]),this.state=t.state||hn(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){a(this,le).includes(t)||(a(this,le).push(t),this.clearGcTimeout(),a(this,z).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){m(this,le,a(this,le).filter(s=>s!==t)),this.scheduleGc(),a(this,z).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){a(this,le).length||(this.state.status==="pending"?this.scheduleGc():a(this,z).remove(this))}continue(){var t;return((t=a(this,ze))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,l,d,u,h,b,j,v,p,x,g,f,k,R,y,F,T,Q;const s=()=>{C(this,ce,ve).call(this,{type:"continue"})},n={client:a(this,jt),meta:this.options.meta,mutationKey:this.options.mutationKey};m(this,ze,or({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(_,M)=>{C(this,ce,ve).call(this,{type:"failed",failureCount:_,error:M})},onPause:()=>{C(this,ce,ve).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>a(this,z).canRun(this)}));const i=this.state.status==="pending",o=!a(this,ze).canStart();try{if(i)s();else{C(this,ce,ve).call(this,{type:"pending",variables:t,isPaused:o}),a(this,z).config.onMutate&&await a(this,z).config.onMutate(t,this,n);const M=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));M!==this.state.context&&C(this,ce,ve).call(this,{type:"pending",context:M,variables:t,isPaused:o})}const _=await a(this,ze).start();return await((u=(d=a(this,z).config).onSuccess)==null?void 0:u.call(d,_,t,this.state.context,this,n)),await((b=(h=this.options).onSuccess)==null?void 0:b.call(h,_,t,this.state.context,n)),await((v=(j=a(this,z).config).onSettled)==null?void 0:v.call(j,_,null,this.state.variables,this.state.context,this,n)),await((x=(p=this.options).onSettled)==null?void 0:x.call(p,_,null,t,this.state.context,n)),C(this,ce,ve).call(this,{type:"success",data:_}),_}catch(_){try{await((f=(g=a(this,z).config).onError)==null?void 0:f.call(g,_,t,this.state.context,this,n))}catch(M){Promise.reject(M)}try{await((R=(k=this.options).onError)==null?void 0:R.call(k,_,t,this.state.context,n))}catch(M){Promise.reject(M)}try{await((F=(y=a(this,z).config).onSettled)==null?void 0:F.call(y,void 0,_,this.state.variables,this.state.context,this,n))}catch(M){Promise.reject(M)}try{await((Q=(T=this.options).onSettled)==null?void 0:Q.call(T,void 0,_,t,this.state.context,n))}catch(M){Promise.reject(M)}throw C(this,ce,ve).call(this,{type:"error",error:_}),_}finally{a(this,z).runNext(this)}}},jt=new WeakMap,le=new WeakMap,z=new WeakMap,ze=new WeakMap,ce=new WeakSet,ve=function(t){const s=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),L.batch(()=>{a(this,le).forEach(n=>{n.onMutationUpdate(t)}),a(this,z).notify({mutation:this,type:"updated",action:t})})},Vs);function hn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var me,ne,Nt,Xs,fn=(Xs=class extends kt{constructor(t={}){super();w(this,me);w(this,ne);w(this,Nt);this.config=t,m(this,me,new Set),m(this,ne,new Map),m(this,Nt,0)}build(t,s,n){const i=new un({client:t,mutationCache:this,mutationId:++St(this,Nt)._,options:t.defaultMutationOptions(s),state:n});return this.add(i),i}add(t){a(this,me).add(t);const s=_t(t);if(typeof s=="string"){const n=a(this,ne).get(s);n?n.push(t):a(this,ne).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(a(this,me).delete(t)){const s=_t(t);if(typeof s=="string"){const n=a(this,ne).get(s);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&a(this,ne).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=_t(t);if(typeof s=="string"){const n=a(this,ne).get(s),i=n==null?void 0:n.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const s=_t(t);if(typeof s=="string"){const i=(n=a(this,ne).get(s))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){L.batch(()=>{a(this,me).forEach(t=>{this.notify({type:"removed",mutation:t})}),a(this,me).clear(),a(this,ne).clear()})}getAll(){return Array.from(a(this,me))}find(t){const s={exact:!0,...t};return this.getAll().find(n=>Cs(s,n))}findAll(t={}){return this.getAll().filter(s=>Cs(t,s))}notify(t){L.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return L.batch(()=>Promise.all(t.map(s=>s.continue().catch(J))))}},me=new WeakMap,ne=new WeakMap,Nt=new WeakMap,Xs);function _t(e){var t;return(t=e.options.scope)==null?void 0:t.id}var de,Zs,mn=(Zs=class extends kt{constructor(t={}){super();w(this,de);this.config=t,m(this,de,new Map)}build(t,s,n){const i=s.queryKey,o=s.queryHash??cs(i,s);let c=this.get(o);return c||(c=new on({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(s),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){a(this,de).has(t.queryHash)||(a(this,de).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=a(this,de).get(t.queryHash);s&&(t.destroy(),s===t&&a(this,de).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){L.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return a(this,de).get(t)}getAll(){return[...a(this,de).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(n=>ks(s,n))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(n=>ks(t,n)):s}notify(t){L.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){L.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){L.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},de=new WeakMap,Zs),A,Se,Re,rt,nt,_e,it,at,Ys,pn=(Ys=class{constructor(e={}){w(this,A);w(this,Se);w(this,Re);w(this,rt);w(this,nt);w(this,_e);w(this,it);w(this,at);m(this,A,e.queryCache||new mn),m(this,Se,e.mutationCache||new fn),m(this,Re,e.defaultOptions||{}),m(this,rt,new Map),m(this,nt,new Map),m(this,_e,0)}mount(){St(this,_e)._++,a(this,_e)===1&&(m(this,it,ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),a(this,A).onFocus())})),m(this,at,Ot.subscribe(async e=>{e&&(await this.resumePausedMutations(),a(this,A).onOnline())})))}unmount(){var e,t;St(this,_e)._--,a(this,_e)===0&&((e=a(this,it))==null||e.call(this),m(this,it,void 0),(t=a(this,at))==null||t.call(this),m(this,at,void 0))}isFetching(e){return a(this,A).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return a(this,Se).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=a(this,A).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=a(this,A).build(this,t),n=s.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Pe(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return a(this,A).findAll(e).map(({queryKey:t,state:s})=>{const n=s.data;return[t,n]})}setQueryData(e,t,s){const n=this.defaultQueryOptions({queryKey:e}),i=a(this,A).get(n.queryHash),o=i==null?void 0:i.state.data,c=Jr(t,o);if(c!==void 0)return a(this,A).build(this,n).setData(c,{...s,manual:!0})}setQueriesData(e,t,s){return L.batch(()=>a(this,A).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=a(this,A).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=a(this,A);L.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=a(this,A);return L.batch(()=>(s.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},n=L.batch(()=>a(this,A).findAll(e).map(i=>i.cancel(s)));return Promise.all(n).then(J).catch(J)}invalidateQueries(e,t={}){return L.batch(()=>(a(this,A).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},n=L.batch(()=>a(this,A).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,s);return s.throwOnError||(o=o.catch(J)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(J)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=a(this,A).build(this,t);return s.isStaleByTime(Pe(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(J).catch(J)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(J).catch(J)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ot.isOnline()?a(this,Se).resumePausedMutations():Promise.resolve()}getQueryCache(){return a(this,A)}getMutationCache(){return a(this,Se)}getDefaultOptions(){return a(this,Re)}setDefaultOptions(e){m(this,Re,e)}setQueryDefaults(e,t){a(this,rt).set(xt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...a(this,rt).values()],s={};return t.forEach(n=>{gt(e,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(e,t){a(this,nt).set(xt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...a(this,nt).values()],s={};return t.forEach(n=>{gt(e,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...a(this,Re).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cs(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ds&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...a(this,Re).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){a(this,A).clear(),a(this,Se).clear()}},A=new WeakMap,Se=new WeakMap,Re=new WeakMap,rt=new WeakMap,nt=new WeakMap,_e=new WeakMap,it=new WeakMap,at=new WeakMap,Ys),hr=D.createContext(void 0),fr=e=>{const t=D.useContext(hr);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xn=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),r.jsx(hr.Provider,{value:e,children:t})),mr=D.createContext(!1),gn=()=>D.useContext(mr);mr.Provider;function bn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yn=D.createContext(bn()),vn=()=>D.useContext(yn),wn=(e,t,s)=>{const n=s!=null&&s.state.error&&typeof e.throwOnError=="function"?ir(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},jn=e=>{D.useEffect(()=>{e.clearReset()},[e])},Nn=({result:e,errorResetBoundary:t,throwOnError:s,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||ir(s,[e.error,n])),kn=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>s(n(...i)):s(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Cn=(e,t)=>e.isLoading&&e.isFetching&&!t,Sn=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Es=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Rn(e,t,s){var j,v,p,x;const n=gn(),i=vn(),o=fr(),c=o.defaultQueryOptions(e);(v=(j=o.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||v.call(j,c);const l=o.getQueryCache().get(c.queryHash);c._optimisticResults=n?"isRestoring":"optimistic",kn(c),wn(c,i,l),jn(i);const d=!o.getQueryCache().get(c.queryHash),[u]=D.useState(()=>new t(o,c)),h=u.getOptimisticResult(c),b=!n&&e.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(g=>{const f=b?u.subscribe(L.batchCalls(g)):J;return u.updateResult(),f},[u,b]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),D.useEffect(()=>{u.setOptions(c)},[c,u]),Sn(c,h))throw Es(c,u,i);if(Nn({result:h,errorResetBoundary:i,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw h.error;if((x=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||x.call(p,c,h),c.experimental_prefetchInRender&&!bt.isServer()&&Cn(h,n)){const g=d?Es(c,u,i):l==null?void 0:l.promise;g==null||g.catch(J).finally(()=>{u.updateResult()})}return c.notifyOnChangeProps?h:u.trackResult(h)}function se(e,t){return Rn(e,ln)}/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const _n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pr=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim();/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */var Pn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Mn=D.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:c,...l},d)=>D.createElement("svg",{ref:d,...Pn,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:pr("lucide",i),...l},[...c.map(([u,h])=>D.createElement(u,h)),...Array.isArray(o)?o:[o]]));/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const G=(e,t)=>{const s=D.forwardRef(({className:n,...i},o)=>D.createElement(Mn,{ref:o,iconNode:t,className:pr(`lucide-${_n(e)}`,n),...i}));return s.displayName=`${e}`,s};/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const On=G("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Fn=G("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const xr=G("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const En=G("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ft=G("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Tn=G("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ts=G("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const gr=G("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const An=G("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const In=G("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const qn=G("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ln=G("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Dn=G("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Qn=G("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const br=G("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
+ * @license lucide-react v0.468.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const $n=G("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),hs="-",Un=e=>{const t=Kn(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{const l=c.split(hs);return l[0]===""&&l.length!==1&&l.shift(),yr(l,t)||zn(c)},getConflictingClassGroupIds:(c,l)=>{const d=s[c]||[];return l&&n[c]?[...d,...n[c]]:d}}},yr=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const s=e[0],n=t.nextPart.get(s),i=n?yr(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(hs);return(c=t.validators.find(({validator:l})=>l(o)))==null?void 0:c.classGroupId},As=/^\[(.+)\]$/,zn=e=>{if(As.test(e)){const t=As.exec(e)[1],s=t==null?void 0:t.substring(0,t.indexOf(":"));if(s)return"arbitrary.."+s}},Kn=e=>{const{theme:t,prefix:s}=e,n={nextPart:new Map,validators:[]};return Bn(Object.entries(e.classGroups),s).forEach(([o,c])=>{ts(c,n,o,t)}),n},ts=(e,t,s,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Is(t,i);o.classGroupId=s;return}if(typeof i=="function"){if(Gn(i)){ts(i(n),t,s,n);return}t.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([o,c])=>{ts(c,Is(t,o),s,n)})})},Is=(e,t)=>{let s=e;return t.split(hs).forEach(n=>{s.nextPart.has(n)||s.nextPart.set(n,{nextPart:new Map,validators:[]}),s=s.nextPart.get(n)}),s},Gn=e=>e.isThemeGetter,Bn=(e,t)=>t?e.map(([s,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([c,l])=>[t+c,l])):o);return[s,i]}):e,Hn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=new Map,n=new Map;const i=(o,c)=>{s.set(o,c),t++,t>e&&(t=0,n=s,s=new Map)};return{get(o){let c=s.get(o);if(c!==void 0)return c;if((c=n.get(o))!==void 0)return i(o,c),c},set(o,c){s.has(o)?s.set(o,c):i(o,c)}}},vr="!",Jn=e=>{const{separator:t,experimentalParseClassName:s}=e,n=t.length===1,i=t[0],o=t.length,c=l=>{const d=[];let u=0,h=0,b;for(let g=0;gh?b-h:void 0;return{modifiers:d,hasImportantModifier:v,baseClassName:p,maybePostfixModifierPosition:x}};return s?l=>s({className:l,parseClassName:c}):c},Wn=e=>{if(e.length<=1)return e;const t=[];let s=[];return e.forEach(n=>{n[0]==="["?(t.push(...s.sort(),n),s=[]):s.push(n)}),t.push(...s.sort()),t},Vn=e=>({cache:Hn(e.cacheSize),parseClassName:Jn(e),...Un(e)}),Xn=/\s+/,Zn=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],c=e.trim().split(Xn);let l="";for(let d=c.length-1;d>=0;d-=1){const u=c[d],{modifiers:h,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:v}=s(u);let p=!!v,x=n(p?j.substring(0,v):j);if(!x){if(!p){l=u+(l.length>0?" "+l:l);continue}if(x=n(j),!x){l=u+(l.length>0?" "+l:l);continue}p=!1}const g=Wn(h).join(":"),f=b?g+vr:g,k=f+x;if(o.includes(k))continue;o.push(k);const R=i(x,p);for(let y=0;y0?" "+l:l)}return l};function Yn(){let e=0,t,s,n="";for(;e{if(typeof e=="string")return e;let t,s="";for(let n=0;nb(h),e());return s=Vn(u),n=s.cache.get,i=s.cache.set,o=l,l(d)}function l(d){const u=n(d);if(u)return u;const h=Zn(d,s);return i(d,h),h}return function(){return o(Yn.apply(null,arguments))}}const E=e=>{const t=s=>s[e]||[];return t.isThemeGetter=!0,t},jr=/^\[(?:([a-z-]+):)?(.+)\]$/i,ti=/^\d+\/\d+$/,si=new Set(["px","full","screen"]),ri=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ni=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ii=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ai=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>He(e)||si.has(e)||ti.test(e),be=e=>lt(e,"length",pi),He=e=>!!e&&!Number.isNaN(Number(e)),Dt=e=>lt(e,"number",He),ht=e=>!!e&&Number.isInteger(Number(e)),li=e=>e.endsWith("%")&&He(e.slice(0,-1)),N=e=>jr.test(e),ye=e=>ri.test(e),ci=new Set(["length","size","percentage"]),di=e=>lt(e,ci,Nr),ui=e=>lt(e,"position",Nr),hi=new Set(["image","url"]),fi=e=>lt(e,hi,gi),mi=e=>lt(e,"",xi),ft=()=>!0,lt=(e,t,s)=>{const n=jr.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):s(n[2]):!1},pi=e=>ni.test(e)&&!ii.test(e),Nr=()=>!1,xi=e=>ai.test(e),gi=e=>oi.test(e),bi=()=>{const e=E("colors"),t=E("spacing"),s=E("blur"),n=E("brightness"),i=E("borderColor"),o=E("borderRadius"),c=E("borderSpacing"),l=E("borderWidth"),d=E("contrast"),u=E("grayscale"),h=E("hueRotate"),b=E("invert"),j=E("gap"),v=E("gradientColorStops"),p=E("gradientColorStopPositions"),x=E("inset"),g=E("margin"),f=E("opacity"),k=E("padding"),R=E("saturate"),y=E("scale"),F=E("sepia"),T=E("skew"),Q=E("space"),_=E("translate"),M=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",N,t],P=()=>[N,t],xe=()=>["",ue,be],Z=()=>["auto",He,N],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Me=()=>["solid","dashed","dotted","double","none"],ct=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ke=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",N],dt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[He,N];return{cacheSize:500,separator:":",theme:{colors:[ft],spacing:[ue,be],blur:["none","",ye,N],brightness:Y(),borderColor:[e],borderRadius:["none","","full",ye,N],borderSpacing:P(),borderWidth:xe(),contrast:Y(),grayscale:ge(),hueRotate:Y(),invert:ge(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[li,be],inset:$(),margin:$(),opacity:Y(),padding:P(),saturate:Y(),scale:Y(),sepia:ge(),skew:Y(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[ye]}],"break-after":[{"break-after":dt()}],"break-before":[{"break-before":dt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...oe(),N]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ht,N]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",ht,N]}],"grid-cols":[{"grid-cols":[ft]}],"col-start-end":[{col:["auto",{span:["full",ht,N]},N]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[ft]}],"row-start-end":[{row:["auto",{span:[ht,N]},N]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal",...Ke()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ke(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ke(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[ye]},ye]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ye,be]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dt]}],"font-family":[{font:[ft]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",He,Dt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ue,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ue,be]}],"underline-offset":[{"underline-offset":["auto",ue,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...oe(),ui]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",di]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...Me(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:Me()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Me()]}],"outline-offset":[{"outline-offset":[ue,N]}],"outline-w":[{outline:[ue,be]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[ue,be]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ye,mi]}],"shadow-color":[{shadow:[ft]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...ct(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ct()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[n]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ye,N]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[b]}],saturate:[{saturate:[R]}],sepia:[{sepia:[F]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[ht,N]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ue,be,Dt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},yi=ei(bi),vi=new pn({defaultOptions:{queries:{retry:1}}}),qs=12,wi=12,ji=10080*60*1e3,Ni=1e3;function ie(...e){return yi(qr(e))}async function re(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);return t.json()}function ae(e){if(e==null)return"n/a";const t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;const s=Math.floor(t/60);return s<60?`${s}m ${t%60}s`:`${Math.floor(s/60)}h ${s%60}m`}const ki=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),Ci=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function Ct(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Si(e){const t=Ct(e);return t?ki.format(t):e??""}function pt(e){const t=Ct(e);return t?Ci.format(t):e??""}function kr(e,t){const s=Ct(e);if(!s)return e??"";const n=t-s.getTime(),i=Math.abs(n);if(i>ji)return pt(e);const o=n>=0?"ago":"from now",c=Math.round(i/1e3);if(c<45)return n>=0?"just now":"soon";if(c<90)return`1m ${o}`;const l=Math.round(c/60);if(l<60)return`${l}m ${o}`;if(l<90)return`1h ${o}`;const d=Math.round(l/60);return d<24?`${d}h ${o}`:d<36?`1d ${o}`:`${Math.round(d/24)}d ${o}`}function pe({value:e,compact:t=!1,relative:s=!1,now:n=Date.now()}){const i=Ct(e);return i?r.jsx("time",{dateTime:i.toISOString(),title:`UTC: ${i.toISOString()}`,children:s?kr(e,n):t?pt(e):Si(e)}):r.jsx(r.Fragment,{children:e??""})}function Cr(e,t){const s=Ct(e);return s?Math.max(0,Math.floor((t-s.getTime())/1e3)):null}function fs(e,t){return e.status==="running"?Cr(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function ms(e,t){return e.status==="pending"?Cr(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function Ri(e){const[t,s]=W.useState(()=>Date.now());return W.useEffect(()=>{if(!e)return;s(Date.now());const n=window.setInterval(()=>s(Date.now()),Ni);return()=>window.clearInterval(n)},[e]),t}function _i(e){return(e??"").split(/\r?\n/).map(s=>s.trim()).find(Boolean)??""}function Et(e,t,s=1){const n=_i(t),i=s>1?` (${s})`:"";return n?`${e}${i}: ${n}`:`${e}${i}`}function Tt(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function Sr(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(`
+`)}function Pi(e){const t=[];for(const s of e){const n=t[t.length-1];if(n&&Tt(s.event_type)&&n.eventType===s.event_type){n.count+=1,n.meta=s.ts,n.detail=Sr([n.detail,s.detail]),n.summary=Et(s.summary,n.detail,n.count);continue}t.push({id:String(s.id),badge:s.event_type,meta:s.ts,summary:Tt(s.event_type)?Et(s.summary,s.detail):s.summary,detail:s.detail,eventType:s.event_type,count:1})}return t}function Mi(e){const t=[];return e.forEach((s,n)=>{const i=t[t.length-1];if(i&&Tt(s.kind)&&i.kind===s.kind){i.count+=1,i.meta=s.timestamp,i.text=Sr([i.text,s.text]),i.summary=Et(`${s.role} · ${s.kind}`,i.text,i.count);return}t.push({id:`${s.timestamp??"entry"}-${n}`,badge:s.title,meta:s.timestamp,summary:Tt(s.kind)?Et(`${s.role} · ${s.kind}`,s.text):`${s.role} · ${s.kind}`,text:s.text,kind:s.kind,count:1})}),t}function Ls(e,t,s,n){return e==="openclaw_stdout"?!1:t||s>=n-2}function Oi(e){return{pending:{badge:"border-amber-300 bg-amber-50 text-amber-800",dot:"bg-amber-500"},running:{badge:"border-blue-300 bg-blue-50 text-blue-700",dot:"bg-blue-600"},blocked:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},denied:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},done:{badge:"border-emerald-300 bg-emerald-50 text-emerald-700",dot:"bg-emerald-600"},waiting_approval:{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}[e]??{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}function Fi(e,t){const s=new URLSearchParams;for(const[n,i]of Object.entries(e))i.trim()&&s.set(n,i.trim());return s.set("limit",String(t)),`/api/jobs?${s.toString()}`}function ot(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function Rr(e){return`/jobs/${e}`}function Ds(e){try{return JSON.parse(e.data)}catch{return null}}function Ei(e,t){return e.some(s=>s.id===t.id)?e:[...e,t]}function Ti(e,t){const s=Qs(t);return e.some(n=>Qs(n)===s)?e:[...e,t]}function Qs(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function Ai(e){return["claimed","dispatch_started","dispatch_finished","done","blocked","denied","waiting_approval"].includes(e)}function Ii(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function qi(){var xe,Z,oe,Me,ct,Ke,ge,dt,Y,gs,bs,ys;const e=fr(),[t,s]=W.useState({status:"",repo:"",thread:"",action:"",intent:"",actor:""}),[n,i]=W.useState(qs),[o,c]=W.useState(()=>window.location.pathname),l=Ii(o),d=l!==null,u=l,h=se({queryKey:["metrics"],queryFn:()=>re("/api/metrics/summary"),enabled:!d}),b=se({queryKey:["me"],queryFn:()=>re("/api/me"),refetchInterval:!1}),j=se({queryKey:["about"],queryFn:()=>re("/api/about")}),v=se({queryKey:["job-actors"],queryFn:()=>re("/api/jobs/actors"),enabled:!d}),p=se({queryKey:["jobs",t,n],queryFn:()=>re(Fi(t,n)),enabled:!d}),x=se({queryKey:["processes"],queryFn:()=>re("/api/processes"),enabled:!d}),g=se({queryKey:["alerts"],queryFn:()=>re("/api/alerts"),enabled:!d}),f=se({queryKey:["job",u],queryFn:()=>re(`/api/jobs/${u}`),enabled:u!==null}),k=se({queryKey:["job-session",u],queryFn:()=>re(`/api/jobs/${u}/session`),enabled:u!==null}),R=se({queryKey:["job-session-events",u],queryFn:()=>re(`/api/jobs/${u}/session/events`),enabled:u!==null}),y=se({queryKey:["job-session-transcript",u],queryFn:()=>re(`/api/jobs/${u}/session/transcript`),enabled:u!==null});W.useEffect(()=>{if(u===null)return;const U=new EventSource(`/api/jobs/${u}/session/stream`);return U.addEventListener("session_event",It=>{const Oe=Ds(It);Oe&&(e.setQueryData(["job-session-events",u],Fe=>({events:Ei((Fe==null?void 0:Fe.events)??[],Oe)})),Ai(Oe.event_type)&&(e.invalidateQueries({queryKey:["job",u]}),e.invalidateQueries({queryKey:["jobs"]})))}),U.addEventListener("transcript_entry",It=>{const Oe=Ds(It);!Oe||Oe.job_id!==u||e.setQueryData(["job-session-transcript",u],Fe=>({entries:Ti((Fe==null?void 0:Fe.entries)??[],Oe.entry)}))}),U.onerror=()=>{e.invalidateQueries({queryKey:["job",u]}),e.invalidateQueries({queryKey:["job-session-events",u]}),e.invalidateQueries({queryKey:["job-session-transcript",u]})},()=>U.close()},[u,e]),W.useEffect(()=>{const U=()=>{c(window.location.pathname)};return window.addEventListener("popstate",U),()=>window.removeEventListener("popstate",U)},[]);const F=W.useCallback(U=>{window.history.pushState({},"",Rr(U)),c(window.location.pathname)},[]),T=((xe=h.data)==null?void 0:xe.metrics.status_counts)??{},Q=((Z=p.data)==null?void 0:Z.jobs)??[],_=W.useCallback(U=>{s(U),i(qs)},[]),M=u?((oe=f.data)==null?void 0:oe.job)??null:null,I=Q.some(U=>U.status==="running"||U.status==="pending")||(M==null?void 0:M.status)==="running"||(M==null?void 0:M.status)==="pending",$=Ri(I),P=r.jsx(Qi,{selectedJobId:u,selectedJob:M,loading:f.isLoading,error:f.error,session:(Me=k.data)==null?void 0:Me.session,sessionEvents:(ct=R.data)==null?void 0:ct.events,transcript:(Ke=y.data)==null?void 0:Ke.entries,now:$});return r.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[r.jsx("header",{className:"border-b border-slate-800 bg-slate-950 text-white",children:r.jsxs("div",{className:"mx-auto flex w-full max-w-[1440px] items-center justify-between gap-3 px-4 py-4 md:px-6",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"truncate text-xl font-semibold",children:"GitHub Agent Bridge"}),r.jsx(Li,{about:j.data})]}),r.jsx($i,{user:(ge=b.data)==null?void 0:ge.user,loading:b.isLoading})]})}),r.jsx("main",{className:"mx-auto grid w-full max-w-[1440px] gap-4 px-3 py-4 sm:px-4 md:px-6 md:py-5",children:l!==null?r.jsx(Di,{jobId:l,detail:P,onRefresh:()=>{f.refetch(),k.refetch(),R.refetch(),y.refetch()}}):r.jsxs(r.Fragment,{children:[h.error?r.jsx(Be,{tone:"error",text:h.error.message}):null,r.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[r.jsx(Pt,{title:"Pending",value:T.pending??0,icon:r.jsx(Tn,{className:"h-5 w-5"})}),r.jsx(Pt,{title:"Running",value:T.running??0,icon:r.jsx(On,{className:"h-5 w-5"})}),r.jsx(Pt,{title:"Blocked",value:T.blocked??0,icon:r.jsx(br,{className:"h-5 w-5"})}),r.jsx(Pt,{title:"Done",value:T.done??0,icon:r.jsx(En,{className:"h-5 w-5"})})]}),r.jsxs("section",{className:"grid gap-3",children:[r.jsx(Ui,{count:Q.length,limit:n,loading:p.isLoading,onRefresh:()=>p.refetch()}),r.jsxs(Ee,{title:"Recent jobs",flushHeader:!0,children:[r.jsx(zi,{filters:t,actorOptions:((dt=v.data)==null?void 0:dt.actors)??[],onChange:_}),p.error?r.jsx(Be,{tone:"error",text:p.error.message}):null,r.jsx(Gi,{jobs:Q,loading:p.isLoading,onViewJob:F,now:$}),Q.length>=n?r.jsx("div",{className:"mt-3 flex justify-center",children:r.jsx("button",{className:"inline-flex h-9 items-center justify-center rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50",type:"button",onClick:()=>i(U=>U+wi),children:"Load more jobs"})}):null]})]}),r.jsxs("section",{className:"grid gap-4",children:[r.jsxs(Ee,{title:"Process activity",action:r.jsx(At,{onClick:()=>x.refetch()}),children:[x.error?r.jsx(Be,{tone:"error",text:x.error.message}):null,r.jsx(Zi,{data:x.data,loading:x.isLoading})]}),r.jsxs(Ee,{title:"Monitor alerts",action:r.jsx(At,{onClick:()=>g.refetch()}),children:[g.error?r.jsx(Be,{tone:"error",text:g.error.message}):null,r.jsx(Yi,{alerts:(Y=g.data)==null?void 0:Y.alerts,loading:g.isLoading,now:$})]})]}),r.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[r.jsx(Ee,{title:"Runtime percentiles",children:r.jsx($s,{label:"runtime",values:(gs=h.data)==null?void 0:gs.metrics.runtime_seconds})}),r.jsx(Ee,{title:"Jobs per day",children:r.jsx(Vi,{values:(bs=h.data)==null?void 0:bs.metrics.by_created_day,loading:h.isLoading,totalJobs:Xi(T)})}),r.jsx(Ee,{title:"Queue wait percentiles",children:r.jsx($s,{label:"queue wait",values:(ys=h.data)==null?void 0:ys.metrics.queue_wait_seconds})})]})]})})]})}function Li({about:e}){const t=e!=null&&e.version?`v${e.version}`:"version loading";return r.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-slate-300",children:[r.jsx("span",{children:"Read-only operational dashboard"}),r.jsx("span",{className:"font-mono text-xs text-slate-400",children:t}),e!=null&&e.repository_url?r.jsxs("a",{className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:underline",href:ot(e.repository_url),rel:"noreferrer",target:"_blank",children:[r.jsx(gr,{className:"h-3.5 w-3.5","aria-hidden":!0}),"GitHub"]}):null]})}function Di({jobId:e,detail:t,onRefresh:s}){return r.jsxs("div",{className:"grid min-w-0 gap-3 sm:gap-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("a",{className:"inline-flex h-9 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50",href:"/",children:[r.jsx(Fn,{className:"h-4 w-4","aria-hidden":!0}),"Dashboard"]}),r.jsx(At,{onClick:s})]}),r.jsx(Ee,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function Qi({selectedJobId:e,selectedJob:t,loading:s,error:n,session:i,sessionEvents:o,transcript:c,now:l}){return t?r.jsx(Hi,{job:t,session:i,sessionEvents:o,transcript:c,now:l}):e!==null&&s?r.jsx(K,{text:"Loading selected job..."}):e!==null&&n?r.jsx(Be,{tone:"error",text:`Job #${e}: ${n.message}`}):r.jsx(K,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function $i({user:e,loading:t}){const s=e!=null&&e.login?`@${e.login}`:t?"Loading profile...":"GitHub OAuth",n=e!=null&&e.avatar_url?r.jsx("img",{className:"h-10 w-10 rounded-full border border-slate-700 bg-slate-800",src:e.avatar_url,alt:e.login?`${e.login} avatar`:"",referrerPolicy:"no-referrer"}):r.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-700 bg-slate-900",children:r.jsx(Ft,{className:"h-5 w-5","aria-hidden":!0})}),i=e!=null&&e.html_url?r.jsx("a",{className:"truncate font-semibold text-white hover:underline",href:ot(e.html_url),rel:"noreferrer",target:"_blank",children:s}):r.jsx("div",{className:"truncate font-semibold text-white",children:s});return r.jsxs("div",{className:"flex max-w-full shrink-0 items-center gap-3 text-sm text-slate-300","aria-label":e!=null&&e.login?`Signed in as ${e.login}`:"Dashboard account",children:[r.jsx(Dn,{className:"hidden h-4 w-4 shrink-0 sm:block","aria-hidden":!0}),r.jsxs("div",{className:"hidden min-w-0 text-right sm:block",children:[i,r.jsx("div",{className:"text-xs text-slate-400",children:"Signed in · read-only"})]}),n]})}function Ui({count:e,limit:t,loading:s,onRefresh:n}){return r.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-white px-3 py-3 shadow-sm md:px-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-base font-semibold",children:"Jobs"}),r.jsx("p",{className:"text-xs text-muted",children:s?"Refreshing latest jobs...":`Showing ${e} of the latest ${t} requested jobs`})]}),r.jsx(At,{onClick:n,compactOnMobile:!0})]})}function Ee({title:e,action:t,children:s,className:n,flushHeader:i=!1}){return r.jsxs("section",{className:ie("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",n),children:[r.jsxs("div",{className:ie("flex items-center justify-between gap-3",!i&&"mb-4"),children:[r.jsx("h2",{className:"text-sm font-semibold",children:e}),t]}),s]})}function Pt({title:e,value:t,icon:s}){return r.jsxs("div",{className:"rounded-lg border border-border bg-panel p-3 shadow-sm md:p-4",children:[r.jsxs("div",{className:"flex items-center justify-between text-muted",children:[r.jsx("span",{className:"text-sm font-medium",children:e}),s]}),r.jsx("strong",{className:"mt-3 block text-2xl leading-none md:mt-4 md:text-3xl",children:t})]})}function zi({filters:e,actorOptions:t,onChange:s}){const[n,i]=W.useState(e);return W.useEffect(()=>i(e),[e]),r.jsxs("details",{className:"my-3 rounded-md border border-border bg-slate-50/70",children:[r.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2 text-sm font-semibold marker:hidden",children:[r.jsxs("span",{className:"inline-flex items-center gap-2",children:[r.jsx(An,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Filters"]}),r.jsx(xr,{className:"h-4 w-4 text-muted","aria-hidden":!0})]}),r.jsxs("form",{className:"grid gap-3 border-t border-border bg-white p-3 md:grid-cols-3 xl:grid-cols-8",onSubmit:o=>{o.preventDefault(),s(n)},children:[r.jsx(Ge,{label:"Status",children:r.jsxs("select",{className:"control",value:n.status,onChange:o=>i({...n,status:o.target.value}),children:[r.jsx("option",{value:"",children:"All"}),r.jsx("option",{value:"pending",children:"pending"}),r.jsx("option",{value:"running",children:"running"}),r.jsx("option",{value:"blocked",children:"blocked"}),r.jsx("option",{value:"done",children:"done"}),r.jsx("option",{value:"denied",children:"denied"}),r.jsx("option",{value:"waiting_approval",children:"waiting_approval"})]})}),r.jsx(Ge,{label:"Repository",children:r.jsx("input",{className:"control",value:n.repo,placeholder:"owner/repo",onChange:o=>i({...n,repo:o.target.value})})}),r.jsx(Ge,{label:"Thread",children:r.jsx("input",{className:"control",value:n.thread,inputMode:"numeric",placeholder:"issue or PR",onChange:o=>i({...n,thread:o.target.value})})}),r.jsx(Ge,{label:"Action",children:r.jsx("input",{className:"control",value:n.action,placeholder:"reply_comment",onChange:o=>i({...n,action:o.target.value})})}),r.jsx(Ge,{label:"Actor",className:"xl:col-span-2",children:r.jsx(Ki,{value:n.actor,options:t,onChange:o=>i({...n,actor:o})})}),r.jsx(Ge,{label:"Intent",children:r.jsxs("select",{className:"control",value:n.intent,onChange:o=>i({...n,intent:o.target.value}),children:[r.jsx("option",{value:"",children:"All"}),r.jsx("option",{value:"review_only",children:"review_only"}),r.jsx("option",{value:"work_allowed",children:"work_allowed"})]})}),r.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 self-end rounded-md bg-primary px-3 text-sm font-semibold text-white",type:"submit",children:[r.jsx(Ln,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})}function Ki({value:e,options:t,onChange:s}){const[n,i]=W.useState(!1),o=e.trim().replace(/^@/,"").toLowerCase(),c=t.filter(d=>!o||d.login.toLowerCase().includes(o)).slice(0,8),l=t.find(d=>d.login.toLowerCase()===o);return r.jsxs("div",{className:"relative min-w-0",children:[r.jsxs("div",{className:"control flex items-center gap-2 px-2",children:[l?r.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:ot(l.avatar_url??""),alt:`${l.login} avatar`,referrerPolicy:"no-referrer"}):r.jsx(Ft,{className:"h-4 w-4 shrink-0 text-muted","aria-hidden":!0}),r.jsx("input",{className:"min-w-0 flex-1 bg-transparent font-mono text-sm outline-none",value:e,placeholder:"@login",onChange:d=>{s(d.target.value),i(!0)},onFocus:()=>i(!0),onBlur:()=>window.setTimeout(()=>i(!1),100)}),e?r.jsx("button",{className:"rounded-sm p-1 text-muted hover:bg-slate-100",type:"button","aria-label":"Clear actor filter",onClick:()=>s(""),children:r.jsx($n,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),n&&c.length>0?r.jsx("div",{className:"absolute left-0 right-0 z-20 mt-1 max-h-72 overflow-auto rounded-md border border-border bg-white p-1 shadow-lg",children:c.map(d=>r.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-slate-50",type:"button",onMouseDown:u=>u.preventDefault(),onClick:()=>{s(d.login),i(!1)},children:[d.avatar_url?r.jsx("img",{className:"h-6 w-6 shrink-0 rounded-full bg-slate-100",src:ot(d.avatar_url),alt:`${d.login} avatar`,referrerPolicy:"no-referrer"}):r.jsx(Ft,{className:"h-5 w-5 shrink-0 text-muted","aria-hidden":!0}),r.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:["@",d.login]}),r.jsx("span",{className:"shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-semibold text-muted",children:d.job_count})]},d.login))}):null]})}function Ge({label:e,children:t,className:s}){return r.jsxs("label",{className:ie("grid min-w-0 gap-1 text-xs font-semibold text-muted",s),children:[e,t]})}function Gi({jobs:e,loading:t,onViewJob:s,now:n}){return t&&e.length===0?r.jsx(K,{text:"Loading jobs..."}):e.length===0?r.jsx(K,{text:"No jobs match the current filters."}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"grid gap-2 md:hidden",children:e.map(i=>r.jsx(Bi,{job:i,onViewJob:s,now:n},i.id))}),r.jsx("div",{className:"hidden max-h-[640px] overflow-auto rounded-md border border-border md:block",children:r.jsxs("table",{className:"min-w-full border-collapse text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"sticky top-0 border-b border-border bg-panel text-left text-xs text-muted",children:[r.jsx("th",{className:"px-2 py-2 font-semibold",children:"ID"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Status"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Repo / thread"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Action"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Actor"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Attempts"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Queue wait"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Runtime"}),r.jsx("th",{className:"px-2 py-2 font-semibold",children:"Updated"})]})}),r.jsx("tbody",{children:e.map(i=>r.jsxs("tr",{className:"cursor-pointer border-b border-border hover:bg-slate-50",onClick:()=>s(i.id),children:[r.jsxs("td",{className:"px-2 py-3 font-mono",children:["#",i.id]}),r.jsx("td",{className:"px-2 py-3",children:r.jsx(xs,{status:i.status})}),r.jsxs("td",{className:"px-2 py-3",children:[r.jsx("div",{className:"font-mono",children:i.repo??i.work_key}),r.jsxs("div",{className:"text-xs text-muted",children:["thread ",i.thread??"n/a"]})]}),r.jsxs("td",{className:"px-2 py-3",children:[r.jsx("div",{children:i.action}),r.jsx("div",{className:"text-xs text-muted",children:i.intent})]}),r.jsx("td",{className:"px-2 py-3",children:r.jsx(ps,{actor:i.trigger_actor,avatarUrl:i.trigger_actor_avatar_url})}),r.jsx("td",{className:"px-2 py-3",children:i.attempts}),r.jsx("td",{className:"px-2 py-3",children:ae(ms(i,n))}),r.jsx("td",{className:"px-2 py-3",children:ae(fs(i,n))}),r.jsx("td",{className:"px-2 py-3 font-mono text-xs",children:r.jsx(pe,{value:i.updated_at,compact:!0,relative:!0,now:n})})]},i.id))})]})})]})}function Bi({job:e,onViewJob:t,now:s}){return r.jsx("article",{className:"rounded-md border border-border bg-white shadow-[0_1px_0_rgba(15,23,42,0.03)]",children:r.jsxs("button",{className:"grid w-full gap-2 p-3 text-left hover:bg-slate-50",type:"button",onClick:()=>t(e.id),children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 space-y-1",children:[r.jsxs("div",{className:"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-2",children:[r.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),r.jsx("span",{className:"truncate font-mono text-sm",children:e.repo??e.work_key})]}),r.jsx("div",{className:"line-clamp-2 text-sm leading-snug text-foreground",children:e.subject}),r.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[r.jsxs("span",{children:["thread ",e.thread??"n/a"," · ",e.action]}),r.jsx(ps,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),r.jsx(xs,{status:e.status})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[r.jsx(ee,{label:"Wait",value:ae(ms(e,s))}),r.jsx(ee,{label:"Runtime",value:ae(fs(e,s))}),r.jsx(ee,{label:"Updated",value:r.jsx(pe,{value:e.updated_at,compact:!0,relative:!0,now:s})})]})]})})}function ps({actor:e,avatarUrl:t,framed:s=!1}){const n=t?r.jsx("img",{className:"h-4 w-4 shrink-0 rounded-full bg-slate-100",src:ot(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):r.jsx(Ft,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i=r.jsxs(r.Fragment,{children:[n,r.jsx("span",{className:"min-w-0 truncate",children:e?`@${e}`:"unknown actor"})]});return s?r.jsx("span",{className:"inline-flex h-7 max-w-full items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-muted",children:i}):r.jsx("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1 font-mono text-xs text-muted",children:i})}function Hi({job:e,session:t,sessionEvents:s,transcript:n,now:i,compact:o=!1}){var v;const c=Rr(e.id),l=s??[],d=n??[],u=Pi(l),h=Mi(d),b=fs(e,i),j=ms(e,i);return r.jsxs("div",{className:"grid min-w-0 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(xs,{status:e.status}),r.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-foreground hover:bg-slate-50",href:c,children:[r.jsx(In,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),r.jsx(ps,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url,framed:!0})]}),r.jsx("div",{className:"min-w-0 break-words font-mono text-sm [overflow-wrap:anywhere]",children:e.work_key}),r.jsx("p",{className:"min-w-0 break-words text-sm text-muted [overflow-wrap:anywhere]",children:e.subject})]}),r.jsxs("div",{className:ie("grid gap-2 text-sm sm:gap-3",o?"grid-cols-1":"grid-cols-3"),children:[r.jsx(ee,{label:"Queue wait",value:ae(j)}),r.jsx(ee,{label:e.status==="running"?"Running for":"Runtime",value:ae(b)}),r.jsx(ee,{label:"Coalesced",value:String(e.coalesced_count)})]}),r.jsxs("div",{className:ie("grid gap-2 text-sm sm:gap-3",o?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[r.jsx(ee,{label:"Created",value:r.jsx(pe,{value:e.created_at,compact:!0,relative:!0,now:i})}),r.jsx(ee,{label:"Started",value:e.started_at?r.jsx(pe,{value:e.started_at,compact:!0,relative:!0,now:i}):"n/a"}),r.jsx(ee,{label:"Updated",value:r.jsx(pe,{value:e.updated_at,compact:!0,relative:!0,now:i})}),r.jsx(ee,{label:"Finished",value:e.finished_at?r.jsx(pe,{value:e.finished_at,compact:!0,relative:!0,now:i}):"n/a"})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Timeline"}),r.jsx("div",{className:"grid min-w-0 gap-3",children:(e.worklog??[]).length>0?(v=e.worklog)==null?void 0:v.map(p=>r.jsxs("div",{className:"min-w-0 border-l-2 border-primary pl-3",children:[r.jsx("div",{className:"text-sm font-semibold",children:p.phase}),r.jsx("div",{className:"font-mono text-xs text-muted",children:r.jsx(pe,{value:p.ts,relative:!0,now:i})}),r.jsx("div",{className:"break-words text-sm [overflow-wrap:anywhere]",children:p.summary}),p.detail?r.jsx("div",{className:"mt-1 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:p.detail}):null]},p.id)):r.jsx(K,{text:"No worklog entries."})})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[r.jsx(Qn,{className:"h-4 w-4","aria-hidden":!0}),"OpenClaw session"]}),t?r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[r.jsx(ee,{label:"Session ID",value:t.id}),r.jsx(ee,{label:"Source",value:t.source})]}),r.jsx("p",{className:"break-words text-xs text-muted [overflow-wrap:anywhere]",children:t.detail})]}):r.jsx(K,{text:"Session correlation is loading."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Agent activity"}),r.jsx("div",{className:"grid max-h-[460px] min-w-0 gap-2 overflow-auto pr-1",children:u.length>0?u.map((p,x)=>r.jsx(Wi,{event:p,defaultOpen:Ls(p.eventType,e.status==="running",x,u.length),now:i},p.id)):r.jsx(K,{text:e.status==="running"?"Waiting for live agent output...":"No agent activity has been recorded for this session."})})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Session transcript"}),r.jsx("div",{className:"grid max-h-[620px] min-w-0 gap-2 overflow-auto pr-1",children:h.length>0?h.map((p,x)=>r.jsx(Ji,{entry:p,defaultOpen:Ls(p.kind,e.status==="running",x,h.length),now:i},p.id)):r.jsx(K,{text:e.status==="running"?"Waiting for live transcript entries...":"No OpenClaw transcript entries are available for this session."})})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"GitHub links"}),r.jsx("ul",{className:"grid gap-2 text-sm",children:e.github_urls.length>0?e.github_urls.map(p=>r.jsx("li",{children:r.jsxs("a",{className:"break-all text-primary hover:underline [overflow-wrap:anywhere]",href:ot(p),rel:"noreferrer",target:"_blank",children:[r.jsx(gr,{className:"mr-1 inline h-3.5 w-3.5 align-[-2px]","aria-hidden":!0}),p]})},p)):r.jsx("li",{className:"text-muted",children:"No links recorded."})})]})]})}function Ji({entry:e,defaultOpen:t,now:s}){return r.jsx(_r,{badge:e.badge,meta:r.jsx(pe,{value:e.meta,relative:!0,now:s}),count:e.count,summary:e.summary,defaultOpen:t,children:r.jsx("pre",{className:"max-h-72 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.text})})}function Wi({event:e,defaultOpen:t,now:s}){return r.jsx(_r,{badge:e.badge,meta:r.jsx(pe,{value:e.meta,relative:!0,now:s}),count:e.count,summary:e.summary,defaultOpen:t,children:e.detail?r.jsx("pre",{className:"max-h-56 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.detail}):null})}function _r({badge:e,meta:t,count:s,summary:n,defaultOpen:i,children:o}){const[c,l]=W.useState(!!i);return r.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:c,onToggle:d=>l(d.currentTarget.open),children:[r.jsxs("summary",{className:"grid cursor-pointer list-none gap-1 px-2 py-1.5 marker:hidden hover:bg-white",children:[r.jsxs("div",{className:"grid min-w-0 gap-1 sm:flex sm:items-center sm:justify-between sm:gap-2",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(xr,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),r.jsx("span",{className:"truncate font-mono text-[11px] font-semibold text-muted",children:e}),s&&s>1?r.jsx("span",{className:"rounded-sm border border-border px-1 font-mono text-[10px] text-muted",children:s}):null]}),r.jsx("span",{className:"min-w-0 truncate pl-5 font-mono text-[11px] text-muted sm:shrink-0 sm:pl-0",children:t})]}),r.jsx("div",{className:"min-w-0 break-words pl-5 text-xs text-foreground [overflow-wrap:anywhere] sm:truncate",children:n})]}),r.jsx("div",{className:"min-w-0 border-t border-border bg-white px-2 py-2",children:o})]})}function $s({label:e,values:t}){const s=[{name:"median",seconds:(t==null?void 0:t.median)??0},{name:"p90",seconds:(t==null?void 0:t.p90)??0},{name:"p99",seconds:(t==null?void 0:t.p99)??0}];return r.jsx("div",{className:"h-56",children:r.jsx(rs,{width:"100%",height:"100%",children:r.jsxs(er,{data:s,children:[r.jsx(ns,{strokeDasharray:"3 3"}),r.jsx(is,{dataKey:"name"}),r.jsx(as,{tickFormatter:ae}),r.jsx(os,{formatter:n=>[ae(Number(n)),e]}),r.jsx(tr,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function Vi({values:e,loading:t,totalJobs:s}){const n=Object.entries(e??{}).map(([i,o])=>({day:i,count:o}));return t&&n.length===0?r.jsx(K,{text:"Loading job history..."}):n.length===0?r.jsx(K,{text:s>0?"Job history has no valid creation dates.":"No job history available."}):r.jsx("div",{className:"h-56",children:r.jsx(rs,{width:"100%",height:"100%",children:r.jsxs(er,{data:n,children:[r.jsx(ns,{strokeDasharray:"3 3"}),r.jsx(is,{dataKey:"day",minTickGap:16}),r.jsx(as,{allowDecimals:!1}),r.jsx(os,{formatter:i=>[Number(i),"jobs"]}),r.jsx(tr,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Xi(e){return Object.values(e).reduce((t,s)=>t+s,0)}function Zi({data:e,loading:t}){var b,j,v,p,x,g;if(t&&!e)return r.jsx(K,{text:"Loading process activity..."});if(!e)return r.jsx(K,{text:"No process snapshot available."});const s=e.executor.children??[],n=s.flatMap(f=>Mr(f)),i=n.reduce((f,k)=>f+k.cpu_ticks,0),o=n.reduce((f,k)=>f+ea(k),0),c=e.executor.service==="active",l=n.slice(0,8).map(f=>({label:`pid ${f.pid}`,ticks:f.cpu_ticks})),d=(e.samples??[]).map(f=>({label:pt(f.ts),ticks:f.cpu_ticks,io:f.io_bytes,active:f.active_since_last_sample?"active":"quiet"})),u=d.length>0?d:l,h=(b=e.samples)==null?void 0:b[e.samples.length-1];return r.jsxs("div",{className:"grid gap-4",children:[r.jsx("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-3",children:r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:ie("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",c?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-white text-slate-600"),children:c?"active":"idle"}),r.jsxs("span",{className:"font-mono text-xs text-muted",children:["service ",e.executor.service]})]}),r.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:e.running_jobs.length>0?`${e.running_jobs.length} running job${e.running_jobs.length===1?"":"s"}`:"No running jobs"}),e.running_jobs.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.running_jobs.slice(0,4).map(f=>r.jsxs("span",{className:"inline-flex min-h-6 items-center gap-1.5 rounded-full border border-blue-200 bg-white px-2 font-mono text-[11px] font-semibold text-blue-700",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-blue-600 animate-live-pulse","aria-hidden":!0}),"#",f.id," ",ae(f.age_seconds)]},f.id))}):null,h?r.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",pt(h.ts)," · ",h.active_since_last_sample?"activity observed":`quiet ${ae(h.idle_seconds)}`]}):null,r.jsx("p",{className:"mt-1 text-xs text-muted",children:e.detail})]}),r.jsxs("div",{className:"grid min-w-[190px] grid-cols-3 gap-2 text-center text-xs",children:[r.jsx(Qt,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),r.jsx(Qt,{label:"Children",value:String(n.length)}),r.jsx(Qt,{label:"CPU ticks",value:String(i)})]})]})}),r.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[r.jsx(Mt,{label:"Live process",value:((j=e.signals)==null?void 0:j.live_process.state)??(n.length>0?"live":"no_child_process"),detail:`${((v=e.signals)==null?void 0:v.live_process.child_count)??n.length} children`}),r.jsx(Mt,{label:"Process activity",value:((p=e.signals)==null?void 0:p.process_activity.state)??(h!=null&&h.active_since_last_sample?"active":"quiet"),detail:h?`sample ${pt(h.ts)}`:"no sample"}),r.jsx(Mt,{label:"Semantic progress",value:(x=e.signals)!=null&&x.semantic_progress.length?"recent":"none",detail:Us(e.running_jobs,"semantic_progress")}),r.jsx(Mt,{label:"Visible progress",value:(g=e.signals)!=null&&g.visible_progress.length?"streaming":"none",detail:Us(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?r.jsx(Be,{tone:"error",text:e.alerts[0]}):null,r.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",children:[r.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[r.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[r.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[r.jsx(Ts,{className:"h-4 w-4","aria-hidden":!0}),d.length>0?"CPU history":"CPU ticks"]}),r.jsxs("span",{className:"font-mono text-xs text-muted",children:[Or(o)," I/O"]})]}),u.length>0?r.jsx("div",{className:"h-40",children:r.jsx(rs,{width:"100%",height:"100%",children:r.jsxs(Ar,{data:u,children:[r.jsx(ns,{strokeDasharray:"3 3"}),r.jsx(is,{dataKey:"label",tick:!1}),r.jsx(as,{allowDecimals:!1,tick:{fontSize:11}}),r.jsx(os,{formatter:f=>[Number(f),"cpu ticks"]}),r.jsx(Ir,{type:"monotone",dataKey:"ticks",stroke:"#0f766e",strokeWidth:2,dot:{r:3},activeDot:{r:5},isAnimationActive:!1})]})})}):r.jsx(K,{text:"No executor CPU samples available."})]}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[r.jsx(Ts,{className:"h-4 w-4","aria-hidden":!0}),"Executor children"]}),s.length>0?r.jsx("div",{className:"grid gap-2",children:s.map(f=>r.jsx(Pr,{process:f},f.pid))}):r.jsx(K,{text:"No child process detected for the executor."})]})]})]})}function Yi({alerts:e,loading:t,now:s}){if(t&&!e)return r.jsx(K,{text:"Loading monitor alerts..."});const n=e??[];return n.length===0?r.jsx(K,{text:"No active monitor alerts."}):r.jsx("div",{className:"grid gap-2",children:n.slice(0,5).map(i=>r.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-2.5",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs font-semibold text-red-700",children:[r.jsx(br,{className:"h-3.5 w-3.5","aria-hidden":!0}),r.jsx("span",{children:i.severity}),r.jsx("span",{className:"font-normal text-red-600",children:kr(i.last_seen,s)}),i.observations>1?r.jsxs("span",{className:"rounded-full border border-red-200 bg-white px-1.5",children:[i.observations,"x"]}):null]}),r.jsx("p",{className:"mt-1 break-words text-sm font-medium text-red-950 [overflow-wrap:anywhere]",children:i.message})]},i.fingerprint))})}function Pr({process:e}){var n,i;const t=((n=e.io_bytes)==null?void 0:n.read_bytes)??0,s=((i=e.io_bytes)==null?void 0:i.write_bytes)??0;return r.jsxs("div",{className:"rounded-md border border-border bg-white p-2.5",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[r.jsxs("span",{className:"font-mono",children:["pid ",e.pid]}),r.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["state ",e.state]}),r.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["cpu ",e.cpu_ticks]}),r.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["I/O ",Or(t+s)]})]}),r.jsx("div",{className:"mt-2 break-words font-mono text-xs text-muted",children:e.cmd||"unknown command"}),e.children&&e.children.length>0?r.jsx("div",{className:"mt-3 border-l-2 border-border pl-3",children:e.children.map(o=>r.jsx(Pr,{process:o},o.pid))}):null]})}function Qt({label:e,value:t}){return r.jsxs("div",{className:"rounded-md border border-border bg-white px-2 py-2",children:[r.jsx("div",{className:"font-mono text-sm font-semibold text-foreground",children:t}),r.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function Mt({label:e,value:t,detail:s}){return r.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-2.5",children:[r.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),r.jsx("div",{className:"mt-1 truncate text-sm font-semibold text-foreground",children:t}),r.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted",children:s})]})}function Us(e,t){const s=e.find(i=>i[t]),n=s==null?void 0:s[t];return!s||!n?"no running heartbeat":`#${s.id} ${n.phase} ${ae(n.age_seconds??null)}`}function Mr(e){return[e,...(e.children??[]).flatMap(t=>Mr(t))]}function ea(e){var t,s;return(((t=e.io_bytes)==null?void 0:t.read_bytes)??0)+(((s=e.io_bytes)==null?void 0:s.write_bytes)??0)}function Or(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function ee({label:e,value:t}){return r.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[r.jsx("div",{className:"text-xs font-semibold text-muted",children:e}),r.jsx("div",{className:"mt-1 min-w-0 break-words text-sm [overflow-wrap:anywhere]",children:t})]})}function xs({status:e}){const t=Oi(e),s=e==="running"||e==="pending";return r.jsxs("span",{className:ie("inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-xs font-semibold",t.badge),children:[r.jsx("span",{className:ie("h-2.5 w-2.5 rounded-full",t.dot,s&&"animate-live-pulse"),"aria-hidden":!0}),e]})}function K({text:e}){return r.jsx("div",{className:"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted",children:e})}function Be({tone:e,text:t}){return r.jsx("div",{className:ie("rounded-md border p-3 text-sm",e==="error"&&"border-red-300 bg-red-50 text-red-700"),children:t})}function At({onClick:e,compactOnMobile:t=!1}){return r.jsxs("button",{className:ie("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50",t?"w-8 px-0 sm:w-auto sm:px-3":"px-3"),onClick:e,type:"button","aria-label":"Refresh",children:[r.jsx(qn,{className:"h-4 w-4","aria-hidden":!0}),r.jsx("span",{className:ie(t&&"hidden sm:inline"),children:"Refresh"})]})}const zs=document.getElementById("root");zs&&Ur.createRoot(zs).render(r.jsx(W.StrictMode,{children:r.jsx(xn,{client:vi,children:r.jsx(qi,{})})}));
diff --git a/src/github_agent_bridge/dashboard_static/assets/index-Bh6F9yTT.js b/src/github_agent_bridge/dashboard_static/assets/index-Bh6F9yTT.js
deleted file mode 100644
index 5517f23..0000000
--- a/src/github_agent_bridge/dashboard_static/assets/index-Bh6F9yTT.js
+++ /dev/null
@@ -1,110 +0,0 @@
-var ys=e=>{throw TypeError(e)};var Lt=(e,t,s)=>t.has(e)||ys("Cannot "+s);var a=(e,t,s)=>(Lt(e,t,"read from private field"),s?s.call(e):t.get(e)),w=(e,t,s)=>t.has(e)?ys("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),f=(e,t,s,r)=>(Lt(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),S=(e,t,s)=>(Lt(e,t,"access private method"),s);var St=(e,t,s,r)=>({set _(i){f(e,t,i,s)},get _(){return a(e,t,r)}});import{e as Mr,f as Or,g as Er,r as Q,R as J,c as rs,b as Fr,C as ns,X as is,Y as as,T as os,L as Tr,a as Ys,B as er,d as Ar}from"./charts-DRWoArYU.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();var Dt={exports:{}},dt={};/**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var vs;function Ir(){if(vs)return dt;vs=1;var e=Mr(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(l,d,u){var h,y={},j=null,b=null;u!==void 0&&(j=""+u),d.key!==void 0&&(j=""+d.key),d.ref!==void 0&&(b=d.ref);for(h in d)r.call(d,h)&&!o.hasOwnProperty(h)&&(y[h]=d[h]);if(l&&l.defaultProps)for(h in d=l.defaultProps,d)y[h]===void 0&&(y[h]=d[h]);return{$$typeof:t,type:l,key:j,ref:b,props:y,_owner:i.current}}return dt.Fragment=s,dt.jsx=c,dt.jsxs=c,dt}var ws;function Lr(){return ws||(ws=1,Dt.exports=Ir()),Dt.exports}var n=Lr(),Rt={},js;function Dr(){if(js)return Rt;js=1;var e=Or();return Rt.createRoot=e.createRoot,Rt.hydrateRoot=e.hydrateRoot,Rt}var qr=Dr();const Qr=Er(qr);var kt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Te,we,Je,zs,$r=(zs=class extends kt{constructor(){super();w(this,Te);w(this,we);w(this,Je);f(this,Je,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){a(this,we)||this.setEventListener(a(this,Je))}onUnsubscribe(){var t;this.hasListeners()||((t=a(this,we))==null||t.call(this),f(this,we,void 0))}setEventListener(t){var s;f(this,Je,t),(s=a(this,we))==null||s.call(this),f(this,we,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){a(this,Te)!==t&&(f(this,Te,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof a(this,Te)=="boolean"?a(this,Te):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Te=new WeakMap,we=new WeakMap,Je=new WeakMap,zs),ls=new $r,Ur={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},je,ss,Ks,zr=(Ks=class{constructor(){w(this,je,Ur);w(this,ss,!1)}setTimeoutProvider(e){f(this,je,e)}setTimeout(e,t){return a(this,je).setTimeout(e,t)}clearTimeout(e){a(this,je).clearTimeout(e)}setInterval(e,t){return a(this,je).setInterval(e,t)}clearInterval(e){a(this,je).clearInterval(e)}},je=new WeakMap,ss=new WeakMap,Ks),Fe=new zr;function Kr(e){setTimeout(e,0)}var Gr=typeof window>"u"||"Deno"in globalThis;function H(){}function Br(e,t){return typeof e=="function"?e(t):e}function $t(e){return typeof e=="number"&&e>=0&&e!==1/0}function tr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pe(e,t){return typeof e=="function"?e(t):e}function X(e,t){return typeof e=="function"?e(t):e}function Ns(e,t){const{type:s="all",exact:r,fetchStatus:i,predicate:o,queryKey:c,stale:l}=e;if(c){if(r){if(t.queryHash!==cs(c,t.options))return!1}else if(!xt(t.queryKey,c))return!1}if(s!=="all"){const d=t.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function ks(e,t){const{exact:s,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(s){if(pt(t.options.mutationKey)!==pt(o))return!1}else if(!xt(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function cs(e,t){return((t==null?void 0:t.queryKeyHashFn)||pt)(e)}function pt(e){return JSON.stringify(e,(t,s)=>zt(s)?Object.keys(s).sort().reduce((r,i)=>(r[i]=s[i],r),{}):s)}function xt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>xt(e[s],t[s])):!1}var Hr=Object.prototype.hasOwnProperty;function sr(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=Cs(e)&&Cs(t);if(!r&&!(zt(e)&&zt(t)))return t;const o=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),l=c.length,d=r?new Array(l):{};let u=0;for(let h=0;h{Fe.setTimeout(t,e)})}function Kt(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?sr(e,t):t}function Wr(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Vr(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var ds=Symbol();function rr(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ds?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function nr(e,t){return typeof e=="function"?e(...t):!!e}function Xr(e,t,s){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var gt=(()=>{let e=()=>Gr;return{isServer(){return e()},setIsServer(t){e=t}}})();function Gt(){let e,t;const s=new Promise((i,o)=>{e=i,t=o});s.status="pending",s.catch(()=>{});function r(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},s.reject=i=>{r({status:"rejected",reason:i}),t(i)},s}var Zr=Kr;function Yr(){let e=[],t=0,s=l=>{l()},r=l=>{l()},i=Zr;const o=l=>{t?e.push(l):i(()=>{s(l)})},c=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(d=>{s(d)})})})};return{batch:l=>{let d;t++;try{d=l()}finally{t--,t||c()}return d},batchCalls:l=>(...d)=>{o(()=>{l(...d)})},schedule:o,setNotifyFunction:l=>{s=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var q=Yr(),We,Ne,Ve,Gs,en=(Gs=class extends kt{constructor(){super();w(this,We,!0);w(this,Ne);w(this,Ve);f(this,Ve,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){a(this,Ne)||this.setEventListener(a(this,Ve))}onUnsubscribe(){var t;this.hasListeners()||((t=a(this,Ne))==null||t.call(this),f(this,Ne,void 0))}setEventListener(t){var s;f(this,Ve,t),(s=a(this,Ne))==null||s.call(this),f(this,Ne,t(this.setOnline.bind(this)))}setOnline(t){a(this,We)!==t&&(f(this,We,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return a(this,We)}},We=new WeakMap,Ne=new WeakMap,Ve=new WeakMap,Gs),Ot=new en;function tn(e){return Math.min(1e3*2**e,3e4)}function ir(e){return(e??"online")==="online"?Ot.isOnline():!0}var Bt=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ar(e){let t=!1,s=0,r;const i=Gt(),o=()=>i.status!=="pending",c=p=>{var g;if(!o()){const m=new Bt(p);j(m),(g=e.onCancel)==null||g.call(e,m)}},l=()=>{t=!0},d=()=>{t=!1},u=()=>ls.isFocused()&&(e.networkMode==="always"||Ot.isOnline())&&e.canRun(),h=()=>ir(e.networkMode)&&e.canRun(),y=p=>{o()||(r==null||r(),i.resolve(p))},j=p=>{o()||(r==null||r(),i.reject(p))},b=()=>new Promise(p=>{var g;r=m=>{(o()||u())&&p(m)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;r=void 0,o()||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(o())return;let p;const g=s===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(m){p=Promise.reject(m)}Promise.resolve(p).then(y).catch(m=>{var A;if(o())return;const k=e.retry??(gt.isServer()?0:3),_=e.retryDelay??tn,v=typeof _=="function"?_(s,m):_,O=k===!0||typeof k=="number"&&su()?void 0:b()).then(()=>{t?j(m):x()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:d,canStart:h,start:()=>(h()?x():b().then(x),i)}}var Ae,Bs,or=(Bs=class{constructor(){w(this,Ae)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$t(this.gcTime)&&f(this,Ae,Fe.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gt.isServer()?1/0:300*1e3))}clearGcTimeout(){a(this,Ae)!==void 0&&(Fe.clearTimeout(a(this,Ae)),f(this,Ae,void 0))}},Ae=new WeakMap,Bs);function sn(e){return{onFetch:(t,s)=>{var h,y,j,b,x;const r=t.options,i=(j=(y=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:y.fetchMore)==null?void 0:j.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],c=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},d=0;const u=async()=>{let p=!1;const g=_=>{Xr(_,()=>t.signal,()=>p=!0)},m=rr(t.options,t.fetchOptions),k=async(_,v,O)=>{if(p)return Promise.reject(t.signal.reason);if(v==null&&_.pages.length)return Promise.resolve(_);const W=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:v,direction:O?"backward":"forward",meta:t.options.meta};return g(G),G})(),C=await m(W),{maxPages:F}=t.options,T=O?Vr:Wr;return{pages:T(_.pages,C,F),pageParams:T(_.pageParams,v,F)}};if(i&&o.length){const _=i==="backward",v=_?rn:Rs,O={pages:o,pageParams:c},A=v(r,O);l=await k(O,A,_)}else{const _=e??o.length;do{const v=d===0?c[0]??r.initialPageParam:Rs(r,l);if(d>0&&v==null)break;l=await k(l,v),d++}while(d<_)}return l};t.options.persister?t.fetchFn=()=>{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=u}}}function Rs(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function rn(e,{pages:t,pageParams:s}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,s[0],s):void 0}var Xe,Ie,Ze,te,Le,L,yt,De,V,lr,he,Hs,nn=(Hs=class extends or{constructor(t){super();w(this,V);w(this,Xe);w(this,Ie);w(this,Ze);w(this,te);w(this,Le);w(this,L);w(this,yt);w(this,De);f(this,De,!1),f(this,yt,t.defaultOptions),this.setOptions(t.options),this.observers=[],f(this,Le,t.client),f(this,te,a(this,Le).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,f(this,Ie,Ps(this.options)),this.state=t.state??a(this,Ie),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return a(this,Xe)}get promise(){var t;return(t=a(this,L))==null?void 0:t.promise}setOptions(t){if(this.options={...a(this,yt),...t},t!=null&&t._type&&f(this,Xe,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Ps(this.options);s.data!==void 0&&(this.setState(_s(s.data,s.dataUpdatedAt)),f(this,Ie,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&a(this,te).remove(this)}setData(t,s){const r=Kt(this.state.data,t,this.options);return S(this,V,he).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(t){S(this,V,he).call(this,{type:"setState",state:t})}cancel(t){var r,i;const s=(r=a(this,L))==null?void 0:r.promise;return(i=a(this,L))==null||i.cancel(t),s?s.then(H).catch(H):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return a(this,Ie)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>X(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ds||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Pe(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!tr(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=a(this,L))==null||s.continue()}onOnline(){var s;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=a(this,L))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),a(this,te).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(a(this,L)&&(a(this,De)||S(this,V,lr).call(this)?a(this,L).cancel({revert:!0}):a(this,L).cancelRetry()),this.scheduleGc()),a(this,te).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||S(this,V,he).call(this,{type:"invalidate"})}async fetch(t,s){var u,h,y,j,b,x,p,g,m,k,_;if(this.state.fetchStatus!=="idle"&&((u=a(this,L))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(a(this,L))return a(this,L).continueRetry(),a(this,L).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(O=>O.options.queryFn);v&&this.setOptions(v.options)}const r=new AbortController,i=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(f(this,De,!0),r.signal)})},o=()=>{const v=rr(this.options,s),A=(()=>{const W={client:a(this,Le),queryKey:this.queryKey,meta:this.meta};return i(W),W})();return f(this,De,!1),this.options.persister?this.options.persister(v,A,this):v(A)},l=(()=>{const v={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:a(this,Le),state:this.state,fetchFn:o};return i(v),v})(),d=a(this,Xe)==="infinite"?sn(this.options.pages):this.options.behavior;d==null||d.onFetch(l,this),f(this,Ze,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&S(this,V,he).call(this,{type:"fetch",meta:(y=l.fetchOptions)==null?void 0:y.meta}),f(this,L,ar({initialPromise:s==null?void 0:s.initialPromise,fn:l.fetchFn,onCancel:v=>{v instanceof Bt&&v.revert&&this.setState({...a(this,Ze),fetchStatus:"idle"}),r.abort()},onFail:(v,O)=>{S(this,V,he).call(this,{type:"failed",failureCount:v,error:O})},onPause:()=>{S(this,V,he).call(this,{type:"pause"})},onContinue:()=>{S(this,V,he).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const v=await a(this,L).start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),(b=(j=a(this,te).config).onSuccess)==null||b.call(j,v,this),(p=(x=a(this,te).config).onSettled)==null||p.call(x,v,this.state.error,this),v}catch(v){if(v instanceof Bt){if(v.silent)return a(this,L).promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw S(this,V,he).call(this,{type:"error",error:v}),(m=(g=a(this,te).config).onError)==null||m.call(g,v,this),(_=(k=a(this,te).config).onSettled)==null||_.call(k,this.state.data,v,this),v}finally{this.scheduleGc()}}},Xe=new WeakMap,Ie=new WeakMap,Ze=new WeakMap,te=new WeakMap,Le=new WeakMap,L=new WeakMap,yt=new WeakMap,De=new WeakMap,V=new WeakSet,lr=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},he=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cr(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,..._s(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return f(this,Ze,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),q.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),a(this,te).notify({query:this,type:"updated",action:t})})},Hs);function cr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ir(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _s(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ps(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var B,R,vt,K,qe,Ye,fe,ke,wt,et,tt,Qe,$e,Ce,st,M,ft,Ht,Jt,Wt,Vt,Xt,Zt,Yt,dr,Js,an=(Js=class extends kt{constructor(t,s){super();w(this,M);w(this,B);w(this,R);w(this,vt);w(this,K);w(this,qe);w(this,Ye);w(this,fe);w(this,ke);w(this,wt);w(this,et);w(this,tt);w(this,Qe);w(this,$e);w(this,Ce);w(this,st,new Set);this.options=s,f(this,B,t),f(this,ke,null),f(this,fe,Gt()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(a(this,R).addObserver(this),Ms(a(this,R),this.options)?S(this,M,ft).call(this):this.updateResult(),S(this,M,Vt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return es(a(this,R),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return es(a(this,R),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,S(this,M,Xt).call(this),S(this,M,Zt).call(this),a(this,R).removeObserver(this)}setOptions(t){const s=this.options,r=a(this,R);if(this.options=a(this,B).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof X(this.options.enabled,a(this,R))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");S(this,M,Yt).call(this),a(this,R).setOptions(this.options),s._defaulted&&!Ut(this.options,s)&&a(this,B).getQueryCache().notify({type:"observerOptionsUpdated",query:a(this,R),observer:this});const i=this.hasListeners();i&&Os(a(this,R),r,this.options,s)&&S(this,M,ft).call(this),this.updateResult(),i&&(a(this,R)!==r||X(this.options.enabled,a(this,R))!==X(s.enabled,a(this,R))||Pe(this.options.staleTime,a(this,R))!==Pe(s.staleTime,a(this,R)))&&S(this,M,Ht).call(this);const o=S(this,M,Jt).call(this);i&&(a(this,R)!==r||X(this.options.enabled,a(this,R))!==X(s.enabled,a(this,R))||o!==a(this,Ce))&&S(this,M,Wt).call(this,o)}getOptimisticResult(t){const s=a(this,B).getQueryCache().build(a(this,B),t),r=this.createResult(s,t);return ln(this,r)&&(f(this,K,r),f(this,Ye,this.options),f(this,qe,a(this,R).state)),r}getCurrentResult(){return a(this,K)}trackResult(t,s){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),s==null||s(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&a(this,fe).status==="pending"&&a(this,fe).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){a(this,st).add(t)}getCurrentQuery(){return a(this,R)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=a(this,B).defaultQueryOptions(t),r=a(this,B).getQueryCache().build(a(this,B),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return S(this,M,ft).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),a(this,K)))}createResult(t,s){var F;const r=a(this,R),i=this.options,o=a(this,K),c=a(this,qe),l=a(this,Ye),u=t!==r?t.state:a(this,vt),{state:h}=t;let y={...h},j=!1,b;if(s._optimisticResults){const T=this.hasListeners(),G=!T&&Ms(t,s),P=T&&Os(t,r,s,i);(G||P)&&(y={...y,...cr(h.data,t.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:p,status:g}=y;b=y.data;let m=!1;if(s.placeholderData!==void 0&&b===void 0&&g==="pending"){let T;o!=null&&o.isPlaceholderData&&s.placeholderData===(l==null?void 0:l.placeholderData)?(T=o.data,m=!0):T=typeof s.placeholderData=="function"?s.placeholderData((F=a(this,tt))==null?void 0:F.state.data,a(this,tt)):s.placeholderData,T!==void 0&&(g="success",b=Kt(o==null?void 0:o.data,T,s),j=!0)}if(s.select&&b!==void 0&&!m)if(o&&b===(c==null?void 0:c.data)&&s.select===a(this,wt))b=a(this,et);else try{f(this,wt,s.select),b=s.select(b),b=Kt(o==null?void 0:o.data,b,s),f(this,et,b),f(this,ke,null)}catch(T){f(this,ke,T)}a(this,ke)&&(x=a(this,ke),b=a(this,et),p=Date.now(),g="error");const k=y.fetchStatus==="fetching",_=g==="pending",v=g==="error",O=_&&k,A=b!==void 0,C={status:g,fetchStatus:y.fetchStatus,isPending:_,isSuccess:g==="success",isError:v,isInitialLoading:O,isLoading:O,data:b,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:p,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>u.dataUpdateCount||y.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!_,isLoadingError:v&&!A,isPaused:y.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:v&&A,isStale:us(t,s),refetch:this.refetch,promise:a(this,fe),isEnabled:X(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=C.data!==void 0,G=C.status==="error"&&!T,P=ie=>{G?ie.reject(C.error):T&&ie.resolve(C.data)},xe=()=>{const ie=f(this,fe,C.promise=Gt());P(ie)},Z=a(this,fe);switch(Z.status){case"pending":t.queryHash===r.queryHash&&P(Z);break;case"fulfilled":(G||C.data!==Z.value)&&xe();break;case"rejected":(!G||C.error!==Z.reason)&&xe();break}}return C}updateResult(){const t=a(this,K),s=this.createResult(a(this,R),this.options);if(f(this,qe,a(this,R).state),f(this,Ye,this.options),a(this,qe).data!==void 0&&f(this,tt,a(this,R)),Ut(s,t))return;f(this,K,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!a(this,st).size)return!0;const c=new Set(o??a(this,st));return this.options.throwOnError&&c.add("error"),Object.keys(a(this,K)).some(l=>{const d=l;return a(this,K)[d]!==t[d]&&c.has(d)})};S(this,M,dr).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&S(this,M,Vt).call(this)}},B=new WeakMap,R=new WeakMap,vt=new WeakMap,K=new WeakMap,qe=new WeakMap,Ye=new WeakMap,fe=new WeakMap,ke=new WeakMap,wt=new WeakMap,et=new WeakMap,tt=new WeakMap,Qe=new WeakMap,$e=new WeakMap,Ce=new WeakMap,st=new WeakMap,M=new WeakSet,ft=function(t){S(this,M,Yt).call(this);let s=a(this,R).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(H)),s},Ht=function(){S(this,M,Xt).call(this);const t=Pe(this.options.staleTime,a(this,R));if(gt.isServer()||a(this,K).isStale||!$t(t))return;const r=tr(a(this,K).dataUpdatedAt,t)+1;f(this,Qe,Fe.setTimeout(()=>{a(this,K).isStale||this.updateResult()},r))},Jt=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(a(this,R)):this.options.refetchInterval)??!1},Wt=function(t){S(this,M,Zt).call(this),f(this,Ce,t),!(gt.isServer()||X(this.options.enabled,a(this,R))===!1||!$t(a(this,Ce))||a(this,Ce)===0)&&f(this,$e,Fe.setInterval(()=>{(this.options.refetchIntervalInBackground||ls.isFocused())&&S(this,M,ft).call(this)},a(this,Ce)))},Vt=function(){S(this,M,Ht).call(this),S(this,M,Wt).call(this,S(this,M,Jt).call(this))},Xt=function(){a(this,Qe)!==void 0&&(Fe.clearTimeout(a(this,Qe)),f(this,Qe,void 0))},Zt=function(){a(this,$e)!==void 0&&(Fe.clearInterval(a(this,$e)),f(this,$e,void 0))},Yt=function(){const t=a(this,B).getQueryCache().build(a(this,B),this.options);if(t===a(this,R))return;const s=a(this,R);f(this,R,t),f(this,vt,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},dr=function(t){q.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(a(this,K))}),a(this,B).getQueryCache().notify({query:a(this,R),type:"observerResultsUpdated"})})},Js);function on(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&X(t.retryOnMount,e)===!1)}function Ms(e,t){return on(e,t)||e.state.data!==void 0&&es(e,t,t.refetchOnMount)}function es(e,t,s){if(X(t.enabled,e)!==!1&&Pe(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&us(e,t)}return!1}function Os(e,t,s,r){return(e!==t||X(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&us(e,s)}function us(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(Pe(t.staleTime,e))}function ln(e,t){return!Ut(e.getCurrentResult(),t)}var jt,le,$,Ue,ce,ve,Ws,cn=(Ws=class extends or{constructor(t){super();w(this,ce);w(this,jt);w(this,le);w(this,$);w(this,Ue);f(this,jt,t.client),this.mutationId=t.mutationId,f(this,$,t.mutationCache),f(this,le,[]),this.state=t.state||dn(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){a(this,le).includes(t)||(a(this,le).push(t),this.clearGcTimeout(),a(this,$).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){f(this,le,a(this,le).filter(s=>s!==t)),this.scheduleGc(),a(this,$).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){a(this,le).length||(this.state.status==="pending"?this.scheduleGc():a(this,$).remove(this))}continue(){var t;return((t=a(this,Ue))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,l,d,u,h,y,j,b,x,p,g,m,k,_,v,O,A,W;const s=()=>{S(this,ce,ve).call(this,{type:"continue"})},r={client:a(this,jt),meta:this.options.meta,mutationKey:this.options.mutationKey};f(this,Ue,ar({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,F)=>{S(this,ce,ve).call(this,{type:"failed",failureCount:C,error:F})},onPause:()=>{S(this,ce,ve).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>a(this,$).canRun(this)}));const i=this.state.status==="pending",o=!a(this,Ue).canStart();try{if(i)s();else{S(this,ce,ve).call(this,{type:"pending",variables:t,isPaused:o}),a(this,$).config.onMutate&&await a(this,$).config.onMutate(t,this,r);const F=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,r));F!==this.state.context&&S(this,ce,ve).call(this,{type:"pending",context:F,variables:t,isPaused:o})}const C=await a(this,Ue).start();return await((u=(d=a(this,$).config).onSuccess)==null?void 0:u.call(d,C,t,this.state.context,this,r)),await((y=(h=this.options).onSuccess)==null?void 0:y.call(h,C,t,this.state.context,r)),await((b=(j=a(this,$).config).onSettled)==null?void 0:b.call(j,C,null,this.state.variables,this.state.context,this,r)),await((p=(x=this.options).onSettled)==null?void 0:p.call(x,C,null,t,this.state.context,r)),S(this,ce,ve).call(this,{type:"success",data:C}),C}catch(C){try{await((m=(g=a(this,$).config).onError)==null?void 0:m.call(g,C,t,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((_=(k=this.options).onError)==null?void 0:_.call(k,C,t,this.state.context,r))}catch(F){Promise.reject(F)}try{await((O=(v=a(this,$).config).onSettled)==null?void 0:O.call(v,void 0,C,this.state.variables,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((W=(A=this.options).onSettled)==null?void 0:W.call(A,void 0,C,t,this.state.context,r))}catch(F){Promise.reject(F)}throw S(this,ce,ve).call(this,{type:"error",error:C}),C}finally{a(this,$).runNext(this)}}},jt=new WeakMap,le=new WeakMap,$=new WeakMap,Ue=new WeakMap,ce=new WeakSet,ve=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),q.batch(()=>{a(this,le).forEach(r=>{r.onMutationUpdate(t)}),a(this,$).notify({mutation:this,type:"updated",action:t})})},Ws);function dn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var me,se,Nt,Vs,un=(Vs=class extends kt{constructor(t={}){super();w(this,me);w(this,se);w(this,Nt);this.config=t,f(this,me,new Set),f(this,se,new Map),f(this,Nt,0)}build(t,s,r){const i=new cn({client:t,mutationCache:this,mutationId:++St(this,Nt)._,options:t.defaultMutationOptions(s),state:r});return this.add(i),i}add(t){a(this,me).add(t);const s=_t(t);if(typeof s=="string"){const r=a(this,se).get(s);r?r.push(t):a(this,se).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(a(this,me).delete(t)){const s=_t(t);if(typeof s=="string"){const r=a(this,se).get(s);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&a(this,se).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=_t(t);if(typeof s=="string"){const r=a(this,se).get(s),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const s=_t(t);if(typeof s=="string"){const i=(r=a(this,se).get(s))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){q.batch(()=>{a(this,me).forEach(t=>{this.notify({type:"removed",mutation:t})}),a(this,me).clear(),a(this,se).clear()})}getAll(){return Array.from(a(this,me))}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ks(s,r))}findAll(t={}){return this.getAll().filter(s=>ks(t,s))}notify(t){q.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return q.batch(()=>Promise.all(t.map(s=>s.continue().catch(H))))}},me=new WeakMap,se=new WeakMap,Nt=new WeakMap,Vs);function _t(e){var t;return(t=e.options.scope)==null?void 0:t.id}var de,Xs,hn=(Xs=class extends kt{constructor(t={}){super();w(this,de);this.config=t,f(this,de,new Map)}build(t,s,r){const i=s.queryKey,o=s.queryHash??cs(i,s);let c=this.get(o);return c||(c=new nn({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){a(this,de).has(t.queryHash)||(a(this,de).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=a(this,de).get(t.queryHash);s&&(t.destroy(),s===t&&a(this,de).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){q.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return a(this,de).get(t)}getAll(){return[...a(this,de).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>Ns(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>Ns(t,r)):s}notify(t){q.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){q.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){q.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},de=new WeakMap,Xs),I,Se,Re,rt,nt,_e,it,at,Zs,fn=(Zs=class{constructor(e={}){w(this,I);w(this,Se);w(this,Re);w(this,rt);w(this,nt);w(this,_e);w(this,it);w(this,at);f(this,I,e.queryCache||new hn),f(this,Se,e.mutationCache||new un),f(this,Re,e.defaultOptions||{}),f(this,rt,new Map),f(this,nt,new Map),f(this,_e,0)}mount(){St(this,_e)._++,a(this,_e)===1&&(f(this,it,ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),a(this,I).onFocus())})),f(this,at,Ot.subscribe(async e=>{e&&(await this.resumePausedMutations(),a(this,I).onOnline())})))}unmount(){var e,t;St(this,_e)._--,a(this,_e)===0&&((e=a(this,it))==null||e.call(this),f(this,it,void 0),(t=a(this,at))==null||t.call(this),f(this,at,void 0))}isFetching(e){return a(this,I).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return a(this,Se).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=a(this,I).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=a(this,I).build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Pe(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return a(this,I).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),i=a(this,I).get(r.queryHash),o=i==null?void 0:i.state.data,c=Br(t,o);if(c!==void 0)return a(this,I).build(this,r).setData(c,{...s,manual:!0})}setQueriesData(e,t,s){return q.batch(()=>a(this,I).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=a(this,I).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=a(this,I);q.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=a(this,I);return q.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=q.batch(()=>a(this,I).findAll(e).map(i=>i.cancel(s)));return Promise.all(r).then(H).catch(H)}invalidateQueries(e,t={}){return q.batch(()=>(a(this,I).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=q.batch(()=>a(this,I).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,s);return s.throwOnError||(o=o.catch(H)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(H)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=a(this,I).build(this,t);return s.isStaleByTime(Pe(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(H).catch(H)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(H).catch(H)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ot.isOnline()?a(this,Se).resumePausedMutations():Promise.resolve()}getQueryCache(){return a(this,I)}getMutationCache(){return a(this,Se)}getDefaultOptions(){return a(this,Re)}setDefaultOptions(e){f(this,Re,e)}setQueryDefaults(e,t){a(this,rt).set(pt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...a(this,rt).values()],s={};return t.forEach(r=>{xt(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){a(this,nt).set(pt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...a(this,nt).values()],s={};return t.forEach(r=>{xt(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...a(this,Re).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cs(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ds&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...a(this,Re).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){a(this,I).clear(),a(this,Se).clear()}},I=new WeakMap,Se=new WeakMap,Re=new WeakMap,rt=new WeakMap,nt=new WeakMap,_e=new WeakMap,it=new WeakMap,at=new WeakMap,Zs),ur=Q.createContext(void 0),hr=e=>{const t=Q.useContext(ur);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},mn=({client:e,children:t})=>(Q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),n.jsx(ur.Provider,{value:e,children:t})),fr=Q.createContext(!1),pn=()=>Q.useContext(fr);fr.Provider;function xn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gn=Q.createContext(xn()),bn=()=>Q.useContext(gn),yn=(e,t,s)=>{const r=s!=null&&s.state.error&&typeof e.throwOnError=="function"?nr(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},vn=e=>{Q.useEffect(()=>{e.clearReset()},[e])},wn=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||nr(s,[e.error,r])),jn=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Nn=(e,t)=>e.isLoading&&e.isFetching&&!t,kn=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Es=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Cn(e,t,s){var j,b,x,p;const r=pn(),i=bn(),o=hr(),c=o.defaultQueryOptions(e);(b=(j=o.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||b.call(j,c);const l=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jn(c),yn(c,i,l),vn(i);const d=!o.getQueryCache().get(c.queryHash),[u]=Q.useState(()=>new t(o,c)),h=u.getOptimisticResult(c),y=!r&&e.subscribed!==!1;if(Q.useSyncExternalStore(Q.useCallback(g=>{const m=y?u.subscribe(q.batchCalls(g)):H;return u.updateResult(),m},[u,y]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),Q.useEffect(()=>{u.setOptions(c)},[c,u]),kn(c,h))throw Es(c,u,i);if(wn({result:h,errorResetBoundary:i,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw h.error;if((p=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||p.call(x,c,h),c.experimental_prefetchInRender&&!gt.isServer()&&Nn(h,r)){const g=d?Es(c,u,i):l==null?void 0:l.promise;g==null||g.catch(H).finally(()=>{u.updateResult()})}return c.notifyOnChangeProps?h:u.trackResult(h)}function ae(e,t){return Cn(e,an)}/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Sn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mr=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */var Rn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const _n=Q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:c,...l},d)=>Q.createElement("svg",{ref:d,...Rn,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:mr("lucide",i),...l},[...c.map(([u,h])=>Q.createElement(u,h)),...Array.isArray(o)?o:[o]]));/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const z=(e,t)=>{const s=Q.forwardRef(({className:r,...i},o)=>Q.createElement(_n,{ref:o,iconNode:t,className:mr(`lucide-${Sn(e)}`,r),...i}));return s.displayName=`${e}`,s};/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Pn=z("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Mn=z("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const pr=z("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const On=z("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Et=z("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const En=z("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Fs=z("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Fn=z("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Tn=z("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const An=z("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const In=z("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Ln=z("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Dn=z("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const qn=z("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const xr=z("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
- * @license lucide-react v0.468.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Qn=z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),hs="-",$n=e=>{const t=zn(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const l=c.split(hs);return l[0]===""&&l.length!==1&&l.shift(),gr(l,t)||Un(c)},getConflictingClassGroupIds:(c,l)=>{const d=s[c]||[];return l&&r[c]?[...d,...r[c]]:d}}},gr=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const s=e[0],r=t.nextPart.get(s),i=r?gr(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(hs);return(c=t.validators.find(({validator:l})=>l(o)))==null?void 0:c.classGroupId},Ts=/^\[(.+)\]$/,Un=e=>{if(Ts.test(e)){const t=Ts.exec(e)[1],s=t==null?void 0:t.substring(0,t.indexOf(":"));if(s)return"arbitrary.."+s}},zn=e=>{const{theme:t,prefix:s}=e,r={nextPart:new Map,validators:[]};return Gn(Object.entries(e.classGroups),s).forEach(([o,c])=>{ts(c,r,o,t)}),r},ts=(e,t,s,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:As(t,i);o.classGroupId=s;return}if(typeof i=="function"){if(Kn(i)){ts(i(r),t,s,r);return}t.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([o,c])=>{ts(c,As(t,o),s,r)})})},As=(e,t)=>{let s=e;return t.split(hs).forEach(r=>{s.nextPart.has(r)||s.nextPart.set(r,{nextPart:new Map,validators:[]}),s=s.nextPart.get(r)}),s},Kn=e=>e.isThemeGetter,Gn=(e,t)=>t?e.map(([s,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([c,l])=>[t+c,l])):o);return[s,i]}):e,Bn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=new Map,r=new Map;const i=(o,c)=>{s.set(o,c),t++,t>e&&(t=0,r=s,s=new Map)};return{get(o){let c=s.get(o);if(c!==void 0)return c;if((c=r.get(o))!==void 0)return i(o,c),c},set(o,c){s.has(o)?s.set(o,c):i(o,c)}}},br="!",Hn=e=>{const{separator:t,experimentalParseClassName:s}=e,r=t.length===1,i=t[0],o=t.length,c=l=>{const d=[];let u=0,h=0,y;for(let g=0;gh?y-h:void 0;return{modifiers:d,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:p}};return s?l=>s({className:l,parseClassName:c}):c},Jn=e=>{if(e.length<=1)return e;const t=[];let s=[];return e.forEach(r=>{r[0]==="["?(t.push(...s.sort(),r),s=[]):s.push(r)}),t.push(...s.sort()),t},Wn=e=>({cache:Bn(e.cacheSize),parseClassName:Hn(e),...$n(e)}),Vn=/\s+/,Xn=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],c=e.trim().split(Vn);let l="";for(let d=c.length-1;d>=0;d-=1){const u=c[d],{modifiers:h,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:b}=s(u);let x=!!b,p=r(x?j.substring(0,b):j);if(!p){if(!x){l=u+(l.length>0?" "+l:l);continue}if(p=r(j),!p){l=u+(l.length>0?" "+l:l);continue}x=!1}const g=Jn(h).join(":"),m=y?g+br:g,k=m+p;if(o.includes(k))continue;o.push(k);const _=i(p,x);for(let v=0;v<_.length;++v){const O=_[v];o.push(m+O)}l=u+(l.length>0?" "+l:l)}return l};function Zn(){let e=0,t,s,r="";for(;e{if(typeof e=="string")return e;let t,s="";for(let r=0;ry(h),e());return s=Wn(u),r=s.cache.get,i=s.cache.set,o=l,l(d)}function l(d){const u=r(d);if(u)return u;const h=Xn(d,s);return i(d,h),h}return function(){return o(Zn.apply(null,arguments))}}const E=e=>{const t=s=>s[e]||[];return t.isThemeGetter=!0,t},vr=/^\[(?:([a-z-]+):)?(.+)\]$/i,ei=/^\d+\/\d+$/,ti=new Set(["px","full","screen"]),si=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ri=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ni=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ii=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ai=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>He(e)||ti.has(e)||ei.test(e),be=e=>ot(e,"length",mi),He=e=>!!e&&!Number.isNaN(Number(e)),qt=e=>ot(e,"number",He),ut=e=>!!e&&Number.isInteger(Number(e)),oi=e=>e.endsWith("%")&&He(e.slice(0,-1)),N=e=>vr.test(e),ye=e=>si.test(e),li=new Set(["length","size","percentage"]),ci=e=>ot(e,li,wr),di=e=>ot(e,"position",wr),ui=new Set(["image","url"]),hi=e=>ot(e,ui,xi),fi=e=>ot(e,"",pi),ht=()=>!0,ot=(e,t,s)=>{const r=vr.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):s(r[2]):!1},mi=e=>ri.test(e)&&!ni.test(e),wr=()=>!1,pi=e=>ii.test(e),xi=e=>ai.test(e),gi=()=>{const e=E("colors"),t=E("spacing"),s=E("blur"),r=E("brightness"),i=E("borderColor"),o=E("borderRadius"),c=E("borderSpacing"),l=E("borderWidth"),d=E("contrast"),u=E("grayscale"),h=E("hueRotate"),y=E("invert"),j=E("gap"),b=E("gradientColorStops"),x=E("gradientColorStopPositions"),p=E("inset"),g=E("margin"),m=E("opacity"),k=E("padding"),_=E("saturate"),v=E("scale"),O=E("sepia"),A=E("skew"),W=E("space"),C=E("translate"),F=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",N,t],P=()=>[N,t],xe=()=>["",ue,be],Z=()=>["auto",He,N],ie=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Me=()=>["solid","dashed","dotted","double","none"],lt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",N],ct=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[He,N];return{cacheSize:500,separator:":",theme:{colors:[ht],spacing:[ue,be],blur:["none","",ye,N],brightness:Y(),borderColor:[e],borderRadius:["none","","full",ye,N],borderSpacing:P(),borderWidth:xe(),contrast:Y(),grayscale:ge(),hueRotate:Y(),invert:ge(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[oi,be],inset:G(),margin:G(),opacity:Y(),padding:P(),saturate:Y(),scale:Y(),sepia:ge(),skew:Y(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[ye]}],"break-after":[{"break-after":ct()}],"break-before":[{"break-before":ct()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ie(),N]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ut,N]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",ut,N]}],"grid-cols":[{"grid-cols":[ht]}],"col-start-end":[{col:["auto",{span:["full",ut,N]},N]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[ht]}],"row-start-end":[{row:["auto",{span:[ut,N]},N]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[W]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[W]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[ye]},ye]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ye,be]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qt]}],"font-family":[{font:[ht]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",He,qt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ue,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ue,be]}],"underline-offset":[{"underline-offset":["auto",ue,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ie(),di]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ci]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...Me(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:Me()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Me()]}],"outline-offset":[{"outline-offset":[ue,N]}],"outline-w":[{outline:[ue,be]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[ue,be]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ye,fi]}],"shadow-color":[{shadow:[ht]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...lt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":lt()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ye,N]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[y]}],saturate:[{saturate:[_]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[ut,N]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ue,be,qt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},bi=Yn(gi),yi=new fn({defaultOptions:{queries:{retry:1}}}),Is=12,vi=12,wi=10080*60*1e3,ji=1e3;function re(...e){return bi(Ar(e))}async function oe(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);return t.json()}function ne(e){if(e==null)return"n/a";const t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;const s=Math.floor(t/60);return s<60?`${s}m ${t%60}s`:`${Math.floor(s/60)}h ${s%60}m`}const Ni=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}),ki=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function Ct(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Ci(e){const t=Ct(e);return t?Ni.format(t):e??""}function mt(e){const t=Ct(e);return t?ki.format(t):e??""}function jr(e,t){const s=Ct(e);if(!s)return e??"";const r=t-s.getTime(),i=Math.abs(r);if(i>wi)return mt(e);const o=r>=0?"ago":"from now",c=Math.round(i/1e3);if(c<45)return r>=0?"just now":"soon";if(c<90)return`1m ${o}`;const l=Math.round(c/60);if(l<60)return`${l}m ${o}`;if(l<90)return`1h ${o}`;const d=Math.round(l/60);return d<24?`${d}h ${o}`:d<36?`1d ${o}`:`${Math.round(d/24)}d ${o}`}function pe({value:e,compact:t=!1,relative:s=!1,now:r=Date.now()}){const i=Ct(e);return i?n.jsx("time",{dateTime:i.toISOString(),title:`UTC: ${i.toISOString()}`,children:s?jr(e,r):t?mt(e):Ci(e)}):n.jsx(n.Fragment,{children:e??""})}function Nr(e,t){const s=Ct(e);return s?Math.max(0,Math.floor((t-s.getTime())/1e3)):null}function fs(e,t){return e.status==="running"?Nr(e.started_at,t)??e.runtime_seconds:e.runtime_seconds}function ms(e,t){return e.status==="pending"?Nr(e.created_at,t)??e.queue_wait_seconds:e.queue_wait_seconds}function Si(e){const[t,s]=J.useState(()=>Date.now());return J.useEffect(()=>{if(!e)return;s(Date.now());const r=window.setInterval(()=>s(Date.now()),ji);return()=>window.clearInterval(r)},[e]),t}function Ri(e){return(e??"").split(/\r?\n/).map(s=>s.trim()).find(Boolean)??""}function Ft(e,t,s=1){const r=Ri(t),i=s>1?` (${s})`:"";return r?`${e}${i}: ${r}`:`${e}${i}`}function Tt(e){return e==="openclaw_stdout"||e==="openclaw_stderr"}function kr(e){return e.map(t=>t==null?void 0:t.trim()).filter(Boolean).join(`
-`)}function _i(e){const t=[];for(const s of e){const r=t[t.length-1];if(r&&Tt(s.event_type)&&r.eventType===s.event_type){r.count+=1,r.meta=s.ts,r.detail=kr([r.detail,s.detail]),r.summary=Ft(s.summary,r.detail,r.count);continue}t.push({id:String(s.id),badge:s.event_type,meta:s.ts,summary:Tt(s.event_type)?Ft(s.summary,s.detail):s.summary,detail:s.detail,eventType:s.event_type,count:1})}return t}function Pi(e){const t=[];return e.forEach((s,r)=>{const i=t[t.length-1];if(i&&Tt(s.kind)&&i.kind===s.kind){i.count+=1,i.meta=s.timestamp,i.text=kr([i.text,s.text]),i.summary=Ft(`${s.role} · ${s.kind}`,i.text,i.count);return}t.push({id:`${s.timestamp??"entry"}-${r}`,badge:s.title,meta:s.timestamp,summary:Tt(s.kind)?Ft(`${s.role} · ${s.kind}`,s.text):`${s.role} · ${s.kind}`,text:s.text,kind:s.kind,count:1})}),t}function Ls(e,t,s,r){return e==="openclaw_stdout"?!1:t||s>=r-2}function Mi(e){return{pending:{badge:"border-amber-300 bg-amber-50 text-amber-800",dot:"bg-amber-500"},running:{badge:"border-blue-300 bg-blue-50 text-blue-700",dot:"bg-blue-600"},blocked:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},denied:{badge:"border-red-300 bg-red-50 text-red-700",dot:"bg-red-600"},done:{badge:"border-emerald-300 bg-emerald-50 text-emerald-700",dot:"bg-emerald-600"},waiting_approval:{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}[e]??{badge:"border-slate-300 bg-slate-50 text-slate-700",dot:"bg-slate-500"}}function Oi(e,t){const s=new URLSearchParams;for(const[r,i]of Object.entries(e))i.trim()&&s.set(r,i.trim());return s.set("limit",String(t)),`/api/jobs?${s.toString()}`}function bt(e){try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.href:"#"}catch{return"#"}}function Cr(e){return`/jobs/${e}`}function Ds(e){try{return JSON.parse(e.data)}catch{return null}}function Ei(e,t){return e.some(s=>s.id===t.id)?e:[...e,t]}function Fi(e,t){const s=qs(t);return e.some(r=>qs(r)===s)?e:[...e,t]}function qs(e){return`${e.timestamp??""}:${e.role}:${e.kind}:${e.title}:${e.text}`}function Ti(e=window.location.pathname){const t=e.match(/^\/jobs\/(\d+)\/?$/);return t?Number(t[1]):null}function Ai(){var P,xe,Z,ie,Me,lt,ze,ge,ct,Y,gs,bs;const e=hr(),[t,s]=J.useState({status:"",repo:"",thread:"",action:"",intent:"",actor:""}),[r,i]=J.useState(Is),[o,c]=J.useState(()=>window.location.pathname),l=Ti(o),d=l!==null,u=l,h=ae({queryKey:["metrics"],queryFn:()=>oe("/api/metrics/summary"),enabled:!d}),y=ae({queryKey:["me"],queryFn:()=>oe("/api/me"),refetchInterval:!1}),j=ae({queryKey:["job-actors"],queryFn:()=>oe("/api/jobs/actors"),enabled:!d}),b=ae({queryKey:["jobs",t,r],queryFn:()=>oe(Oi(t,r)),enabled:!d}),x=ae({queryKey:["processes"],queryFn:()=>oe("/api/processes"),enabled:!d}),p=ae({queryKey:["alerts"],queryFn:()=>oe("/api/alerts"),enabled:!d}),g=ae({queryKey:["job",u],queryFn:()=>oe(`/api/jobs/${u}`),enabled:u!==null}),m=ae({queryKey:["job-session",u],queryFn:()=>oe(`/api/jobs/${u}/session`),enabled:u!==null}),k=ae({queryKey:["job-session-events",u],queryFn:()=>oe(`/api/jobs/${u}/session/events`),enabled:u!==null}),_=ae({queryKey:["job-session-transcript",u],queryFn:()=>oe(`/api/jobs/${u}/session/transcript`),enabled:u!==null});J.useEffect(()=>{if(u===null)return;const D=new EventSource(`/api/jobs/${u}/session/stream`);return D.addEventListener("session_event",It=>{const Ke=Ds(It);Ke&&(e.setQueryData(["job-session-events",u],Oe=>({events:Ei((Oe==null?void 0:Oe.events)??[],Ke)})),e.invalidateQueries({queryKey:["job",u]}),e.invalidateQueries({queryKey:["jobs"]}))}),D.addEventListener("transcript_entry",It=>{const Ke=Ds(It);!Ke||Ke.job_id!==u||e.setQueryData(["job-session-transcript",u],Oe=>({entries:Fi((Oe==null?void 0:Oe.entries)??[],Ke.entry)}))}),D.onerror=()=>{D.close()},()=>D.close()},[u,e]),J.useEffect(()=>{const D=()=>{c(window.location.pathname)};return window.addEventListener("popstate",D),()=>window.removeEventListener("popstate",D)},[]);const v=J.useCallback(D=>{window.history.pushState({},"",Cr(D)),c(window.location.pathname)},[]),O=((P=h.data)==null?void 0:P.metrics.status_counts)??{},A=((xe=b.data)==null?void 0:xe.jobs)??[],W=J.useCallback(D=>{s(D),i(Is)},[]),C=u?((Z=g.data)==null?void 0:Z.job)??null:null,F=A.some(D=>D.status==="running"||D.status==="pending")||(C==null?void 0:C.status)==="running"||(C==null?void 0:C.status)==="pending",T=Si(F),G=n.jsx(Li,{selectedJobId:u,selectedJob:C,loading:g.isLoading,error:g.error,session:(ie=m.data)==null?void 0:ie.session,sessionEvents:(Me=k.data)==null?void 0:Me.events,transcript:(lt=_.data)==null?void 0:lt.entries,now:T});return n.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[n.jsx("header",{className:"border-b border-slate-800 bg-slate-950 text-white",children:n.jsxs("div",{className:"mx-auto flex w-full max-w-[1440px] items-center justify-between gap-3 px-4 py-4 md:px-6",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h1",{className:"truncate text-xl font-semibold",children:"GitHub Agent Bridge"}),n.jsx("p",{className:"text-sm text-slate-300",children:"Read-only operational dashboard"})]}),n.jsx(Di,{user:(ze=y.data)==null?void 0:ze.user,loading:y.isLoading})]})}),n.jsx("main",{className:"mx-auto grid w-full max-w-[1440px] gap-4 px-3 py-4 sm:px-4 md:px-6 md:py-5",children:l!==null?n.jsx(Ii,{jobId:l,detail:G,onRefresh:()=>{g.refetch(),m.refetch(),k.refetch(),_.refetch()}}):n.jsxs(n.Fragment,{children:[h.error?n.jsx(Be,{tone:"error",text:h.error.message}):null,n.jsxs("section",{className:"grid grid-cols-2 gap-3 xl:grid-cols-4","aria-label":"Summary metrics",children:[n.jsx(Pt,{title:"Pending",value:O.pending??0,icon:n.jsx(En,{className:"h-5 w-5"})}),n.jsx(Pt,{title:"Running",value:O.running??0,icon:n.jsx(Pn,{className:"h-5 w-5"})}),n.jsx(Pt,{title:"Blocked",value:O.blocked??0,icon:n.jsx(xr,{className:"h-5 w-5"})}),n.jsx(Pt,{title:"Done",value:O.done??0,icon:n.jsx(On,{className:"h-5 w-5"})})]}),n.jsxs("section",{className:"grid gap-3",children:[n.jsx(qi,{count:A.length,limit:r,loading:b.isLoading,onRefresh:()=>b.refetch()}),n.jsxs(Ee,{title:"Recent jobs",flushHeader:!0,children:[n.jsx(Qi,{filters:t,actorOptions:((ge=j.data)==null?void 0:ge.actors)??[],onChange:W}),b.error?n.jsx(Be,{tone:"error",text:b.error.message}):null,n.jsx(Ui,{jobs:A,loading:b.isLoading,onViewJob:v,now:T}),A.length>=r?n.jsx("div",{className:"mt-3 flex justify-center",children:n.jsx("button",{className:"inline-flex h-9 items-center justify-center rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50",type:"button",onClick:()=>i(D=>D+vi),children:"Load more jobs"})}):null]})]}),n.jsxs("section",{className:"grid gap-4",children:[n.jsxs(Ee,{title:"Process activity",action:n.jsx(At,{onClick:()=>x.refetch()}),children:[x.error?n.jsx(Be,{tone:"error",text:x.error.message}):null,n.jsx(Wi,{data:x.data,loading:x.isLoading})]}),n.jsxs(Ee,{title:"Monitor alerts",action:n.jsx(At,{onClick:()=>p.refetch()}),children:[p.error?n.jsx(Be,{tone:"error",text:p.error.message}):null,n.jsx(Vi,{alerts:(ct=p.data)==null?void 0:ct.alerts,loading:p.isLoading,now:T})]})]}),n.jsxs("section",{className:"grid gap-4 xl:grid-cols-3",children:[n.jsx(Ee,{title:"Runtime percentiles",children:n.jsx(Qs,{label:"runtime",values:(Y=h.data)==null?void 0:Y.metrics.runtime_seconds})}),n.jsx(Ee,{title:"Jobs per day",children:n.jsx(Hi,{values:(gs=h.data)==null?void 0:gs.metrics.by_created_day,loading:h.isLoading,totalJobs:Ji(O)})}),n.jsx(Ee,{title:"Queue wait percentiles",children:n.jsx(Qs,{label:"queue wait",values:(bs=h.data)==null?void 0:bs.metrics.queue_wait_seconds})})]})]})})]})}function Ii({jobId:e,detail:t,onRefresh:s}){return n.jsxs("div",{className:"grid min-w-0 gap-3 sm:gap-4",children:[n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("a",{className:"inline-flex h-9 items-center gap-2 rounded-md border border-border px-3 text-sm font-semibold text-foreground hover:bg-slate-50",href:"/",children:[n.jsx(Mn,{className:"h-4 w-4","aria-hidden":!0}),"Dashboard"]}),n.jsx(At,{onClick:s})]}),n.jsx(Ee,{title:`Job #${e}`,className:"p-3 sm:p-4",children:t})]})}function Li({selectedJobId:e,selectedJob:t,loading:s,error:r,session:i,sessionEvents:o,transcript:c,now:l}){return t?n.jsx(Ki,{job:t,session:i,sessionEvents:o,transcript:c,now:l}):e!==null&&s?n.jsx(U,{text:"Loading selected job..."}):e!==null&&r?n.jsx(Be,{tone:"error",text:`Job #${e}: ${r.message}`}):n.jsx(U,{text:"Select a job to inspect its timeline, worklog and GitHub links."})}function Di({user:e,loading:t}){const s=e!=null&&e.login?`@${e.login}`:t?"Loading profile...":"GitHub OAuth",r=e!=null&&e.avatar_url?n.jsx("img",{className:"h-10 w-10 rounded-full border border-slate-700 bg-slate-800",src:e.avatar_url,alt:e.login?`${e.login} avatar`:"",referrerPolicy:"no-referrer"}):n.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-700 bg-slate-900",children:n.jsx(Et,{className:"h-5 w-5","aria-hidden":!0})}),i=e!=null&&e.html_url?n.jsx("a",{className:"truncate font-semibold text-white hover:underline",href:bt(e.html_url),rel:"noreferrer",target:"_blank",children:s}):n.jsx("div",{className:"truncate font-semibold text-white",children:s});return n.jsxs("div",{className:"flex max-w-full shrink-0 items-center gap-3 text-sm text-slate-300","aria-label":e!=null&&e.login?`Signed in as ${e.login}`:"Dashboard account",children:[n.jsx(Dn,{className:"hidden h-4 w-4 shrink-0 sm:block","aria-hidden":!0}),n.jsxs("div",{className:"hidden min-w-0 text-right sm:block",children:[i,n.jsx("div",{className:"text-xs text-slate-400",children:"Signed in · read-only"})]}),r]})}function qi({count:e,limit:t,loading:s,onRefresh:r}){return n.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-white px-3 py-3 shadow-sm md:px-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-base font-semibold",children:"Jobs"}),n.jsx("p",{className:"text-xs text-muted",children:s?"Refreshing latest jobs...":`Showing ${e} of the latest ${t} requested jobs`})]}),n.jsx(At,{onClick:r,compactOnMobile:!0})]})}function Ee({title:e,action:t,children:s,className:r,flushHeader:i=!1}){return n.jsxs("section",{className:re("min-w-0 rounded-lg border border-border bg-panel p-4 shadow-sm",r),children:[n.jsxs("div",{className:re("flex items-center justify-between gap-3",!i&&"mb-4"),children:[n.jsx("h2",{className:"text-sm font-semibold",children:e}),t]}),s]})}function Pt({title:e,value:t,icon:s}){return n.jsxs("div",{className:"rounded-lg border border-border bg-panel p-3 shadow-sm md:p-4",children:[n.jsxs("div",{className:"flex items-center justify-between text-muted",children:[n.jsx("span",{className:"text-sm font-medium",children:e}),s]}),n.jsx("strong",{className:"mt-3 block text-2xl leading-none md:mt-4 md:text-3xl",children:t})]})}function Qi({filters:e,actorOptions:t,onChange:s}){const[r,i]=J.useState(e);return J.useEffect(()=>i(e),[e]),n.jsxs("details",{className:"my-3 rounded-md border border-border bg-slate-50/70",children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2 text-sm font-semibold marker:hidden",children:[n.jsxs("span",{className:"inline-flex items-center gap-2",children:[n.jsx(Tn,{className:"h-4 w-4 text-muted","aria-hidden":!0}),"Filters"]}),n.jsx(pr,{className:"h-4 w-4 text-muted","aria-hidden":!0})]}),n.jsxs("form",{className:"grid gap-3 border-t border-border bg-white p-3 md:grid-cols-3 xl:grid-cols-8",onSubmit:o=>{o.preventDefault(),s(r)},children:[n.jsx(Ge,{label:"Status",children:n.jsxs("select",{className:"control",value:r.status,onChange:o=>i({...r,status:o.target.value}),children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"pending",children:"pending"}),n.jsx("option",{value:"running",children:"running"}),n.jsx("option",{value:"blocked",children:"blocked"}),n.jsx("option",{value:"done",children:"done"}),n.jsx("option",{value:"denied",children:"denied"}),n.jsx("option",{value:"waiting_approval",children:"waiting_approval"})]})}),n.jsx(Ge,{label:"Repository",children:n.jsx("input",{className:"control",value:r.repo,placeholder:"owner/repo",onChange:o=>i({...r,repo:o.target.value})})}),n.jsx(Ge,{label:"Thread",children:n.jsx("input",{className:"control",value:r.thread,inputMode:"numeric",placeholder:"issue or PR",onChange:o=>i({...r,thread:o.target.value})})}),n.jsx(Ge,{label:"Action",children:n.jsx("input",{className:"control",value:r.action,placeholder:"reply_comment",onChange:o=>i({...r,action:o.target.value})})}),n.jsx(Ge,{label:"Actor",className:"xl:col-span-2",children:n.jsx($i,{value:r.actor,options:t,onChange:o=>i({...r,actor:o})})}),n.jsx(Ge,{label:"Intent",children:n.jsxs("select",{className:"control",value:r.intent,onChange:o=>i({...r,intent:o.target.value}),children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"review_only",children:"review_only"}),n.jsx("option",{value:"work_allowed",children:"work_allowed"})]})}),n.jsxs("button",{className:"inline-flex h-9 items-center justify-center gap-2 self-end rounded-md bg-primary px-3 text-sm font-semibold text-white",type:"submit",children:[n.jsx(Ln,{className:"h-4 w-4","aria-hidden":!0}),"Apply"]})]})]})}function $i({value:e,options:t,onChange:s}){const[r,i]=J.useState(!1),o=e.trim().replace(/^@/,"").toLowerCase(),c=t.filter(d=>!o||d.login.toLowerCase().includes(o)).slice(0,8),l=t.find(d=>d.login.toLowerCase()===o);return n.jsxs("div",{className:"relative min-w-0",children:[n.jsxs("div",{className:"control flex items-center gap-2 px-2",children:[l?n.jsx("img",{className:"h-5 w-5 shrink-0 rounded-full bg-slate-100",src:bt(l.avatar_url??""),alt:`${l.login} avatar`,referrerPolicy:"no-referrer"}):n.jsx(Et,{className:"h-4 w-4 shrink-0 text-muted","aria-hidden":!0}),n.jsx("input",{className:"min-w-0 flex-1 bg-transparent font-mono text-sm outline-none",value:e,placeholder:"@login",onChange:d=>{s(d.target.value),i(!0)},onFocus:()=>i(!0),onBlur:()=>window.setTimeout(()=>i(!1),100)}),e?n.jsx("button",{className:"rounded-sm p-1 text-muted hover:bg-slate-100",type:"button","aria-label":"Clear actor filter",onClick:()=>s(""),children:n.jsx(Qn,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),r&&c.length>0?n.jsx("div",{className:"absolute left-0 right-0 z-20 mt-1 max-h-72 overflow-auto rounded-md border border-border bg-white p-1 shadow-lg",children:c.map(d=>n.jsxs("button",{className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-slate-50",type:"button",onMouseDown:u=>u.preventDefault(),onClick:()=>{s(d.login),i(!1)},children:[d.avatar_url?n.jsx("img",{className:"h-6 w-6 shrink-0 rounded-full bg-slate-100",src:bt(d.avatar_url),alt:`${d.login} avatar`,referrerPolicy:"no-referrer"}):n.jsx(Et,{className:"h-5 w-5 shrink-0 text-muted","aria-hidden":!0}),n.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:["@",d.login]}),n.jsx("span",{className:"shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-semibold text-muted",children:d.job_count})]},d.login))}):null]})}function Ge({label:e,children:t,className:s}){return n.jsxs("label",{className:re("grid min-w-0 gap-1 text-xs font-semibold text-muted",s),children:[e,t]})}function Ui({jobs:e,loading:t,onViewJob:s,now:r}){return t&&e.length===0?n.jsx(U,{text:"Loading jobs..."}):e.length===0?n.jsx(U,{text:"No jobs match the current filters."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"grid gap-2 md:hidden",children:e.map(i=>n.jsx(zi,{job:i,onViewJob:s,now:r},i.id))}),n.jsx("div",{className:"hidden max-h-[640px] overflow-auto rounded-md border border-border md:block",children:n.jsxs("table",{className:"min-w-full border-collapse text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"sticky top-0 border-b border-border bg-panel text-left text-xs text-muted",children:[n.jsx("th",{className:"px-2 py-2 font-semibold",children:"ID"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Status"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Repo / thread"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Action"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Actor"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Attempts"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Queue wait"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Runtime"}),n.jsx("th",{className:"px-2 py-2 font-semibold",children:"Updated"})]})}),n.jsx("tbody",{children:e.map(i=>n.jsxs("tr",{className:"cursor-pointer border-b border-border hover:bg-slate-50",onClick:()=>s(i.id),children:[n.jsxs("td",{className:"px-2 py-3 font-mono",children:["#",i.id]}),n.jsx("td",{className:"px-2 py-3",children:n.jsx(xs,{status:i.status})}),n.jsxs("td",{className:"px-2 py-3",children:[n.jsx("div",{className:"font-mono",children:i.repo??i.work_key}),n.jsxs("div",{className:"text-xs text-muted",children:["thread ",i.thread??"n/a"]})]}),n.jsxs("td",{className:"px-2 py-3",children:[n.jsx("div",{children:i.action}),n.jsx("div",{className:"text-xs text-muted",children:i.intent})]}),n.jsx("td",{className:"px-2 py-3",children:n.jsx(ps,{actor:i.trigger_actor,avatarUrl:i.trigger_actor_avatar_url})}),n.jsx("td",{className:"px-2 py-3",children:i.attempts}),n.jsx("td",{className:"px-2 py-3",children:ne(ms(i,r))}),n.jsx("td",{className:"px-2 py-3",children:ne(fs(i,r))}),n.jsx("td",{className:"px-2 py-3 font-mono text-xs",children:n.jsx(pe,{value:i.updated_at,compact:!0,relative:!0,now:r})})]},i.id))})]})})]})}function zi({job:e,onViewJob:t,now:s}){return n.jsx("article",{className:"rounded-md border border-border bg-white shadow-[0_1px_0_rgba(15,23,42,0.03)]",children:n.jsxs("button",{className:"grid w-full gap-2 p-3 text-left hover:bg-slate-50",type:"button",onClick:()=>t(e.id),children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"min-w-0 space-y-1",children:[n.jsxs("div",{className:"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-2",children:[n.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold text-muted",children:["#",e.id]}),n.jsx("span",{className:"truncate font-mono text-sm",children:e.repo??e.work_key})]}),n.jsx("div",{className:"line-clamp-2 text-sm leading-snug text-foreground",children:e.subject}),n.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted",children:[n.jsxs("span",{children:["thread ",e.thread??"n/a"," · ",e.action]}),n.jsx(ps,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url})]})]}),n.jsx(xs,{status:e.status})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[n.jsx(ee,{label:"Wait",value:ne(ms(e,s))}),n.jsx(ee,{label:"Runtime",value:ne(fs(e,s))}),n.jsx(ee,{label:"Updated",value:n.jsx(pe,{value:e.updated_at,compact:!0,relative:!0,now:s})})]})]})})}function ps({actor:e,avatarUrl:t,framed:s=!1}){const r=t?n.jsx("img",{className:"h-4 w-4 shrink-0 rounded-full bg-slate-100",src:bt(t),alt:e?`${e} avatar`:"",referrerPolicy:"no-referrer"}):n.jsx(Et,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),i=n.jsxs(n.Fragment,{children:[r,n.jsx("span",{className:"min-w-0 truncate",children:e?`@${e}`:"unknown actor"})]});return s?n.jsx("span",{className:"inline-flex h-7 max-w-full items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-muted",children:i}):n.jsx("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1 font-mono text-xs text-muted",children:i})}function Ki({job:e,session:t,sessionEvents:s,transcript:r,now:i,compact:o=!1}){var b;const c=Cr(e.id),l=s??[],d=r??[],u=_i(l),h=Pi(d),y=fs(e,i),j=ms(e,i);return n.jsxs("div",{className:"grid min-w-0 gap-4",children:[n.jsxs("div",{className:"grid gap-2",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(xs,{status:e.status}),n.jsxs("a",{className:"inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-xs font-semibold text-foreground hover:bg-slate-50",href:c,children:[n.jsx(An,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Job #",e.id]}),n.jsx(ps,{actor:e.trigger_actor,avatarUrl:e.trigger_actor_avatar_url,framed:!0})]}),n.jsx("div",{className:"min-w-0 break-words font-mono text-sm [overflow-wrap:anywhere]",children:e.work_key}),n.jsx("p",{className:"min-w-0 break-words text-sm text-muted [overflow-wrap:anywhere]",children:e.subject})]}),n.jsxs("div",{className:re("grid gap-2 text-sm sm:gap-3",o?"grid-cols-1":"grid-cols-3"),children:[n.jsx(ee,{label:"Queue wait",value:ne(j)}),n.jsx(ee,{label:e.status==="running"?"Running for":"Runtime",value:ne(y)}),n.jsx(ee,{label:"Coalesced",value:String(e.coalesced_count)})]}),n.jsxs("div",{className:re("grid gap-2 text-sm sm:gap-3",o?"grid-cols-1":"grid-cols-2 xl:grid-cols-4"),children:[n.jsx(ee,{label:"Created",value:n.jsx(pe,{value:e.created_at,compact:!0,relative:!0,now:i})}),n.jsx(ee,{label:"Started",value:e.started_at?n.jsx(pe,{value:e.started_at,compact:!0,relative:!0,now:i}):"n/a"}),n.jsx(ee,{label:"Updated",value:n.jsx(pe,{value:e.updated_at,compact:!0,relative:!0,now:i})}),n.jsx(ee,{label:"Finished",value:e.finished_at?n.jsx(pe,{value:e.finished_at,compact:!0,relative:!0,now:i}):"n/a"})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Timeline"}),n.jsx("div",{className:"grid min-w-0 gap-3",children:(e.worklog??[]).length>0?(b=e.worklog)==null?void 0:b.map(x=>n.jsxs("div",{className:"min-w-0 border-l-2 border-primary pl-3",children:[n.jsx("div",{className:"text-sm font-semibold",children:x.phase}),n.jsx("div",{className:"font-mono text-xs text-muted",children:n.jsx(pe,{value:x.ts,relative:!0,now:i})}),n.jsx("div",{className:"break-words text-sm [overflow-wrap:anywhere]",children:x.summary}),x.detail?n.jsx("div",{className:"mt-1 break-words font-mono text-xs text-muted [overflow-wrap:anywhere]",children:x.detail}):null]},x.id)):n.jsx(U,{text:"No worklog entries."})})]}),n.jsxs("div",{children:[n.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[n.jsx(qn,{className:"h-4 w-4","aria-hidden":!0}),"OpenClaw session"]}),t?n.jsxs("div",{className:"grid gap-3",children:[n.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[n.jsx(ee,{label:"Session ID",value:t.id}),n.jsx(ee,{label:"Source",value:t.source})]}),n.jsx("p",{className:"break-words text-xs text-muted [overflow-wrap:anywhere]",children:t.detail})]}):n.jsx(U,{text:"Session correlation is loading."})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Agent activity"}),n.jsx("div",{className:"grid max-h-[460px] min-w-0 gap-2 overflow-auto pr-1",children:u.length>0?u.map((x,p)=>n.jsx(Bi,{event:x,defaultOpen:Ls(x.eventType,e.status==="running",p,u.length),now:i},x.id)):n.jsx(U,{text:e.status==="running"?"Waiting for live agent output...":"No agent activity has been recorded for this session."})})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Session transcript"}),n.jsx("div",{className:"grid max-h-[620px] min-w-0 gap-2 overflow-auto pr-1",children:h.length>0?h.map((x,p)=>n.jsx(Gi,{entry:x,defaultOpen:Ls(x.kind,e.status==="running",p,h.length),now:i},x.id)):n.jsx(U,{text:e.status==="running"?"Waiting for live transcript entries...":"No OpenClaw transcript entries are available for this session."})})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"GitHub links"}),n.jsx("ul",{className:"grid gap-2 text-sm",children:e.github_urls.length>0?e.github_urls.map(x=>n.jsx("li",{children:n.jsxs("a",{className:"break-all text-primary hover:underline [overflow-wrap:anywhere]",href:bt(x),rel:"noreferrer",target:"_blank",children:[n.jsx(Fn,{className:"mr-1 inline h-3.5 w-3.5 align-[-2px]","aria-hidden":!0}),x]})},x)):n.jsx("li",{className:"text-muted",children:"No links recorded."})})]})]})}function Gi({entry:e,defaultOpen:t,now:s}){return n.jsx(Sr,{badge:e.badge,meta:n.jsx(pe,{value:e.meta,relative:!0,now:s}),count:e.count,summary:e.summary,defaultOpen:t,children:n.jsx("pre",{className:"max-h-72 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.text})})}function Bi({event:e,defaultOpen:t,now:s}){return n.jsx(Sr,{badge:e.badge,meta:n.jsx(pe,{value:e.meta,relative:!0,now:s}),count:e.count,summary:e.summary,defaultOpen:t,children:e.detail?n.jsx("pre",{className:"max-h-56 max-w-full overflow-auto whitespace-pre-wrap break-words rounded bg-slate-950 px-2 py-1.5 font-mono text-xs leading-relaxed text-slate-100 [overflow-wrap:anywhere]",children:e.detail}):null})}function Sr({badge:e,meta:t,count:s,summary:r,defaultOpen:i,children:o}){const[c,l]=J.useState(!!i);return n.jsxs("details",{className:"group min-w-0 rounded border border-border bg-slate-50/60",open:c,onToggle:d=>l(d.currentTarget.open),children:[n.jsxs("summary",{className:"grid cursor-pointer list-none gap-1 px-2 py-1.5 marker:hidden hover:bg-white",children:[n.jsxs("div",{className:"grid min-w-0 gap-1 sm:flex sm:items-center sm:justify-between sm:gap-2",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[n.jsx(pr,{className:"h-3.5 w-3.5 shrink-0 text-muted transition-transform group-open:rotate-180","aria-hidden":!0}),n.jsx("span",{className:"truncate font-mono text-[11px] font-semibold text-muted",children:e}),s&&s>1?n.jsx("span",{className:"rounded-sm border border-border px-1 font-mono text-[10px] text-muted",children:s}):null]}),n.jsx("span",{className:"min-w-0 truncate pl-5 font-mono text-[11px] text-muted sm:shrink-0 sm:pl-0",children:t})]}),n.jsx("div",{className:"min-w-0 break-words pl-5 text-xs text-foreground [overflow-wrap:anywhere] sm:truncate",children:r})]}),n.jsx("div",{className:"min-w-0 border-t border-border bg-white px-2 py-2",children:o})]})}function Qs({label:e,values:t}){const s=[{name:"median",seconds:(t==null?void 0:t.median)??0},{name:"p90",seconds:(t==null?void 0:t.p90)??0},{name:"p99",seconds:(t==null?void 0:t.p99)??0}];return n.jsx("div",{className:"h-56",children:n.jsx(rs,{width:"100%",height:"100%",children:n.jsxs(Ys,{data:s,children:[n.jsx(ns,{strokeDasharray:"3 3"}),n.jsx(is,{dataKey:"name"}),n.jsx(as,{tickFormatter:ne}),n.jsx(os,{formatter:r=>[ne(Number(r)),e]}),n.jsx(er,{dataKey:"seconds",fill:"#0969da",radius:[4,4,0,0]})]})})})}function Hi({values:e,loading:t,totalJobs:s}){const r=Object.entries(e??{}).map(([i,o])=>({day:i,count:o}));return t&&r.length===0?n.jsx(U,{text:"Loading job history..."}):r.length===0?n.jsx(U,{text:s>0?"Job history has no valid creation dates.":"No job history available."}):n.jsx("div",{className:"h-56",children:n.jsx(rs,{width:"100%",height:"100%",children:n.jsxs(Ys,{data:r,children:[n.jsx(ns,{strokeDasharray:"3 3"}),n.jsx(is,{dataKey:"day",minTickGap:16}),n.jsx(as,{allowDecimals:!1}),n.jsx(os,{formatter:i=>[Number(i),"jobs"]}),n.jsx(er,{dataKey:"count",fill:"#16a34a",radius:[4,4,0,0]})]})})})}function Ji(e){return Object.values(e).reduce((t,s)=>t+s,0)}function Wi({data:e,loading:t}){var y,j,b,x,p,g;if(t&&!e)return n.jsx(U,{text:"Loading process activity..."});if(!e)return n.jsx(U,{text:"No process snapshot available."});const s=e.executor.children??[],r=s.flatMap(m=>_r(m)),i=r.reduce((m,k)=>m+k.cpu_ticks,0),o=r.reduce((m,k)=>m+Xi(k),0),c=e.executor.service==="active",l=r.slice(0,8).map(m=>({label:`pid ${m.pid}`,ticks:m.cpu_ticks})),d=(e.samples??[]).map(m=>({label:mt(m.ts),ticks:m.cpu_ticks,io:m.io_bytes,active:m.active_since_last_sample?"active":"quiet"})),u=d.length>0?d:l,h=(y=e.samples)==null?void 0:y[e.samples.length-1];return n.jsxs("div",{className:"grid gap-4",children:[n.jsx("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-3",children:n.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:re("inline-flex h-6 items-center rounded-full border px-2 text-xs font-semibold",c?"border-emerald-300 bg-emerald-50 text-emerald-700":"border-slate-300 bg-white text-slate-600"),children:c?"active":"idle"}),n.jsxs("span",{className:"font-mono text-xs text-muted",children:["service ",e.executor.service]})]}),n.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:e.running_jobs.length>0?`${e.running_jobs.length} running job${e.running_jobs.length===1?"":"s"}`:"No running jobs"}),e.running_jobs.length>0?n.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.running_jobs.slice(0,4).map(m=>n.jsxs("span",{className:"inline-flex min-h-6 items-center gap-1.5 rounded-full border border-blue-200 bg-white px-2 font-mono text-[11px] font-semibold text-blue-700",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-blue-600 animate-live-pulse","aria-hidden":!0}),"#",m.id," ",ne(m.age_seconds)]},m.id))}):null,h?n.jsxs("p",{className:"mt-1 text-xs text-muted",children:["Last persisted sample ",mt(h.ts)," · ",h.active_since_last_sample?"activity observed":`quiet ${ne(h.idle_seconds)}`]}):null,n.jsx("p",{className:"mt-1 text-xs text-muted",children:e.detail})]}),n.jsxs("div",{className:"grid min-w-[190px] grid-cols-3 gap-2 text-center text-xs",children:[n.jsx(Qt,{label:"PID",value:e.executor.pid?String(e.executor.pid):"n/a"}),n.jsx(Qt,{label:"Children",value:String(r.length)}),n.jsx(Qt,{label:"CPU ticks",value:String(i)})]})]})}),n.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[n.jsx(Mt,{label:"Live process",value:((j=e.signals)==null?void 0:j.live_process.state)??(r.length>0?"live":"no_child_process"),detail:`${((b=e.signals)==null?void 0:b.live_process.child_count)??r.length} children`}),n.jsx(Mt,{label:"Process activity",value:((x=e.signals)==null?void 0:x.process_activity.state)??(h!=null&&h.active_since_last_sample?"active":"quiet"),detail:h?`sample ${mt(h.ts)}`:"no sample"}),n.jsx(Mt,{label:"Semantic progress",value:(p=e.signals)!=null&&p.semantic_progress.length?"recent":"none",detail:$s(e.running_jobs,"semantic_progress")}),n.jsx(Mt,{label:"Visible progress",value:(g=e.signals)!=null&&g.visible_progress.length?"streaming":"none",detail:$s(e.running_jobs,"visible_progress")})]}),e.alerts.length>0?n.jsx(Be,{tone:"error",text:e.alerts[0]}):null,n.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",children:[n.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[n.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[n.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(Fs,{className:"h-4 w-4","aria-hidden":!0}),d.length>0?"CPU history":"CPU ticks"]}),n.jsxs("span",{className:"font-mono text-xs text-muted",children:[Pr(o)," I/O"]})]}),u.length>0?n.jsx("div",{className:"h-40",children:n.jsx(rs,{width:"100%",height:"100%",children:n.jsxs(Fr,{data:u,children:[n.jsx(ns,{strokeDasharray:"3 3"}),n.jsx(is,{dataKey:"label",tick:!1}),n.jsx(as,{allowDecimals:!1,tick:{fontSize:11}}),n.jsx(os,{formatter:m=>[Number(m),"cpu ticks"]}),n.jsx(Tr,{type:"monotone",dataKey:"ticks",stroke:"#0f766e",strokeWidth:2,dot:{r:3},activeDot:{r:5},isAnimationActive:!1})]})})}):n.jsx(U,{text:"No executor CPU samples available."})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[n.jsx(Fs,{className:"h-4 w-4","aria-hidden":!0}),"Executor children"]}),s.length>0?n.jsx("div",{className:"grid gap-2",children:s.map(m=>n.jsx(Rr,{process:m},m.pid))}):n.jsx(U,{text:"No child process detected for the executor."})]})]})]})}function Vi({alerts:e,loading:t,now:s}){if(t&&!e)return n.jsx(U,{text:"Loading monitor alerts..."});const r=e??[];return r.length===0?n.jsx(U,{text:"No active monitor alerts."}):n.jsx("div",{className:"grid gap-2",children:r.slice(0,5).map(i=>n.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-2.5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs font-semibold text-red-700",children:[n.jsx(xr,{className:"h-3.5 w-3.5","aria-hidden":!0}),n.jsx("span",{children:i.severity}),n.jsx("span",{className:"font-normal text-red-600",children:jr(i.last_seen,s)}),i.observations>1?n.jsxs("span",{className:"rounded-full border border-red-200 bg-white px-1.5",children:[i.observations,"x"]}):null]}),n.jsx("p",{className:"mt-1 break-words text-sm font-medium text-red-950 [overflow-wrap:anywhere]",children:i.message})]},i.fingerprint))})}function Rr({process:e}){var r,i;const t=((r=e.io_bytes)==null?void 0:r.read_bytes)??0,s=((i=e.io_bytes)==null?void 0:i.write_bytes)??0;return n.jsxs("div",{className:"rounded-md border border-border bg-white p-2.5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[n.jsxs("span",{className:"font-mono",children:["pid ",e.pid]}),n.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["state ",e.state]}),n.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["cpu ",e.cpu_ticks]}),n.jsxs("span",{className:"rounded-full border border-border px-2 text-xs text-muted",children:["I/O ",Pr(t+s)]})]}),n.jsx("div",{className:"mt-2 break-words font-mono text-xs text-muted",children:e.cmd||"unknown command"}),e.children&&e.children.length>0?n.jsx("div",{className:"mt-3 border-l-2 border-border pl-3",children:e.children.map(o=>n.jsx(Rr,{process:o},o.pid))}):null]})}function Qt({label:e,value:t}){return n.jsxs("div",{className:"rounded-md border border-border bg-white px-2 py-2",children:[n.jsx("div",{className:"font-mono text-sm font-semibold text-foreground",children:t}),n.jsx("div",{className:"mt-0.5 text-[11px] font-semibold uppercase text-muted",children:e})]})}function Mt({label:e,value:t,detail:s}){return n.jsxs("div",{className:"min-w-0 rounded-md border border-border bg-white p-2.5",children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase text-muted",children:e}),n.jsx("div",{className:"mt-1 truncate text-sm font-semibold text-foreground",children:t}),n.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted",children:s})]})}function $s(e,t){const s=e.find(i=>i[t]),r=s==null?void 0:s[t];return!s||!r?"no running heartbeat":`#${s.id} ${r.phase} ${ne(r.age_seconds??null)}`}function _r(e){return[e,...(e.children??[]).flatMap(t=>_r(t))]}function Xi(e){var t,s;return(((t=e.io_bytes)==null?void 0:t.read_bytes)??0)+(((s=e.io_bytes)==null?void 0:s.write_bytes)??0)}function Pr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function ee({label:e,value:t}){return n.jsxs("div",{className:"min-w-0 rounded-md border border-border p-3",children:[n.jsx("div",{className:"text-xs font-semibold text-muted",children:e}),n.jsx("div",{className:"mt-1 min-w-0 break-words text-sm [overflow-wrap:anywhere]",children:t})]})}function xs({status:e}){const t=Mi(e),s=e==="running"||e==="pending";return n.jsxs("span",{className:re("inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-xs font-semibold",t.badge),children:[n.jsx("span",{className:re("h-2.5 w-2.5 rounded-full",t.dot,s&&"animate-live-pulse"),"aria-hidden":!0}),e]})}function U({text:e}){return n.jsx("div",{className:"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted",children:e})}function Be({tone:e,text:t}){return n.jsx("div",{className:re("rounded-md border p-3 text-sm",e==="error"&&"border-red-300 bg-red-50 text-red-700"),children:t})}function At({onClick:e,compactOnMobile:t=!1}){return n.jsxs("button",{className:re("inline-flex h-8 items-center justify-center gap-2 rounded-md border border-border text-sm font-semibold text-foreground hover:bg-slate-50",t?"w-8 px-0 sm:w-auto sm:px-3":"px-3"),onClick:e,type:"button","aria-label":"Refresh",children:[n.jsx(In,{className:"h-4 w-4","aria-hidden":!0}),n.jsx("span",{className:re(t&&"hidden sm:inline"),children:"Refresh"})]})}const Us=document.getElementById("root");Us&&Qr.createRoot(Us).render(n.jsx(J.StrictMode,{children:n.jsx(mn,{client:yi,children:n.jsx(Ai,{})})}));
diff --git a/src/github_agent_bridge/dashboard_static/assets/index-DZ0faviD.css b/src/github_agent_bridge/dashboard_static/assets/index-CDukmhDa.css
similarity index 77%
rename from src/github_agent_bridge/dashboard_static/assets/index-DZ0faviD.css
rename to src/github_agent_bridge/dashboard_static/assets/index-CDukmhDa.css
index 859153d..668a82c 100644
--- a/src/github_agent_bridge/dashboard_static/assets/index-DZ0faviD.css
+++ b/src/github_agent_bridge/dashboard_static/assets/index-CDukmhDa.css
@@ -1 +1 @@
-*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{box-sizing:border-box}body{margin:0;min-width:320px;overflow-x:hidden;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;letter-spacing:0}#root{overflow-x:hidden}.animate-live-pulse{animation:live-pulse 1.25s ease-in-out infinite}.control{height:36px;width:100%;border-radius:6px;border:1px solid hsl(214 20% 88%);background:#fff;padding:0 10px;color:#1a222e;font:inherit}.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.max-h-56{max-height:14rem}.max-h-72{max-height:18rem}.max-h-\[460px\]{max-height:460px}.max-h-\[620px\]{max-height:620px}.max-h-\[640px\]{max-height:640px}.min-h-6{min-height:1.5rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[190px\]{min-width:190px}.min-w-full{min-width:100%}.max-w-\[1440px\]{max-width:1440px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-pointer{cursor:pointer}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-border{--tw-border-opacity: 1;border-color:hsl(214 20% 88% / var(--tw-border-opacity, 1))}.border-emerald-300{--tw-border-opacity: 1;border-color:rgb(110 231 183 / var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:hsl(212 92% 42% / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(210 20% 98% / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-panel{--tw-bg-opacity: 1;background-color:hsl(0 0% 100% / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(212 92% 42% / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/60{background-color:#f8fafc99}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-1{padding:.25rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pl-3{padding-left:.75rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-\[-2px\]{vertical-align:-2px}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-foreground{--tw-text-opacity: 1;color:hsl(216 28% 14% / var(--tw-text-opacity, 1))}.text-muted{--tw-text-opacity: 1;color:hsl(215 16% 47% / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:hsl(212 92% 42% / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-950{--tw-text-opacity: 1;color:rgb(69 10 10 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-\[0_1px_0_rgba\(15\,23\,42\,0\.03\)\]{--tw-shadow: 0 1px 0 rgba(15,23,42,.03);--tw-shadow-colored: 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.72)}}@media(prefers-reduced-motion:reduce){.animate-live-pulse{animation:none}}.marker\:hidden *::marker{display:none}.marker\:hidden::marker{display:none}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media(min-width:640px){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:w-auto{width:auto}.sm\:shrink-0{flex-shrink:0}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm\:p-4{padding:1rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pl-0{padding-left:0}}@media(min-width:768px){.md\:mt-4{margin-top:1rem}.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:p-4{padding:1rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media(min-width:1024px){.lg\:grid-cols-\[minmax\(0\,0\.9fr\)_minmax\(0\,1\.1fr\)\]{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}}@media(min-width:1280px){.xl\:col-span-2{grid-column:span 2 / span 2}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}
+*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{box-sizing:border-box}body{margin:0;min-width:320px;overflow-x:hidden;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;letter-spacing:0}#root{overflow-x:hidden}.animate-live-pulse{animation:live-pulse 1.25s ease-in-out infinite}.control{height:36px;width:100%;border-radius:6px;border:1px solid hsl(214 20% 88%);background:#fff;padding:0 10px;color:#1a222e;font:inherit}.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.max-h-56{max-height:14rem}.max-h-72{max-height:18rem}.max-h-\[460px\]{max-height:460px}.max-h-\[620px\]{max-height:620px}.max-h-\[640px\]{max-height:640px}.min-h-6{min-height:1.5rem}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[190px\]{min-width:190px}.min-w-full{min-width:100%}.max-w-\[1440px\]{max-width:1440px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-pointer{cursor:pointer}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-border{--tw-border-opacity: 1;border-color:hsl(214 20% 88% / var(--tw-border-opacity, 1))}.border-emerald-300{--tw-border-opacity: 1;border-color:rgb(110 231 183 / var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:hsl(212 92% 42% / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(210 20% 98% / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-panel{--tw-bg-opacity: 1;background-color:hsl(0 0% 100% / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(212 92% 42% / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/60{background-color:#f8fafc99}.bg-slate-50\/70{background-color:#f8fafcb3}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-1{padding:.25rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pl-3{padding-left:.75rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-\[-2px\]{vertical-align:-2px}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-foreground{--tw-text-opacity: 1;color:hsl(216 28% 14% / var(--tw-text-opacity, 1))}.text-muted{--tw-text-opacity: 1;color:hsl(215 16% 47% / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:hsl(212 92% 42% / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-950{--tw-text-opacity: 1;color:rgb(69 10 10 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-\[0_1px_0_rgba\(15\,23\,42\,0\.03\)\]{--tw-shadow: 0 1px 0 rgba(15,23,42,.03);--tw-shadow-colored: 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.72)}}@media(prefers-reduced-motion:reduce){.animate-live-pulse{animation:none}}.marker\:hidden *::marker{display:none}.marker\:hidden::marker{display:none}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media(min-width:640px){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:w-auto{width:auto}.sm\:shrink-0{flex-shrink:0}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm\:p-4{padding:1rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pl-0{padding-left:0}}@media(min-width:768px){.md\:mt-4{margin-top:1rem}.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:p-4{padding:1rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media(min-width:1024px){.lg\:grid-cols-\[minmax\(0\,0\.9fr\)_minmax\(0\,1\.1fr\)\]{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}}@media(min-width:1280px){.xl\:col-span-2{grid-column:span 2 / span 2}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}
diff --git a/src/github_agent_bridge/dashboard_static/index.html b/src/github_agent_bridge/dashboard_static/index.html
index f8710f4..0514de1 100644
--- a/src/github_agent_bridge/dashboard_static/index.html
+++ b/src/github_agent_bridge/dashboard_static/index.html
@@ -4,9 +4,9 @@
GitHub Agent Bridge Dashboard
-
+
-
+
diff --git a/src/github_agent_bridge/dispatch.py b/src/github_agent_bridge/dispatch.py
index 666a5cb..b1eaeff 100644
--- a/src/github_agent_bridge/dispatch.py
+++ b/src/github_agent_bridge/dispatch.py
@@ -131,6 +131,9 @@ def is_non_actionable_review(self, ctx: GitHubContext) -> bool:
review = self.pull_request_review(ctx)
if not review:
return False
+ state = (review.get("state") or "").upper()
+ if state == "APPROVED":
+ return True
body = (review.get("body") or "").lower()
non_actionable_markers = (
"generated no new comments",
diff --git a/src/github_agent_bridge/parser.py b/src/github_agent_bridge/parser.py
index 19a3b20..0b035de 100644
--- a/src/github_agent_bridge/parser.py
+++ b/src/github_agent_bridge/parser.py
@@ -8,9 +8,9 @@
REVIEW_ONLY_PATTERNS = ("fes-ne una review", "fes una review", "fes review", "fer una review", "fes-ne una revisio", "fes-ne una revisió", "fes una revisio", "fes una revisió", "fer una revisio", "fer una revisió", "review de la pr", "revisió de la pr", "revisio de la pr", "revisa aquesta pr", "revisa els canvis", "revisar els canvis", "com veus els canvis", "què et semblen els canvis", "que et semblen els canvis", "what do you think of these changes", "please review", "can you review")
IMPLEMENTATION_PATTERNS = ("fes els canvis", "fes-ho", "implementa", "modifica", "canvia", "arregla", "corregeix", "fix", "push", "commit", "aplica", "resol", "resolve")
-BOT_MENTION_PATTERNS = ("@pilipilisbot", "pilipilisbot", "you are receiving this because you were mentioned")
-ASSIGNMENT_PATTERNS = ("assigned you", "assigned to you", "you were assigned", "you are assigned", "assigned pilipilisbot", "assigned @pilipilisbot")
-REVIEW_REQUEST_PATTERNS = ("requested your review", "requested a review from you", "you were requested for review", "review requested", "requested review from pilipilisbot", "requested review from @pilipilisbot", "requested @pilipilisbot")
+BOT_MENTION_PATTERNS = ("you are receiving this because you were mentioned",)
+ASSIGNMENT_PATTERNS = ("assigned you", "assigned to you", "you were assigned", "you are assigned")
+REVIEW_REQUEST_PATTERNS = ("requested your review", "requested a review from you", "you were requested for review", "review requested")
COPILOT_REVIEW_PATTERNS = ("copilot-pull-request-reviewer", "github-copilot", "github copilot", "copilot reviewed", "copilot commented", "copilot left a comment", "copilot suggested", "copilot requested changes")
WORKFLOW_RUN_FAILED_PATTERNS = ("run failed", "workflow run failed", "workflow failed", "job failed", "failing after")
@@ -37,13 +37,41 @@ def parse_auth_results(msg: Message) -> dict[str, bool]:
return {"spf": "spf=pass" in raw, "dkim": "dkim=pass" in raw, "dmarc": "dmarc=pass" in raw}
+def is_github_notification_message(msg: Message, from_addr: str | None = None) -> bool:
+ """Return True for direct GitHub notifications and Google Groups rewrites.
+
+ GISCE routes GitHub mail through a Google Group, so incoming notifications can
+ arrive as `From: ... via GISCE Bot ` while retaining the
+ GitHub reply address, message id and X-GitHub headers.
+ """
+ sender = (from_addr or decode_header_value(msg.get("From", ""))).lower()
+ if "notifications@github.com" in sender:
+ return True
+ reply_to = decode_header_value(msg.get("Reply-To", "")).lower()
+ message_id = decode_header_value(msg.get("Message-ID", "")).lower()
+ return (
+ bool(msg.get("X-GitHub-Recipient"))
+ and bool(msg.get("X-GitHub-Reason"))
+ and "@reply.github.com" in reply_to
+ and "github.com" in message_id
+ )
+
+
def _contains_any(text: str, patterns: tuple[str, ...]) -> bool:
return any(p in text for p in patterns)
-def github_event_flags(subject: str, body: str) -> dict[str, bool]:
+def _bot_patterns(bot_logins: set[str] | None) -> tuple[str, ...]:
+ names = sorted({login.lower().lstrip("@") for login in (bot_logins or set()) if login.strip()})
+ return tuple(pattern for name in names for pattern in (f"@{name}", name))
+
+
+def github_event_flags(subject: str, body: str, bot_logins: set[str] | None = None) -> dict[str, bool]:
text = f"{subject}\n{body}".lower()
- return {"bot_mentioned": _contains_any(text, BOT_MENTION_PATTERNS), "assigned": _contains_any(text, ASSIGNMENT_PATTERNS), "review_requested": _contains_any(text, REVIEW_REQUEST_PATTERNS), "copilot_review": _contains_any(text, COPILOT_REVIEW_PATTERNS)}
+ bot_patterns = _bot_patterns(bot_logins)
+ assignment_patterns = ASSIGNMENT_PATTERNS + tuple(f"assigned {p}" for p in bot_patterns)
+ review_patterns = REVIEW_REQUEST_PATTERNS + tuple(f"requested review from {p}" for p in bot_patterns) + tuple(f"requested {p}" for p in bot_patterns)
+ return {"bot_mentioned": _contains_any(text, BOT_MENTION_PATTERNS + bot_patterns), "assigned": _contains_any(text, assignment_patterns), "review_requested": _contains_any(text, review_patterns), "copilot_review": _contains_any(text, COPILOT_REVIEW_PATTERNS)}
def _looks_like_pr_thread(subject: str, body: str) -> bool:
@@ -51,9 +79,9 @@ def _looks_like_pr_thread(subject: str, body: str) -> bool:
return bool(re.search(r"\bpr #\d+\b|\bpull request #\d+\b", text) or re.search(r"github\.com/[^/]+/[^/]+/pull/\d+", text))
-def classify_work_intent(subject: str, body: str) -> str:
+def classify_work_intent(subject: str, body: str, bot_logins: set[str] | None = None) -> str:
text = f"{subject}\n{body}".lower()
- flags = github_event_flags(subject, body)
+ flags = github_event_flags(subject, body, bot_logins)
asks_review = flags["review_requested"] or _contains_any(text, REVIEW_ONLY_PATTERNS)
asks_implementation = flags["assigned"] or _contains_any(text, IMPLEMENTATION_PATTERNS)
if asks_review and not asks_implementation:
@@ -66,9 +94,9 @@ def classify_work_intent(subject: str, body: str) -> str:
return "work_allowed"
-def classify_github_action(subject: str, body: str) -> str:
+def classify_github_action(subject: str, body: str, bot_logins: set[str] | None = None) -> str:
text = f"{subject}\n{body}".lower()
- flags = github_event_flags(subject, body)
+ flags = github_event_flags(subject, body, bot_logins)
if re.search(r"github\.com/[^/]+/[^/]+/actions/runs/\d+", text) and _contains_any(text, WORKFLOW_RUN_FAILED_PATTERNS):
return "workflow_run_failed"
if "merged" in text:
diff --git a/src/github_agent_bridge/policy.py b/src/github_agent_bridge/policy.py
index 350a71f..20c2ea1 100644
--- a/src/github_agent_bridge/policy.py
+++ b/src/github_agent_bridge/policy.py
@@ -21,6 +21,7 @@
"worktree",
}
DEFAULT_REPO_ROLE = "contributor"
+DEFAULT_BOT_LOGINS = frozenset({"pilipilisbot"})
@dataclass(frozen=True)
@@ -60,7 +61,7 @@ class FeedbackLearning:
@dataclass(frozen=True)
class Policy:
- source_from: str = "notifications@github.com"
+ source_from: str | tuple[str, ...] = "notifications@github.com"
required_url_prefix: str = "https://github.com/"
message_id_domain: str = "github.com"
trusted_repos: set[str] = field(default_factory=set)
@@ -73,6 +74,7 @@ class Policy:
org_routes: dict[str, Route] = field(default_factory=dict)
repo_roles: dict[str, str] = field(default_factory=dict)
org_roles: dict[str, str] = field(default_factory=dict)
+ bot_logins: set[str] = field(default_factory=lambda: set(DEFAULT_BOT_LOGINS))
prompt_overrides: PromptOverrides = field(default_factory=PromptOverrides)
feedback_learning: FeedbackLearning = field(default_factory=FeedbackLearning)
@@ -150,7 +152,7 @@ def feedback_learning(raw: dict) -> FeedbackLearning:
)
return cls(
- source_from=source.get("from", cls.source_from),
+ source_from=tuple(source.get("from")) if isinstance(source.get("from"), list) else source.get("from", cls.source_from),
required_url_prefix=source.get("requiredUrlPrefix", cls.required_url_prefix),
message_id_domain=source.get("messageIdDomain", cls.message_id_domain),
trusted_repos={r.lower() for r in data.get("trustedRepos", [])},
@@ -161,13 +163,21 @@ def feedback_learning(raw: dict) -> FeedbackLearning:
trusted_auto_actions=set(actions.get("trustedAuto", ["reply_comment", "open_issue", "submit_review", "sync_after_merge", "workflow_run_failed"])),
repo_routes=routes(data.get("repoRoutes", {})), org_routes=routes(data.get("orgRoutes", {})),
repo_roles=roles(data.get("repoRoles", {})), org_roles=roles(data.get("orgRoles", {})),
+ bot_logins=(
+ {str(login).lower().lstrip("@") for login in data.get("botLogins", []) if str(login).strip()}
+ if "botLogins" in data
+ else set(DEFAULT_BOT_LOGINS)
+ ),
prompt_overrides=prompt_overrides(data.get("promptOverrides", {})),
feedback_learning=feedback_learning(data.get("feedbackLearning", {})),
)
def trusted_source(self, n: Notification, ctx: GitHubContext) -> bool:
auth_ok = all(bool(n.auth.get(k)) for k in ("spf", "dkim", "dmarc")) if n.auth else True
- return self.source_from in n.from_addr and auth_ok and any(u.startswith(self.required_url_prefix) for u in ctx.urls) and self.message_id_domain in n.message_id
+ sources = (self.source_from,) if isinstance(self.source_from, str) else self.source_from
+ from_addr = n.from_addr.lower()
+ source_ok = any(str(source).lower() in from_addr for source in sources)
+ return source_ok and auth_ok and any(u.startswith(self.required_url_prefix) for u in ctx.urls) and self.message_id_domain in n.message_id
def repo_trusted(self, repo: str | None) -> bool:
if not repo:
diff --git a/src/github_agent_bridge/queue.py b/src/github_agent_bridge/queue.py
index 5d0903c..ae57d89 100644
--- a/src/github_agent_bridge/queue.py
+++ b/src/github_agent_bridge/queue.py
@@ -44,8 +44,8 @@ def init(self) -> None:
def enqueue(self, n: Notification, policy: Policy) -> tuple[Job | None, str]:
ctx = extract_github_context(n.body)
- action = classify_github_action(n.subject, n.body)
- intent = classify_work_intent(n.subject, n.body)
+ action = classify_github_action(n.subject, n.body, policy.bot_logins)
+ intent = classify_work_intent(n.subject, n.body, policy.bot_logins)
decision = policy.decision(n, ctx, action)
status = {"auto": "done", "ask": "waiting_approval", "deny": "denied"}.get(decision, "pending")
now = utc_now()
diff --git a/src/github_agent_bridge/reader.py b/src/github_agent_bridge/reader.py
index 6b267f1..d5ab2b0 100644
--- a/src/github_agent_bridge/reader.py
+++ b/src/github_agent_bridge/reader.py
@@ -5,7 +5,7 @@
from dataclasses import dataclass
from .models import Notification
-from .parser import decode_header_value, extract_body_text, parse_auth_results
+from .parser import decode_header_value, extract_body_text, is_github_notification_message, parse_auth_results
from .policy import Policy
from .queue import JobQueue
@@ -57,7 +57,7 @@ def fetch_once(self) -> int:
from_addr = decode_header_value(msg.get("From", ""))
subject = decode_header_value(msg.get("Subject", ""))
message_id = decode_header_value(msg.get("Message-ID", ""))
- if "notifications@github.com" in from_addr.lower():
+ if is_github_notification_message(msg, from_addr):
n = Notification(uid=uid, message_id=message_id, subject=subject, from_addr=from_addr, body=extract_body_text(msg), auth=parse_auth_results(msg))
self.queue.enqueue(n, self.policy)
# Only GitHub notifications belong to this bounded context.
diff --git a/tests/test_actors.py b/tests/test_actors.py
index 6e207a4..367f7b8 100644
--- a/tests/test_actors.py
+++ b/tests/test_actors.py
@@ -4,7 +4,14 @@
import sqlite3
import subprocess
-from github_agent_bridge.actors import actor_endpoint, backfill_trigger_actors, trigger_actor_from_notification
+from github_agent_bridge.actors import (
+ actor_details_from_github_payload,
+ actor_endpoint,
+ backfill_trigger_actors,
+ default_gh_bin,
+ normalize_github_login,
+ trigger_actor_from_notification,
+)
from github_agent_bridge.models import GitHubContext, Notification
from github_agent_bridge.policy import Policy
from github_agent_bridge.queue import JobQueue
@@ -23,6 +30,31 @@ def test_trigger_actor_from_notification_uses_github_sender_login():
assert trigger_actor_from_notification(n) == "ecarreras"
+def test_normalize_github_login_accepts_github_app_bot_suffix():
+ assert normalize_github_login("copilot-pull-request-reviewer[bot]") == "copilot-pull-request-reviewer[bot]"
+
+
+def test_default_gh_bin_uses_service_environment(monkeypatch):
+ monkeypatch.setenv("GITHUB_AGENT_BRIDGE_GH_BIN", "/opt/bin/gh")
+
+ assert default_gh_bin() == "/opt/bin/gh"
+
+
+def test_actor_details_from_github_payload_accepts_github_app_bot_login():
+ actor = actor_details_from_github_payload(
+ {
+ "user": {
+ "login": "copilot-pull-request-reviewer[bot]",
+ "avatar_url": "https://avatars.githubusercontent.com/in/946600?v=4",
+ }
+ }
+ )
+
+ assert actor is not None
+ assert actor.login == "copilot-pull-request-reviewer[bot]"
+ assert actor.avatar_url == "https://avatars.githubusercontent.com/in/946600?v=4"
+
+
def test_actor_endpoint_prefers_exact_trigger_resource():
assert actor_endpoint(GitHubContext(urls=[], repo="gisce/erp", issue_number=1, comment_id=99)) == "repos/gisce/erp/issues/comments/99"
assert actor_endpoint(GitHubContext(urls=[], repo="gisce/erp", issue_number=1)) == "repos/gisce/erp/issues/1"
diff --git a/tests/test_backend.py b/tests/test_backend.py
index 570cc87..cf78517 100644
--- a/tests/test_backend.py
+++ b/tests/test_backend.py
@@ -6,7 +6,8 @@
import pytest
from fastapi.testclient import TestClient
-from github_agent_bridge.backend import DashboardConfig, _encode_session, _session_stream_events, _sign, create_app
+from github_agent_bridge import __version__
+from github_agent_bridge.backend import DashboardConfig, _encode_session, _is_allowed, _session_stream_events, _sign, create_app
from github_agent_bridge.dashboard_data import get_job_detail, job_session, job_session_events, job_session_transcript, list_job_actors, list_jobs, metrics_summary
from github_agent_bridge.monitor import MonitorReport
from github_agent_bridge.models import Notification
@@ -49,6 +50,21 @@ def test_dashboard_status_is_read_only_and_lists_recent_jobs(tmp_path):
assert jobs.json()["jobs"][0]["trigger_actor_avatar_url"] is None
+def test_dashboard_about_exposes_package_version_and_repository(tmp_path):
+ db = tmp_path / "bridge.sqlite3"
+ JobQueue(db)
+ client = TestClient(create_app(DashboardConfig(db=db, require_auth=False)))
+
+ response = client.get("/api/about")
+
+ assert response.status_code == 200
+ assert response.json() == {
+ "service": "github-agent-bridge-dashboard",
+ "version": __version__,
+ "repository_url": "https://github.com/pilipilisbot/github-agent-bridge",
+ }
+
+
def test_dashboard_serves_built_react_ui_with_existing_auth(tmp_path):
db = tmp_path / "bridge.sqlite3"
static_dir = tmp_path / "static"
@@ -95,17 +111,27 @@ def test_dashboard_job_frontend_route_falls_back_for_deep_links(tmp_path):
assert "root" in response.text
-def test_dashboard_ui_requires_auth_by_default(tmp_path):
+def test_dashboard_ui_redirects_to_oauth_login_by_default(tmp_path):
db = tmp_path / "bridge.sqlite3"
static_dir = tmp_path / "static"
static_dir.mkdir()
(static_dir / "index.html").write_text("", encoding="utf-8")
JobQueue(db)
- app = create_app(DashboardConfig(db=db, static_dir=static_dir, secret_key="secret", allowed_users={"alice"}))
+ app = create_app(
+ DashboardConfig(
+ db=db,
+ static_dir=static_dir,
+ secret_key="secret",
+ oauth_client_id="client",
+ oauth_client_secret="client-secret",
+ allowed_users={"alice"},
+ )
+ )
- response = TestClient(app).get("/")
+ response = TestClient(app, follow_redirects=False).get("/")
- assert response.status_code == 401
+ assert response.status_code == 302
+ assert response.headers["location"] == "/auth/login"
def test_dashboard_ui_reports_missing_build_after_auth(tmp_path):
@@ -462,6 +488,45 @@ def test_dashboard_oauth_login_requests_org_scope_only_for_org_allowlist(tmp_pat
assert query["scope"] == ["read:user read:org"]
+def test_dashboard_oauth_login_requests_org_scope_for_team_allowlist(tmp_path):
+ db = tmp_path / "bridge.sqlite3"
+ JobQueue(db)
+ app = create_app(
+ DashboardConfig(
+ db=db,
+ secret_key="secret",
+ oauth_client_id="client-id",
+ oauth_client_secret="client-secret",
+ allowed_teams={"example/platform"},
+ )
+ )
+
+ response = TestClient(app, follow_redirects=False).get("/auth/login")
+
+ assert response.status_code == 302
+ query = parse_qs(urlparse(response.headers["location"]).query)
+ assert query["scope"] == ["read:user read:org"]
+
+
+def test_dashboard_session_authorization_allows_configured_team(monkeypatch):
+ def fake_github_json(url, token):
+ assert token == "token"
+ assert url.endswith("/user/teams")
+ return [
+ {"slug": "other", "organization": {"login": "example"}},
+ {"slug": "platform", "organization": {"login": "Example"}},
+ ]
+
+ monkeypatch.setattr("github_agent_bridge.backend._github_json", fake_github_json)
+ config = DashboardConfig(
+ secret_key="secret",
+ allowed_teams={"example/platform"},
+ )
+
+ assert _is_allowed(config, "alice", "token") is True
+ assert _is_allowed(config, "alice", None) is False
+
+
def test_dashboard_processes_exposes_live_executor_snapshot(tmp_path, monkeypatch):
db = tmp_path / "bridge.sqlite3"
q = JobQueue(db)
diff --git a/tests/test_github_followup_detection.py b/tests/test_github_followup_detection.py
index 48eb7ca..780cf79 100644
--- a/tests/test_github_followup_detection.py
+++ b/tests/test_github_followup_detection.py
@@ -65,6 +65,28 @@ def test_visible_followup_ignores_review_comment_before_trigger():
assert github.visible_followup_after_trigger(ctx) is None
+def test_approved_review_is_non_actionable():
+ ctx = GitHubContext(
+ urls=["https://github.com/gisce/erp/pull/27805#pullrequestreview-4325056741"],
+ repo="gisce/erp",
+ issue_number=27805,
+ review_id=4325056741,
+ )
+ github = RecordingGitHubClient(
+ {
+ ("api", "repos/gisce/erp/pulls/27805/reviews/4325056741"): json.dumps(
+ {
+ "state": "APPROVED",
+ "body": "Looks good after the follow-up commit.",
+ "submitted_at": "2026-05-20T03:59:00Z",
+ }
+ ),
+ }
+ )
+
+ assert github.is_non_actionable_review(ctx) is True
+
+
def test_visible_followup_for_issue_comment_returns_newest_bot_comment_after_trigger():
ctx = GitHubContext(
urls=["https://github.com/pilipilisbot/github-agent-bridge/pull/13#issuecomment-4524715895"],
diff --git a/tests/test_manual_enqueue_cli.py b/tests/test_manual_enqueue_cli.py
index 313b062..2ec4a1f 100644
--- a/tests/test_manual_enqueue_cli.py
+++ b/tests/test_manual_enqueue_cli.py
@@ -1,6 +1,7 @@
import json
+from email.message import EmailMessage
-from github_agent_bridge.cli import _parse_github_comment_url, notification_from_comment_url
+from github_agent_bridge.cli import _parse_github_comment_url, msg_to_notification, notification_from_comment_url
from github_agent_bridge.parser import extract_github_context
@@ -32,3 +33,28 @@ def fake_gh(args, gh_bin="gh"):
assert ctx.repo == "gisce/erp"
assert ctx.issue_number == 27675
assert ctx.comment_id == 4419572864
+
+
+def test_giscebot_mention_classifies_as_reply_comment():
+ from github_agent_bridge.parser import classify_github_action
+
+ body = "@giscebot pots mirar això?\nhttps://github.com/gisce/erp/pull/27675#issuecomment-4419572864"
+
+ assert classify_github_action("Re: [gisce/erp] Example (PR #27675)", body, {"giscebot"}) == "reply_comment"
+
+
+def test_msg_to_notification_accepts_google_group_rewritten_github_mail():
+ msg = EmailMessage()
+ msg["From"] = "'Eduard Carreras' via GISCE Bot "
+ msg["Reply-To"] = "gisce/erp "
+ msg["Message-ID"] = ""
+ msg["Subject"] = "Re: [gisce/erp] Example (PR #27853)"
+ msg["X-GitHub-Recipient"] = "giscebot"
+ msg["X-GitHub-Reason"] = "mention"
+ msg.set_content("https://github.com/gisce/erp/pull/27853#issuecomment-4547966148")
+
+ n = msg_to_notification(msg, uid=6)
+
+ assert n is not None
+ assert n.uid == 6
+ assert n.from_addr == "'Eduard Carreras' via GISCE Bot "
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 0695a70..5312235 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -46,7 +46,7 @@ def test_extract_pr_comment_context_before_workflow_run_link():
def test_mentions_are_actionable():
- assert classify_github_action("Re: [x] PR", "@pilipilisbot fes-ho") == "reply_comment"
+ assert classify_github_action("Re: [x] PR", "@pilipilisbot fes-ho", {"pilipilisbot"}) == "reply_comment"
assert classify_github_action("Re: [x] PR", "You are receiving this because you were mentioned.") == "reply_comment"
@@ -71,23 +71,23 @@ def test_review_request_uses_formal_review_flow():
subject = "Re: [gisce/erp] Permitir caller en los dominios (PR #27315)"
body = "ecarreras requested review from @pilipilisbot on this pull request."
- assert classify_github_action(subject, body) == "submit_review"
- assert classify_work_intent(subject, body) == "review_only"
+ assert classify_github_action(subject, body, {"pilipilisbot"}) == "submit_review"
+ assert classify_work_intent(subject, body, {"pilipilisbot"}) == "review_only"
def test_pr_review_followup_is_read_only_without_explicit_implementation():
subject = "Re: [gisce/erp] Permitir caller en los dominios (PR #27315)"
body = "@pilipilisbot però la transacció en què s'executa que entra per eval_domain és amb una transacció readonly"
- assert classify_github_action(subject, body) == "reply_comment"
- assert classify_work_intent(subject, body) == "review_only"
+ assert classify_github_action(subject, body, {"pilipilisbot"}) == "reply_comment"
+ assert classify_work_intent(subject, body, {"pilipilisbot"}) == "review_only"
def test_pr_followup_can_still_request_explicit_implementation():
subject = "Re: [gisce/erp] Permitir caller en los dominios (PR #27315)"
body = "@pilipilisbot aplica el canvi i fes push"
- assert classify_github_action(subject, body) == "reply_comment"
+ assert classify_github_action(subject, body, {"pilipilisbot"}) == "reply_comment"
assert classify_work_intent(subject, body) == "work_allowed"
@@ -95,5 +95,5 @@ def test_pr_assignment_allows_work():
subject = "Re: [gisce/erp] Permitir caller en los dominios (PR #27315)"
body = "ecarreras assigned @pilipilisbot to this pull request."
- assert classify_github_action(subject, body) == "open_issue"
- assert classify_work_intent(subject, body) == "work_allowed"
+ assert classify_github_action(subject, body, {"pilipilisbot"}) == "open_issue"
+ assert classify_work_intent(subject, body, {"pilipilisbot"}) == "work_allowed"
diff --git a/tests/test_policy.py b/tests/test_policy.py
index 1ba4a94..e792025 100644
--- a/tests/test_policy.py
+++ b/tests/test_policy.py
@@ -10,6 +10,22 @@ def test_trusted_org_auto_trusted():
assert Policy(trusted_orgs={"gisce"}).decision(n, ctx, "reply_comment") == "auto_trusted"
+def test_trusted_source_accepts_configured_forwarder():
+ body = "@giscebot https://github.com/gisce/erp/pull/27853#issuecomment-4547966148"
+ n = Notification(
+ 1,
+ "",
+ "subj",
+ "'Eduard Carreras' via GISCE Bot ",
+ body,
+ auth={"spf": True, "dkim": True, "dmarc": True},
+ )
+ ctx = extract_github_context(body)
+ policy = Policy(source_from=("notifications@github.com", "giscebot@gisce.net"), trusted_orgs={"gisce"})
+
+ assert policy.decision(n, ctx, "reply_comment") == "auto_trusted"
+
+
def test_enabled_repos_restricts_canary_scope():
n = Notification(1, "", "subj", "notifications@github.com", "", auth={"spf": True, "dkim": True, "dmarc": True})
erp = extract_github_context("@pilipilisbot https://github.com/gisce/erp/issues/1#issuecomment-1")
@@ -46,6 +62,30 @@ def test_policy_from_file_loads_roles_and_rejects_unknown(tmp_path):
raise AssertionError("expected ValueError for unknown repo role")
+def test_policy_from_file_loads_bot_logins(tmp_path):
+ policy_file = tmp_path / "policy.json"
+ policy_file.write_text('{"botLogins": ["@GISCEBot", "pilipilisbot"]}')
+
+ policy = Policy.from_file(policy_file)
+
+ assert policy.bot_logins == {"giscebot", "pilipilisbot"}
+
+
+def test_policy_keeps_default_bot_login_when_not_configured(tmp_path):
+ policy_file = tmp_path / "policy.json"
+ policy_file.write_text("{}")
+
+ assert Policy().bot_logins == {"pilipilisbot"}
+ assert Policy.from_file(policy_file).bot_logins == {"pilipilisbot"}
+
+
+def test_policy_allows_explicit_empty_bot_logins(tmp_path):
+ policy_file = tmp_path / "policy.json"
+ policy_file.write_text('{"botLogins": []}')
+
+ assert Policy.from_file(policy_file).bot_logins == set()
+
+
def test_policy_from_file_loads_feedback_learning(tmp_path):
policy_file = tmp_path / "policy.json"
policy_file.write_text('{"feedbackLearning": {"enabled": false, "minConfidence": 0.7, "autoApproveConfidence": 0.9, "maxEventsPerRun": 3, "model": "test-model", "thinking": "medium", "sessionId": "feedback-test"}}')
diff --git a/tests/test_queue.py b/tests/test_queue.py
index 584d07c..b0dbe67 100644
--- a/tests/test_queue.py
+++ b/tests/test_queue.py
@@ -12,7 +12,7 @@ def notif(uid, mid, body):
def policy():
- return Policy(trusted_orgs={"gisce"})
+ return Policy(trusted_orgs={"gisce"}, bot_logins={"pilipilisbot"})
def test_enqueue_and_coalesce_same_work_key(tmp_path, monkeypatch):
@@ -76,6 +76,35 @@ def fake_actor(ctx, *, gh_bin="gh"):
assert job.trigger_actor_avatar_url == "https://avatars.githubusercontent.com/u/294235?v=4"
+def test_enqueue_accepts_github_app_bot_actor_from_context(tmp_path, monkeypatch):
+ def fake_actor(ctx, *, gh_bin="gh"):
+ from github_agent_bridge.actors import TriggerActor
+
+ return TriggerActor(
+ login="copilot-pull-request-reviewer[bot]",
+ avatar_url="https://avatars.githubusercontent.com/in/946600?v=4",
+ )
+
+ monkeypatch.setattr("github_agent_bridge.actors.github_actor_details_for_context", fake_actor)
+ q = JobQueue(tmp_path / "q.sqlite3")
+
+ job, state = q.enqueue(
+ Notification(
+ uid=1,
+ message_id="<1@github.com>",
+ subject="Re: [gisce/erp] PR",
+ from_addr="GitHub ",
+ body="https://github.com/gisce/erp/pull/1#pullrequestreview-99",
+ auth={"spf": True, "dkim": True, "dmarc": True},
+ ),
+ policy(),
+ )
+
+ assert state == "enqueued"
+ assert job.trigger_actor == "copilot-pull-request-reviewer[bot]"
+ assert job.trigger_actor_avatar_url == "https://avatars.githubusercontent.com/in/946600?v=4"
+
+
def test_enqueue_falls_back_to_context_actor_for_generic_github_sender(tmp_path, monkeypatch):
calls = []