diff --git a/README.md b/README.md index cd4f814a..a9b645d1 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,10 @@ argus ``` Use the terminal cockpit to talk to the Manager, follow live work, inspect state, and resume projects. +Without an explicit `--port`, Argus reuses a compatible backend or selects the +first available port starting at `8799` when another program or stale backend +occupies it. On Windows, a plain `argus` launch also opens the Web UI; use +`argus --no-open` for the terminal cockpit only. ### Web UI @@ -201,7 +205,8 @@ Start Argus and open the Web UI in your default browser: argus --web ``` -Default address: [http://127.0.0.1:8799](http://127.0.0.1:8799) +Preferred address: [http://127.0.0.1:8799](http://127.0.0.1:8799); Argus advances +to the next available port when needed. The Web UI follows the browser language on first launch and supports English and Simplified Chinese. Use the language button in the session sidebar to diff --git a/README.zh-CN.md b/README.zh-CN.md index 186b4887..65712323 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -190,6 +190,9 @@ argus ``` 通过终端 Cockpit 与 Manager 对话、跟踪实时工作、检查状态并恢复项目。 +未显式指定 `--port` 时,Argus 会复用兼容后端;若默认端口被其他程序或旧后端占用, +则从 `8799` 开始选择首个可用端口。在 Windows 上,普通 `argus` 启动会同时打开 +Web UI;使用 `argus --no-open` 可只保留终端 Cockpit。 ### Web UI @@ -199,7 +202,7 @@ argus argus --web ``` -默认地址:[http://127.0.0.1:8799](http://127.0.0.1:8799) +首选地址:[http://127.0.0.1:8799](http://127.0.0.1:8799);被占用时会自动顺延。 ```bash argus --web --no-open # 只启动,不打开浏览器 diff --git a/argus_doctor.py b/argus_doctor.py index dc654723..0d8db4ba 100644 --- a/argus_doctor.py +++ b/argus_doctor.py @@ -179,13 +179,12 @@ def run_bootstrap_doctor(root=None): findings.append(_finding( "ARGUS-DESKTOP-001", "Desktop runtime", - electron_ready, + True, ( "Electron runtime present" if electron_installed and electron_ready else "Desktop dependencies not installed (optional for CLI/Web)" if not electron_installed - else "Electron runtime binary missing" + else "Electron runtime binary missing (optional for CLI/Web)" ), - "run `npm --prefix desktop ci`; Desktop postinstall downloads the declared Electron runtime", )) web_host = os.environ.get("ARGUS_SKILL_WEB_HOST", "127.0.0.1") diff --git a/argus_skill/apps/tui_launcher.py b/argus_skill/apps/tui_launcher.py index ee170129..4df1b1d1 100644 --- a/argus_skill/apps/tui_launcher.py +++ b/argus_skill/apps/tui_launcher.py @@ -27,7 +27,6 @@ "--gc", "--watch", "--follow", - "--web", "--pair-plan", "--notify", "--init-identity", @@ -145,6 +144,15 @@ def _run_python_admin(argv: list[str]) -> int: def _uses_python_admin(argv: list[str]) -> bool: + # `argus --web` is a cockpit surface: it needs the TUI's automatic port + # selection and browser launch. Keep the legacy raw WebAPI spelling on the + # Python path only when its backend-specific options are present. + if "--web" in argv and any( + arg == option or arg.startswith(f"{option}=") + for arg in argv + for option in ("--web-host", "--web-port") + ): + return True i = 0 while i < len(argv): arg = argv[i] diff --git a/argus_skill/core/knobs.py b/argus_skill/core/knobs.py index 826ab039..8d117b3d 100644 --- a/argus_skill/core/knobs.py +++ b/argus_skill/core/knobs.py @@ -103,7 +103,7 @@ class BudgetCaps: Knob("ARGUS_SKILL_REWRITE_MODEL", "auto", "interactive prompt rewrite model: gpt-5.5 on codex/copilot, Manager model otherwise; set an id to override", "models"), Knob("ARGUS_SKILL_MANAGER_REPLY_MODEL", "inherit", "operator-facing Manager SELF model; inherit uses the configured Manager/shared route model", "models", cockpit=True), Knob("ARGUS_SKILL_FRONTDOOR_MODEL", "auto", "cheap front-door classification model: gpt-5.4-mini on codex/copilot, Manager model otherwise", "models"), - Knob("ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT", "medium", "reasoning effort for the LLM-only front-door and STEER confirmation", "models"), + Knob("ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT", "low", "reasoning effort for the LLM-only front-door and STEER confirmation", "models"), # --- reasoning effort --- Knob("ARGUS_SKILL_MANAGER_REASONING_EFFORT", "high", "manager reasoning effort", "reasoning", cockpit=True), Knob("ARGUS_SKILL_PLANNER_REASONING_EFFORT", "high", "planner reasoning effort", "reasoning", cockpit=True), diff --git a/argus_skill/core/portable_filename.py b/argus_skill/core/portable_filename.py new file mode 100644 index 00000000..095d39d4 --- /dev/null +++ b/argus_skill/core/portable_filename.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +import base64 +import os + +_WINDOWS_RESERVED = frozenset({ + "con", + "prn", + "aux", + "nul", + *(f"com{i}" for i in range(1, 10)), + *(f"lpt{i}" for i in range(1, 10)), +}) + + +def portable_filename_component( + value: str, + *, + windows: bool | None = None, + max_bytes: int = 120, +) -> str: + """Encode a logical identifier as one bounded, portable path component.""" + text = str(value) + raw = text.encode("utf-8") + if len(raw) > max_bytes: + raise ValueError(f"identifier exceeds {max_bytes} UTF-8 bytes") + on_windows = os.name == "nt" if windows is None else windows + stem = text.split(".", 1)[0].casefold() + unsafe = ( + not text + or text.startswith("~") + or any(char in text for char in "/\\\0") + or ( + on_windows + and ( + any(ord(char) < 32 or char in '<>:"|?*' for char in text) + or text.endswith((" ", ".")) + or stem in _WINDOWS_RESERVED + ) + ) + ) + if not unsafe: + return text + encoded = base64.urlsafe_b64encode(raw).decode("ascii").rstrip("=") + return f"~{encoded}" + + +__all__ = ["portable_filename_component"] diff --git a/argus_skill/manager/_front_door_ops.py b/argus_skill/manager/_front_door_ops.py index 59146523..a03bb5cd 100644 --- a/argus_skill/manager/_front_door_ops.py +++ b/argus_skill/manager/_front_door_ops.py @@ -43,7 +43,7 @@ def classify_front_door( Built FRESH on the raw backend (``self.runner``, NEVER ``self._session`` — no giant-session resume, no pollution), ``resume_thread_id=None``. Effort comes from - ``ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT`` (default ``medium``). Biases + ``ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT`` (default ``low``). Biases each axis to its own safe default on any error.""" from ..life.router import classify_front_door @@ -56,8 +56,8 @@ def classify_front_door( _backend = self.runner _effort = resolve_knob( "ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT", - "medium", - ).value.strip() or "medium" + "low", + ).value.strip() or "low" def run_exec(prompt: str) -> Any: # noqa: ANN401 return gateway_run_exec( diff --git a/argus_skill/release.py b/argus_skill/release.py index d36ab5aa..dd89d065 100644 --- a/argus_skill/release.py +++ b/argus_skill/release.py @@ -58,6 +58,7 @@ def _source_files(root: Path) -> Iterable[Path]: "plugins/argus/**/*.yaml", "plugins/argus/bin/*", "plugins/argus/install.sh", + "argus_doctor.py", "pyproject.toml", ) tracked = _git_tracked_files(root) diff --git a/argus_skill/release_manifest.json b/argus_skill/release_manifest.json index 6412e4ce..53500430 100644 --- a/argus_skill/release_manifest.json +++ b/argus_skill/release_manifest.json @@ -1,6 +1,6 @@ { "package_version": "0.1.1", - "release_id": "0.1.1+a4de81c666ef26a3", + "release_id": "0.1.1+87a2e4aae67e9583", "schema_version": 1, - "source_digest": "a4de81c666ef26a3645b67f679e18132546e5ec92003000d736e503810fa9700" + "source_digest": "87a2e4aae67e95833d5b12a2140b54f90aae0eca54255b656f60d0d5d1826adb" } diff --git a/argus_skill/team/curator.py b/argus_skill/team/curator.py index f6dbc8d2..fe2dc4d2 100644 --- a/argus_skill/team/curator.py +++ b/argus_skill/team/curator.py @@ -24,6 +24,7 @@ from __future__ import annotations import contextlib +import ctypes import logging import os import re @@ -38,6 +39,8 @@ from . import completion, leaderboard, pool, registry, roster, task_board log = logging.getLogger(__name__) +_SYNCHRONIZE = 0x00100000 +_WAIT_TIMEOUT = 0x00000102 def _windows_process_command_line(pid: int) -> str: @@ -62,14 +65,47 @@ def _windows_process_command_line(pid: int) -> str: return result.stdout.strip() if result.returncode == 0 else "" -def _terminate_windows_tree(pid: int) -> None: - subprocess.run( - ["taskkill.exe", "/PID", str(int(pid)), "/T", "/F"], - check=False, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0), - ) +def _terminate_windows_tree(pid: int) -> bool: + try: + result = subprocess.run( + ["taskkill.exe", "/PID", str(int(pid)), "/T", "/F"], + check=False, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0), + ) + except OSError: + return False + return result.returncode == 0 + + +def _open_windows_process_handle(pid: int) -> int: + windll = getattr(ctypes, "windll", None) + if windll is None: + return 0 + open_process = windll.kernel32.OpenProcess + open_process.argtypes = (ctypes.c_uint32, ctypes.c_int, ctypes.c_uint32) + open_process.restype = ctypes.c_void_p + return int(open_process(_SYNCHRONIZE, False, int(pid)) or 0) + + +def _close_windows_process_handle(handle: int) -> None: + windll = getattr(ctypes, "windll", None) + if handle > 0 and windll is not None: + close_handle = windll.kernel32.CloseHandle + close_handle.argtypes = (ctypes.c_void_p,) + close_handle.restype = ctypes.c_int + close_handle(ctypes.c_void_p(handle)) + + +def _windows_process_handle_alive(handle: int) -> bool: + windll = getattr(ctypes, "windll", None) + if handle <= 0 or windll is None: + return False + wait = windll.kernel32.WaitForSingleObject + wait.argtypes = (ctypes.c_void_p, ctypes.c_uint32) + wait.restype = ctypes.c_uint32 + return wait(ctypes.c_void_p(handle), 0) == _WAIT_TIMEOUT def _pid_is_teammate(pid: int, member_id: str, root: Path | None = None) -> bool: @@ -139,14 +175,41 @@ class _AdoptedProc: ``_terminate`` rely on, so adopted children flow through every owned-child path unchanged.""" - def __init__(self, pid: int, member_id: str, root: Path) -> None: + def __init__( + self, + pid: int, + member_id: str, + root: Path, + *, + windows_handle: int = 0, + ) -> None: self.pid = int(pid) self._member_id = member_id self._root = Path(root) + self._windows_handle = ( + windows_handle or _open_windows_process_handle(self.pid) + if os.name == "nt" + else 0 + ) + if os.name == "nt" and self._windows_handle <= 0: + raise OSError(f"could not retain Windows process handle for pid {self.pid}") def poll(self) -> int | None: + if os.name == "nt": + if _windows_process_handle_alive(self._windows_handle): + return None + self._close_windows_handle() + return 0 return None if _pid_is_teammate(self.pid, self._member_id, self._root) else 0 + def _close_windows_handle(self) -> None: + handle = self._windows_handle + self._windows_handle = 0 + _close_windows_process_handle(handle) + + def __del__(self) -> None: + self._close_windows_handle() + def wait(self, timeout: float | None = None) -> int: end = (time.time() + timeout) if timeout else None while self.poll() is None: @@ -311,10 +374,22 @@ def _adopt_orphans(self, root: Path, *, now: float | None = None) -> list[str]: child_key = _child_key(root, str(mid or "")) if not mid or child_key in self._children or not pid: continue - if m.get("status") != "running" or not _pid_is_teammate(int(pid), mid, root): + if m.get("status") != "running": continue + if os.name == "nt": + handle = _open_windows_process_handle(int(pid)) + if handle <= 0: + continue + if not _pid_is_teammate(int(pid), mid, root): + _close_windows_process_handle(handle) + continue + proc = _AdoptedProc(int(pid), mid, root, windows_handle=handle) + else: + if not _pid_is_teammate(int(pid), mid, root): + continue + proc = _AdoptedProc(int(pid), mid, root) self._children[child_key] = TrackedTeammate( - _AdoptedProc(int(pid), mid, root), member_id=mid, + proc, member_id=mid, task_id=m.get("task_id", ""), root=root, started_at=now, timeout_s=self.teammate_timeout_s, hard_grace_s=self.hard_grace_s) adopted.append(mid) @@ -381,20 +456,20 @@ def _refill(self, root: Path, *, width: int, cwd: Path, "failed_dead_cwd": failed_dead_cwd} # ---- reaping -------------------------------------------------------- - def _terminate(self, tt: TrackedTeammate, *, grace: float = 2.0) -> None: + def _terminate(self, tt: TrackedTeammate, *, grace: float = 2.0) -> bool: """Kill one tracked child's process group (SIGTERM → grace → SIGKILL).""" proc = tt.proc if proc.poll() is not None: - return + return True if os.name == "nt": _terminate_windows_tree(proc.pid) with contextlib.suppress(subprocess.TimeoutExpired): proc.wait(timeout=max(grace, 5.0)) - return + return proc.poll() is not None try: os.killpg(os.getpgid(proc.pid), signal.SIGTERM) except (OSError, ProcessLookupError): - return + return proc.poll() is not None try: proc.wait(timeout=grace) except subprocess.TimeoutExpired: @@ -402,6 +477,7 @@ def _terminate(self, tt: TrackedTeammate, *, grace: float = 2.0) -> None: os.killpg(os.getpgid(proc.pid), signal.SIGKILL) with contextlib.suppress(subprocess.TimeoutExpired): proc.wait(timeout=5) + return proc.poll() is not None def _reap(self, now: float | None = None) -> dict[str, list[str]]: """Drop children that exited on their own; hard-kill+free those past the @@ -425,7 +501,12 @@ def _reap(self, now: float | None = None) -> dict[str, list[str]]: dropped.append(tt.member_id) continue if now >= tt.hard_deadline(): - self._terminate(tt) + if not self._terminate(tt): + log.error( + "curator: timed-out teammate %s remained alive after termination", + tt.member_id, + ) + continue with contextlib.suppress(Exception): task_board.fail(tt.root, tt.task_id, reason="curator hard-timeout") roster.set_member_status(tt.root, tt.member_id, "failed") @@ -607,7 +688,12 @@ def stop(self) -> None: stopped_roots: set[Path] = set() for tt in list(self._children.values()): status = "stopped" if tt.alive() else "exited" - self._terminate(tt) + if not self._terminate(tt): + log.error( + "curator: teammate %s remained alive during shutdown", + tt.member_id, + ) + continue stopped_roots.add(tt.root) with contextlib.suppress(Exception): roster.set_member_status(tt.root, tt.member_id, status) diff --git a/argus_skill/team/task_board.py b/argus_skill/team/task_board.py index dd8f4dc2..bfc63652 100644 --- a/argus_skill/team/task_board.py +++ b/argus_skill/team/task_board.py @@ -7,11 +7,11 @@ """ from __future__ import annotations -import hashlib import os from pathlib import Path from typing import Any +from ..core.portable_filename import portable_filename_component from . import _store @@ -29,21 +29,8 @@ def _task_filename(task_id: str) -> str: invalid = not task_id or task_id in {".", ".."} or any(c in task_id for c in "/\\\0") if invalid: raise ValueError(f"invalid task_id for task board path: {task_id!r}") - if os.name == "nt": - stem = task_id.split(".", 1)[0].casefold() - windows_unsafe = ( - any(ord(char) < 32 or char in '<>:"|?*' for char in task_id) - or task_id.endswith((" ", ".")) - or stem in { - "con", "prn", "aux", "nul", - *(f"com{i}" for i in range(1, 10)), - *(f"lpt{i}" for i in range(1, 10)), - } - ) - if windows_unsafe: - digest = hashlib.sha256(task_id.encode("utf-8")).hexdigest() - return f"id-{digest}.json" - return f"{task_id}.json" + component = portable_filename_component(task_id, windows=os.name == "nt") + return f"{component}.json" def _path(root: Path, task_id: str) -> Path: diff --git a/argus_skill/tools/subagent/_experiment_preflight.py b/argus_skill/tools/subagent/_experiment_preflight.py index 9f1fb41c..dc051440 100644 --- a/argus_skill/tools/subagent/_experiment_preflight.py +++ b/argus_skill/tools/subagent/_experiment_preflight.py @@ -189,9 +189,12 @@ def _claim_run_dir( claim_path = _claim_path(run_dir) key = (claim_owner, str(run_dir)) with _CLAIMS_LOCK: - for (owner, claimed_dir), _handle in _HELD_CLAIMS.items(): + for (held_owner, claimed_dir), _handle in _HELD_CLAIMS.items(): if claimed_dir == str(run_dir): - return f"experiment run directory is already claimed by task {owner}: {run_dir}" + return ( + "experiment run directory is already claimed" + f" by task {held_owner}: {run_dir}" + ) claim_path.parent.mkdir(parents=True, exist_ok=True) handle = claim_path.open("a+", encoding="utf-8") try: @@ -199,15 +202,15 @@ def _claim_run_dir( except portalocker.exceptions.LockException: try: handle.seek(0) - owner = json.load(handle) + owner_record = json.load(handle) except (OSError, ValueError, json.JSONDecodeError): - owner = {} + owner_record = {} handle.close() return ( "experiment run directory is already claimed" + ( - f" by task {owner.get('task_id')}" - if owner.get("task_id") + f" by task {owner_record.get('task_id')}" + if owner_record.get("task_id") else "" ) + f": {run_dir}" diff --git a/argus_skill/tools/subagent/_registry.py b/argus_skill/tools/subagent/_registry.py index fdaae5ae..505e040a 100644 --- a/argus_skill/tools/subagent/_registry.py +++ b/argus_skill/tools/subagent/_registry.py @@ -6,7 +6,6 @@ """ from __future__ import annotations -import hashlib import json import os import subprocess @@ -20,6 +19,7 @@ fcntl = None # type: ignore[assignment] from ...core.daemon_lock import is_pid_running +from ...core.portable_filename import portable_filename_component from ._text import _tail_file # --------------------------------------------------------------------------- @@ -57,14 +57,7 @@ # --------------------------------------------------------------------------- def _task_file_component(task_id: str) -> str: - text = str(task_id) - windows_unsafe = os.name == "nt" and ( - any(ord(char) < 32 or char in '<>:"|?*' for char in text) - or text.endswith((" ", ".")) - ) - if windows_unsafe or any(char in text for char in "/\\\0"): - return f"id-{hashlib.sha256(text.encode('utf-8')).hexdigest()}" - return text + return portable_filename_component(str(task_id), windows=os.name == "nt") def _registry_path(task_id: str) -> Path: diff --git a/argus_skill/webapi/manager_dispatch.py b/argus_skill/webapi/manager_dispatch.py index 631b3f14..5832c78b 100644 --- a/argus_skill/webapi/manager_dispatch.py +++ b/argus_skill/webapi/manager_dispatch.py @@ -539,9 +539,9 @@ def _maybe_greeting_reply( """Short-circuit a safe message-only reply from the merged classifier. Only fires when no stateful action was decided and the classifier did not - need the startup/rotation handoff to - answer it (``send_body == body``) — otherwise the greeting reply could be - stale relative to the actual enriched turn sent to the Manager. + need the startup/rotation handoff to answer it (``send_body == body``). + Otherwise the greeting would consume the handoff without seeding the next + substantive Manager turn. """ if ( classify.greeting_reply diff --git a/argus_skill/webapi/manager_state.py b/argus_skill/webapi/manager_state.py index 3076b228..701c44cd 100644 --- a/argus_skill/webapi/manager_state.py +++ b/argus_skill/webapi/manager_state.py @@ -30,6 +30,7 @@ _REGISTRY_LOCK = threading.Lock() _MANAGER_PREWARMING: set[str] = set() _MANAGER_PREWARMING_LOCK = threading.Lock() +_MANAGER_PREWARM_OWNER: str | None = None # Emergency natural-language pause bypasses the per-session Manager lock. A # generation bump lets any older turn notice that it was superseded before it # can commit/dispatch work after the operator has clocked the session out. @@ -107,6 +108,7 @@ def _prewarm_manager_context( *, global_root: Path | str | None = None, ) -> None: + """Warm one lightweight classifier transport for the active project.""" from ..life.memory import MemoryBundle from ..manager.front_door import _ensure_manager_runner @@ -117,7 +119,9 @@ def _prewarm_manager_context( with _lock_for(sid): if not mem.project_root.is_dir(): return - state = _chat_state_for(sid) + if not _is_manager_prewarm_owner(sid): + return + state = _chat_state_for(sid, manager_activity=False) if state.get("_manager_acp_prewarmed") or state.get("backend") != "copilot": return state["session_id"] = sid @@ -127,57 +131,40 @@ def _prewarm_manager_context( prewarm = getattr(backend, "prewarm_acp_client", None) if not callable(prewarm): return - from ..core.knobs import ( - resolve_knob, - resolve_manager_classify_model, - resolve_manager_reply_model, - resolve_role_reasoning_effort, - ) + from ..core.knobs import resolve_knob, resolve_manager_classify_model - cwd = str(state.get("manager_runner_workdir") or Path.cwd()) classify_effort = resolve_knob( "ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT", - "medium", - ).value.strip() or "medium" + "low", + ).value.strip() or "low" prewarm( model=resolve_manager_classify_model(), reasoning_effort=classify_effort, lean=True, - cwd=cwd, + cwd=str(state.get("manager_runner_workdir") or Path.cwd()), front_door_session=True, ) - prewarm( - model=resolve_manager_reply_model(), - reasoning_effort=resolve_role_reasoning_effort( - "ARGUS_SKILL_SELF_REASONING_EFFORT", - default="high", - ), - lean=False, - cwd=cwd, - read_only=True, - add_dirs=([str(mem.project_root)] if str(mem.project_root) != cwd else None), - ) + if not _is_manager_prewarm_owner(sid): + _release_manager_state(sid) + return state["_manager_acp_prewarmed"] = True -def _manager_context_is_prewarmed(sid: str, *, blocking: bool = True) -> bool: - """Return the warm flag without forcing read-only callers to wait. +def _is_manager_prewarm_owner(sid: str) -> bool: + with _MANAGER_PREWARMING_LOCK: + return _MANAGER_PREWARM_OWNER == sid - Compact snapshot reads schedule a best-effort prewarm. They must not queue - behind a Manager turn that can legitimately hold the per-session lock for - several minutes. ``blocking=False`` treats a busy context as not-yet-warm; - the background worker will perform the authoritative check once it can - acquire the lock. - """ - lock = _lock_for(sid) - acquired = lock.acquire(blocking=blocking) - if not acquired: - return False - try: - state = _STATES.get(sid) - return bool(state and state.get("_manager_acp_prewarmed")) - finally: - lock.release() + +def _claim_manager_prewarm_owner(sid: str) -> None: + """Make the latest explicit active-project request the sole prewarm owner.""" + global _MANAGER_PREWARM_OWNER + + with _MANAGER_PREWARMING_LOCK: + _MANAGER_PREWARM_OWNER = sid + + +def _mark_manager_activity(sid: str) -> None: + _claim_manager_prewarm_owner(sid) def schedule_manager_prewarm( @@ -185,20 +172,20 @@ def schedule_manager_prewarm( *, global_root: Path | str | None = None, ) -> None: - """Warm exactly one project's private Manager ACP pool in background.""" - if _manager_context_is_prewarmed(sid, blocking=False): + """Best-effort prewarm for the one project currently open in the Web UI.""" + _claim_manager_prewarm_owner(sid) + state = _STATES.get(sid) + if state and state.get("_manager_acp_prewarmed"): return with _MANAGER_PREWARMING_LOCK: if sid in _MANAGER_PREWARMING: return - if _manager_context_is_prewarmed(sid, blocking=False): - return _MANAGER_PREWARMING.add(sid) def _run() -> None: try: _prewarm_manager_context(sid, global_root=global_root) - except Exception: # noqa: BLE001 - project selection must stay available + except Exception: # noqa: BLE001 - page reads must stay available pass finally: with _MANAGER_PREWARMING_LOCK: @@ -262,10 +249,18 @@ def _evict_stale_manager_states(*, exclude_sid: str) -> None: lock.release() -def _chat_state_for(sid: str) -> dict[str, Any]: +def _chat_state_for( + sid: str, + *, + manager_activity: bool = True, +) -> dict[str, Any]: + if manager_activity: + _mark_manager_activity(sid) _evict_stale_manager_states(exclude_sid=sid) st = _STATES.get(sid) if st is not None: + if manager_activity: + st["_manager_activity_seen"] = True st["last_access_monotonic"] = time.monotonic() return st from ..agent_cli.runner_backend import normalize_runner_backend @@ -286,6 +281,7 @@ def _chat_state_for(sid: str) -> dict[str, Any]: "needs_startup_handoff": True, "session_started_s": time.monotonic(), "last_access_monotonic": time.monotonic(), + "_manager_activity_seen": manager_activity, "mission_count": 0, "config": dict(DEFAULT_MANAGER_CONFIG), "continuous_objective": "", @@ -327,10 +323,16 @@ def reset_manager_context( def shutdown_manager_bridge() -> None: """Release warm Manager runners and Copilot ACP children on Web shutdown.""" + global _MANAGER_PREWARM_OWNER + with _REGISTRY_LOCK: states = list(_STATES.values()) _STATES.clear() _LOCKS.clear() + _CONTROL_GENERATIONS.clear() + with _MANAGER_PREWARMING_LOCK: + _MANAGER_PREWARMING.clear() + _MANAGER_PREWARM_OWNER = None for state in states: runner = state.get("manager_runner") if runner is not None and hasattr(runner, "reset_chat_session"): diff --git a/argus_skill/webapi/routes/projects.py b/argus_skill/webapi/routes/projects.py index bf79cabb..031c2827 100644 --- a/argus_skill/webapi/routes/projects.py +++ b/argus_skill/webapi/routes/projects.py @@ -177,20 +177,18 @@ def _snapshot( sid: str, events_limit: int = Query(80, ge=1, le=500), compact: bool = Query(False), + prewarm: bool = Query(False), ) -> dict[str, Any]: root = ctx.project_root_or_404(sid) + if prewarm: + try: + from ..manager_state import schedule_manager_prewarm - def _build_snapshot() -> dict[str, Any] | None: - if compact: - try: - from ..manager_state import schedule_manager_prewarm + schedule_manager_prewarm(sid, global_root=root) + except Exception: # noqa: BLE001 - snapshot must remain read-available + pass - schedule_manager_prewarm( - sid, - global_root=root, - ) - except Exception: # noqa: BLE001 - snapshot must remain read-available - pass + def _build_snapshot() -> dict[str, Any] | None: return server_mod.build_snapshot( sid, global_root=root, diff --git a/desktop/src/preload/index.ts b/desktop/src/preload/index.ts index 2c4a8525..569b18a2 100644 --- a/desktop/src/preload/index.ts +++ b/desktop/src/preload/index.ts @@ -83,7 +83,7 @@ const api = { openLogs: (): Promise => ipcRenderer.invoke('argus:open-logs'), openData: (): Promise => ipcRenderer.invoke('argus:open-data'), restartBackend: (): Promise => ipcRenderer.invoke('argus:restart-backend'), - exportDiagnostics: (): Promise => ipcRenderer.invoke('argus:export-diagnostics'), + exportDiagnostics: (): Promise => ipcRenderer.invoke('argus:export-diagnostics'), openCockpit: (): Promise => ipcRenderer.invoke('argus:open-cockpit'), onShowSetup: (callback: () => void): (() => void) => { const listener = (): void => callback(); diff --git a/docs/argus-doctor-recovery-design.zh-CN.md b/docs/argus-doctor-recovery-design.zh-CN.md new file mode 100644 index 00000000..65dfdeb9 --- /dev/null +++ b/docs/argus-doctor-recovery-design.zh-CN.md @@ -0,0 +1,1861 @@ +# Argus Bootstrap Doctor & Recovery 设计规范 + +> 状态:已批准;Phase 1–2 与 Desktop Bootstrap Recovery 基础闭环已实现 +> 日期:2026-08-13 +> 当前实现:`argus doctor` / `argus --doctor` / `argus -doctor` 只读诊断、`--json`、`--deep`、`--verify`,以及 `argus repair --plan|--safe`。当前没有能在既有 daemon PID 锁协议下无竞态执行的 SAFE 修改,因此 stale lock 仅生成 MANUAL 计划,不自动删除。独立标准库入口 `argus-doctor` 已可在不导入 Argus Core 的情况下检查主机、源码、venv、Core import、Git、Node 与 Web/TUI 资产。Desktop 在 Python/Web 后端失败时已有独立错误页,可重试、修改设置并导出脱敏诊断;版本恢复与签名更新器仍按后续阶段实施。CONSENT/MANUAL Repair Provider 仍保持只规划、不自动越权执行。 +> 适用项目:Argus +> 目标平台:Windows、Linux、macOS +> 目标入口:CLI、TUI、Web、Desktop、外层 AI Terminal / Agent +> 实施约束:本规范批准前不编写实现代码 + +--- + +## 1. 摘要 + +本规范设计一个跨平台的 Argus 环境诊断、修复、更新与回滚系统。 + +它解决的核心问题是:当 Argus 主程序、Python 运行时、WebAPI、Desktop 后端、TUI、AI Backend、daemon 或安装状态发生异常时,用户可能无法进入完整 Argus,也就无法使用现有的 Argus 能力诊断 Argus 本身。 + +因此,完整方案不能只扩展当前依赖 `argus_skill` 正常导入的 `argus --doctor`,而应提供两个互补层级: + +1. **Bootstrap Doctor / Rescue Runtime**:不依赖完整 Argus Core,在 Argus 无法正常启动时仍能运行。 +2. **Full Doctor & Recovery**:当 Argus Core 或 API 可用时,提供完整诊断、修复计划、授权执行、验收和回滚。 + +核心原则: + +> 确定性检测 → 结构化 Finding → 根因排序 → 修复计划 → 分级授权 → 注册动作执行 → 验收 → 回滚 → 审计。 + +AI 终端可以辅助解释和编排,但不能成为底层事实来源,也不能自由生成 Shell 命令并直接修改用户环境。 + +--- + +## 2. 命令命名 + +### 2.1 推荐命令 + +```bash +argus doctor +``` + +兼容已有入口: + +```bash +argus --doctor +``` + +帮助命令保持标准形式: + +```bash +argus -h +argus --help +``` + +不建议将以下形式作为正式文档入口: + +```bash +argus -doctor +``` + +单横线通常用于单字符参数。若后续确有兼容需求,可以将 `-doctor` 做成隐藏别名,但所有公开文档统一使用 `argus doctor`。 + +### 2.2 诊断与修复必须分离 + +```bash +argus doctor # 只读检测,永不修改 +argus repair --plan # 生成修复计划,永不修改 +argus repair --apply # 授权后执行指定计划 +argus doctor --verify # 修复后验收 +``` + +`doctor` 不得为了方便而顺便修复。任何产生副作用的行为必须进入 `repair` 阶段。 + +--- + +## 3. 背景与问题定义 + +当前 Argus 已经具备以下基础能力: + +- `argus --doctor`:检查 backend、认证、daemon、锁与 Session。 +- `argus --setup`:配置 backend 和认证模式。 +- `argus update`:对干净源码仓库执行 fast-forward 更新。 +- `/api/projects/{sid}/doctor`:项目级 WebAPI Doctor。 +- `runtime_identity.py` / `release.py`:版本、源码和 Release 身份检查。 +- `daemon_upgrade.py`:在任务边界安全切换 daemon。 +- `daemon/self_maintenance.py`:框架代码故障的隔离修复与 canary。 +- Windows Desktop 已具备 Electron host、bundled backend、ownership 检查和有限恢复能力。 + +但现有 Doctor 默认要求: + +- `argus` 命令可以执行; +- Python 解释器存在; +- `argus_skill` 能够导入; +- CLI 入口没有损坏。 + +以下故障会让现有 Doctor 自身失效: + +- `argus` 不在 PATH; +- 虚拟环境被删除、移动或损坏; +- Python 不存在或版本不兼容; +- `argus_skill` 无法 import; +- Desktop bundled backend 丢失; +- WebAPI 启动失败; +- Electron 可启动但 Python backend 起不来; +- Web 资产与 API protocol 不一致; +- 安装只完成了一半; +- macOS Gatekeeper 阻止应用; +- Windows 文件锁阻止替换; +- Linux service 配置错误; +- AI backend 本身未登录或不可用。 + +因此,本功能的首要要求是: + +> 诊断入口不能完全依赖被诊断的完整系统。 + +--- + +## 4. 目标 + +### 4.1 产品目标 + +1. 用户无法进入完整 Argus 时,仍有可用诊断入口。 +2. Windows、Linux、macOS 使用统一 Finding 和 Repair Plan 协议。 +3. CLI、Web、Desktop、TUI 和外层 AI Agent 展示同一事实。 +4. 不同故障对象由不同 Repair Provider 处理。 +5. Doctor 始终只读。 +6. 修复操作可审查、可授权、可验证、尽量可回滚。 +7. 没有 AI 时仍能完成确定性诊断。 +8. 有 AI 时可以获得更清晰的解释和选项比较。 +9. 更新不得破坏活动任务或用户本地修改。 +10. 所有日志和 Support Bundle 必须脱敏。 + +### 4.2 技术目标 + +1. 建立统一 Maintenance Core。 +2. 建立 Platform Adapter:Windows、Linux、macOS。 +3. 建立 Installation Adapter:源码、托管运行时、Desktop、外部包管理器、容器。 +4. 建立独立 Rescue Runtime。 +5. 建立系统级 Maintenance API。 +6. 建立稳定 JSON Schema 和 Finding ID。 +7. 建立 Repair Action Registry。 +8. 建立 append-only Operation Journal。 + +--- + +## 5. 非目标 + +以下内容不属于首版范围: + +1. 不允许 AI 自由生成命令后直接执行。 +2. 不自动输入、迁移或重置用户凭据。 +3. 不自动执行 sudo、UAC 或 root 操作。 +4. 不自动 `git stash`、`merge`、`rebase`、`reset --hard`。 +5. 不自动强制终止活动实验或未知进程。 +6. 不自动修复任意第三方软件。 +7. 不承诺在磁盘完全损坏或 Rescue Runtime 也被删除时本机自我恢复。 +8. 不在首版支持所有 Linux 发行版和所有 CPU 架构。 +9. 不让浏览器直接检查浏览器所在设备;Web Doctor 检查的是 Argus 服务所在主机。 +10. 不把现有框架代码 self-maintenance 与主机环境 repair 混成一个无边界系统。 + +--- + +## 6. 核心设计原则 + +### 6.1 Local-first + +CLI 和 Rescue Runtime 必须能在 WebAPI 不工作时运行。 + +### 6.2 Deterministic-first + +底层检测和风险判断由确定性代码完成;AI 只能解释、比较和选择已注册动作。 + +### 6.3 Read-only Doctor + +`argus doctor` 不得修改文件、配置、进程、服务或网络状态。 + +### 6.4 Typed Repair + +所有修复必须是注册的、类型化的 RepairAction,禁止执行 Finding 中的任意文本命令。 + +### 6.5 Fail closed + +无法验证进程所有权、安装归属、计划新鲜度或权限时,必须拒绝修改。 + +### 6.6 One truth, many surfaces + +CLI、Web、Desktop 和 TUI 只负责展示和交互,Maintenance Core 是唯一诊断与修复规则来源。 + +### 6.7 Platform × Installation + +修复策略不仅取决于操作系统,还取决于安装方式。 + +### 6.8 Verify, not assume + +命令退出码为 0 不等于修复成功。每个动作必须定义验收检查。 + +--- + +## 7. 分层恢复模型 + +### 7.1 Level 0:命令不存在 + +表现: + +```text +'argus' is not recognized +command not found: argus +``` + +普通 `argus doctor` 无法运行。 + +需要独立的 Rescue Runtime: + +```text +Windows: argus-doctor.exe +Linux: argus-doctor +macOS: argus-doctor +``` + +Rescue Runtime 必须: + +- 独立于当前 Argus venv; +- 不依赖 Node.js; +- 不依赖 WebAPI; +- 不依赖 AI backend; +- 能读取安装清单; +- 能搜索已知安装目录; +- 能检查 PATH、Python、Node、Git 和安装完整性; +- 能输出稳定 JSON; +- 能恢复 launcher 或给出官方重装计划; +- 发行时具有签名或可验证哈希。 + +如果 Rescue Runtime 也不存在,外层 AI Terminal 必须使用官方、可校验的恢复包,不能静默执行来源不明的 `curl | sh` 或 PowerShell 脚本。 + +### 7.2 Level 1:Launcher 可运行,Core 损坏 + +典型问题: + +- `ModuleNotFoundError: argus_skill`; +- venv Python 不存在; +- editable install 指向已移动目录; +- release manifest 缺失; +- frontend bundle 缺失; +- Desktop bundled backend 缺失。 + +由 Bootstrap Doctor 检查安装和启动链路,不导入完整 Argus Core。 + +### 7.3 Level 2:Core 可运行,WebAPI 失败 + +典型问题: + +- FastAPI/uvicorn 无法加载; +- 端口被占用; +- API crash loop; +- ownership record 不一致; +- CLI/API Release 不一致。 + +CLI 直接调用本地 Maintenance Core,不通过 HTTP。 + +### 7.4 Level 3:API 可运行,UI 失败 + +典型问题: + +- Web 白屏; +- bundle 与 API protocol 不兼容; +- token 过期; +- Desktop preload/IPC 失败; +- 浏览器缓存旧资产。 + +通过系统级 Maintenance API 诊断。 + +### 7.5 Level 4:UI 正常,运行时异常 + +典型问题: + +- backend 未登录; +- provider/model 不匹配; +- daemon 未启动; +- stale lock; +- workspace lease 冲突; +- Session 路径失效; +- 项目状态损坏。 + +由 Full Doctor 处理。 + +--- + +## 8. 总体架构 + +```text +┌──────────────────────────────────────────────┐ +│ 外层 AI Terminal │ +│ Codex / Claude / Pi / Copilot / OpenCode │ +└──────────────────────┬───────────────────────┘ + │ 执行命令 / 读取 JSON + ▼ +┌──────────────────────────────────────────────┐ +│ Argus Rescue Runtime │ +│ Bootstrap Doctor / Launcher Repair │ +└──────────────────────┬───────────────────────┘ + │ Core 可用时扩展能力 + ▼ +┌──────────────────────────────────────────────┐ +│ Maintenance Core │ +│ │ +│ Collect → Diagnose → Rank → Plan │ +│ → Authorize → Execute → Verify → Rollback │ +│ → Journal │ +└───────────────┬────────────────┬─────────────┘ + │ │ + ▼ ▼ +┌──────────────────────┐ ┌────────────────────┐ +│ Platform Adapters │ │ Installation │ +│ Windows/Linux/macOS │ │ Adapters │ +└──────────────────────┘ └────────────────────┘ + │ │ + └────────┬───────┘ + ▼ +┌──────────────────────────────────────────────┐ +│ CLI / TUI / Web / Desktop / MCP / Agent │ +└──────────────────────────────────────────────┘ +``` + +--- + +## 9. 适配维度 + +### 9.1 平台维度 + +```text +windows +linux +macos +``` + +### 9.2 安装维度 + +```text +source_checkout +managed_runtime +desktop_bundle +external_package_manager +container +unknown +``` + +同一问题在不同安装模式下修复方式不同。 + +例如: + +- Homebrew 安装不得被 `pip install -e .` 覆盖; +- Desktop bundle 不得使用源码仓库更新流程; +- dirty source checkout 不得自动 fast-forward; +- container 中不得尝试修改只读基础镜像。 + +--- + +## 10. Platform Adapter 设计 + +概念接口: + +```text +PlatformAdapter +├─ platform_info() +├─ architecture() +├─ find_executables(name) +├─ inspect_process(pid) +├─ process_owner(pid) +├─ process_tree(pid) +├─ port_owner(host, port) +├─ inspect_path_environment() +├─ check_file_permissions(path) +├─ inspect_file_lock(path) +├─ atomic_replace(source, target) +├─ service_status(name) +├─ graceful_stop_owned_process(identity) +├─ open_url(url) +├─ elevation_requirement(action) +└─ support_capabilities() +``` + +不支持的能力返回明确状态: + +```text +NOT_APPLICABLE +UNSUPPORTED +MANUAL_REQUIRED +CHECK_UNAVAILABLE +``` + +`NOT_APPLICABLE` 不得被计为失败。 + +--- + +## 11. Installation Adapter 设计 + +概念接口: + +```text +InstallationAdapter +├─ detect() +├─ installation_identity() +├─ verify_integrity() +├─ check_update() +├─ stage_update() +├─ verify_candidate() +├─ switch_to_candidate() +├─ rollback() +├─ repair_launcher() +└─ owned_paths() +``` + +任何修改前必须确认当前安装由对应 Adapter 管理。 + +--- + +## 12. Doctor 检测对象 + +### 12.1 Host + +检查: + +- OS 和版本; +- CPU 架构; +- 用户权限; +- 可用磁盘空间; +- 临时目录; +- 时间和时区; +- 网络、DNS 和代理摘要; +- 文件系统能力; +- WSL、容器、SSH、远程桌面等运行环境。 + +### 12.2 Argus Installation + +检查: + +- 安装类型; +- 安装路径; +- 安装 ID; +- 当前版本; +- Release ID; +- Source Digest; +- 是否存在多个安装; +- 当前命令实际解析到哪个安装; +- Desktop、CLI、WebAPI 是否属于同一个 Release; +- 安装是否完整; +- 是否处于半升级状态。 + +### 12.3 Python Runtime + +检查: + +- Python 是否存在; +- 版本是否满足要求; +- 架构是否匹配; +- venv 是否存在; +- `sys.executable`; +- `argus_skill` 是否可导入; +- 必要依赖是否存在; +- editable install 是否指向移动或删除的源码目录; +- launcher 与 Python 是否来自不同环境。 + +### 12.4 Node/TUI/Web Runtime + +检查: + +- Node.js 是否存在; +- Node 版本; +- TUI bundle 是否存在; +- Web dist 是否存在; +- bundle Release ID; +- 前端与 API protocol 是否兼容; +- Node 架构是否与系统匹配。 + +### 12.5 CLI/TUI + +检查: + +- PATH 中有多少个 `argus`; +- 当前命令解析路径; +- shim 是否失效; +- Console 编码; +- TTY 能力; +- TUI 是否能启动; +- CLI 和后台 API ownership 是否一致。 + +### 12.6 WebAPI + +检查: + +- 监听端口; +- 端口占用者; +- API 进程身份; +- `/api/meta`; +- API schema/version; +- token 配置; +- ownership record; +- crash loop; +- Web 静态资产; +- loopback/LAN 安全设置。 + +### 12.7 Desktop + +检查: + +- Electron 应用版本; +- bundled backend 是否存在; +- backend 哈希; +- Desktop/backend Release ID; +- preload 和 IPC; +- bundled Web; +- owned backend PID; +- crash recovery 状态; +- 更新是否中断; +- 上一个可回滚版本。 + +### 12.8 AI Backend + +检查: + +- Codex、Claude、Copilot、Pi、OpenCode、Grok 是否存在; +- 版本; +- 登录状态; +- 认证目录; +- provider; +- model catalog; +- role model 是否存在; +- API route 是否配置; +- 可选网络连通性; +- 限流、配额或账户问题; +- 当前配置与实际可用 backend 是否冲突。 + +### 12.9 Daemon/Session/Project + +检查: + +- daemon 是否存活; +- PID 是否真实; +- PID 是否属于 Argus; +- daemon protocol; +- daemon 与 CLI Release 是否一致; +- stale lock; +- workspace lease; +- Session metadata; +- 项目路径; +- 状态 schema; +- backlog 是否需要执行器; +- active mission 是否允许重启。 + +### 12.10 Update + +检查: + +- upstream; +- ahead/behind/diverged; +- Git dirty; +- detached HEAD; +- 最低支持版本; +- 可用稳定版本; +- 安全更新; +- 状态迁移兼容性; +- 活动任务是否允许切换。 + +--- + +## 13. Finding 与根因排序 + +Doctor 不应只输出一组平级错误,而要区分根因和症状。 + +示例: + +```text +症状:daemon 没有运行 +根因:配置的 backend executable 不存在 +``` + +推荐修复必须优先指向根因,而不是反复建议启动 daemon。 + +### 13.1 Finding ID + +建议稳定编号: + +```text +ARGUS-HOST-001 +ARGUS-INSTALL-001 +ARGUS-PYTHON-001 +ARGUS-NODE-001 +ARGUS-PATH-001 +ARGUS-CLI-001 +ARGUS-WEB-001 +ARGUS-DESKTOP-001 +ARGUS-BACKEND-001 +ARGUS-DAEMON-001 +ARGUS-CONFIG-001 +ARGUS-STATE-001 +ARGUS-UPDATE-001 +ARGUS-PERMISSION-001 +``` + +同一问题在 CLI、API、Web 和 Desktop 中必须使用相同 Finding ID。 + +--- + +## 14. 不同对象的修复路由 + +修复路由键: + +```text +Finding Code ++ Target Kind ++ Platform ++ Installation Kind ++ Capability Matrix += Repair Provider + Repair Action +``` + +示例: + +| 问题 | Windows Desktop | Linux CLI | macOS Desktop | +|---|---|---|---| +| backend 文件缺失 | 恢复 bundled backend | 重建 venv/package | 恢复 `.app` bundle | +| daemon 不响应 | ownership 验证后重启 | systemd/user process | launchd/user process | +| PATH 缺失 | user PATH/shim | shell/XDG shim | Homebrew/shim | +| 版本过旧 | Desktop updater | package/source update | signed/notarized updater | +| 认证过期 | 官方登录 | 官方登录 | 官方登录 | +| 端口占用 | Windows PID identity | `/proc`/socket | `lsof`/process identity | +| 文件锁定 | 退出 owned process 后替换 | atomic rename | 退出 App Helper 后替换 | + +禁止存在: + +```text +run_shell(finding.fix) +``` + +允许的只能是注册动作,例如: + +```text +restart_owned_backend +remove_verified_stale_lock +reinstall_editable_package +repair_argus_launcher +persist_backend_selection +stage_source_update +restore_desktop_bundle +launch_official_login +``` + +--- + +## 15. 完整工作流程 + +### 15.1 Discovery + +收集: + +```text +HostSnapshot +InstallationSnapshot +RuntimeSnapshot +BackendSnapshot +ProcessSnapshot +ConfigSnapshot +UpdateSnapshot +``` + +Quick 模式默认不访问网络。 + +### 15.2 Diagnosis + +确定性规则引擎生成 Finding。 + +### 15.3 Root Cause Ranking + +构建 Finding 依赖关系,将根因排在症状之前。 + +### 15.4 Repair Planning + +生成 Repair Plan,包含: + +- Plan ID; +- schema version; +- snapshot hash; +- 有效期; +- 动作顺序; +- 依赖关系; +- 风险等级; +- 影响对象; +- 网络要求; +- 权限要求; +- 重启要求; +- 回滚方案; +- 验收方法。 + +### 15.5 Authorization + +按风险等级授权。 + +### 15.6 Execution + +执行前重新验证: + +- Finding 仍存在; +- Snapshot 未变化; +- 目标进程身份未变化; +- Plan 未过期; +- 活动任务允许操作; +- 当前用户具备所需权限。 + +### 15.7 Verification + +每个动作执行后运行专门验收,再运行相关 Doctor checks。 + +### 15.8 Rollback + +验收失败时: + +- 恢复配置备份; +- 切回旧 runtime; +- 恢复旧 launcher; +- 恢复旧 Desktop bundle; +- 恢复旧 daemon; +- 保留失败日志。 + +### 15.9 Journal + +所有动作写入 append-only Operation Journal。 + +--- + +## 16. 风险等级 + +### 16.1 SAFE + +可在 `argus repair --safe` 中执行: + +- 删除已验证死亡的 stale lock; +- 创建缺失的 Argus 状态目录; +- 重建非权威缓存; +- 清理 Argus 自己拥有的临时文件; +- 恢复可重新生成的索引。 + +### 16.2 CONSENT + +必须明确确认: + +- 修改持久化配置; +- 重装 Argus; +- fast-forward 更新; +- 重启 daemon; +- 重启 Desktop backend; +- 修改用户 PATH; +- 切换 backend; +- 状态 schema 迁移; +- 切换 runtime 版本。 + +### 16.3 MANUAL + +只能提供指导: + +- 输入凭据; +- 官方登录; +- sudo/UAC; +- Git merge/rebase; +- dirty/diverged branch; +- 删除未知进程; +- 强制中止活动实验; +- 修改系统范围配置。 + +AI 不得改变动作的风险等级。 + +--- + +## 17. AI Terminal / Recovery Advisor + +### 17.1 AI 是可选能力 + +无 AI 时: + +```bash +argus doctor --offline +``` + +必须仍能输出完整确定性报告。 + +### 17.2 Advisor 与 Execution Backend 分离 + +```text +Execution Backend +``` + +用于 Manager、Planner、Engineer、Reviewer。 + +```text +Recovery Advisor +``` + +用于解释 Doctor 报告。 + +即使 Argus 配置的 Codex backend 损坏,也可以临时使用 Claude、Pi 等已登录 CLI 解释报告。 + +建议参数: + +```bash +argus doctor --advisor auto +argus doctor --advisor none +argus doctor --advisor codex +argus doctor --advisor claude +argus doctor --advisor copilot +argus doctor --advisor pi +argus doctor --advisor opencode +argus doctor --advisor grok +``` + +### 17.3 AI 可以做什么 + +- 解释 Finding; +- 比较多个已注册修复方案; +- 识别 Finding 之间的可能联系; +- 生成适合用户阅读的步骤; +- 从 RepairAction Registry 中选择候选动作; +- 帮助外层 Agent 编排标准流程。 + +### 17.4 AI 禁止做什么 + +- 生成任意 Shell 后直接执行; +- 绕过确认; +- 降低风险等级; +- 读取或打印密钥; +- 自动 sudo/UAC; +- 自动强杀进程; +- 自动 Git merge/reset; +- 在 Doctor 阶段修改系统。 + +### 17.5 AI 输入脱敏 + +AI 只接收: + +- 平台和版本; +- 组件版本; +- Finding; +- 脱敏路径; +- 错误类别; +- RepairAction 列表; +- 非秘密配置摘要。 + +不得接收: + +- API Key; +- Token; +- Authorization Header; +- 完整环境变量; +- 完整 private log; +- backend auth 文件。 + +--- + +## 18. 外层 AI Agent 标准流程 + +当用户在 Codex、Claude、Pi 等终端里说“帮我检测并修复 Argus”时,Agent 应执行: + +```text +1. 定位 argus 或 argus-doctor +2. 运行 doctor --json +3. 必要时运行 doctor --deep --json +4. 向用户解释根因和风险 +5. 运行 repair --plan --json +6. 展示会修改的内容 +7. 等待授权 +8. apply 指定 Plan ID +9. doctor --verify +10. 报告结果和剩余人工步骤 +``` + +如果 `argus` 命令不存在: + +```text +1. 查询安装清单和已知目录 +2. 查找独立 argus-doctor +3. 如仍不存在,使用官方签名恢复包 +4. 先恢复 launcher +5. 再运行完整 Doctor +``` + +--- + +## 19. CLI 设计 + +### 19.1 Quick Doctor + +```bash +argus doctor +``` + +要求: + +- 只读; +- 无网络; +- 快速; +- 检查核心启动链路; +- 输出最高优先级根因。 + +### 19.2 Deep Doctor + +```bash +argus doctor --deep +``` + +增加: + +- 网络; +- backend auth; +- provider catalog; +- update check; +- API route reachability; +- Desktop/Web Release 一致性; +- 完整状态检查。 + +### 19.3 指定目标 + +```bash +argus doctor --target host +argus doctor --target install +argus doctor --target cli +argus doctor --target web +argus doctor --target desktop +argus doctor --target backend +argus doctor --target daemon +argus doctor --target project +argus doctor --target update +``` + +### 19.4 JSON + +```bash +argus doctor --json +``` + +供 AI Terminal、CI、Desktop、Web、自动化脚本和 Support Tool 使用。 + +### 19.5 Repair + +```bash +argus repair --plan +argus repair --plan --finding ARGUS-PATH-002 +argus repair --safe +argus repair --apply rp-20260813-001 +``` + +### 19.6 Verification + +```bash +argus doctor --verify +argus doctor --verify --operation op-xxx +``` + +### 19.7 建议退出码 + +保持与现有语义兼容: + +```text +0 无 blocking Finding +2 参数或用法错误 +3 存在 blocking Finding / not ready +4 Doctor 自身降级,部分检查不可用 +5 内部一致性错误 +``` + +Warning 可以在退出码 0 下报告,是否升级为非零由 CI 模式决定。 + +--- + +## 20. Web 设计 + +增加系统级 Health Center: + +```text +Overview +Host +Installation +CLI +Web/API +Desktop +AI Backends +Daemons +Projects +Updates +Repair History +``` + +每个 Finding 展示: + +- Finding ID; +- 严重度; +- 目标对象; +- 脱敏证据; +- 影响; +- 根因; +- 推荐修复; +- 风险等级; +- 是否需要重启; +- 是否可回滚。 + +Web 必须明确显示目标主机: + +```text +Target host: +Ubuntu 24.04 x86_64 +argus-server-03 +``` + +用户可能在 Windows/macOS 浏览器中修复 Linux 服务器。浏览器系统不是诊断目标。 + +### 20.1 API 正常时 + +通过系统级 API 工作。 + +### 20.2 API 异常时 + +普通浏览器无法直接检查服务端进程,这是物理限制。 + +恢复方式: + +1. 本机 CLI/Rescue Runtime; +2. 外层 AI Terminal; +3. Desktop Bootstrap Recovery; +4. 可选独立 Recovery Gateway。 + +### 20.3 Recovery Gateway(后续) + +若要求“Full WebAPI 崩溃时仍有 Web 恢复页”,需要稳定 Launcher: + +```text +Stable Launcher +├─ Recovery UI/API +└─ Full Argus Backend +``` + +Recovery Gateway 只监听 loopback。远程访问通过 SSH Tunnel 或严格配对。 + +--- + +## 21. Desktop 设计 + +Desktop 需要两个恢复面。 + +### 21.1 正常 Health Center + +由现有 Web Cockpit 提供,与浏览器 Web 共用。 + +### 21.2 Bootstrap Recovery Screen + +由 Electron main/preload 自己提供,不依赖 Python backend。 + +允许: + +- 验证 bundled backend; +- 检查 backend 是否缺失; +- 检查 Release ID; +- 检查端口; +- 检查进程 ownership; +- 重启自己拥有的 backend; +- 调用独立 Rescue Runtime; +- 恢复上一个 Desktop 版本; +- 启动签名更新器; +- 导出脱敏日志。 + +禁止: + +- 修改项目状态; +- 修改 AI 凭据; +- 任意执行 Shell; +- 终止非 Desktop 所有的进程; +- 自动修改 Git。 + +--- + +## 22. 平台细节 + +### 22.1 Windows + +重点检查: + +- `where.exe argus` 多安装; +- PATH 指向失效 venv; +- PowerShell/CMD/Git Bash PATH 差异; +- Python Launcher; +- npm global bin; +- CP936/UTF-8; +- UAC; +- Windows 进程树和 PID 复用; +- 文件锁; +- 端口占用; +- `%APPDATA%` / `%LOCALAPPDATA%`; +- NTFS ACL; +- 长路径; +- Defender 隔离; +- NSIS 半更新; +- x64/arm64 不一致。 + +Windows 更新应采用并排版本或专用 updater,不假设能覆盖正在运行的 `.exe`。 + +### 22.2 Linux + +重点检查: + +- systemd user service; +- 无 systemd 的进程模式; +- XDG 路径; +- owner/group/mode; +- sudo; +- bash/zsh/fish; +- 交互 Shell、systemd、cron PATH 不一致; +- glibc/musl; +- headless/SSH; +- `/tmp`; +- `ulimit`; +- 容器; +- AppImage/tar/deb/rpm; +- x64/arm64。 + +首版不自动调用 apt/dnf/pacman。 + +### 22.3 macOS + +重点检查: + +- Intel x64 / Apple Silicon arm64; +- Rosetta; +- `/usr/local/bin` / `/opt/homebrew/bin`; +- Gatekeeper; +- quarantine; +- codesign; +- notarization; +- `.app` bundle; +- launchd; +- Keychain; +- App Translocation; +- Electron Helper; +- GUI 与 Terminal PATH 不一致。 + +macOS Desktop 更新包必须签名并 notarize。 + +--- + +## 23. 配置与状态权威 + +所有入口必须共享同一个核心状态根目录: + +```text +ARGUS_SKILL_HOME +默认 ~/.argus-skill +``` + +禁止出现: + +```text +CLI 一份 backend 配置 +Web 一份 backend 配置 +Desktop 一份 backend 配置 +``` + +Desktop 可以单独保存窗口、主题、端口和 ownership record,但 backend、provider、model、daemon、projects、update policy 和 repair history 必须由 Core 统一管理。 + +--- + +## 24. Release Unit + +Desktop 发布时以下组件是不可拆分的 Release Unit: + +```text +Electron 主程序 +Python frozen backend +Web frontend dist +TUI bundle +API protocol version +release manifest +state schema compatibility +``` + +启动时校验: + +```text +desktop_release_id +backend_release_id +web_release_id +api_protocol_version +source_digest +``` + +不一致时进入恢复模式,不得静默继续。 + +--- + +## 25. 更新策略 + +### 25.1 Source Checkout + +```text +检测 Git 状态 +→ fetch +→ 检查 clean/ahead/behind/diverged +→ 隔离 worktree 准备候选版本 +→ 安装候选环境 +→ doctor + smoke tests +→ 等待任务边界 +→ drain 旧 daemon +→ 切换 +→ 验收 +→ 失败回滚 +``` + +禁止自动 stash、merge、rebase、reset。 + +### 25.2 Managed Runtime + +```text +~/.argus-skill/runtimes/ +├─ 0.1.1/ +├─ 0.1.2/ +└─ current → 0.1.2 +``` + +Windows 可使用 launcher 配置文件替代符号链接。 + +### 25.3 Desktop Bundle + +- Windows:NSIS/签名更新包; +- macOS:签名、notarized DMG/ZIP; +- Linux:首版 AppImage 或 tar.gz,后续 deb/rpm; +- 必须原生平台构建; +- 失败恢复旧版本。 + +### 25.4 External Package Manager + +若检测到 brew、pipx、apt 等外部管理方式,Argus 默认只输出正确更新建议,不绕过包管理器覆盖安装。 + +### 25.5 更新政策 + +```text +off +notify +safe +``` + +默认 `notify`。自动更新不应根据“安装时间久”单独触发,而要综合版本、兼容性、Release、Git 状态和活动任务。 + +--- + +## 26. 数据模型 + +### 26.1 Finding + +| 字段 | 类型 | 约束 | +|---|---|---| +| id | string | 单次 Finding 实例 ID | +| code | string | 稳定 Finding 编号 | +| scope | string | host/install/runtime/project 等 | +| target | TargetRef | 被诊断对象 | +| severity | enum | info/warning/error/blocker | +| status | enum | active/resolved/suppressed/unavailable | +| summary | string | 人类可读摘要 | +| detail | string | 脱敏详情 | +| evidence | Evidence[] | 结构化脱敏证据 | +| root_cause | boolean | 是否为根因 | +| caused_by | string[] | 上游 Finding ID | +| confidence | number | 0..1 | +| repair_action_ids | string[] | 已注册动作 | +| detected_at | timestamp | 检测时间 | +| fingerprint | string | 去重指纹 | + +### 26.2 RepairAction + +| 字段 | 类型 | 约束 | +|---|---|---| +| id | string | 稳定动作 ID | +| finding_code | string | 对应 Finding | +| target_kind | string | 目标类型 | +| platforms | string[] | 支持平台 | +| installation_kinds | string[] | 支持安装类型 | +| risk | enum | safe/consent/manual | +| description | string | 修改说明 | +| changes | Change[] | 预期变化 | +| requires_network | boolean | 网络要求 | +| requires_elevation | boolean | 权限要求 | +| requires_restart | boolean | 重启要求 | +| preconditions | Check[] | 前置条件 | +| verification | Check[] | 验收条件 | +| rollback | RollbackSpec | 回滚定义 | +| idempotent | boolean | 是否幂等 | + +### 26.3 RepairPlan + +| 字段 | 类型 | 约束 | +|---|---|---| +| plan_id | string | 唯一 ID | +| schema_version | integer | 协议版本 | +| created_at | timestamp | 创建时间 | +| expires_at | timestamp | 过期时间 | +| snapshot_hash | string | 环境快照哈希 | +| finding_ids | string[] | 处理对象 | +| actions | PlannedAction[] | 有序动作 | +| dependencies | Dependency[] | 动作依赖 | +| risk_summary | object | 风险摘要 | +| requires_confirmation | boolean | 是否需要确认 | + +### 26.4 RepairResult + +| 字段 | 类型 | 约束 | +|---|---|---| +| operation_id | string | 操作 ID | +| plan_id | string | 来源计划 | +| status | enum | running/succeeded/partial/failed/rolled_back | +| action_results | object[] | 每个动作结果 | +| verification | object | 总体验收 | +| rollback | object | 回滚结果 | +| remaining_findings | string[] | 剩余问题 | +| started_at | timestamp | 开始时间 | +| completed_at | timestamp | 完成时间 | + +--- + +## 27. API 契约 + +### 27.1 诊断 + +```http +GET /api/system/health +GET /api/system/health?mode=deep +GET /api/system/capabilities +``` + +### 27.2 Repair + +```http +POST /api/system/repair/plan +POST /api/system/repair/apply +POST /api/system/repair/cancel +GET /api/system/operations/{id} +GET /api/system/operations/{id}/events +``` + +### 27.3 Update + +```http +POST /api/system/update/check +POST /api/system/update/plan +POST /api/system/update/apply +``` + +### 27.4 Support + +```http +POST /api/system/support-bundle +``` + +### 27.5 安全要求 + +修改类 API 必须: + +- Bearer Token 鉴权; +- 默认只允许 loopback; +- 绑定 Plan ID; +- 绑定 snapshot hash; +- 绑定一次性确认; +- 防止重复执行; +- 记录 actor; +- 拒绝任意 Shell 文本。 + +未鉴权请求最多返回脱敏健康摘要,不得返回日志尾部、真实路径或进程详情。 + +--- + +## 28. Operation Journal + +建议路径概念: + +```text +/maintenance/operations/.jsonl +``` + +记录: + +```text +operation_id +plan_id +finding_id +actor +approval +before_snapshot_hash +actions +result +verification +rollback +timestamps +``` + +Journal append-only,默认不记录 Secret。 + +--- + +## 29. 功能要求 + +### FR-1 Bootstrap 可用性 + +Doctor **必须**在完整 Argus Core 不可用时提供 Bootstrap 诊断。 + +### FR-2 Doctor 只读 + +`argus doctor` **必须只读**,不得修改文件、配置、进程或服务。 + +### FR-3 平台识别 + +Doctor **必须**识别 Windows、Linux、macOS 和 CPU 架构。 + +### FR-4 安装识别 + +Doctor **必须**识别安装类型,禁止使用错误更新方式覆盖外部包管理器。 + +### FR-5 结构化 Finding + +所有诊断 **必须**返回结构化 Finding。 + +### FR-6 注册动作 + +所有修复 **必须**来自 RepairAction Registry。 + +### FR-7 多入口一致性 + +CLI、Web、Desktop 和 TUI **必须**使用相同 Finding ID 和 Schema。 + +### FR-8 AI 可选 + +无 AI 时 Doctor **必须**仍可完成确定性诊断。 + +### FR-9 计划新鲜度 + +执行修复前 **必须**验证 Plan 未过期且环境未改变。 + +### FR-10 验收 + +每个 RepairAction **必须**定义可机器验证的验收方式。 + +### FR-11 授权 + +CONSENT Action **必须**获得明确授权。 + +### FR-12 人工边界 + +涉及凭据、sudo、UAC、Git merge 的动作 **不得自动执行**。 + +### FR-13 Desktop 恢复 + +Desktop backend 无法启动时,Electron **必须**提供独立恢复页。 + +### FR-14 远程 Web + +远程 Web **不得默认拥有高风险主机修复权限**。 + +### FR-15 更新回滚 + +更新 **必须**支持 staged validation 和失败回滚。 + +### FR-16 所有权验证 + +系统 **不得**停止、替换或删除无法证明属于当前 Argus 安装的进程和文件。 + +### FR-17 兼容入口 + +现有 `argus --doctor` **必须**保留兼容。 + +--- + +## 30. 非功能要求 + +### NFR-1 性能 + +- Quick Doctor 本地检查目标:5 秒内完成; +- 每个外部命令有超时; +- Deep Doctor 默认总时间不超过 60 秒; +- 网络失败不得无限等待。 + +### NFR-2 安全 + +- 禁止 `shell=True`; +- 禁止拼接未验证命令; +- 不打印 Secret; +- 不上传原始日志; +- 不终止未知进程; +- 不修改未知安装。 + +### NFR-3 可靠性 + +- 单项检查异常变为 `CHECK_UNAVAILABLE`; +- Doctor 不因单项失败整体崩溃; +- 修复动作尽量幂等; +- 配置写入原子化; +- 防止 TOCTOU。 + +### NFR-4 兼容性 + +- 兼容现有 `argus --doctor`; +- JSON Schema 带版本; +- 新 CLI 能识别旧 API; +- 新 API 不误接管旧进程。 + +### NFR-5 可审计性 + +- 每个动作有记录; +- 日志脱敏; +- 支持 Support Bundle; +- 分享前提示用户复核。 + +### NFR-6 可测试性 + +- Platform Adapter 可注入 fake; +- 外部命令可注入 runner; +- 每个 Finding 规则可独立测试; +- 每个 RepairAction 有故障注入测试。 + +--- + +## 31. Edge Cases + +### EC-1 + +Rescue Runtime 本身缺失:只能通过官方签名恢复包恢复。 + +### EC-2 + +存在多个 Argus 安装:报告全部候选,不自动删除或接管。 + +### EC-3 + +端口占用者身份不可确认:不得终止,只提供更换端口或人工处理。 + +### EC-4 + +PID 已复用:必须使用 PID + 启动时间 + executable path 等联合身份。 + +### EC-5 + +网络离线:本地检查继续,网络 Finding 标记 unavailable,不误判配置错误。 + +### EC-6 + +backend auth probe 本身会消费模型额度:Quick Doctor 不执行该探测。 + +### EC-7 + +Plan 生成后环境变化:拒绝执行并重新规划。 + +### EC-8 + +修复进行中断电或进程崩溃:下次启动从 Journal 判断状态,进入 reconciliation。 + +### EC-9 + +更新候选通过单项检查但完整 smoke test 失败:回滚。 + +### EC-10 + +Web 浏览器与目标主机平台不同:UI 显示目标主机而非浏览器平台。 + +### EC-11 + +容器文件系统只读:修复动作降级为外部镜像/部署建议。 + +### EC-12 + +macOS App 被 quarantine:不得通过未解释的方式静默移除安全属性。 + +### EC-13 + +Windows 文件被 Defender 隔离:不得关闭 Defender,只报告和提供人工恢复路径。 + +### EC-14 + +dirty/diverged Git:禁止自动更新。 + +### EC-15 + +活动 mission:禁止强制切换运行时,除非用户明确请求中止且已有安全机制。 + +--- + +## 32. 验收标准 + +### AC-1:Core 无法导入 + +Given:`argus_skill` 无法 import +When:运行独立 Rescue Doctor +Then:报告 Python/package Finding,而不是崩溃。 +关联:FR-1、FR-5。 + +### AC-2:Doctor 只读 + +Given:任意可诊断故障 +When:运行 `argus doctor` +Then:文件、配置、进程和服务状态保持不变。 +关联:FR-2。 + +### AC-3:WebAPI 端口占用 + +Given:端口被未知进程占用 +When:运行 Doctor +Then:报告占用事实,不自动终止进程。 +关联:FR-11、FR-16。 + +### AC-4:Desktop backend 丢失 + +Given:Electron 可启动但 bundled backend 缺失 +When:打开 Desktop +Then:进入 Bootstrap Recovery Screen。 +关联:FR-13。 + +### AC-5:配置 backend 损坏 + +Given:Codex 未登录但 Claude 可用 +When:使用 `--advisor auto` +Then:可由 Claude 解释报告,但不得自动切换 Execution Backend。 +关联:FR-8、FR-11。 + +### AC-6:无 AI + +Given:没有任何 AI CLI +When:运行 Doctor +Then:确定性报告仍完整输出。 +关联:FR-8。 + +### AC-7:Plan 过期 + +Given:Plan 生成后 PATH 或进程变化 +When:执行 Plan +Then:拒绝执行并要求重新诊断。 +关联:FR-9。 + +### AC-8:活动任务 + +Given:daemon 正在执行 mission +When:计划要求更新 daemon +Then:等待任务边界或请求用户选择,不直接强杀。 +关联:FR-11、FR-15。 + +### AC-9:Dirty Git + +Given:源码仓库存在本地修改 +When:检查更新 +Then:阻止自动更新,不 stash/reset/merge。 +关联:FR-12、FR-15。 + +### AC-10:远程 Web + +Given:macOS 浏览器连接 Linux Argus +When:打开 Health Center +Then:明确显示修复目标是 Linux 主机。 +关联:FR-7、FR-14。 + +### AC-11:Secret Redaction + +Given:日志和环境包含 Token +When:生成 JSON 或 Support Bundle +Then:不包含原始 Secret。 +关联:NFR-2、NFR-5。 + +### AC-12:修复后验收失败 + +Given:RepairAction 命令成功但目标状态未恢复 +When:运行 verification +Then:操作判定失败并按定义回滚。 +关联:FR-10、FR-15。 + +### AC-13:多入口一致 + +Given:同一模拟环境故障 +When:分别通过 CLI JSON、API、Web、Desktop 查看 +Then:Finding ID、严重度、根因和 RepairAction 一致。 +关联:FR-7。 + +--- + +## 33. 测试矩阵 + +### 33.1 Tier 1 + +- Windows 10/11 x64; +- Ubuntu 22.04/24.04 x64; +- macOS Apple Silicon arm64。 + +### 33.2 Tier 2 + +- Windows arm64; +- macOS Intel x64; +- Debian; +- Linux arm64。 + +### 33.3 Tier 3 + +- Fedora; +- Arch; +- Alpine/musl; +- 其他桌面发行版。 + +### 33.4 测试类别 + +1. Schema Contract Tests; +2. Finding Rule Unit Tests; +3. Adapter Contract Tests; +4. RepairAction Preconditions; +5. RepairAction Idempotency; +6. Rollback Tests; +7. Secret Redaction Tests; +8. CLI/API/UI Consistency Tests; +9. Native Platform E2E; +10. Packaging Smoke Tests; +11. Update Failure Injection; +12. Crash/Reconciliation Tests。 + +--- + +## 34. 与 Windows 适配工作的边界 + +另一个终端当前负责 Windows 适配时,应继续聚焦: + +```text +Windows Process / Path / Port / File Lock +Daemon lifecycle +Desktop backend ownership +Windows packaging +Windows native tests +``` + +Doctor 系统负责: + +```text +调用结构化 Windows primitives +→ 生成 Finding +→ 选择 Windows RepairAction +→ 规划、授权、执行、验收和回滚 +``` + +Windows 适配最好提供: + +- 结构化进程身份; +- 端口占用者; +- 文件锁状态; +- PATH 候选; +- 权限状态; +- Desktop backend ownership; +- 安全启停能力; +- 默认只读的检查函数。 + +建议 Git 分支/工作树边界: + +```text +fix/windows-compat +feat/health-recovery +``` + +合并顺序: + +```text +main +→ merge fix/windows-compat +→ rebase health-recovery +→ 接入 WindowsPlatformAdapter +``` + +--- + +## 35. 推荐实施阶段 + +### Phase 0:批准设计规范 + +确认: + +- 命令; +- 数据模型; +- API; +- 风险政策; +- 平台边界; +- Rescue Runtime 范围。 + +### Phase 1:统一 Full Doctor Finding Schema + +在现有 Core 可运行前提下扩展只读诊断。 + +### Phase 2:独立 Rescue Runtime + +解决 Argus Core 无法进入的问题。 + +### Phase 3:Repair Plan 与 SAFE Action + +首批只实现无争议、安全、可验收的动作。 + +### Phase 4:Windows CLI/Web/Desktop + +接入 Windows primitives,验证完整架构。 + +### Phase 5:Linux CLI/Web + +优先支持 headless、SSH、systemd。 + +### Phase 6:macOS CLI/Web/Desktop + +支持 Apple Silicon、Rosetta、Gatekeeper 和签名应用。 + +### Phase 7:跨平台安全更新与回滚 + +完成 Desktop/Runtime staged update。 + +### Phase 8:AI Advisor 与外层 Agent 工具 + +在确定性规则和 Repair Registry 稳定后加入。 + +--- + +## 36. 上线门槛 + +首版进入 Preview 前必须满足: + +- Doctor 全路径只读证明; +- 无 Secret 泄漏; +- 无任意 Shell 执行; +- 无未知进程终止; +- Plan freshness 生效; +- 至少 Windows Tier 1 E2E 通过; +- CLI/API Finding 一致; +- 修复失败可回滚或明确标记不可回滚; +- Support Bundle 脱敏测试通过; +- 文档明确哪些动作仍需人工完成。 + +--- + +## 37. 待批准的关键决策 + +1. 正式命令是否采用 `argus doctor` 并保留 `argus --doctor`。 +2. Rescue Runtime 的实现形式与发行方式。 +3. 是否在首版提供 Recovery Gateway。 +4. 首批 SAFE RepairAction 清单。 +5. 远程 Web 是否永远禁止 CONSENT Action,还是允许加强认证后开启。 +6. Desktop 更新渠道和签名策略。 +7. Linux 首批支持的发行版与打包格式。 +8. macOS 首批是否同时支持 Intel 与 Apple Silicon。 +9. Repair Plan 默认有效期。 +10. Operation Journal 保留周期。 + +--- + +## 38. 最终设计结论 + +完整能力由两个系统组成: + +### Bootstrap Doctor + +在 Argus 主程序、Python 环境、WebAPI 或 Desktop backend 无法正常进入时仍然可以使用。 + +### Full Doctor & Recovery + +在 Core/API 可用时提供完整诊断、AI 辅助解释、修复规划、授权执行、验收、更新与回滚。 + +最终原则: + +> AI 可以帮助理解和编排,但底层环境事实必须由确定性检查得出;修复必须来自注册动作;不同平台、安装方式和目标对象必须路由到不同 Repair Provider;Doctor 本身永远只读。 diff --git a/frontend/core/src/release.generated.ts b/frontend/core/src/release.generated.ts index 18899686..05e4166a 100644 --- a/frontend/core/src/release.generated.ts +++ b/frontend/core/src/release.generated.ts @@ -1,3 +1,3 @@ // Generated by argus_skill.release_tools.generate_manifest. Do not edit. -export const RELEASE_ID = "0.1.1+a4de81c666ef26a3"; -export const RELEASE_SOURCE_DIGEST = "a4de81c666ef26a3645b67f679e18132546e5ec92003000d736e503810fa9700"; +export const RELEASE_ID = "0.1.1+87a2e4aae67e9583"; +export const RELEASE_SOURCE_DIGEST = "87a2e4aae67e95833d5b12a2140b54f90aae0eca54255b656f60d0d5d1826adb"; diff --git a/frontend/tui/bundle/argus.mjs b/frontend/tui/bundle/argus.mjs index 66690e32..0eeed6fb 100644 --- a/frontend/tui/bundle/argus.mjs +++ b/frontend/tui/bundle/argus.mjs @@ -1,50 +1,50 @@ import { createRequire as __argusCreateRequire } from 'node:module'; const require = __argusCreateRequire(import.meta.url); -var Ev=Object.create;var uE=Object.defineProperty;var mv=Object.getOwnPropertyDescriptor;var Iv=Object.getOwnPropertyNames;var hv=Object.getPrototypeOf,Cv=Object.prototype.hasOwnProperty;var Jr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var cE=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var nr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Bv=(e,t)=>{for(var r in t)uE(e,r,{get:t[r],enumerable:!0})},Dv=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Iv(t))!Cv.call(e,s)&&s!==r&&uE(e,s,{get:()=>t[s],enumerable:!(i=mv(t,s))||i.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?Ev(hv(e)):{},Dv(t||!e||!e.__esModule?uE(r,"default",{value:e,enumerable:!0}):r,e));var Qh=nr(Jt=>{"use strict";var jc=Symbol.for("react.element"),yv=Symbol.for("react.portal"),Qv=Symbol.for("react.fragment"),vv=Symbol.for("react.strict_mode"),wv=Symbol.for("react.profiler"),Sv=Symbol.for("react.provider"),_v=Symbol.for("react.context"),Rv=Symbol.for("react.forward_ref"),Fv=Symbol.for("react.suspense"),bv=Symbol.for("react.memo"),xv=Symbol.for("react.lazy"),gh=Symbol.iterator;function kv(e){return e===null||typeof e!="object"?null:(e=gh&&e[gh]||e["@@iterator"],typeof e=="function"?e:null)}var Eh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mh=Object.assign,Ih={};function ru(e,t,r){this.props=e,this.context=t,this.refs=Ih,this.updater=r||Eh}ru.prototype.isReactComponent={};ru.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ru.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hh(){}hh.prototype=ru.prototype;function gE(e,t,r){this.props=e,this.context=t,this.refs=Ih,this.updater=r||Eh}var dE=gE.prototype=new hh;dE.constructor=gE;mh(dE,ru.prototype);dE.isPureReactComponent=!0;var dh=Array.isArray,Ch=Object.prototype.hasOwnProperty,pE={current:null},Bh={key:!0,ref:!0,__self:!0,__source:!0};function Dh(e,t,r){var i,s={},a=null,u=null;if(t!=null)for(i in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(a=""+t.key),t)Ch.call(t,i)&&!Bh.hasOwnProperty(i)&&(s[i]=t[i]);var E=arguments.length-2;if(E===1)s.children=r;else if(1{"use strict";vh.exports=Qh()});var Oh=nr((ox,Gg)=>{Gg.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Gg.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Gg.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var BE=nr((ix,lu)=>{var jr=global.process,Ta=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Ta(jr)?(Lh=Jr("assert"),Au=Oh(),Mh=/^win/i.test(jr.platform),zc=Jr("events"),typeof zc!="function"&&(zc=zc.EventEmitter),jr.__signal_exit_emitter__?Pn=jr.__signal_exit_emitter__:(Pn=jr.__signal_exit_emitter__=new zc,Pn.count=0,Pn.emitted={}),Pn.infinite||(Pn.setMaxListeners(1/0),Pn.infinite=!0),lu.exports=function(e,t){if(!Ta(global.process))return function(){};Lh.equal(typeof e,"function","a callback must be provided for exit handler"),au===!1&&hE();var r="exit";t&&t.alwaysLast&&(r="afterexit");var i=function(){Pn.removeListener(r,e),Pn.listeners("exit").length===0&&Pn.listeners("afterexit").length===0&&Hg()};return Pn.on(r,e),i},Hg=function(){!au||!Ta(global.process)||(au=!1,Au.forEach(function(t){try{jr.removeListener(t,Wg[t])}catch{}}),jr.emit=Kg,jr.reallyExit=CE,Pn.count-=1)},lu.exports.unload=Hg,Oa=function(t,r,i){Pn.emitted[t]||(Pn.emitted[t]=!0,Pn.emit(t,r,i))},Wg={},Au.forEach(function(e){Wg[e]=function(){if(Ta(global.process)){var r=jr.listeners(e);r.length===Pn.count&&(Hg(),Oa("exit",null,e),Oa("afterexit",null,e),Mh&&e==="SIGHUP"&&(e="SIGINT"),jr.kill(jr.pid,e))}}}),lu.exports.signals=function(){return Au},au=!1,hE=function(){au||!Ta(global.process)||(au=!0,Pn.count+=1,Au=Au.filter(function(t){try{return jr.on(t,Wg[t]),!0}catch{return!1}}),jr.emit=Uh,jr.reallyExit=Ph)},lu.exports.load=hE,CE=jr.reallyExit,Ph=function(t){Ta(global.process)&&(jr.exitCode=t||0,Oa("exit",jr.exitCode,null),Oa("afterexit",jr.exitCode,null),CE.call(jr,jr.exitCode))},Kg=jr.emit,Uh=function(t,r){if(t==="exit"&&Ta(global.process)){r!==void 0&&(jr.exitCode=r);var i=Kg.apply(this,arguments);return Oa("exit",jr.exitCode,null),Oa("afterexit",jr.exitCode,null),i}else return Kg.apply(this,arguments)}):lu.exports=function(){return function(){}};var Lh,Au,Mh,zc,Pn,Hg,Oa,Wg,au,hE,CE,Ph,Kg,Uh});var oC=nr(Or=>{"use strict";function kE(e,t){var r=e.length;e.push(t);e:for(;0>>1,s=e[i];if(0>>1;ijg(E,r))Ijg(C,E)?(e[i]=C,e[I]=r,i=I):(e[i]=E,e[u]=r,i=u);else if(Ijg(C,r))e[i]=C,e[I]=r,i=I;else break e}}return t}function jg(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(qh=performance,Or.unstable_now=function(){return qh.now()}):(FE=Date,zh=FE.now(),Or.unstable_now=function(){return FE.now()-zh});var qh,FE,zh,Ds=[],jA=[],Qw=1,vi=null,uo=3,qg=!1,La=!1,Zc=!1,Zh=typeof setTimeout=="function"?setTimeout:null,eC=typeof clearTimeout=="function"?clearTimeout:null,$h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function NE(e){for(var t=Zi(jA);t!==null;){if(t.callback===null)Vg(jA);else if(t.startTime<=e)Vg(jA),t.sortIndex=t.expirationTime,kE(Ds,t);else break;t=Zi(jA)}}function TE(e){if(Zc=!1,NE(e),!La)if(Zi(Ds)!==null)La=!0,LE(OE);else{var t=Zi(jA);t!==null&&ME(TE,t.startTime-e)}}function OE(e,t){La=!1,Zc&&(Zc=!1,eC(ef),ef=-1),qg=!0;var r=uo;try{for(NE(t),vi=Zi(Ds);vi!==null&&(!(vi.expirationTime>t)||e&&!nC());){var i=vi.callback;if(typeof i=="function"){vi.callback=null,uo=vi.priorityLevel;var s=i(vi.expirationTime<=t);t=Or.unstable_now(),typeof s=="function"?vi.callback=s:vi===Zi(Ds)&&Vg(Ds),NE(t)}else Vg(Ds);vi=Zi(Ds)}if(vi!==null)var a=!0;else{var u=Zi(jA);u!==null&&ME(TE,u.startTime-t),a=!1}return a}finally{vi=null,uo=r,qg=!1}}var zg=!1,Yg=null,ef=-1,tC=5,rC=-1;function nC(){return!(Or.unstable_now()-rCe||125i?(e.sortIndex=r,kE(jA,e),Zi(Ds)===null&&e===Zi(jA)&&(Zc?(eC(ef),ef=-1):Zc=!0,ME(TE,r-i))):(e.sortIndex=s,kE(Ds,e),La||qg||(La=!0,LE(OE))),e};Or.unstable_shouldYield=nC;Or.unstable_wrapCallback=function(e){var t=uo;return function(){var r=uo;uo=t;try{return e.apply(this,arguments)}finally{uo=r}}}});var sC=nr((Ix,iC)=>{"use strict";iC.exports=oC()});var aC=nr((hx,AC)=>{AC.exports=function(t){var r={},i=jt(),s=sC(),a=Object.assign;function u(n){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+n,l=1;lq||p[b]!==h[q]){var ie=` -`+p[b].replace(" at new "," at ");return n.displayName&&ie.includes("")&&(ie=ie.replace("",n.displayName)),ie}while(1<=b&&0<=q);break}}}finally{ta=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?bi(n):""}var Wo=Object.prototype.hasOwnProperty,CA=[],xi=-1;function Ko(n){return{current:n}}function ar(n){0>xi||(n.current=CA[xi],CA[xi]=null,xi--)}function Wt(n,o){xi++,CA[xi]=n.current,n.current=o}var Sr={},Gr=Ko(Sr),Q=Ko(!1),_=Sr;function U(n,o){var l=n.type.contextTypes;if(!l)return Sr;var c=n.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===o)return c.__reactInternalMemoizedMaskedChildContext;var p={},h;for(h in l)p[h]=o[h];return c&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=o,n.__reactInternalMemoizedMaskedChildContext=p),p}function H(n){return n=n.childContextTypes,n!=null}function re(){ar(Q),ar(Gr)}function de(n,o,l){if(Gr.current!==Sr)throw Error(u(168));Wt(Gr,o),Wt(Q,l)}function Re(n,o,l){var c=n.stateNode;if(o=o.childContextTypes,typeof c.getChildContext!="function")return l;c=c.getChildContext();for(var p in c)if(!(p in o))throw Error(u(108,Le(n)||"Unknown",p));return a({},l,c)}function Fe(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Sr,_=Gr.current,Wt(Gr,n),Wt(Q,Q.current),!0}function We(n,o,l){var c=n.stateNode;if(!c)throw Error(u(169));l?(n=Re(n,o,_),c.__reactInternalMemoizedMergedChildContext=n,ar(Q),ar(Gr),Wt(Gr,n)):ar(Q),Wt(Q,l)}var xe=Math.clz32?Math.clz32:Vt,$e=Math.log,Bt=Math.LN2;function Vt(n){return n>>>=0,n===0?32:31-($e(n)/Bt|0)|0}var _r=64,qt=4194304;function mn(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Kn(n,o){var l=n.pendingLanes;if(l===0)return 0;var c=0,p=n.suspendedLanes,h=n.pingedLanes,b=l&268435455;if(b!==0){var q=b&~p;q!==0?c=mn(q):(h&=b,h!==0&&(c=mn(h)))}else b=l&~p,b!==0?c=mn(b):h!==0&&(c=mn(h));if(c===0)return 0;if(o!==0&&o!==c&&(o&p)===0&&(p=c&-c,h=o&-o,p>=h||p===16&&(h&4194240)!==0))return o;if((c&4)!==0&&(c|=l&16),o=n.entangledLanes,o!==0)for(n=n.entanglements,o&=c;0l;l++)o.push(n);return o}function DA(n,o,l){n.pendingLanes|=o,o!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,o=31-xe(o),n[o]=l}function Ip(n,o){var l=n.pendingLanes&~o;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=o,n.mutableReadLanes&=o,n.entangledLanes&=o,o=n.entanglements;var c=n.eventTimes;for(n=n.expirationTimes;0>=b,p-=b,ci=1<<32-xe(o)+p|l<Y?(j=P,P=null):j=P.sibling;var le=Ve(d,P,S[Y],x);if(le===null){P===null&&(P=j);break}n&&P&&le.alternate===null&&o(d,P),B=h(le,B,Y),T===null?w=le:T.sibling=le,T=le,P=j}if(Y===S.length)return l(d,P),Rr&&Ti(d,Y),w;if(P===null){for(;YY?(j=P,P=null):j=P.sibling;var Ue=Ve(d,P,le.value,x);if(Ue===null){P===null&&(P=j);break}n&&P&&Ue.alternate===null&&o(d,P),B=h(Ue,B,Y),T===null?w=Ue:T.sibling=Ue,T=Ue,P=j}if(le.done)return l(d,P),Rr&&Ti(d,Y),w;if(P===null){for(;!le.done;Y++,le=S.next())le=wt(d,le.value,x),le!==null&&(B=h(le,B,Y),T===null?w=le:T.sibling=le,T=le);return Rr&&Ti(d,Y),w}for(P=c(d,P);!le.done;Y++,le=S.next())le=A(P,d,Y,le.value,x),le!==null&&(n&&le.alternate!==null&&P.delete(le.key===null?Y:le.key),B=h(le,B,Y),T===null?w=le:T.sibling=le,T=le);return n&&P.forEach(function(st){return o(d,st)}),Rr&&Ti(d,Y),w}function m(d,B,S,x){if(typeof S=="object"&&S!==null&&S.type===y&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case I:e:{for(var w=S.key,T=B;T!==null;){if(T.key===w){if(w=S.type,w===y){if(T.tag===7){l(d,T.sibling),B=p(T,S.props.children),B.return=d,d=B;break e}}else if(T.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===X&&$o(w)===T.type){l(d,T.sibling),B=p(T,S.props),B.ref=gl(d,T,S),B.return=d,d=B;break e}l(d,T);break}else o(d,T);T=T.sibling}S.type===y?(B=ti(S.props.children,d.mode,x,S.key),B.return=d,d=B):(x=jl(S.type,S.key,S.props,null,d.mode,x),x.ref=gl(d,B,S),x.return=d,d=x)}return b(d);case C:e:{for(T=S.key;B!==null;){if(B.key===T)if(B.tag===4&&B.stateNode.containerInfo===S.containerInfo&&B.stateNode.implementation===S.implementation){l(d,B.sibling),B=p(B,S.children||[]),B.return=d,d=B;break e}else{l(d,B);break}else o(d,B);B=B.sibling}B=Ws(S,d.mode,x),B.return=d,d=B}return b(d);case X:return T=S._init,m(d,B,T(S._payload),x)}if(W(S))return f(d,B,S,x);if(he(S))return g(d,B,S,x);Yu(d,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,B!==null&&B.tag===6?(l(d,B.sibling),B=p(B,S),B.return=d,d=B):(l(d,B),B=bo(S,d.mode,x),B.return=d,d=B),b(d)):l(d,B)}return m}var Li=sa(!0),Aa=sa(!1),aa=Ko(null),la=null,fi=null,Eo=null;function rr(){Eo=fi=la=null}function Of(n,o,l){Qt?(Wt(aa,o._currentValue),o._currentValue=l):(Wt(aa,o._currentValue2),o._currentValue2=l)}function dl(n){var o=aa.current;ar(aa),Qt?n._currentValue=o:n._currentValue2=o}function Vu(n,o,l){for(;n!==null;){var c=n.alternate;if((n.childLanes&o)!==o?(n.childLanes|=o,c!==null&&(c.childLanes|=o)):c!==null&&(c.childLanes&o)!==o&&(c.childLanes|=o),n===l)break;n=n.return}}function io(n,o){la=n,Eo=fi=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&o)!==0&&(Vn=!0),n.firstContext=null)}function Ot(n){var o=Qt?n._currentValue:n._currentValue2;if(Eo!==n)if(n={context:n,memoizedValue:o,next:null},fi===null){if(la===null)throw Error(u(308));fi=n,la.dependencies={lanes:0,firstContext:n}}else fi=fi.next=n;return o}var gi=null;function _A(n){gi===null?gi=[n]:gi.push(n)}function RA(n,o,l,c){var p=o.interleaved;return p===null?(l.next=l,_A(o)):(l.next=p.next,p.next=l),o.interleaved=l,Mi(n,c)}function Mi(n,o){n.lanes|=o;var l=n.alternate;for(l!==null&&(l.lanes|=o),l=n,n=n.return;n!==null;)n.childLanes|=o,l=n.alternate,l!==null&&(l.childLanes|=o),l=n,n=n.return;return l.tag===3?l.stateNode:null}var ks=!1;function pl(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lf(n,o){n=n.updateQueue,o.updateQueue===n&&(o.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Pi(n,o){return{eventTime:n,lane:o,tag:0,payload:null,callback:null,next:null}}function jn(n,o,l){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Nt&2)!==0){var p=c.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),c.pending=o,Mi(n,l)}return p=c.interleaved,p===null?(o.next=o,_A(c)):(o.next=p.next,p.next=o),c.interleaved=o,Mi(n,l)}function ua(n,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194240)!==0)){var c=o.lanes;c&=n.pendingLanes,l|=c,o.lanes=l,kf(n,l)}}function Mf(n,o){var l=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var b={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};h===null?p=h=b:h=h.next=b,l=l.next}while(l!==null);h===null?p=h=o:h=h.next=o}else p=h=o;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:h,shared:c.shared,effects:c.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=o:n.next=o,l.lastBaseUpdate=o}function El(n,o,l,c){var p=n.updateQueue;ks=!1;var h=p.firstBaseUpdate,b=p.lastBaseUpdate,q=p.shared.pending;if(q!==null){p.shared.pending=null;var ie=q,be=ie.next;ie.next=null,b===null?h=be:b.next=be,b=ie;var ot=n.alternate;ot!==null&&(ot=ot.updateQueue,q=ot.lastBaseUpdate,q!==b&&(q===null?ot.firstBaseUpdate=be:q.next=be,ot.lastBaseUpdate=ie))}if(h!==null){var wt=p.baseState;b=0,ot=be=ie=null,q=h;do{var Ve=q.lane,A=q.eventTime;if((c&Ve)===Ve){ot!==null&&(ot=ot.next={eventTime:A,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var f=n,g=q;switch(Ve=o,A=l,g.tag){case 1:if(f=g.payload,typeof f=="function"){wt=f.call(A,wt,Ve);break e}wt=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=g.payload,Ve=typeof f=="function"?f.call(A,wt,Ve):f,Ve==null)break e;wt=a({},wt,Ve);break e;case 2:ks=!0}}q.callback!==null&&q.lane!==0&&(n.flags|=64,Ve=p.effects,Ve===null?p.effects=[q]:Ve.push(q))}else A={eventTime:A,lane:Ve,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ot===null?(be=ot=A,ie=wt):ot=ot.next=A,b|=Ve;if(q=q.next,q===null){if(q=p.shared.pending,q===null)break;Ve=q,q=Ve.next,Ve.next=null,p.lastBaseUpdate=Ve,p.shared.pending=null}}while(!0);if(ot===null&&(ie=wt),p.baseState=ie,p.firstBaseUpdate=be,p.lastBaseUpdate=ot,o=p.shared.interleaved,o!==null){p=o;do b|=p.lane,p=p.next;while(p!==o)}else h===null&&(p.shared.lanes=0);Gs|=b,n.lanes=b,n.memoizedState=wt}}function Pf(n,o,l){if(n=o.effects,o.effects=null,n!==null)for(o=0;ol?l:4,n(!0);var c=$u.transition;$u.transition={};try{n(!1),o()}finally{Tt=l,$u.transition=c}}function jf(){return Xo().memoizedState}function MI(n,o,l){var c=gs(n);if(l={lane:c,action:l,hasEagerState:!1,eagerState:null,next:null},Yf(n))Vf(o,l);else if(l=RA(n,o,l,c),l!==null){var p=Mr();$n(l,n,c,p),qf(l,o,c)}}function Np(n,o,l){var c=gs(n),p={lane:c,action:l,hasEagerState:!1,eagerState:null,next:null};if(Yf(n))Vf(o,p);else{var h=n.alternate;if(n.lanes===0&&(h===null||h.lanes===0)&&(h=o.lastRenderedReducer,h!==null))try{var b=o.lastRenderedState,q=h(b,l);if(p.hasEagerState=!0,p.eagerState=q,Vo(q,b)){var ie=o.interleaved;ie===null?(p.next=p,_A(o)):(p.next=ie.next,ie.next=p),o.interleaved=p;return}}catch{}l=RA(n,o,p,c),l!==null&&(p=Mr(),$n(l,n,c,p),qf(l,o,c))}}function Yf(n){var o=n.alternate;return n===Lr||o!==null&&o===Lr}function Vf(n,o){Ts=ml=!0;var l=n.pending;l===null?o.next=o:(o.next=l.next,l.next=o),n.pending=o}function qf(n,o,l){if((l&4194240)!==0){var c=o.lanes;c&=n.pendingLanes,l|=c,o.lanes=l,kf(n,l)}}var Bl={readContext:Ot,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},ic={readContext:Ot,useCallback:function(n,o){return Gi().memoizedState=[n,o===void 0?null:o],n},useContext:Ot,useEffect:Kf,useImperativeHandle:function(n,o,l){return l=l!=null?l.concat([n]):null,kA(4194308,4,Fp.bind(null,o,n),l)},useLayoutEffect:function(n,o){return kA(4194308,4,n,o)},useInsertionEffect:function(n,o){return kA(4,2,n,o)},useMemo:function(n,o){var l=Gi();return o=o===void 0?null:o,n=n(),l.memoizedState=[n,o],n},useReducer:function(n,o,l){var c=Gi();return o=l!==void 0?l(o):o,c.memoizedState=c.baseState=o,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:o},c.queue=n,n=n.dispatch=MI.bind(null,Lr,n),[c.memoizedState,n]},useRef:function(n){var o=Gi();return n={current:n},o.memoizedState=n},useState:Rp,useDebugValue:Jf,useDeferredValue:function(n){return Gi().memoizedState=n},useTransition:function(){var n=Rp(!1),o=n[0];return n=LI.bind(null,n[1]),Gi().memoizedState=n,[o,n]},useMutableSource:function(){},useSyncExternalStore:function(n,o,l){var c=Lr,p=Gi();if(Rr){if(l===void 0)throw Error(u(407));l=l()}else{if(l=o(),ln===null)throw Error(u(349));(fs&30)!==0||wp(c,o,l)}p.memoizedState=l;var h={value:l,getSnapshot:o};return p.queue=h,Kf(Hf.bind(null,c,h,n),[n]),c.flags|=2048,xA(9,Sp.bind(null,c,h,l,o),void 0,null),l},useId:function(){var n=Gi(),o=ln.identifierPrefix;if(Rr){var l=Ni,c=ci;l=(c&~(1<<32-xe(c)-1)).toString(32)+l,o=":"+o+"R"+l,l=Os++,0_c&&(o.flags|=128,c=!0,bt(p,!1),o.lanes=4194304)}else{if(!c)if(n=bA(h),n!==null){if(o.flags|=128,c=!0,n=n.updateQueue,n!==null&&(o.updateQueue=n,o.flags|=4),bt(p,!0),p.tail===null&&p.tailMode==="hidden"&&!h.alternate&&!Rr)return vn(o),null}else 2*fr()-p.renderingStartTime>_c&&l!==1073741824&&(o.flags|=128,c=!0,bt(p,!1),o.lanes=4194304);p.isBackwards?(h.sibling=o.child,o.child=h):(n=p.last,n!==null?n.sibling=h:o.child=h,p.last=h)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=fr(),o.sibling=null,n=Qr.current,Wt(Qr,c?n&1|2:n&1),o):(vn(o),null);case 22:case 23:return Hl(),l=o.memoizedState!==null,n!==null&&n.memoizedState!==null!==l&&(o.flags|=8192),l&&(o.mode&1)!==0?(xr&1073741824)!==0&&(vn(o),ut&&o.subtreeFlags&6&&(o.flags|=8192)):vn(o),null;case 24:return null;case 25:return null}throw Error(u(156,o.tag))}function Up(n,o){switch(ju(o),o.tag){case 1:return H(o.type)&&re(),n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 3:return FA(),ar(Q),ar(Gr),zu(),n=o.flags,(n&65536)!==0&&(n&128)===0?(o.flags=n&-65537|128,o):null;case 5:return di(o),null;case 13:if(ar(Qr),n=o.memoizedState,n!==null&&n.dehydrated!==null){if(o.alternate===null)throw Error(u(340));ia()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 19:return ar(Qr),null;case 4:return FA(),null;case 10:return dl(o.type._context),null;case 22:case 23:return Hl(),null;case 24:return null;default:return null}}var Bc=!1,On=!1,Gp=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Ms(n,o){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(c){kr(n,o,c)}else l.current=null}function Ca(n,o,l){try{l()}catch(c){kr(n,o,c)}}var ig=!1;function sg(n,o){for(et(n.containerInfo),nt=o;nt!==null;)if(n=nt,o=n.child,(n.subtreeFlags&1028)!==0&&o!==null)o.return=n,nt=o;else for(;nt!==null;){n=nt;try{var l=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(l!==null){var c=l.memoizedProps,p=l.memoizedState,h=n.stateNode,b=h.getSnapshotBeforeUpdate(n.elementType===n.type?c:Ro(n.type,c),p);h.__reactInternalSnapshotBeforeUpdate=b}break;case 3:ut&&po(n.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(q){kr(n,n.return,q)}if(o=n.sibling,o!==null){o.return=n.return,nt=o;break}nt=n.return}return l=ig,ig=!1,l}function Ba(n,o,l){var c=o.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&n)===n){var h=p.destroy;p.destroy=void 0,h!==void 0&&Ca(o,l,h)}p=p.next}while(p!==c)}}function wl(n,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&n)===n){var c=l.create;l.destroy=c()}l=l.next}while(l!==o)}}function Dc(n){var o=n.ref;if(o!==null){var l=n.stateNode;n.tag===5?n=ae(l):n=l,typeof o=="function"?o(n):o.current=n}}function Sl(n){var o=n.alternate;o!==null&&(n.alternate=null,Sl(o)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(o=n.stateNode,o!==null&&yr(o)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Ag(n){return n.tag===5||n.tag===3||n.tag===4}function ag(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ag(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function yc(n,o,l){var c=n.tag;if(c===5||c===6)n=n.stateNode,o?ai(l,n,o):Ss(l,n);else if(c!==4&&(n=n.child,n!==null))for(yc(n,o,l),n=n.sibling;n!==null;)yc(n,o,l),n=n.sibling}function Ps(n,o,l){var c=n.tag;if(c===5||c===6)n=n.stateNode,o?Ai(l,n,o):tn(l,n);else if(c!==4&&(n=n.child,n!==null))for(Ps(n,o,l),n=n.sibling;n!==null;)Ps(n,o,l),n=n.sibling}var an=null,mo=!1;function Ln(n,o,l){for(l=l.child;l!==null;)Qc(n,o,l),l=l.sibling}function Qc(n,o,l){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(sl,l)}catch{}switch(l.tag){case 5:On||Ms(l,o);case 6:if(ut){var c=an,p=mo;an=null,Ln(n,o,l),an=c,mo=p,an!==null&&(mo?kn(an,l.stateNode):Go(an,l.stateNode))}else Ln(n,o,l);break;case 18:ut&&an!==null&&(mo?Uu(an,l.stateNode):bf(an,l.stateNode));break;case 4:ut?(c=an,p=mo,an=l.stateNode.containerInfo,mo=!0,Ln(n,o,l),an=c,mo=p):(mt&&(c=l.stateNode.containerInfo,p=ui(c),EA(c,p)),Ln(n,o,l));break;case 0:case 11:case 14:case 15:if(!On&&(c=l.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){p=c=c.next;do{var h=p,b=h.destroy;h=h.tag,b!==void 0&&((h&2)!==0||(h&4)!==0)&&Ca(l,o,b),p=p.next}while(p!==c)}Ln(n,o,l);break;case 1:if(!On&&(Ms(l,o),c=l.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=l.memoizedProps,c.state=l.memoizedState,c.componentWillUnmount()}catch(q){kr(l,o,q)}Ln(n,o,l);break;case 21:Ln(n,o,l);break;case 22:l.mode&1?(On=(c=On)||l.memoizedState!==null,Ln(n,o,l),On=c):Ln(n,o,l);break;default:Ln(n,o,l)}}function _l(n){var o=n.updateQueue;if(o!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new Gp),o.forEach(function(c){var p=bc.bind(null,n,c);l.has(c)||(l.add(c),c.then(p,p))})}}function Fo(n,o){var l=o.deletions;if(l!==null)for(var c=0;c";case Da:return":has("+(Sc(n)||"")+")";case MA:return'[role="'+n.value+'"]';case bl:return'"'+n.value+'"';case Fl:return'[data-testname="'+n.value+'"]';default:throw Error(u(365))}}function gg(n,o){var l=[];n=[n,0];for(var c=0;cp&&(p=b),c&=~h}if(c=p,c=fr()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*dg(c/1960))-c,10n?16:n,Yi===null)var c=!1;else{if(n=Yi,Yi=null,Ll=0,(Nt&6)!==0)throw Error(u(331));var p=Nt;for(Nt|=4,nt=n.current;nt!==null;){var h=nt,b=h.child;if((nt.flags&16)!==0){var q=h.deletions;if(q!==null){for(var ie=0;iefr()-PA?Hs(n,0):Nl|=l),fn(n,o)}function Ig(n,o){o===0&&((n.mode&1)===0?o=1:(o=qt,qt<<=1,(qt&130023424)===0&&(qt=4194304)));var l=Mr();n=Mi(n,o),n!==null&&(DA(n,o,l),fn(n,l))}function Yp(n){var o=n.memoizedState,l=0;o!==null&&(l=o.retryLane),Ig(n,l)}function bc(n,o){var l=0;switch(n.tag){case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=n.stateNode;break;default:throw Error(u(314))}c!==null&&c.delete(o),Ig(n,l)}var hg;hg=function(n,o,l){if(n!==null)if(n.memoizedProps!==o.pendingProps||Q.current)Vn=!0;else{if((n.lanes&l)===0&&(o.flags&128)===0)return Vn=!1,Pp(n,o,l);Vn=(n.flags&131072)!==0}else Vn=!1,Rr&&(o.flags&1048576)!==0&&Ju(o,ul,o.index);switch(o.lanes=0,o.tag){case 2:var c=o.type;ma(n,o),n=o.pendingProps;var p=U(o,Gr.current);io(o,l),p=da(null,o,c,n,p,l);var h=Gf();return o.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,H(c)?(h=!0,Fe(o)):h=!1,o.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,pl(o),p.updater=ac,o.stateNode=p,p._reactInternals=o,zf(o,c,n,l),o=Ea(null,o,c,!0,h,l)):(o.tag=0,Rr&&h&&xs(o),Tn(null,o,p,l),o=o.child),o;case 16:c=o.elementType;e:{switch(ma(n,o),n=o.pendingProps,p=c._init,c=p(c._payload),o.type=c,p=o.tag=Bg(c),n=Ro(c,n),p){case 0:o=mc(null,o,c,n,l);break e;case 1:o=OA(null,o,c,n,l);break e;case 11:o=gc(null,o,c,n,l);break e;case 14:o=dc(null,o,c,Ro(c.type,n),l);break e}throw Error(u(306,c,""))}return o;case 0:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),mc(n,o,c,p,l);case 1:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),OA(n,o,c,p,l);case 3:e:{if(Hi(o),n===null)throw Error(u(387));c=o.pendingProps,h=o.memoizedState,p=h.element,Lf(n,o),El(o,c,null,l);var b=o.memoizedState;if(c=b.element,vt&&h.isDehydrated)if(h={element:c,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},o.updateQueue.baseState=h,o.memoizedState=h,o.flags&256){p=pa(Error(u(423)),o),o=yl(n,o,c,l,p);break e}else if(c!==p){p=pa(Error(u(424)),o),o=yl(n,o,c,l,p);break e}else for(vt&&(So=dr(o.stateNode.containerInfo),oo=o,Rr=!0,zo=null,wA=!1),l=Aa(o,null,c,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ia(),c===p){o=Wi(n,o,l);break e}Tn(n,o,c,l)}o=o.child}return o;case 5:return Uf(o),n===null&&SA(o),c=o.type,p=o.pendingProps,h=n!==null?n.memoizedProps:null,b=p.children,V(c,p)?b=null:h!==null&&V(c,h)&&(o.flags|=32),Zf(n,o),Tn(n,o,b,l),o.child;case 6:return n===null&&SA(o),null;case 13:return Ql(n,o,l);case 4:return qu(o,o.stateNode.containerInfo),c=o.pendingProps,n===null?o.child=Li(o,null,c,l):Tn(n,o,c,l),o.child;case 11:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),gc(n,o,c,p,l);case 7:return Tn(n,o,o.pendingProps,l),o.child;case 8:return Tn(n,o,o.pendingProps.children,l),o.child;case 12:return Tn(n,o,o.pendingProps.children,l),o.child;case 10:e:{if(c=o.type._context,p=o.pendingProps,h=o.memoizedProps,b=p.value,Of(o,c,b),h!==null)if(Vo(h.value,b)){if(h.children===p.children&&!Q.current){o=Wi(n,o,l);break e}}else for(h=o.child,h!==null&&(h.return=o);h!==null;){var q=h.dependencies;if(q!==null){b=h.child;for(var ie=q.firstContext;ie!==null;){if(ie.context===c){if(h.tag===1){ie=Pi(-1,l&-l),ie.tag=2;var be=h.updateQueue;if(be!==null){be=be.shared;var ot=be.pending;ot===null?ie.next=ie:(ie.next=ot.next,ot.next=ie),be.pending=ie}}h.lanes|=l,ie=h.alternate,ie!==null&&(ie.lanes|=l),Vu(h.return,l,o),q.lanes|=l;break}ie=ie.next}}else if(h.tag===10)b=h.type===o.type?null:h.child;else if(h.tag===18){if(b=h.return,b===null)throw Error(u(341));b.lanes|=l,q=b.alternate,q!==null&&(q.lanes|=l),Vu(b,l,o),b=h.sibling}else b=h.child;if(b!==null)b.return=h;else for(b=h;b!==null;){if(b===o){b=null;break}if(h=b.sibling,h!==null){h.return=b.return,b=h;break}b=b.return}h=b}Tn(n,o,p.children,l),o=o.child}return o;case 9:return p=o.type,c=o.pendingProps.children,io(o,l),p=Ot(p),c=c(p),o.flags|=1,Tn(n,o,c,l),o.child;case 14:return c=o.type,p=Ro(c,o.pendingProps),p=Ro(c.type,p),dc(n,o,c,p,l);case 15:return pc(n,o,o.type,o.pendingProps,l);case 17:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),ma(n,o),o.tag=1,H(c)?(n=!0,Fe(o)):n=!1,io(o,l),Lp(o,c,p),zf(o,c,p,l),Ea(null,o,c,!0,n,l);case 19:return rg(n,o,l);case 22:return Ec(n,o,l)}throw Error(u(156,o.tag))};function Cg(n,o){return jo(n,o)}function Vp(n,o,l,c){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Io(n,o,l,c){return new Vp(n,o,l,c)}function ei(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Bg(n){if(typeof n=="function")return ei(n)?1:0;if(n!=null){if(n=n.$$typeof,n===ne)return 11;if(n===J)return 14}return 2}function ho(n,o){var l=n.alternate;return l===null?(l=Io(n.tag,o,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=o,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,o=n.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function jl(n,o,l,c,p,h){var b=2;if(c=n,typeof n=="function")ei(n)&&(b=1);else if(typeof n=="string")b=5;else e:switch(n){case y:return ti(l.children,p,h,o);case D:b=8,p|=8;break;case R:return n=Io(12,l,o,p|2),n.elementType=R,n.lanes=h,n;case oe:return n=Io(13,l,o,p),n.elementType=oe,n.lanes=h,n;case $:return n=Io(19,l,o,p),n.elementType=$,n.lanes=h,n;case Z:return Es(l,p,h,o);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case O:b=10;break e;case G:b=9;break e;case ne:b=11;break e;case J:b=14;break e;case X:b=16,c=null;break e}throw Error(u(130,n==null?n:typeof n,""))}return o=Io(b,l,o,p),o.elementType=n,o.type=c,o.lanes=h,o}function ti(n,o,l,c){return n=Io(7,n,c,o),n.lanes=l,n}function Es(n,o,l,c){return n=Io(22,n,c,o),n.elementType=Z,n.lanes=l,n.stateNode={isHidden:!1},n}function bo(n,o,l){return n=Io(6,n,null,o),n.lanes=l,n}function Ws(n,o,l){return o=Io(4,n.children!==null?n.children:[],n.key,o),o.lanes=l,o.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},o}function qp(n,o,l,c,p){this.tag=o,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ye,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xf(0),this.expirationTimes=xf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xf(0),this.identifierPrefix=c,this.onRecoverableError=p,vt&&(this.mutableSourceEagerHydrationData=null)}function Dg(n,o,l,c,p,h,b,q,ie){return n=new qp(n,o,l,q,ie),o===1?(o=1,h===!0&&(o|=8)):o=0,h=Io(3,null,null,o),n.current=h,h.stateNode=n,h.memoizedState={element:c,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},pl(h),n}function yg(n){if(!n)return Sr;n=n._reactInternals;e:{if(pe(n)!==n||n.tag!==1)throw Error(u(170));var o=n;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(H(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(u(171))}if(n.tag===1){var l=n.type;if(H(l))return Re(n,l,o)}return o}function xc(n){var o=n._reactInternals;if(o===void 0)throw typeof n.render=="function"?Error(u(188)):(n=Object.keys(n).join(","),Error(u(268,n)));return n=ve(o),n===null?null:n.stateNode}function Ks(n,o){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l=be&&h>=wt&&p<=ot&&b<=Ve){n.splice(o,1);break}else if(c!==be||l.width!==ie.width||Veb){if(!(h!==wt||l.height!==ie.height||otp)){be>c&&(ie.width+=be-c,ie.x=c),oth&&(ie.height+=wt-h,ie.y=h),Vel&&(l=b)),btypeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var gE=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var nr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},ww=(e,t)=>{for(var r in t)fE(e,r,{get:t[r],enumerable:!0})},vw=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dw(t))!Qw.call(e,s)&&s!==r&&fE(e,s,{get:()=>t[s],enumerable:!(i=Bw(t,s))||i.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?Cw(yw(e)):{},vw(t||!e||!e.__esModule?fE(r,"default",{value:e,enumerable:!0}):r,e));var _h=nr(Jt=>{"use strict";var Yc=Symbol.for("react.element"),Sw=Symbol.for("react.portal"),_w=Symbol.for("react.fragment"),Rw=Symbol.for("react.strict_mode"),bw=Symbol.for("react.profiler"),Fw=Symbol.for("react.provider"),xw=Symbol.for("react.context"),kw=Symbol.for("react.forward_ref"),Nw=Symbol.for("react.suspense"),Tw=Symbol.for("react.memo"),Ow=Symbol.for("react.lazy"),mh=Symbol.iterator;function Lw(e){return e===null||typeof e!="object"?null:(e=mh&&e[mh]||e["@@iterator"],typeof e=="function"?e:null)}var Ch={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bh=Object.assign,Dh={};function nu(e,t,r){this.props=e,this.context=t,this.refs=Dh,this.updater=r||Ch}nu.prototype.isReactComponent={};nu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};nu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function yh(){}yh.prototype=nu.prototype;function pE(e,t,r){this.props=e,this.context=t,this.refs=Dh,this.updater=r||Ch}var EE=pE.prototype=new yh;EE.constructor=pE;Bh(EE,nu.prototype);EE.isPureReactComponent=!0;var Ih=Array.isArray,Qh=Object.prototype.hasOwnProperty,mE={current:null},wh={key:!0,ref:!0,__self:!0,__source:!0};function vh(e,t,r){var i,s={},a=null,u=null;if(t!=null)for(i in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(a=""+t.key),t)Qh.call(t,i)&&!wh.hasOwnProperty(i)&&(s[i]=t[i]);var E=arguments.length-2;if(E===1)s.children=r;else if(1{"use strict";Rh.exports=_h()});var Uh=nr((fx,Wg)=>{Wg.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Wg.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Wg.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var yE=nr((gx,uu)=>{var jr=global.process,Oa=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Oa(jr)?(Gh=Jr("assert"),au=Uh(),Hh=/^win/i.test(jr.platform),$c=Jr("events"),typeof $c!="function"&&($c=$c.EventEmitter),jr.__signal_exit_emitter__?Pn=jr.__signal_exit_emitter__:(Pn=jr.__signal_exit_emitter__=new $c,Pn.count=0,Pn.emitted={}),Pn.infinite||(Pn.setMaxListeners(1/0),Pn.infinite=!0),uu.exports=function(e,t){if(!Oa(global.process))return function(){};Gh.equal(typeof e,"function","a callback must be provided for exit handler"),lu===!1&&BE();var r="exit";t&&t.alwaysLast&&(r="afterexit");var i=function(){Pn.removeListener(r,e),Pn.listeners("exit").length===0&&Pn.listeners("afterexit").length===0&&Kg()};return Pn.on(r,e),i},Kg=function(){!lu||!Oa(global.process)||(lu=!1,au.forEach(function(t){try{jr.removeListener(t,Jg[t])}catch{}}),jr.emit=jg,jr.reallyExit=DE,Pn.count-=1)},uu.exports.unload=Kg,La=function(t,r,i){Pn.emitted[t]||(Pn.emitted[t]=!0,Pn.emit(t,r,i))},Jg={},au.forEach(function(e){Jg[e]=function(){if(Oa(global.process)){var r=jr.listeners(e);r.length===Pn.count&&(Kg(),La("exit",null,e),La("afterexit",null,e),Hh&&e==="SIGHUP"&&(e="SIGINT"),jr.kill(jr.pid,e))}}}),uu.exports.signals=function(){return au},lu=!1,BE=function(){lu||!Oa(global.process)||(lu=!0,Pn.count+=1,au=au.filter(function(t){try{return jr.on(t,Jg[t]),!0}catch{return!1}}),jr.emit=Kh,jr.reallyExit=Wh)},uu.exports.load=BE,DE=jr.reallyExit,Wh=function(t){Oa(global.process)&&(jr.exitCode=t||0,La("exit",jr.exitCode,null),La("afterexit",jr.exitCode,null),DE.call(jr,jr.exitCode))},jg=jr.emit,Kh=function(t,r){if(t==="exit"&&Oa(global.process)){r!==void 0&&(jr.exitCode=r);var i=jg.apply(this,arguments);return La("exit",jr.exitCode,null),La("afterexit",jr.exitCode,null),i}else return jg.apply(this,arguments)}):uu.exports=function(){return function(){}};var Gh,au,Hh,$c,Pn,Kg,La,Jg,lu,BE,DE,Wh,jg,Kh});var aC=nr(Or=>{"use strict";function TE(e,t){var r=e.length;e.push(t);e:for(;0>>1,s=e[i];if(0>>1;iVg(E,r))IVg(h,E)?(e[i]=h,e[I]=r,i=I):(e[i]=E,e[u]=r,i=u);else if(IVg(h,r))e[i]=h,e[I]=r,i=I;else break e}}return t}function Vg(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Zh=performance,Or.unstable_now=function(){return Zh.now()}):(xE=Date,eC=xE.now(),Or.unstable_now=function(){return xE.now()-eC});var Zh,xE,eC,Ds=[],jA=[],_v=1,wi=null,uo=3,$g=!1,Ma=!1,ef=!1,nC=typeof setTimeout=="function"?setTimeout:null,oC=typeof clearTimeout=="function"?clearTimeout:null,tC=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function OE(e){for(var t=Zi(jA);t!==null;){if(t.callback===null)zg(jA);else if(t.startTime<=e)zg(jA),t.sortIndex=t.expirationTime,TE(Ds,t);else break;t=Zi(jA)}}function LE(e){if(ef=!1,OE(e),!Ma)if(Zi(Ds)!==null)Ma=!0,PE(ME);else{var t=Zi(jA);t!==null&&UE(LE,t.startTime-e)}}function ME(e,t){Ma=!1,ef&&(ef=!1,oC(tf),tf=-1),$g=!0;var r=uo;try{for(OE(t),wi=Zi(Ds);wi!==null&&(!(wi.expirationTime>t)||e&&!AC());){var i=wi.callback;if(typeof i=="function"){wi.callback=null,uo=wi.priorityLevel;var s=i(wi.expirationTime<=t);t=Or.unstable_now(),typeof s=="function"?wi.callback=s:wi===Zi(Ds)&&zg(Ds),OE(t)}else zg(Ds);wi=Zi(Ds)}if(wi!==null)var a=!0;else{var u=Zi(jA);u!==null&&UE(LE,u.startTime-t),a=!1}return a}finally{wi=null,uo=r,$g=!1}}var Xg=!1,qg=null,tf=-1,iC=5,sC=-1;function AC(){return!(Or.unstable_now()-sCe||125i?(e.sortIndex=r,TE(jA,e),Zi(Ds)===null&&e===Zi(jA)&&(ef?(oC(tf),tf=-1):ef=!0,UE(LE,r-i))):(e.sortIndex=s,TE(Ds,e),Ma||$g||(Ma=!0,PE(ME))),e};Or.unstable_shouldYield=AC;Or.unstable_wrapCallback=function(e){var t=uo;return function(){var r=uo;uo=t;try{return e.apply(this,arguments)}finally{uo=r}}}});var uC=nr((vx,lC)=>{"use strict";lC.exports=aC()});var fC=nr((Sx,cC)=>{cC.exports=function(t){var r={},i=jt(),s=uC(),a=Object.assign;function u(n){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+n,l=1;lV||p[F]!==C[V]){var ae=` +`+p[F].replace(" at new "," at ");return n.displayName&&ae.includes("")&&(ae=ae.replace("",n.displayName)),ae}while(1<=F&&0<=V);break}}}finally{ra=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?Fi(n):""}var Wo=Object.prototype.hasOwnProperty,CA=[],xi=-1;function Ko(n){return{current:n}}function ar(n){0>xi||(n.current=CA[xi],CA[xi]=null,xi--)}function Wt(n,o){xi++,CA[xi]=n.current,n.current=o}var Sr={},Gr=Ko(Sr),Q=Ko(!1),_=Sr;function U(n,o){var l=n.type.contextTypes;if(!l)return Sr;var c=n.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===o)return c.__reactInternalMemoizedMaskedChildContext;var p={},C;for(C in l)p[C]=o[C];return c&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=o,n.__reactInternalMemoizedMaskedChildContext=p),p}function W(n){return n=n.childContextTypes,n!=null}function re(){ar(Q),ar(Gr)}function pe(n,o,l){if(Gr.current!==Sr)throw Error(u(168));Wt(Gr,o),Wt(Q,l)}function _e(n,o,l){var c=n.stateNode;if(o=o.childContextTypes,typeof c.getChildContext!="function")return l;c=c.getChildContext();for(var p in c)if(!(p in o))throw Error(u(108,xe(n)||"Unknown",p));return a({},l,c)}function Re(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Sr,_=Gr.current,Wt(Gr,n),Wt(Q,Q.current),!0}function He(n,o,l){var c=n.stateNode;if(!c)throw Error(u(169));l?(n=_e(n,o,_),c.__reactInternalMemoizedMergedChildContext=n,ar(Q),ar(Gr),Wt(Gr,n)):ar(Q),Wt(Q,l)}var Fe=Math.clz32?Math.clz32:Vt,$e=Math.log,Bt=Math.LN2;function Vt(n){return n>>>=0,n===0?32:31-($e(n)/Bt|0)|0}var _r=64,qt=4194304;function mn(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Kn(n,o){var l=n.pendingLanes;if(l===0)return 0;var c=0,p=n.suspendedLanes,C=n.pingedLanes,F=l&268435455;if(F!==0){var V=F&~p;V!==0?c=mn(V):(C&=F,C!==0&&(c=mn(C)))}else F=l&~p,F!==0?c=mn(F):C!==0&&(c=mn(C));if(c===0)return 0;if(o!==0&&o!==c&&(o&p)===0&&(p=c&-c,C=o&-o,p>=C||p===16&&(C&4194240)!==0))return o;if((c&4)!==0&&(c|=l&16),o=n.entangledLanes,o!==0)for(n=n.entanglements,o&=c;0l;l++)o.push(n);return o}function DA(n,o,l){n.pendingLanes|=o,o!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,o=31-Fe(o),n[o]=l}function Cp(n,o){var l=n.pendingLanes&~o;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=o,n.mutableReadLanes&=o,n.entangledLanes&=o,o=n.entanglements;var c=n.eventTimes;for(n=n.expirationTimes;0>=F,p-=F,ci=1<<32-Fe(o)+p|l<Y?(j=P,P=null):j=P.sibling;var ue=Ve(d,P,S[Y],x);if(ue===null){P===null&&(P=j);break}n&&P&&ue.alternate===null&&o(d,P),B=C(ue,B,Y),T===null?v=ue:T.sibling=ue,T=ue,P=j}if(Y===S.length)return l(d,P),Rr&&Ti(d,Y),v;if(P===null){for(;YY?(j=P,P=null):j=P.sibling;var Me=Ve(d,P,ue.value,x);if(Me===null){P===null&&(P=j);break}n&&P&&Me.alternate===null&&o(d,P),B=C(Me,B,Y),T===null?v=Me:T.sibling=Me,T=Me,P=j}if(ue.done)return l(d,P),Rr&&Ti(d,Y),v;if(P===null){for(;!ue.done;Y++,ue=S.next())ue=vt(d,ue.value,x),ue!==null&&(B=C(ue,B,Y),T===null?v=ue:T.sibling=ue,T=ue);return Rr&&Ti(d,Y),v}for(P=c(d,P);!ue.done;Y++,ue=S.next())ue=A(P,d,Y,ue.value,x),ue!==null&&(n&&ue.alternate!==null&&P.delete(ue.key===null?Y:ue.key),B=C(ue,B,Y),T===null?v=ue:T.sibling=ue,T=ue);return n&&P.forEach(function(st){return o(d,st)}),Rr&&Ti(d,Y),v}function m(d,B,S,x){if(typeof S=="object"&&S!==null&&S.type===y&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case I:e:{for(var v=S.key,T=B;T!==null;){if(T.key===v){if(v=S.type,v===y){if(T.tag===7){l(d,T.sibling),B=p(T,S.props.children),B.return=d,d=B;break e}}else if(T.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===q&&$o(v)===T.type){l(d,T.sibling),B=p(T,S.props),B.ref=dl(d,T,S),B.return=d,d=B;break e}l(d,T);break}else o(d,T);T=T.sibling}S.type===y?(B=ti(S.props.children,d.mode,x,S.key),B.return=d,d=B):(x=Yl(S.type,S.key,S.props,null,d.mode,x),x.ref=dl(d,B,S),x.return=d,d=x)}return F(d);case h:e:{for(T=S.key;B!==null;){if(B.key===T)if(B.tag===4&&B.stateNode.containerInfo===S.containerInfo&&B.stateNode.implementation===S.implementation){l(d,B.sibling),B=p(B,S.children||[]),B.return=d,d=B;break e}else{l(d,B);break}else o(d,B);B=B.sibling}B=Ws(S,d.mode,x),B.return=d,d=B}return F(d);case q:return T=S._init,m(d,B,T(S._payload),x)}if(H(S))return f(d,B,S,x);if(Be(S))return g(d,B,S,x);Vu(d,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,B!==null&&B.tag===6?(l(d,B.sibling),B=p(B,S),B.return=d,d=B):(l(d,B),B=Fo(S,d.mode,x),B.return=d,d=B),F(d)):l(d,B)}return m}var Li=Aa(!0),aa=Aa(!1),la=Ko(null),ua=null,fi=null,Eo=null;function rr(){Eo=fi=ua=null}function Mf(n,o,l){Qt?(Wt(la,o._currentValue),o._currentValue=l):(Wt(la,o._currentValue2),o._currentValue2=l)}function pl(n){var o=la.current;ar(la),Qt?n._currentValue=o:n._currentValue2=o}function qu(n,o,l){for(;n!==null;){var c=n.alternate;if((n.childLanes&o)!==o?(n.childLanes|=o,c!==null&&(c.childLanes|=o)):c!==null&&(c.childLanes&o)!==o&&(c.childLanes|=o),n===l)break;n=n.return}}function io(n,o){ua=n,Eo=fi=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&o)!==0&&(Vn=!0),n.firstContext=null)}function Ot(n){var o=Qt?n._currentValue:n._currentValue2;if(Eo!==n)if(n={context:n,memoizedValue:o,next:null},fi===null){if(ua===null)throw Error(u(308));fi=n,ua.dependencies={lanes:0,firstContext:n}}else fi=fi.next=n;return o}var gi=null;function _A(n){gi===null?gi=[n]:gi.push(n)}function RA(n,o,l,c){var p=o.interleaved;return p===null?(l.next=l,_A(o)):(l.next=p.next,p.next=l),o.interleaved=l,Mi(n,c)}function Mi(n,o){n.lanes|=o;var l=n.alternate;for(l!==null&&(l.lanes|=o),l=n,n=n.return;n!==null;)n.childLanes|=o,l=n.alternate,l!==null&&(l.childLanes|=o),l=n,n=n.return;return l.tag===3?l.stateNode:null}var ks=!1;function El(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pf(n,o){n=n.updateQueue,o.updateQueue===n&&(o.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Pi(n,o){return{eventTime:n,lane:o,tag:0,payload:null,callback:null,next:null}}function jn(n,o,l){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Nt&2)!==0){var p=c.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),c.pending=o,Mi(n,l)}return p=c.interleaved,p===null?(o.next=o,_A(c)):(o.next=p.next,p.next=o),c.interleaved=o,Mi(n,l)}function ca(n,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194240)!==0)){var c=o.lanes;c&=n.pendingLanes,l|=c,o.lanes=l,Tf(n,l)}}function Uf(n,o){var l=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,C=null;if(l=l.firstBaseUpdate,l!==null){do{var F={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};C===null?p=C=F:C=C.next=F,l=l.next}while(l!==null);C===null?p=C=o:C=C.next=o}else p=C=o;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:C,shared:c.shared,effects:c.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=o:n.next=o,l.lastBaseUpdate=o}function ml(n,o,l,c){var p=n.updateQueue;ks=!1;var C=p.firstBaseUpdate,F=p.lastBaseUpdate,V=p.shared.pending;if(V!==null){p.shared.pending=null;var ae=V,be=ae.next;ae.next=null,F===null?C=be:F.next=be,F=ae;var nt=n.alternate;nt!==null&&(nt=nt.updateQueue,V=nt.lastBaseUpdate,V!==F&&(V===null?nt.firstBaseUpdate=be:V.next=be,nt.lastBaseUpdate=ae))}if(C!==null){var vt=p.baseState;F=0,nt=be=ae=null,V=C;do{var Ve=V.lane,A=V.eventTime;if((c&Ve)===Ve){nt!==null&&(nt=nt.next={eventTime:A,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var f=n,g=V;switch(Ve=o,A=l,g.tag){case 1:if(f=g.payload,typeof f=="function"){vt=f.call(A,vt,Ve);break e}vt=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=g.payload,Ve=typeof f=="function"?f.call(A,vt,Ve):f,Ve==null)break e;vt=a({},vt,Ve);break e;case 2:ks=!0}}V.callback!==null&&V.lane!==0&&(n.flags|=64,Ve=p.effects,Ve===null?p.effects=[V]:Ve.push(V))}else A={eventTime:A,lane:Ve,tag:V.tag,payload:V.payload,callback:V.callback,next:null},nt===null?(be=nt=A,ae=vt):nt=nt.next=A,F|=Ve;if(V=V.next,V===null){if(V=p.shared.pending,V===null)break;Ve=V,V=Ve.next,Ve.next=null,p.lastBaseUpdate=Ve,p.shared.pending=null}}while(!0);if(nt===null&&(ae=vt),p.baseState=ae,p.firstBaseUpdate=be,p.lastBaseUpdate=nt,o=p.shared.interleaved,o!==null){p=o;do F|=p.lane,p=p.next;while(p!==o)}else C===null&&(p.shared.lanes=0);Gs|=F,n.lanes=F,n.memoizedState=vt}}function Gf(n,o,l){if(n=o.effects,o.effects=null,n!==null)for(o=0;ol?l:4,n(!0);var c=Xu.transition;Xu.transition={};try{n(!1),o()}finally{Tt=l,Xu.transition=c}}function Vf(){return Xo().memoizedState}function HI(n,o,l){var c=gs(n);if(l={lane:c,action:l,hasEagerState:!1,eagerState:null,next:null},qf(n))zf(o,l);else if(l=RA(n,o,l,c),l!==null){var p=Mr();$n(l,n,c,p),$f(l,o,c)}}function Op(n,o,l){var c=gs(n),p={lane:c,action:l,hasEagerState:!1,eagerState:null,next:null};if(qf(n))zf(o,p);else{var C=n.alternate;if(n.lanes===0&&(C===null||C.lanes===0)&&(C=o.lastRenderedReducer,C!==null))try{var F=o.lastRenderedState,V=C(F,l);if(p.hasEagerState=!0,p.eagerState=V,Vo(V,F)){var ae=o.interleaved;ae===null?(p.next=p,_A(o)):(p.next=ae.next,ae.next=p),o.interleaved=p;return}}catch{}l=RA(n,o,p,c),l!==null&&(p=Mr(),$n(l,n,c,p),$f(l,o,c))}}function qf(n){var o=n.alternate;return n===Lr||o!==null&&o===Lr}function zf(n,o){Ts=Il=!0;var l=n.pending;l===null?o.next=o:(o.next=l.next,l.next=o),n.pending=o}function $f(n,o,l){if((l&4194240)!==0){var c=o.lanes;c&=n.pendingLanes,l|=c,o.lanes=l,Tf(n,l)}}var Dl={readContext:Ot,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},sc={readContext:Ot,useCallback:function(n,o){return Gi().memoizedState=[n,o===void 0?null:o],n},useContext:Ot,useEffect:jf,useImperativeHandle:function(n,o,l){return l=l!=null?l.concat([n]):null,kA(4194308,4,xp.bind(null,o,n),l)},useLayoutEffect:function(n,o){return kA(4194308,4,n,o)},useInsertionEffect:function(n,o){return kA(4,2,n,o)},useMemo:function(n,o){var l=Gi();return o=o===void 0?null:o,n=n(),l.memoizedState=[n,o],n},useReducer:function(n,o,l){var c=Gi();return o=l!==void 0?l(o):o,c.memoizedState=c.baseState=o,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:o},c.queue=n,n=n.dispatch=HI.bind(null,Lr,n),[c.memoizedState,n]},useRef:function(n){var o=Gi();return n={current:n},o.memoizedState=n},useState:Fp,useDebugValue:Yf,useDeferredValue:function(n){return Gi().memoizedState=n},useTransition:function(){var n=Fp(!1),o=n[0];return n=GI.bind(null,n[1]),Gi().memoizedState=n,[o,n]},useMutableSource:function(){},useSyncExternalStore:function(n,o,l){var c=Lr,p=Gi();if(Rr){if(l===void 0)throw Error(u(407));l=l()}else{if(l=o(),ln===null)throw Error(u(349));(fs&30)!==0||_p(c,o,l)}p.memoizedState=l;var C={value:l,getSnapshot:o};return p.queue=C,jf(Kf.bind(null,c,C,n),[n]),c.flags|=2048,xA(9,Rp.bind(null,c,C,l,o),void 0,null),l},useId:function(){var n=Gi(),o=ln.identifierPrefix;if(Rr){var l=Ni,c=ci;l=(c&~(1<<32-Fe(c)-1)).toString(32)+l,o=":"+o+"R"+l,l=Os++,0Rc&&(o.flags|=128,c=!0,Ft(p,!1),o.lanes=4194304)}else{if(!c)if(n=FA(C),n!==null){if(o.flags|=128,c=!0,n=n.updateQueue,n!==null&&(o.updateQueue=n,o.flags|=4),Ft(p,!0),p.tail===null&&p.tailMode==="hidden"&&!C.alternate&&!Rr)return vn(o),null}else 2*fr()-p.renderingStartTime>Rc&&l!==1073741824&&(o.flags|=128,c=!0,Ft(p,!1),o.lanes=4194304);p.isBackwards?(C.sibling=o.child,o.child=C):(n=p.last,n!==null?n.sibling=C:o.child=C,p.last=C)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=fr(),o.sibling=null,n=Qr.current,Wt(Qr,c?n&1|2:n&1),o):(vn(o),null);case 22:case 23:return Wl(),l=o.memoizedState!==null,n!==null&&n.memoizedState!==null!==l&&(o.flags|=8192),l&&(o.mode&1)!==0?(xr&1073741824)!==0&&(vn(o),ct&&o.subtreeFlags&6&&(o.flags|=8192)):vn(o),null;case 24:return null;case 25:return null}throw Error(u(156,o.tag))}function Hp(n,o){switch(Yu(o),o.tag){case 1:return W(o.type)&&re(),n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 3:return bA(),ar(Q),ar(Gr),$u(),n=o.flags,(n&65536)!==0&&(n&128)===0?(o.flags=n&-65537|128,o):null;case 5:return di(o),null;case 13:if(ar(Qr),n=o.memoizedState,n!==null&&n.dehydrated!==null){if(o.alternate===null)throw Error(u(340));sa()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 19:return ar(Qr),null;case 4:return bA(),null;case 10:return pl(o.type._context),null;case 22:case 23:return Wl(),null;case 24:return null;default:return null}}var Dc=!1,On=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,rt=null;function Ms(n,o){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(c){kr(n,o,c)}else l.current=null}function Ba(n,o,l){try{l()}catch(c){kr(n,o,c)}}var Ag=!1;function ag(n,o){for(Ze(n.containerInfo),rt=o;rt!==null;)if(n=rt,o=n.child,(n.subtreeFlags&1028)!==0&&o!==null)o.return=n,rt=o;else for(;rt!==null;){n=rt;try{var l=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(l!==null){var c=l.memoizedProps,p=l.memoizedState,C=n.stateNode,F=C.getSnapshotBeforeUpdate(n.elementType===n.type?c:Ro(n.type,c),p);C.__reactInternalSnapshotBeforeUpdate=F}break;case 3:ct&&po(n.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(V){kr(n,n.return,V)}if(o=n.sibling,o!==null){o.return=n.return,rt=o;break}rt=n.return}return l=Ag,Ag=!1,l}function Da(n,o,l){var c=o.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&n)===n){var C=p.destroy;p.destroy=void 0,C!==void 0&&Ba(o,l,C)}p=p.next}while(p!==c)}}function Sl(n,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&n)===n){var c=l.create;l.destroy=c()}l=l.next}while(l!==o)}}function yc(n){var o=n.ref;if(o!==null){var l=n.stateNode;n.tag===5?n=se(l):n=l,typeof o=="function"?o(n):o.current=n}}function _l(n){var o=n.alternate;o!==null&&(n.alternate=null,_l(o)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(o=n.stateNode,o!==null&&yr(o)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function lg(n){return n.tag===5||n.tag===3||n.tag===4}function ug(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||lg(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Qc(n,o,l){var c=n.tag;if(c===5||c===6)n=n.stateNode,o?ai(l,n,o):Ss(l,n);else if(c!==4&&(n=n.child,n!==null))for(Qc(n,o,l),n=n.sibling;n!==null;)Qc(n,o,l),n=n.sibling}function Ps(n,o,l){var c=n.tag;if(c===5||c===6)n=n.stateNode,o?Ai(l,n,o):tn(l,n);else if(c!==4&&(n=n.child,n!==null))for(Ps(n,o,l),n=n.sibling;n!==null;)Ps(n,o,l),n=n.sibling}var an=null,mo=!1;function Ln(n,o,l){for(l=l.child;l!==null;)wc(n,o,l),l=l.sibling}function wc(n,o,l){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(Al,l)}catch{}switch(l.tag){case 5:On||Ms(l,o);case 6:if(ct){var c=an,p=mo;an=null,Ln(n,o,l),an=c,mo=p,an!==null&&(mo?kn(an,l.stateNode):Go(an,l.stateNode))}else Ln(n,o,l);break;case 18:ct&&an!==null&&(mo?Gu(an,l.stateNode):kf(an,l.stateNode));break;case 4:ct?(c=an,p=mo,an=l.stateNode.containerInfo,mo=!0,Ln(n,o,l),an=c,mo=p):(mt&&(c=l.stateNode.containerInfo,p=ui(c),EA(c,p)),Ln(n,o,l));break;case 0:case 11:case 14:case 15:if(!On&&(c=l.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){p=c=c.next;do{var C=p,F=C.destroy;C=C.tag,F!==void 0&&((C&2)!==0||(C&4)!==0)&&Ba(l,o,F),p=p.next}while(p!==c)}Ln(n,o,l);break;case 1:if(!On&&(Ms(l,o),c=l.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=l.memoizedProps,c.state=l.memoizedState,c.componentWillUnmount()}catch(V){kr(l,o,V)}Ln(n,o,l);break;case 21:Ln(n,o,l);break;case 22:l.mode&1?(On=(c=On)||l.memoizedState!==null,Ln(n,o,l),On=c):Ln(n,o,l);break;default:Ln(n,o,l)}}function Rl(n){var o=n.updateQueue;if(o!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new Wp),o.forEach(function(c){var p=xc.bind(null,n,c);l.has(c)||(l.add(c),c.then(p,p))})}}function bo(n,o){var l=o.deletions;if(l!==null)for(var c=0;c";case ya:return":has("+(_c(n)||"")+")";case MA:return'[role="'+n.value+'"]';case xl:return'"'+n.value+'"';case Fl:return'[data-testname="'+n.value+'"]';default:throw Error(u(365))}}function pg(n,o){var l=[];n=[n,0];for(var c=0;cp&&(p=F),c&=~C}if(c=p,c=fr()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Eg(c/1960))-c,10n?16:n,Yi===null)var c=!1;else{if(n=Yi,Yi=null,Ml=0,(Nt&6)!==0)throw Error(u(331));var p=Nt;for(Nt|=4,rt=n.current;rt!==null;){var C=rt,F=C.child;if((rt.flags&16)!==0){var V=C.deletions;if(V!==null){for(var ae=0;aefr()-PA?Hs(n,0):Tl|=l),fn(n,o)}function Cg(n,o){o===0&&((n.mode&1)===0?o=1:(o=qt,qt<<=1,(qt&130023424)===0&&(qt=4194304)));var l=Mr();n=Mi(n,o),n!==null&&(DA(n,o,l),fn(n,l))}function qp(n){var o=n.memoizedState,l=0;o!==null&&(l=o.retryLane),Cg(n,l)}function xc(n,o){var l=0;switch(n.tag){case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=n.stateNode;break;default:throw Error(u(314))}c!==null&&c.delete(o),Cg(n,l)}var Bg;Bg=function(n,o,l){if(n!==null)if(n.memoizedProps!==o.pendingProps||Q.current)Vn=!0;else{if((n.lanes&l)===0&&(o.flags&128)===0)return Vn=!1,Gp(n,o,l);Vn=(n.flags&131072)!==0}else Vn=!1,Rr&&(o.flags&1048576)!==0&&ju(o,cl,o.index);switch(o.lanes=0,o.tag){case 2:var c=o.type;Ia(n,o),n=o.pendingProps;var p=U(o,Gr.current);io(o,l),p=pa(null,o,c,n,p,l);var C=Wf();return o.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,W(c)?(C=!0,Re(o)):C=!1,o.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,El(o),p.updater=lc,o.stateNode=p,p._reactInternals=o,Xf(o,c,n,l),o=ma(null,o,c,!0,C,l)):(o.tag=0,Rr&&C&&xs(o),Tn(null,o,p,l),o=o.child),o;case 16:c=o.elementType;e:{switch(Ia(n,o),n=o.pendingProps,p=c._init,c=p(c._payload),o.type=c,p=o.tag=yg(c),n=Ro(c,n),p){case 0:o=Ic(null,o,c,n,l);break e;case 1:o=OA(null,o,c,n,l);break e;case 11:o=dc(null,o,c,n,l);break e;case 14:o=pc(null,o,c,Ro(c.type,n),l);break e}throw Error(u(306,c,""))}return o;case 0:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),Ic(n,o,c,p,l);case 1:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),OA(n,o,c,p,l);case 3:e:{if(Hi(o),n===null)throw Error(u(387));c=o.pendingProps,C=o.memoizedState,p=C.element,Pf(n,o),ml(o,c,null,l);var F=o.memoizedState;if(c=F.element,wt&&C.isDehydrated)if(C={element:c,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},o.updateQueue.baseState=C,o.memoizedState=C,o.flags&256){p=Ea(Error(u(423)),o),o=Ql(n,o,c,l,p);break e}else if(c!==p){p=Ea(Error(u(424)),o),o=Ql(n,o,c,l,p);break e}else for(wt&&(So=dr(o.stateNode.containerInfo),oo=o,Rr=!0,zo=null,vA=!1),l=aa(o,null,c,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(sa(),c===p){o=Wi(n,o,l);break e}Tn(n,o,c,l)}o=o.child}return o;case 5:return Hf(o),n===null&&SA(o),c=o.type,p=o.pendingProps,C=n!==null?n.memoizedProps:null,F=p.children,J(c,p)?F=null:C!==null&&J(c,C)&&(o.flags|=32),tg(n,o),Tn(n,o,F,l),o.child;case 6:return n===null&&SA(o),null;case 13:return wl(n,o,l);case 4:return zu(o,o.stateNode.containerInfo),c=o.pendingProps,n===null?o.child=Li(o,null,c,l):Tn(n,o,c,l),o.child;case 11:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),dc(n,o,c,p,l);case 7:return Tn(n,o,o.pendingProps,l),o.child;case 8:return Tn(n,o,o.pendingProps.children,l),o.child;case 12:return Tn(n,o,o.pendingProps.children,l),o.child;case 10:e:{if(c=o.type._context,p=o.pendingProps,C=o.memoizedProps,F=p.value,Mf(o,c,F),C!==null)if(Vo(C.value,F)){if(C.children===p.children&&!Q.current){o=Wi(n,o,l);break e}}else for(C=o.child,C!==null&&(C.return=o);C!==null;){var V=C.dependencies;if(V!==null){F=C.child;for(var ae=V.firstContext;ae!==null;){if(ae.context===c){if(C.tag===1){ae=Pi(-1,l&-l),ae.tag=2;var be=C.updateQueue;if(be!==null){be=be.shared;var nt=be.pending;nt===null?ae.next=ae:(ae.next=nt.next,nt.next=ae),be.pending=ae}}C.lanes|=l,ae=C.alternate,ae!==null&&(ae.lanes|=l),qu(C.return,l,o),V.lanes|=l;break}ae=ae.next}}else if(C.tag===10)F=C.type===o.type?null:C.child;else if(C.tag===18){if(F=C.return,F===null)throw Error(u(341));F.lanes|=l,V=F.alternate,V!==null&&(V.lanes|=l),qu(F,l,o),F=C.sibling}else F=C.child;if(F!==null)F.return=C;else for(F=C;F!==null;){if(F===o){F=null;break}if(C=F.sibling,C!==null){C.return=F.return,F=C;break}F=F.return}C=F}Tn(n,o,p.children,l),o=o.child}return o;case 9:return p=o.type,c=o.pendingProps.children,io(o,l),p=Ot(p),c=c(p),o.flags|=1,Tn(n,o,c,l),o.child;case 14:return c=o.type,p=Ro(c,o.pendingProps),p=Ro(c.type,p),pc(n,o,c,p,l);case 15:return Ec(n,o,o.type,o.pendingProps,l);case 17:return c=o.type,p=o.pendingProps,p=o.elementType===c?p:Ro(c,p),Ia(n,o),o.tag=1,W(c)?(n=!0,Re(o)):n=!1,io(o,l),Pp(o,c,p),Xf(o,c,p,l),ma(null,o,c,!0,n,l);case 19:return og(n,o,l);case 22:return mc(n,o,l)}throw Error(u(156,o.tag))};function Dg(n,o){return jo(n,o)}function zp(n,o,l,c){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Io(n,o,l,c){return new zp(n,o,l,c)}function ei(n){return n=n.prototype,!(!n||!n.isReactComponent)}function yg(n){if(typeof n=="function")return ei(n)?1:0;if(n!=null){if(n=n.$$typeof,n===ne)return 11;if(n===Z)return 14}return 2}function ho(n,o){var l=n.alternate;return l===null?(l=Io(n.tag,o,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=o,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,o=n.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function Yl(n,o,l,c,p,C){var F=2;if(c=n,typeof n=="function")ei(n)&&(F=1);else if(typeof n=="string")F=5;else e:switch(n){case y:return ti(l.children,p,C,o);case D:F=8,p|=8;break;case R:return n=Io(12,l,o,p|2),n.elementType=R,n.lanes=C,n;case oe:return n=Io(13,l,o,p),n.elementType=oe,n.lanes=C,n;case $:return n=Io(19,l,o,p),n.elementType=$,n.lanes=C,n;case X:return Es(l,p,C,o);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case O:F=10;break e;case G:F=9;break e;case ne:F=11;break e;case Z:F=14;break e;case q:F=16,c=null;break e}throw Error(u(130,n==null?n:typeof n,""))}return o=Io(F,l,o,p),o.elementType=n,o.type=c,o.lanes=C,o}function ti(n,o,l,c){return n=Io(7,n,c,o),n.lanes=l,n}function Es(n,o,l,c){return n=Io(22,n,c,o),n.elementType=X,n.lanes=l,n.stateNode={isHidden:!1},n}function Fo(n,o,l){return n=Io(6,n,null,o),n.lanes=l,n}function Ws(n,o,l){return o=Io(4,n.children!==null?n.children:[],n.key,o),o.lanes=l,o.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},o}function $p(n,o,l,c,p){this.tag=o,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=je,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nf(0),this.expirationTimes=Nf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nf(0),this.identifierPrefix=c,this.onRecoverableError=p,wt&&(this.mutableSourceEagerHydrationData=null)}function Qg(n,o,l,c,p,C,F,V,ae){return n=new $p(n,o,l,V,ae),o===1?(o=1,C===!0&&(o|=8)):o=0,C=Io(3,null,null,o),n.current=C,C.stateNode=n,C.memoizedState={element:c,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},El(C),n}function wg(n){if(!n)return Sr;n=n._reactInternals;e:{if(de(n)!==n||n.tag!==1)throw Error(u(170));var o=n;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(W(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(u(171))}if(n.tag===1){var l=n.type;if(W(l))return _e(n,l,o)}return o}function kc(n){var o=n._reactInternals;if(o===void 0)throw typeof n.render=="function"?Error(u(188)):(n=Object.keys(n).join(","),Error(u(268,n)));return n=we(o),n===null?null:n.stateNode}function Ks(n,o){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l=be&&C>=vt&&p<=nt&&F<=Ve){n.splice(o,1);break}else if(c!==be||l.width!==ae.width||VeF){if(!(C!==vt||l.height!==ae.height||ntp)){be>c&&(ae.width+=be-c,ae.x=c),ntC&&(ae.height+=vt-C,ae.y=C),Vel&&(l=F)),F ")+` No matching component was found for: - `)+n.join(" > ")}return null},r.getPublicRootInstance=function(n){return n=n.current,n.child?n.child.tag===5?ae(n.child.stateNode):n.child.stateNode:null},r.injectIntoDevTools=function(n){if(n={bundleType:n.bundleType,version:n.version,rendererPackageName:n.rendererPackageName,rendererConfig:n.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:Qg,findFiberByHostInstance:n.findFiberByHostInstance||vg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")n=!1;else{var o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(o.isDisabled||!o.supportsFiber)n=!0;else{try{sl=o.inject(n),Yo=o}catch{}n=!!o.checkDCE}}return n},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(n,o,l,c){if(!Ae)throw Error(u(363));n=xl(n,o);var p=ir(n,l,c).disconnect;return{disconnect:function(){p()}}},r.registerMutableSourceForHydration=function(n,o){var l=o._getVersion;l=l(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,l]:n.mutableSourceEagerHydrationData.push(o,l)},r.runWithPriority=function(n,o){var l=Tt;try{return Tt=n,o()}finally{Tt=l}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(n,o,l,c){var p=o.current,h=Mr(),b=gs(p);return l=yg(l),o.context===null?o.context=l:o.pendingContext=l,o=Pi(h,b),o.payload={element:n},c=c===void 0?null:c,c!==null&&(o.callback=c),n=jn(p,o,b),n!==null&&($n(n,p,b,h),ua(n,p,b)),b},r}});var uC=nr((Cx,lC)=>{"use strict";lC.exports=aC()});var cC=nr(Ma=>{"use strict";Ma.ConcurrentRoot=1;Ma.ContinuousEventPriority=4;Ma.DefaultEventPriority=16;Ma.DiscreteEventPriority=1;Ma.IdleEventPriority=536870912;Ma.LegacyRoot=0});var gC=nr((Dx,fC)=>{"use strict";fC.exports=cC()});var QC=nr((Gx,yC)=>{yC.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF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uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var eA=nr((hk,HC)=>{"use strict";var UC=["nodebuffer","arraybuffer","fragments"],GC=typeof Blob<"u";GC&&UC.push("blob");HC.exports={BINARY_TYPES:UC,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:GC,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var af=nr((Ck,Ad)=>{"use strict";var{EMPTY_BUFFER:nS}=eA(),zE=Buffer[Symbol.species];function oS(e,t){if(e.length===0)return nS;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let s=0;s{"use strict";var JC=Symbol("kDone"),XE=Symbol("kRun"),ZE=class{constructor(t){this[JC]=()=>{this.pending--,this[XE]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[XE]()}[XE](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[JC])}}};jC.exports=ZE});var pu=nr((Dk,$C)=>{"use strict";var lf=Jr("zlib"),VC=af(),sS=YC(),{kStatusCode:qC}=eA(),AS=Buffer[Symbol.species],aS=Buffer.from([0,0,255,255]),ld=Symbol("permessage-deflate"),tA=Symbol("total-length"),gu=Symbol("callback"),YA=Symbol("buffers"),du=Symbol("error"),ad,em=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!ad){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ad=new sS(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[gu];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(s=>!(r.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>s.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!s.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(i=>{let s=r[i];if(s.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(s=s[0],i==="client_max_window_bits"){if(s!==!0){let a=+s;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${s}`);s=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${s}`)}else if(i==="server_max_window_bits"){let a=+s;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${s}`);s=a}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(s!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${s}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=s})}),t}decompress(t,r,i){ad.add(s=>{this._decompress(t,r,(a,u)=>{s(),i(a,u)})})}compress(t,r,i){ad.add(s=>{this._compress(t,r,(a,u)=>{s(),i(a,u)})})}_decompress(t,r,i){let s=this._isServer?"client":"server";if(!this._inflate){let a=`${s}_max_window_bits`,u=typeof this.params[a]!="number"?lf.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=lf.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[ld]=this,this._inflate[tA]=0,this._inflate[YA]=[],this._inflate.on("error",uS),this._inflate.on("data",zC)}this._inflate[gu]=i,this._inflate.write(t),r&&this._inflate.write(aS),this._inflate.flush(()=>{let a=this._inflate[du];if(a){this._inflate.close(),this._inflate=null,i(a);return}let u=VC.concat(this._inflate[YA],this._inflate[tA]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[tA]=0,this._inflate[YA]=[],r&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),i(null,u)})}_compress(t,r,i){let s=this._isServer?"server":"client";if(!this._deflate){let a=`${s}_max_window_bits`,u=typeof this.params[a]!="number"?lf.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=lf.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[tA]=0,this._deflate[YA]=[],this._deflate.on("data",lS)}this._deflate[gu]=i,this._deflate.write(t),this._deflate.flush(lf.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=VC.concat(this._deflate[YA],this._deflate[tA]);r&&(a=new AS(a.buffer,a.byteOffset,a.length-4)),this._deflate[gu]=null,this._deflate[tA]=0,this._deflate[YA]=[],r&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),i(null,a)})}};$C.exports=em;function lS(e){this[YA].push(e),this[tA]+=e.length}function zC(e){if(this[tA]+=e.length,this[ld]._maxPayload<1||this[tA]<=this[ld]._maxPayload){this[YA].push(e);return}this[du]=new RangeError("Max payload size exceeded"),this[du].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[du][qC]=1009,this.removeListener("data",zC),this.reset()}function uS(e){if(this[ld]._inflate=null,this[du]){this[gu](this[du]);return}e[qC]=1007,this[gu](e)}});var Eu=nr((yk,ud)=>{"use strict";var{isUtf8:XC}=Jr("buffer"),{hasBlob:cS}=eA(),fS=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function gS(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function tm(e){let t=e.length,r=0;for(;r=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function dS(e){return cS&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}ud.exports={isBlob:dS,isValidStatusCode:gS,isValidUTF8:tm,tokenChars:fS};if(XC)ud.exports.isValidUTF8=function(e){return e.length<24?tm(e):XC(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=Jr("utf-8-validate");ud.exports.isValidUTF8=function(t){return t.length<32?tm(t):e(t)}}catch{}});var sm=nr((Qk,iB)=>{"use strict";var{Writable:pS}=Jr("stream"),ZC=pu(),{BINARY_TYPES:ES,EMPTY_BUFFER:eB,kStatusCode:mS,kWebSocket:IS}=eA(),{concat:rm,toArrayBuffer:hS,unmask:CS}=af(),{isValidStatusCode:BS,isValidUTF8:tB}=Eu(),cd=Buffer[Symbol.species],wi=0,rB=1,nB=2,oB=3,nm=4,om=5,fd=6,im=class extends pS{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||ES[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[IS]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=wi}_write(t,r,i){if(this._opcode===8&&this._state==wi)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=i.length?r.set(this._buffers.shift(),s):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),s),this._buffers[0]=new cd(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case wi:this.getInfo(t);break;case rB:this.getPayloadLength16(t);break;case nB:this.getPayloadLength64(t);break;case oB:this.getMask();break;case nm:this.getData(t);break;case om:case fd:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(s);return}let i=(r[0]&64)===64;if(i&&!this._extensions[ZC.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(s);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(s);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(s);return}if(i){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(s);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(s);return}this._payloadLength===126?this._state=rB:this._payloadLength===127?this._state=nB:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(s);return}this._payloadLength=i*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=oB:this._state=nm}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=nm}getData(t){let r=eB;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(r,t);return}if(this._compressed){this._state=om,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(i);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[ZC.extensionName].decompress(t,this._fin,(s,a)=>{if(s)return r(s);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(u);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let u=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(u);return}this._fragments.push(a)}this.dataMessage(r),this._state===wi&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=wi;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=rm(i,r):this._binaryType==="arraybuffer"?s=hS(rm(i,r)):this._binaryType==="blob"?s=new Blob(i):s=i,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=wi):(this._state=fd,setImmediate(()=>{this.emit("message",s,!0),this._state=wi,this.startLoop(t)}))}else{let s=rm(i,r);if(!this._skipUTF8Validation&&!tB(s)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===om||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=wi):(this._state=fd,setImmediate(()=>{this.emit("message",s,!1),this._state=wi,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,eB),this.end();else{let i=t.readUInt16BE(0);if(!BS(i)){let a=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(a);return}let s=new cd(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!tB(s)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(a);return}this._loop=!1,this.emit("conclude",i,s),this.end()}this._state=wi;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=wi):(this._state=fd,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=wi,this.startLoop(r)}))}createError(t,r,i,s,a){this._loop=!1,this._errored=!0;let u=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,this.createError),u.code=a,u[mS]=s,u}};iB.exports=im});var lm=nr((wk,aB)=>{"use strict";var{Duplex:vk}=Jr("stream"),{randomFillSync:DS}=Jr("crypto"),{types:{isUint8Array:yS}}=Jr("util"),sB=pu(),{EMPTY_BUFFER:QS,kWebSocket:vS,NOOP:wS}=eA(),{isBlob:mu,isValidStatusCode:SS}=Eu(),{mask:AB,toBuffer:Ua}=af(),Si=Symbol("kByteLength"),_S=Buffer.alloc(4),gd=8*1024,Ga,Iu=gd,es=0,RS=1,FS=2,Am=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=es,this.onerror=wS,this[vS]=void 0}static frame(t,r){let i,s=!1,a=2,u=!1;r.mask&&(i=r.maskBuffer||_S,r.generateMask?r.generateMask(i):(Iu===gd&&(Ga===void 0&&(Ga=Buffer.alloc(gd)),DS(Ga,0,gd),Iu=0),i[0]=Ga[Iu++],i[1]=Ga[Iu++],i[2]=Ga[Iu++],i[3]=Ga[Iu++]),u=(i[0]|i[1]|i[2]|i[3])===0,a=6);let E;typeof t=="string"?(!r.mask||u)&&r[Si]!==void 0?E=r[Si]:(t=Buffer.from(t),E=t.length):(E=t.length,s=r.mask&&r.readOnly&&!u);let I=E;E>=65536?(a+=8,I=127):E>125&&(a+=2,I=126);let C=Buffer.allocUnsafe(s?E+a:a);return C[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(C[0]|=64),C[1]=I,I===126?C.writeUInt16BE(E,2):I===127&&(C[2]=C[3]=0,C.writeUIntBE(E,4,6)),r.mask?(C[1]|=128,C[a-4]=i[0],C[a-3]=i[1],C[a-2]=i[2],C[a-1]=i[3],u?[C,t]:s?(AB(t,i,C,a,E),[C]):(AB(t,i,t,0,E),[C,t])):[C,t]}close(t,r,i,s){let a;if(t===void 0)a=QS;else{if(typeof t!="number"||!SS(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let E=Buffer.byteLength(r);if(E>123)throw new RangeError("The message must not be greater than 123 bytes");if(a=Buffer.allocUnsafe(2+E),a.writeUInt16BE(t,0),typeof r=="string")a.write(r,2);else if(yS(r))a.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let u={[Si]:a.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==es?this.enqueue([this.dispatch,a,!1,u,s]):this.sendFrame(e.frame(a,u),s)}ping(t,r,i){let s,a;if(typeof t=="string"?(s=Buffer.byteLength(t),a=!1):mu(t)?(s=t.size,a=!1):(t=Ua(t),s=t.length,a=Ua.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Si]:s,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};mu(t)?this._state!==es?this.enqueue([this.getBlobData,t,!1,u,i]):this.getBlobData(t,!1,u,i):this._state!==es?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}pong(t,r,i){let s,a;if(typeof t=="string"?(s=Buffer.byteLength(t),a=!1):mu(t)?(s=t.size,a=!1):(t=Ua(t),s=t.length,a=Ua.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Si]:s,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};mu(t)?this._state!==es?this.enqueue([this.getBlobData,t,!1,u,i]):this.getBlobData(t,!1,u,i):this._state!==es?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}send(t,r,i){let s=this._extensions[sB.extensionName],a=r.binary?2:1,u=r.compress,E,I;typeof t=="string"?(E=Buffer.byteLength(t),I=!1):mu(t)?(E=t.size,I=!1):(t=Ua(t),E=t.length,I=Ua.readOnly),this._firstFragment?(this._firstFragment=!1,u&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=E>=s._threshold),this._compress=u):(u=!1,a=0),r.fin&&(this._firstFragment=!0);let C={[Si]:E,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:I,rsv1:u};mu(t)?this._state!==es?this.enqueue([this.getBlobData,t,this._compress,C,i]):this.getBlobData(t,this._compress,C,i):this._state!==es?this.enqueue([this.dispatch,t,this._compress,C,i]):this.dispatch(t,this._compress,C,i)}getBlobData(t,r,i,s){this._bufferedBytes+=i[Si],this._state=FS,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let E=new Error("The socket was closed while the blob was being read");process.nextTick(am,this,E,s);return}this._bufferedBytes-=i[Si];let u=Ua(a);r?this.dispatch(u,r,i,s):(this._state=es,this.sendFrame(e.frame(u,i),s),this.dequeue())}).catch(a=>{process.nextTick(bS,this,a,s)})}dispatch(t,r,i,s){if(!r){this.sendFrame(e.frame(t,i),s);return}let a=this._extensions[sB.extensionName];this._bufferedBytes+=i[Si],this._state=RS,a.compress(t,i.fin,(u,E)=>{if(this._socket.destroyed){let I=new Error("The socket was closed while data was being compressed");am(this,I,s);return}this._bufferedBytes-=i[Si],this._state=es,i.readOnly=!1,this.sendFrame(e.frame(E,i),s),this.dequeue()})}dequeue(){for(;this._state===es&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Si],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Si],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};aB.exports=Am;function am(e,t,r){typeof r=="function"&&r(t);for(let i=0;i{"use strict";var{kForOnEventAttribute:uf,kListener:um}=eA(),lB=Symbol("kCode"),uB=Symbol("kData"),cB=Symbol("kError"),fB=Symbol("kMessage"),gB=Symbol("kReason"),hu=Symbol("kTarget"),dB=Symbol("kType"),pB=Symbol("kWasClean"),rA=class{constructor(t){this[hu]=null,this[dB]=t}get target(){return this[hu]}get type(){return this[dB]}};Object.defineProperty(rA.prototype,"target",{enumerable:!0});Object.defineProperty(rA.prototype,"type",{enumerable:!0});var Ha=class extends rA{constructor(t,r={}){super(t),this[lB]=r.code===void 0?0:r.code,this[gB]=r.reason===void 0?"":r.reason,this[pB]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[lB]}get reason(){return this[gB]}get wasClean(){return this[pB]}};Object.defineProperty(Ha.prototype,"code",{enumerable:!0});Object.defineProperty(Ha.prototype,"reason",{enumerable:!0});Object.defineProperty(Ha.prototype,"wasClean",{enumerable:!0});var Cu=class extends rA{constructor(t,r={}){super(t),this[cB]=r.error===void 0?null:r.error,this[fB]=r.message===void 0?"":r.message}get error(){return this[cB]}get message(){return this[fB]}};Object.defineProperty(Cu.prototype,"error",{enumerable:!0});Object.defineProperty(Cu.prototype,"message",{enumerable:!0});var cf=class extends rA{constructor(t,r={}){super(t),this[uB]=r.data===void 0?null:r.data}get data(){return this[uB]}};Object.defineProperty(cf.prototype,"data",{enumerable:!0});var xS={addEventListener(e,t,r={}){for(let s of this.listeners(e))if(!r[uf]&&s[um]===t&&!s[uf])return;let i;if(e==="message")i=function(a,u){let E=new cf("message",{data:u?a:a.toString()});E[hu]=this,dd(t,this,E)};else if(e==="close")i=function(a,u){let E=new Ha("close",{code:a,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});E[hu]=this,dd(t,this,E)};else if(e==="error")i=function(a){let u=new Cu("error",{error:a,message:a.message});u[hu]=this,dd(t,this,u)};else if(e==="open")i=function(){let a=new rA("open");a[hu]=this,dd(t,this,a)};else return;i[uf]=!!r[uf],i[um]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[um]===t&&!r[uf]){this.removeListener(e,r);break}}};EB.exports={CloseEvent:Ha,ErrorEvent:Cu,Event:rA,EventTarget:xS,MessageEvent:cf};function dd(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var pd=nr((_k,IB)=>{"use strict";var{tokenChars:ff}=Eu();function Qs(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function kS(e){let t=Object.create(null),r=Object.create(null),i=!1,s=!1,a=!1,u,E,I=-1,C=-1,y=-1,D=0;for(;D{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(s=>{let a=i[s];return Array.isArray(a)||(a=[a]),a.map(u=>u===!0?s:`${s}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}IB.exports={format:NS,parse:kS}});var hd=nr((bk,FB)=>{"use strict";var TS=Jr("events"),OS=Jr("https"),LS=Jr("http"),BB=Jr("net"),MS=Jr("tls"),{randomBytes:PS,createHash:US}=Jr("crypto"),{Duplex:Rk,Readable:Fk}=Jr("stream"),{URL:cm}=Jr("url"),VA=pu(),GS=sm(),HS=lm(),{isBlob:WS}=Eu(),{BINARY_TYPES:hB,CLOSE_TIMEOUT:KS,EMPTY_BUFFER:Ed,GUID:JS,kForOnEventAttribute:fm,kListener:jS,kStatusCode:YS,kWebSocket:Un,NOOP:DB}=eA(),{EventTarget:{addEventListener:VS,removeEventListener:qS}}=mB(),{format:zS,parse:$S}=pd(),{toBuffer:XS}=af(),yB=Symbol("kAborted"),gm=[8,13],nA=["CONNECTING","OPEN","CLOSING","CLOSED"],ZS=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,qr=class e extends TS{constructor(t,r,i){super(),this._binaryType=hB[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ed,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),QB(this,t,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){hB.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let s=new GS({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),a=new HS(t,this._extensions,i.generateMask);this._receiver=s,this._sender=a,this._socket=t,s[Un]=this,a[Un]=this,t[Un]=this,s.on("conclude",r_),s.on("drain",n_),s.on("error",o_),s.on("message",i_),s.on("ping",s_),s.on("pong",A_),a.onerror=a_,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",SB),t.on("data",Id),t.on("end",_B),t.on("error",RB),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[VA.extensionName]&&this._extensions[VA.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ii(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),wB(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){dm(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Ed,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){dm(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Ed,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){dm(this,t,i);return}let s={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[VA.extensionName]||(s.compress=!1),this._sender.send(t||Ed,s,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ii(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(qr,"CONNECTING",{enumerable:!0,value:nA.indexOf("CONNECTING")});Object.defineProperty(qr.prototype,"CONNECTING",{enumerable:!0,value:nA.indexOf("CONNECTING")});Object.defineProperty(qr,"OPEN",{enumerable:!0,value:nA.indexOf("OPEN")});Object.defineProperty(qr.prototype,"OPEN",{enumerable:!0,value:nA.indexOf("OPEN")});Object.defineProperty(qr,"CLOSING",{enumerable:!0,value:nA.indexOf("CLOSING")});Object.defineProperty(qr.prototype,"CLOSING",{enumerable:!0,value:nA.indexOf("CLOSING")});Object.defineProperty(qr,"CLOSED",{enumerable:!0,value:nA.indexOf("CLOSED")});Object.defineProperty(qr.prototype,"CLOSED",{enumerable:!0,value:nA.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(qr.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(qr.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[fm])return t[jS];return null},set(t){for(let r of this.listeners(e))if(r[fm]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[fm]:!0})}})});qr.prototype.addEventListener=VS;qr.prototype.removeEventListener=qS;FB.exports=qr;function QB(e,t,r,i){let s={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:KS,protocolVersion:gm[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=s.autoPong,e._closeTimeout=s.closeTimeout,!gm.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${gm.join(", ")})`);let a;if(t instanceof cm)a=t;else try{a=new cm(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),e._url=a.href;let u=a.protocol==="wss:",E=a.protocol==="ws+unix:",I;if(a.protocol!=="ws:"&&!u&&!E?I=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:E&&!a.pathname?I="The URL's pathname is empty":a.hash&&(I="The URL contains a fragment identifier"),I){let ne=new SyntaxError(I);if(e._redirects===0)throw ne;md(e,ne);return}let C=u?443:80,y=PS(16).toString("base64"),D=u?OS.request:LS.request,R=new Set,O;if(s.createConnection=s.createConnection||(u?t_:e_),s.defaultPort=s.defaultPort||C,s.port=a.port||C,s.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":y,Connection:"Upgrade",Upgrade:"websocket"},s.path=a.pathname+a.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(O=new VA({...s.perMessageDeflate,isServer:!1,maxPayload:s.maxPayload}),s.headers["Sec-WebSocket-Extensions"]=zS({[VA.extensionName]:O.offer()})),r.length){for(let ne of r){if(typeof ne!="string"||!ZS.test(ne)||R.has(ne))throw new SyntaxError("An invalid or duplicated subprotocol was specified");R.add(ne)}s.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin),(a.username||a.password)&&(s.auth=`${a.username}:${a.password}`),E){let ne=s.path.split(":");s.socketPath=ne[0],s.path=ne[1]}let G;if(s.followRedirects){if(e._redirects===0){e._originalIpc=E,e._originalSecure=u,e._originalHostOrSocketPath=E?s.socketPath:a.host;let ne=i&&i.headers;if(i={...i,headers:{}},ne)for(let[oe,$]of Object.entries(ne))i.headers[oe.toLowerCase()]=$}else if(e.listenerCount("redirect")===0){let ne=E?e._originalIpc?s.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:a.host===e._originalHostOrSocketPath;(!ne||e._originalSecure&&!u)&&(delete s.headers.authorization,delete s.headers.cookie,ne||delete s.headers.host,s.auth=void 0)}s.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),G=e._req=D(s),e._redirects&&e.emit("redirect",e.url,G)}else G=e._req=D(s);s.timeout&&G.on("timeout",()=>{ii(e,G,"Opening handshake has timed out")}),G.on("error",ne=>{G===null||G[yB]||(G=e._req=null,md(e,ne))}),G.on("response",ne=>{let oe=ne.headers.location,$=ne.statusCode;if(oe&&s.followRedirects&&$>=300&&$<400){if(++e._redirects>s.maxRedirects){ii(e,G,"Maximum redirects exceeded");return}G.abort();let J;try{J=new cm(oe,t)}catch{let Z=new SyntaxError(`Invalid URL: ${oe}`);md(e,Z);return}QB(e,J,r,i)}else e.emit("unexpected-response",G,ne)||ii(e,G,`Unexpected server response: ${ne.statusCode}`)}),G.on("upgrade",(ne,oe,$)=>{if(e.emit("upgrade",ne),e.readyState!==qr.CONNECTING)return;G=e._req=null;let J=ne.headers.upgrade;if(J===void 0||J.toLowerCase()!=="websocket"){ii(e,oe,"Invalid Upgrade header");return}let X=US("sha1").update(y+JS).digest("base64");if(ne.headers["sec-websocket-accept"]!==X){ii(e,oe,"Invalid Sec-WebSocket-Accept header");return}let Z=ne.headers["sec-websocket-protocol"],ge;if(Z!==void 0?R.size?R.has(Z)||(ge="Server sent an invalid subprotocol"):ge="Server sent a subprotocol but none was requested":R.size&&(ge="Server sent no subprotocol"),ge){ii(e,oe,ge);return}Z&&(e._protocol=Z);let he=ne.headers["sec-websocket-extensions"];if(he!==void 0){if(!O){ii(e,oe,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ue;try{ue=$S(he)}catch{ii(e,oe,"Invalid Sec-WebSocket-Extensions header");return}let Le=Object.keys(ue);if(Le.length!==1||Le[0]!==VA.extensionName){ii(e,oe,"Server indicated an extension that was not requested");return}try{O.accept(ue[VA.extensionName])}catch{ii(e,oe,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[VA.extensionName]=O}e.setSocket(oe,$,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxBufferedChunks:s.maxBufferedChunks,maxFragments:s.maxFragments,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(G,e):G.end()}function md(e,t){e._readyState=qr.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function e_(e){return e.path=e.socketPath,BB.connect(e)}function t_(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=BB.isIP(e.host)?"":e.host),MS.connect(e)}function ii(e,t,r){e._readyState=qr.CLOSING;let i=new Error(r);Error.captureStackTrace(i,ii),t.setHeader?(t[yB]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(md,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function dm(e,t,r){if(t){let i=WS(t)?t.size:XS(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${nA[e.readyState]})`);process.nextTick(r,i)}}function r_(e,t){let r=this[Un];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Un]!==void 0&&(r._socket.removeListener("data",Id),process.nextTick(vB,r._socket),e===1005?r.close():r.close(e,t))}function n_(){let e=this[Un];e.isPaused||e._socket.resume()}function o_(e){let t=this[Un];t._socket[Un]!==void 0&&(t._socket.removeListener("data",Id),process.nextTick(vB,t._socket),t.close(e[YS])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function CB(){this[Un].emitClose()}function i_(e,t){this[Un].emit("message",e,t)}function s_(e){let t=this[Un];t._autoPong&&t.pong(e,!this._isServer,DB),t.emit("ping",e)}function A_(e){this[Un].emit("pong",e)}function vB(e){e.resume()}function a_(e){let t=this[Un];t.readyState!==qr.CLOSED&&(t.readyState===qr.OPEN&&(t._readyState=qr.CLOSING,wB(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function wB(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function SB(){let e=this[Un];if(this.removeListener("close",SB),this.removeListener("data",Id),this.removeListener("end",_B),e._readyState=qr.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Un]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",CB),e._receiver.on("finish",CB))}function Id(e){this[Un]._receiver.write(e)||this.pause()}function _B(){let e=this[Un];e._readyState=qr.CLOSING,e._receiver.end(),this.end()}function RB(){let e=this[Un];this.removeListener("error",RB),this.on("error",DB),e&&(e._readyState=qr.CLOSING,this.destroy())}});var NB=nr((kk,kB)=>{"use strict";var xk=hd(),{Duplex:l_}=Jr("stream");function bB(e){e.emit("close")}function u_(){!this.destroyed&&this._writableState.finished&&this.destroy()}function xB(e){this.removeListener("error",xB),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function c_(e,t){let r=!0,i=new l_({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a,u){let E=!u&&i._readableState.objectMode?a.toString():a;i.push(E)||e.pause()}),e.once("error",function(a){i.destroyed||(r=!1,i.destroy(a))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(s,a){if(e.readyState===e.CLOSED){a(s),process.nextTick(bB,i);return}let u=!1;e.once("error",function(I){u=!0,a(I)}),e.once("close",function(){u||a(s),process.nextTick(bB,i)}),r&&e.terminate()},i._final=function(s){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(s)});return}e._socket!==null&&(e._socket._writableState.finished?(s(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){s()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(s,a,u){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(s,a,u)});return}e.send(s,u)},i.on("end",u_),i.on("error",xB),i}kB.exports=c_});var pm=nr((Nk,TB)=>{"use strict";var{tokenChars:f_}=Eu();function g_(e){let t=new Set,r=-1,i=-1,s=0;for(s;s{"use strict";var d_=Jr("events"),Cd=Jr("http"),{Duplex:Tk}=Jr("stream"),{createHash:p_}=Jr("crypto"),OB=pd(),Wa=pu(),E_=pm(),m_=hd(),{CLOSE_TIMEOUT:I_,GUID:h_,kWebSocket:C_}=eA(),B_=/^[+/0-9A-Za-z]{22}==$/,LB=0,MB=1,UB=2,Em=class extends d_{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:I_,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:m_,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Cd.createServer((i,s)=>{let a=Cd.STATUS_CODES[426];s.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),s.end(a)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=D_(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,a,u)=>{this.handleUpgrade(s,a,u,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=LB}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===UB){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(gf,this);return}if(t&&this.once("close",t),this._state!==MB)if(this._state=MB,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(gf,this):process.nextTick(gf,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{gf(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,s){r.on("error",PB);let a=t.headers["sec-websocket-key"],u=t.headers.upgrade,E=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Ka(this,t,r,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){Ka(this,t,r,400,"Invalid Upgrade header");return}if(a===void 0||!B_.test(a)){Ka(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(E!==13&&E!==8){Ka(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){df(r,400);return}let I=t.headers["sec-websocket-protocol"],C=new Set;if(I!==void 0)try{C=E_.parse(I)}catch{Ka(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let y=t.headers["sec-websocket-extensions"],D={};if(this.options.perMessageDeflate&&y!==void 0){let R=new Wa({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let O=OB.parse(y);O[Wa.extensionName]&&(R.accept(O[Wa.extensionName]),D[Wa.extensionName]=R)}catch{Ka(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let R={origin:t.headers[`${E===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(R,(O,G,ne,oe)=>{if(!O)return df(r,G||401,ne,oe);this.completeUpgrade(D,a,C,t,r,i,s)});return}if(!this.options.verifyClient(R))return df(r,401)}this.completeUpgrade(D,a,C,t,r,i,s)}completeUpgrade(t,r,i,s,a,u,E){if(!a.readable||!a.writable)return a.destroy();if(a[C_])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>LB)return df(a,503);let C=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${p_("sha1").update(r+h_).digest("base64")}`],y=new this.options.WebSocket(null,void 0,this.options);if(i.size){let D=this.options.handleProtocols?this.options.handleProtocols(i,s):i.values().next().value;D&&(C.push(`Sec-WebSocket-Protocol: ${D}`),y._protocol=D)}if(t[Wa.extensionName]){let D=t[Wa.extensionName].params,R=OB.format({[Wa.extensionName]:[D]});C.push(`Sec-WebSocket-Extensions: ${R}`),y._extensions=t}this.emit("headers",C,s),a.write(C.concat(`\r + `)+n.join(" > ")}return null},r.getPublicRootInstance=function(n){return n=n.current,n.child?n.child.tag===5?se(n.child.stateNode):n.child.stateNode:null},r.injectIntoDevTools=function(n){if(n={bundleType:n.bundleType,version:n.version,rendererPackageName:n.rendererPackageName,rendererConfig:n.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:vg,findFiberByHostInstance:n.findFiberByHostInstance||Sg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")n=!1;else{var o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(o.isDisabled||!o.supportsFiber)n=!0;else{try{Al=o.inject(n),Yo=o}catch{}n=!!o.checkDCE}}return n},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(n,o,l,c){if(!le)throw Error(u(363));n=kl(n,o);var p=ir(n,l,c).disconnect;return{disconnect:function(){p()}}},r.registerMutableSourceForHydration=function(n,o){var l=o._getVersion;l=l(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,l]:n.mutableSourceEagerHydrationData.push(o,l)},r.runWithPriority=function(n,o){var l=Tt;try{return Tt=n,o()}finally{Tt=l}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(n,o,l,c){var p=o.current,C=Mr(),F=gs(p);return l=wg(l),o.context===null?o.context=l:o.pendingContext=l,o=Pi(C,F),o.payload={element:n},c=c===void 0?null:c,c!==null&&(o.callback=c),n=jn(p,o,F),n!==null&&($n(n,p,F,C),ca(n,p,F)),F},r}});var dC=nr((_x,gC)=>{"use strict";gC.exports=fC()});var pC=nr(Pa=>{"use strict";Pa.ConcurrentRoot=1;Pa.ContinuousEventPriority=4;Pa.DefaultEventPriority=16;Pa.DiscreteEventPriority=1;Pa.IdleEventPriority=536870912;Pa.LegacyRoot=0});var mC=nr((bx,EC)=>{"use strict";EC.exports=pC()});var _C=nr((qx,SC)=>{SC.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2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uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var eA=nr((Sk,jC)=>{"use strict";var KC=["nodebuffer","arraybuffer","fragments"],JC=typeof Blob<"u";JC&&KC.push("blob");jC.exports={BINARY_TYPES:KC,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:JC,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var lf=nr((_k,ld)=>{"use strict";var{EMPTY_BUFFER:AS}=eA(),XE=Buffer[Symbol.species];function aS(e,t){if(e.length===0)return AS;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let s=0;s{"use strict";var qC=Symbol("kDone"),em=Symbol("kRun"),tm=class{constructor(t){this[qC]=()=>{this.pending--,this[em]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[em]()}[em](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[qC])}}};zC.exports=tm});var Eu=nr((bk,tB)=>{"use strict";var uf=Jr("zlib"),XC=lf(),uS=$C(),{kStatusCode:ZC}=eA(),cS=Buffer[Symbol.species],fS=Buffer.from([0,0,255,255]),cd=Symbol("permessage-deflate"),tA=Symbol("total-length"),du=Symbol("callback"),YA=Symbol("buffers"),pu=Symbol("error"),ud,rm=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!ud){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ud=new uS(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[du];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(s=>!(r.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>s.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!s.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(i=>{let s=r[i];if(s.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(s=s[0],i==="client_max_window_bits"){if(s!==!0){let a=+s;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${s}`);s=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${s}`)}else if(i==="server_max_window_bits"){let a=+s;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${i}": ${s}`);s=a}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(s!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${s}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=s})}),t}decompress(t,r,i){ud.add(s=>{this._decompress(t,r,(a,u)=>{s(),i(a,u)})})}compress(t,r,i){ud.add(s=>{this._compress(t,r,(a,u)=>{s(),i(a,u)})})}_decompress(t,r,i){let s=this._isServer?"client":"server";if(!this._inflate){let a=`${s}_max_window_bits`,u=typeof this.params[a]!="number"?uf.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=uf.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[cd]=this,this._inflate[tA]=0,this._inflate[YA]=[],this._inflate.on("error",dS),this._inflate.on("data",eB)}this._inflate[du]=i,this._inflate.write(t),r&&this._inflate.write(fS),this._inflate.flush(()=>{let a=this._inflate[pu];if(a){this._inflate.close(),this._inflate=null,i(a);return}let u=XC.concat(this._inflate[YA],this._inflate[tA]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[tA]=0,this._inflate[YA]=[],r&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),i(null,u)})}_compress(t,r,i){let s=this._isServer?"server":"client";if(!this._deflate){let a=`${s}_max_window_bits`,u=typeof this.params[a]!="number"?uf.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=uf.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[tA]=0,this._deflate[YA]=[],this._deflate.on("data",gS)}this._deflate[du]=i,this._deflate.write(t),this._deflate.flush(uf.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=XC.concat(this._deflate[YA],this._deflate[tA]);r&&(a=new cS(a.buffer,a.byteOffset,a.length-4)),this._deflate[du]=null,this._deflate[tA]=0,this._deflate[YA]=[],r&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),i(null,a)})}};tB.exports=rm;function gS(e){this[YA].push(e),this[tA]+=e.length}function eB(e){if(this[tA]+=e.length,this[cd]._maxPayload<1||this[tA]<=this[cd]._maxPayload){this[YA].push(e);return}this[pu]=new RangeError("Max payload size exceeded"),this[pu].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[pu][ZC]=1009,this.removeListener("data",eB),this.reset()}function dS(e){if(this[cd]._inflate=null,this[pu]){this[du](this[pu]);return}e[ZC]=1007,this[du](e)}});var mu=nr((Fk,fd)=>{"use strict";var{isUtf8:rB}=Jr("buffer"),{hasBlob:pS}=eA(),ES=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function mS(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function nm(e){let t=e.length,r=0;for(;r=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function IS(e){return pS&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}fd.exports={isBlob:IS,isValidStatusCode:mS,isValidUTF8:nm,tokenChars:ES};if(rB)fd.exports.isValidUTF8=function(e){return e.length<24?nm(e):rB(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=Jr("utf-8-validate");fd.exports.isValidUTF8=function(t){return t.length<32?nm(t):e(t)}}catch{}});var am=nr((xk,lB)=>{"use strict";var{Writable:hS}=Jr("stream"),nB=Eu(),{BINARY_TYPES:CS,EMPTY_BUFFER:oB,kStatusCode:BS,kWebSocket:DS}=eA(),{concat:om,toArrayBuffer:yS,unmask:QS}=lf(),{isValidStatusCode:wS,isValidUTF8:iB}=mu(),gd=Buffer[Symbol.species],vi=0,sB=1,AB=2,aB=3,im=4,sm=5,dd=6,Am=class extends hS{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||CS[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[DS]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=vi}_write(t,r,i){if(this._opcode===8&&this._state==vi)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=i.length?r.set(this._buffers.shift(),s):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),s),this._buffers[0]=new gd(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case vi:this.getInfo(t);break;case sB:this.getPayloadLength16(t);break;case AB:this.getPayloadLength64(t);break;case aB:this.getMask();break;case im:this.getData(t);break;case sm:case dd:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(s);return}let i=(r[0]&64)===64;if(i&&!this._extensions[nB.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(s);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(s);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(s);return}if(i){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(s);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(s);return}this._payloadLength===126?this._state=sB:this._payloadLength===127?this._state=AB:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(s);return}this._payloadLength=i*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=aB:this._state=im}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=im}getData(t){let r=oB;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(r,t);return}if(this._compressed){this._state=sm,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(i);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[nB.extensionName].decompress(t,this._fin,(s,a)=>{if(s)return r(s);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(u);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let u=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(u);return}this._fragments.push(a)}this.dataMessage(r),this._state===vi&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=vi;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=om(i,r):this._binaryType==="arraybuffer"?s=yS(om(i,r)):this._binaryType==="blob"?s=new Blob(i):s=i,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=vi):(this._state=dd,setImmediate(()=>{this.emit("message",s,!0),this._state=vi,this.startLoop(t)}))}else{let s=om(i,r);if(!this._skipUTF8Validation&&!iB(s)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===sm||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=vi):(this._state=dd,setImmediate(()=>{this.emit("message",s,!1),this._state=vi,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,oB),this.end();else{let i=t.readUInt16BE(0);if(!wS(i)){let a=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(a);return}let s=new gd(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!iB(s)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(a);return}this._loop=!1,this.emit("conclude",i,s),this.end()}this._state=vi;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=vi):(this._state=dd,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=vi,this.startLoop(r)}))}createError(t,r,i,s,a){this._loop=!1,this._errored=!0;let u=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,this.createError),u.code=a,u[BS]=s,u}};lB.exports=Am});var cm=nr((Nk,fB)=>{"use strict";var{Duplex:kk}=Jr("stream"),{randomFillSync:vS}=Jr("crypto"),{types:{isUint8Array:SS}}=Jr("util"),uB=Eu(),{EMPTY_BUFFER:_S,kWebSocket:RS,NOOP:bS}=eA(),{isBlob:Iu,isValidStatusCode:FS}=mu(),{mask:cB,toBuffer:Ga}=lf(),Si=Symbol("kByteLength"),xS=Buffer.alloc(4),pd=8*1024,Ha,hu=pd,es=0,kS=1,NS=2,lm=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=es,this.onerror=bS,this[RS]=void 0}static frame(t,r){let i,s=!1,a=2,u=!1;r.mask&&(i=r.maskBuffer||xS,r.generateMask?r.generateMask(i):(hu===pd&&(Ha===void 0&&(Ha=Buffer.alloc(pd)),vS(Ha,0,pd),hu=0),i[0]=Ha[hu++],i[1]=Ha[hu++],i[2]=Ha[hu++],i[3]=Ha[hu++]),u=(i[0]|i[1]|i[2]|i[3])===0,a=6);let E;typeof t=="string"?(!r.mask||u)&&r[Si]!==void 0?E=r[Si]:(t=Buffer.from(t),E=t.length):(E=t.length,s=r.mask&&r.readOnly&&!u);let I=E;E>=65536?(a+=8,I=127):E>125&&(a+=2,I=126);let h=Buffer.allocUnsafe(s?E+a:a);return h[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(h[0]|=64),h[1]=I,I===126?h.writeUInt16BE(E,2):I===127&&(h[2]=h[3]=0,h.writeUIntBE(E,4,6)),r.mask?(h[1]|=128,h[a-4]=i[0],h[a-3]=i[1],h[a-2]=i[2],h[a-1]=i[3],u?[h,t]:s?(cB(t,i,h,a,E),[h]):(cB(t,i,t,0,E),[h,t])):[h,t]}close(t,r,i,s){let a;if(t===void 0)a=_S;else{if(typeof t!="number"||!FS(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let E=Buffer.byteLength(r);if(E>123)throw new RangeError("The message must not be greater than 123 bytes");if(a=Buffer.allocUnsafe(2+E),a.writeUInt16BE(t,0),typeof r=="string")a.write(r,2);else if(SS(r))a.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let u={[Si]:a.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==es?this.enqueue([this.dispatch,a,!1,u,s]):this.sendFrame(e.frame(a,u),s)}ping(t,r,i){let s,a;if(typeof t=="string"?(s=Buffer.byteLength(t),a=!1):Iu(t)?(s=t.size,a=!1):(t=Ga(t),s=t.length,a=Ga.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Si]:s,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};Iu(t)?this._state!==es?this.enqueue([this.getBlobData,t,!1,u,i]):this.getBlobData(t,!1,u,i):this._state!==es?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}pong(t,r,i){let s,a;if(typeof t=="string"?(s=Buffer.byteLength(t),a=!1):Iu(t)?(s=t.size,a=!1):(t=Ga(t),s=t.length,a=Ga.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[Si]:s,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};Iu(t)?this._state!==es?this.enqueue([this.getBlobData,t,!1,u,i]):this.getBlobData(t,!1,u,i):this._state!==es?this.enqueue([this.dispatch,t,!1,u,i]):this.sendFrame(e.frame(t,u),i)}send(t,r,i){let s=this._extensions[uB.extensionName],a=r.binary?2:1,u=r.compress,E,I;typeof t=="string"?(E=Buffer.byteLength(t),I=!1):Iu(t)?(E=t.size,I=!1):(t=Ga(t),E=t.length,I=Ga.readOnly),this._firstFragment?(this._firstFragment=!1,u&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=E>=s._threshold),this._compress=u):(u=!1,a=0),r.fin&&(this._firstFragment=!0);let h={[Si]:E,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:I,rsv1:u};Iu(t)?this._state!==es?this.enqueue([this.getBlobData,t,this._compress,h,i]):this.getBlobData(t,this._compress,h,i):this._state!==es?this.enqueue([this.dispatch,t,this._compress,h,i]):this.dispatch(t,this._compress,h,i)}getBlobData(t,r,i,s){this._bufferedBytes+=i[Si],this._state=NS,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let E=new Error("The socket was closed while the blob was being read");process.nextTick(um,this,E,s);return}this._bufferedBytes-=i[Si];let u=Ga(a);r?this.dispatch(u,r,i,s):(this._state=es,this.sendFrame(e.frame(u,i),s),this.dequeue())}).catch(a=>{process.nextTick(TS,this,a,s)})}dispatch(t,r,i,s){if(!r){this.sendFrame(e.frame(t,i),s);return}let a=this._extensions[uB.extensionName];this._bufferedBytes+=i[Si],this._state=kS,a.compress(t,i.fin,(u,E)=>{if(this._socket.destroyed){let I=new Error("The socket was closed while data was being compressed");um(this,I,s);return}this._bufferedBytes-=i[Si],this._state=es,i.readOnly=!1,this.sendFrame(e.frame(E,i),s),this.dequeue()})}dequeue(){for(;this._state===es&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Si],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Si],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};fB.exports=lm;function um(e,t,r){typeof r=="function"&&r(t);for(let i=0;i{"use strict";var{kForOnEventAttribute:cf,kListener:fm}=eA(),gB=Symbol("kCode"),dB=Symbol("kData"),pB=Symbol("kError"),EB=Symbol("kMessage"),mB=Symbol("kReason"),Cu=Symbol("kTarget"),IB=Symbol("kType"),hB=Symbol("kWasClean"),rA=class{constructor(t){this[Cu]=null,this[IB]=t}get target(){return this[Cu]}get type(){return this[IB]}};Object.defineProperty(rA.prototype,"target",{enumerable:!0});Object.defineProperty(rA.prototype,"type",{enumerable:!0});var Wa=class extends rA{constructor(t,r={}){super(t),this[gB]=r.code===void 0?0:r.code,this[mB]=r.reason===void 0?"":r.reason,this[hB]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[gB]}get reason(){return this[mB]}get wasClean(){return this[hB]}};Object.defineProperty(Wa.prototype,"code",{enumerable:!0});Object.defineProperty(Wa.prototype,"reason",{enumerable:!0});Object.defineProperty(Wa.prototype,"wasClean",{enumerable:!0});var Bu=class extends rA{constructor(t,r={}){super(t),this[pB]=r.error===void 0?null:r.error,this[EB]=r.message===void 0?"":r.message}get error(){return this[pB]}get message(){return this[EB]}};Object.defineProperty(Bu.prototype,"error",{enumerable:!0});Object.defineProperty(Bu.prototype,"message",{enumerable:!0});var ff=class extends rA{constructor(t,r={}){super(t),this[dB]=r.data===void 0?null:r.data}get data(){return this[dB]}};Object.defineProperty(ff.prototype,"data",{enumerable:!0});var OS={addEventListener(e,t,r={}){for(let s of this.listeners(e))if(!r[cf]&&s[fm]===t&&!s[cf])return;let i;if(e==="message")i=function(a,u){let E=new ff("message",{data:u?a:a.toString()});E[Cu]=this,Ed(t,this,E)};else if(e==="close")i=function(a,u){let E=new Wa("close",{code:a,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});E[Cu]=this,Ed(t,this,E)};else if(e==="error")i=function(a){let u=new Bu("error",{error:a,message:a.message});u[Cu]=this,Ed(t,this,u)};else if(e==="open")i=function(){let a=new rA("open");a[Cu]=this,Ed(t,this,a)};else return;i[cf]=!!r[cf],i[fm]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[fm]===t&&!r[cf]){this.removeListener(e,r);break}}};CB.exports={CloseEvent:Wa,ErrorEvent:Bu,Event:rA,EventTarget:OS,MessageEvent:ff};function Ed(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var md=nr((Ok,DB)=>{"use strict";var{tokenChars:gf}=mu();function Qs(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function LS(e){let t=Object.create(null),r=Object.create(null),i=!1,s=!1,a=!1,u,E,I=-1,h=-1,y=-1,D=0;for(;D{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(s=>{let a=i[s];return Array.isArray(a)||(a=[a]),a.map(u=>u===!0?s:`${s}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}DB.exports={format:MS,parse:LS}});var Bd=nr((Pk,NB)=>{"use strict";var PS=Jr("events"),US=Jr("https"),GS=Jr("http"),wB=Jr("net"),HS=Jr("tls"),{randomBytes:WS,createHash:KS}=Jr("crypto"),{Duplex:Lk,Readable:Mk}=Jr("stream"),{URL:gm}=Jr("url"),VA=Eu(),JS=am(),jS=cm(),{isBlob:YS}=mu(),{BINARY_TYPES:yB,CLOSE_TIMEOUT:VS,EMPTY_BUFFER:Id,GUID:qS,kForOnEventAttribute:dm,kListener:zS,kStatusCode:$S,kWebSocket:Un,NOOP:vB}=eA(),{EventTarget:{addEventListener:XS,removeEventListener:ZS}}=BB(),{format:e_,parse:t_}=md(),{toBuffer:r_}=lf(),SB=Symbol("kAborted"),pm=[8,13],nA=["CONNECTING","OPEN","CLOSING","CLOSED"],n_=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,qr=class e extends PS{constructor(t,r,i){super(),this._binaryType=yB[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Id,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),_B(this,t,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){yB.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let s=new JS({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),a=new jS(t,this._extensions,i.generateMask);this._receiver=s,this._sender=a,this._socket=t,s[Un]=this,a[Un]=this,t[Un]=this,s.on("conclude",s_),s.on("drain",A_),s.on("error",a_),s.on("message",l_),s.on("ping",u_),s.on("pong",c_),a.onerror=f_,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",FB),t.on("data",Cd),t.on("end",xB),t.on("error",kB),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[VA.extensionName]&&this._extensions[VA.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ii(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),bB(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Em(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Id,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Em(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Id,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Em(this,t,i);return}let s={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[VA.extensionName]||(s.compress=!1),this._sender.send(t||Id,s,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ii(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(qr,"CONNECTING",{enumerable:!0,value:nA.indexOf("CONNECTING")});Object.defineProperty(qr.prototype,"CONNECTING",{enumerable:!0,value:nA.indexOf("CONNECTING")});Object.defineProperty(qr,"OPEN",{enumerable:!0,value:nA.indexOf("OPEN")});Object.defineProperty(qr.prototype,"OPEN",{enumerable:!0,value:nA.indexOf("OPEN")});Object.defineProperty(qr,"CLOSING",{enumerable:!0,value:nA.indexOf("CLOSING")});Object.defineProperty(qr.prototype,"CLOSING",{enumerable:!0,value:nA.indexOf("CLOSING")});Object.defineProperty(qr,"CLOSED",{enumerable:!0,value:nA.indexOf("CLOSED")});Object.defineProperty(qr.prototype,"CLOSED",{enumerable:!0,value:nA.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(qr.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(qr.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[dm])return t[zS];return null},set(t){for(let r of this.listeners(e))if(r[dm]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[dm]:!0})}})});qr.prototype.addEventListener=XS;qr.prototype.removeEventListener=ZS;NB.exports=qr;function _B(e,t,r,i){let s={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:VS,protocolVersion:pm[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=s.autoPong,e._closeTimeout=s.closeTimeout,!pm.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${pm.join(", ")})`);let a;if(t instanceof gm)a=t;else try{a=new gm(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),e._url=a.href;let u=a.protocol==="wss:",E=a.protocol==="ws+unix:",I;if(a.protocol!=="ws:"&&!u&&!E?I=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:E&&!a.pathname?I="The URL's pathname is empty":a.hash&&(I="The URL contains a fragment identifier"),I){let ne=new SyntaxError(I);if(e._redirects===0)throw ne;hd(e,ne);return}let h=u?443:80,y=WS(16).toString("base64"),D=u?US.request:GS.request,R=new Set,O;if(s.createConnection=s.createConnection||(u?i_:o_),s.defaultPort=s.defaultPort||h,s.port=a.port||h,s.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":y,Connection:"Upgrade",Upgrade:"websocket"},s.path=a.pathname+a.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(O=new VA({...s.perMessageDeflate,isServer:!1,maxPayload:s.maxPayload}),s.headers["Sec-WebSocket-Extensions"]=e_({[VA.extensionName]:O.offer()})),r.length){for(let ne of r){if(typeof ne!="string"||!n_.test(ne)||R.has(ne))throw new SyntaxError("An invalid or duplicated subprotocol was specified");R.add(ne)}s.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin),(a.username||a.password)&&(s.auth=`${a.username}:${a.password}`),E){let ne=s.path.split(":");s.socketPath=ne[0],s.path=ne[1]}let G;if(s.followRedirects){if(e._redirects===0){e._originalIpc=E,e._originalSecure=u,e._originalHostOrSocketPath=E?s.socketPath:a.host;let ne=i&&i.headers;if(i={...i,headers:{}},ne)for(let[oe,$]of Object.entries(ne))i.headers[oe.toLowerCase()]=$}else if(e.listenerCount("redirect")===0){let ne=E?e._originalIpc?s.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:a.host===e._originalHostOrSocketPath;(!ne||e._originalSecure&&!u)&&(delete s.headers.authorization,delete s.headers.cookie,ne||delete s.headers.host,s.auth=void 0)}s.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),G=e._req=D(s),e._redirects&&e.emit("redirect",e.url,G)}else G=e._req=D(s);s.timeout&&G.on("timeout",()=>{ii(e,G,"Opening handshake has timed out")}),G.on("error",ne=>{G===null||G[SB]||(G=e._req=null,hd(e,ne))}),G.on("response",ne=>{let oe=ne.headers.location,$=ne.statusCode;if(oe&&s.followRedirects&&$>=300&&$<400){if(++e._redirects>s.maxRedirects){ii(e,G,"Maximum redirects exceeded");return}G.abort();let Z;try{Z=new gm(oe,t)}catch{let X=new SyntaxError(`Invalid URL: ${oe}`);hd(e,X);return}_B(e,Z,r,i)}else e.emit("unexpected-response",G,ne)||ii(e,G,`Unexpected server response: ${ne.statusCode}`)}),G.on("upgrade",(ne,oe,$)=>{if(e.emit("upgrade",ne),e.readyState!==qr.CONNECTING)return;G=e._req=null;let Z=ne.headers.upgrade;if(Z===void 0||Z.toLowerCase()!=="websocket"){ii(e,oe,"Invalid Upgrade header");return}let q=KS("sha1").update(y+qS).digest("base64");if(ne.headers["sec-websocket-accept"]!==q){ii(e,oe,"Invalid Sec-WebSocket-Accept header");return}let X=ne.headers["sec-websocket-protocol"],fe;if(X!==void 0?R.size?R.has(X)||(fe="Server sent an invalid subprotocol"):fe="Server sent a subprotocol but none was requested":R.size&&(fe="Server sent no subprotocol"),fe){ii(e,oe,fe);return}X&&(e._protocol=X);let Be=ne.headers["sec-websocket-extensions"];if(Be!==void 0){if(!O){ii(e,oe,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Ae;try{Ae=t_(Be)}catch{ii(e,oe,"Invalid Sec-WebSocket-Extensions header");return}let xe=Object.keys(Ae);if(xe.length!==1||xe[0]!==VA.extensionName){ii(e,oe,"Server indicated an extension that was not requested");return}try{O.accept(Ae[VA.extensionName])}catch{ii(e,oe,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[VA.extensionName]=O}e.setSocket(oe,$,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxBufferedChunks:s.maxBufferedChunks,maxFragments:s.maxFragments,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(G,e):G.end()}function hd(e,t){e._readyState=qr.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function o_(e){return e.path=e.socketPath,wB.connect(e)}function i_(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=wB.isIP(e.host)?"":e.host),HS.connect(e)}function ii(e,t,r){e._readyState=qr.CLOSING;let i=new Error(r);Error.captureStackTrace(i,ii),t.setHeader?(t[SB]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(hd,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Em(e,t,r){if(t){let i=YS(t)?t.size:r_(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${nA[e.readyState]})`);process.nextTick(r,i)}}function s_(e,t){let r=this[Un];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Un]!==void 0&&(r._socket.removeListener("data",Cd),process.nextTick(RB,r._socket),e===1005?r.close():r.close(e,t))}function A_(){let e=this[Un];e.isPaused||e._socket.resume()}function a_(e){let t=this[Un];t._socket[Un]!==void 0&&(t._socket.removeListener("data",Cd),process.nextTick(RB,t._socket),t.close(e[$S])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function QB(){this[Un].emitClose()}function l_(e,t){this[Un].emit("message",e,t)}function u_(e){let t=this[Un];t._autoPong&&t.pong(e,!this._isServer,vB),t.emit("ping",e)}function c_(e){this[Un].emit("pong",e)}function RB(e){e.resume()}function f_(e){let t=this[Un];t.readyState!==qr.CLOSED&&(t.readyState===qr.OPEN&&(t._readyState=qr.CLOSING,bB(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function bB(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function FB(){let e=this[Un];if(this.removeListener("close",FB),this.removeListener("data",Cd),this.removeListener("end",xB),e._readyState=qr.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Un]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",QB),e._receiver.on("finish",QB))}function Cd(e){this[Un]._receiver.write(e)||this.pause()}function xB(){let e=this[Un];e._readyState=qr.CLOSING,e._receiver.end(),this.end()}function kB(){let e=this[Un];this.removeListener("error",kB),this.on("error",vB),e&&(e._readyState=qr.CLOSING,this.destroy())}});var MB=nr((Gk,LB)=>{"use strict";var Uk=Bd(),{Duplex:g_}=Jr("stream");function TB(e){e.emit("close")}function d_(){!this.destroyed&&this._writableState.finished&&this.destroy()}function OB(e){this.removeListener("error",OB),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function p_(e,t){let r=!0,i=new g_({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a,u){let E=!u&&i._readableState.objectMode?a.toString():a;i.push(E)||e.pause()}),e.once("error",function(a){i.destroyed||(r=!1,i.destroy(a))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(s,a){if(e.readyState===e.CLOSED){a(s),process.nextTick(TB,i);return}let u=!1;e.once("error",function(I){u=!0,a(I)}),e.once("close",function(){u||a(s),process.nextTick(TB,i)}),r&&e.terminate()},i._final=function(s){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(s)});return}e._socket!==null&&(e._socket._writableState.finished?(s(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){s()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(s,a,u){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(s,a,u)});return}e.send(s,u)},i.on("end",d_),i.on("error",OB),i}LB.exports=p_});var mm=nr((Hk,PB)=>{"use strict";var{tokenChars:E_}=mu();function m_(e){let t=new Set,r=-1,i=-1,s=0;for(s;s{"use strict";var I_=Jr("events"),Dd=Jr("http"),{Duplex:Wk}=Jr("stream"),{createHash:h_}=Jr("crypto"),UB=md(),Ka=Eu(),C_=mm(),B_=Bd(),{CLOSE_TIMEOUT:D_,GUID:y_,kWebSocket:Q_}=eA(),w_=/^[+/0-9A-Za-z]{22}==$/,GB=0,HB=1,KB=2,Im=class extends I_{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:D_,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:B_,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Dd.createServer((i,s)=>{let a=Dd.STATUS_CODES[426];s.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),s.end(a)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=v_(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,a,u)=>{this.handleUpgrade(s,a,u,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=GB}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===KB){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(df,this);return}if(t&&this.once("close",t),this._state!==HB)if(this._state=HB,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(df,this):process.nextTick(df,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{df(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,s){r.on("error",WB);let a=t.headers["sec-websocket-key"],u=t.headers.upgrade,E=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Ja(this,t,r,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){Ja(this,t,r,400,"Invalid Upgrade header");return}if(a===void 0||!w_.test(a)){Ja(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(E!==13&&E!==8){Ja(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){pf(r,400);return}let I=t.headers["sec-websocket-protocol"],h=new Set;if(I!==void 0)try{h=C_.parse(I)}catch{Ja(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let y=t.headers["sec-websocket-extensions"],D={};if(this.options.perMessageDeflate&&y!==void 0){let R=new Ka({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let O=UB.parse(y);O[Ka.extensionName]&&(R.accept(O[Ka.extensionName]),D[Ka.extensionName]=R)}catch{Ja(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let R={origin:t.headers[`${E===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(R,(O,G,ne,oe)=>{if(!O)return pf(r,G||401,ne,oe);this.completeUpgrade(D,a,h,t,r,i,s)});return}if(!this.options.verifyClient(R))return pf(r,401)}this.completeUpgrade(D,a,h,t,r,i,s)}completeUpgrade(t,r,i,s,a,u,E){if(!a.readable||!a.writable)return a.destroy();if(a[Q_])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>GB)return pf(a,503);let h=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${h_("sha1").update(r+y_).digest("base64")}`],y=new this.options.WebSocket(null,void 0,this.options);if(i.size){let D=this.options.handleProtocols?this.options.handleProtocols(i,s):i.values().next().value;D&&(h.push(`Sec-WebSocket-Protocol: ${D}`),y._protocol=D)}if(t[Ka.extensionName]){let D=t[Ka.extensionName].params,R=UB.format({[Ka.extensionName]:[D]});h.push(`Sec-WebSocket-Extensions: ${R}`),y._extensions=t}this.emit("headers",h,s),a.write(h.concat(`\r `).join(`\r -`)),a.removeListener("error",PB),y.setSocket(a,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(y),y.on("close",()=>{this.clients.delete(y),this._shouldEmitClose&&!this.clients.size&&process.nextTick(gf,this)})),E(y,s)}};GB.exports=Em;function D_(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let i of Object.keys(t))e.removeListener(i,t[i])}}function gf(e){e._state=UB,e.emit("close")}function PB(){this.destroy()}function df(e,t,r,i){r=r||Cd.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Cd.STATUS_CODES[t]}\r +`)),a.removeListener("error",WB),y.setSocket(a,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(y),y.on("close",()=>{this.clients.delete(y),this._shouldEmitClose&&!this.clients.size&&process.nextTick(df,this)})),E(y,s)}};JB.exports=Im;function v_(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let i of Object.keys(t))e.removeListener(i,t[i])}}function df(e){e._state=KB,e.emit("close")}function WB(){this.destroy()}function pf(e,t,r,i){r=r||Dd.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Dd.STATUS_CODES[t]}\r `+Object.keys(i).map(s=>`${s}: ${i[s]}`).join(`\r `)+`\r \r -`+r)}function Ka(e,t,r,i,s,a){if(e.listenerCount("wsClientError")){let u=new Error(s);Error.captureStackTrace(u,Ka),e.emit("wsClientError",u,r,t)}else df(r,i,s,a)}});var y_,Q_,v_,w_,S_,__,WB,R_,Bd,mm=cE(()=>{y_=Me(NB(),1),Q_=Me(pd(),1),v_=Me(pu(),1),w_=Me(sm(),1),S_=Me(lm(),1),__=Me(pm(),1),WB=Me(hd(),1),R_=Me(HB(),1),Bd=WB.default});var Dd,KB=cE(()=>{mm();Dd=global;Dd.WebSocket||=Bd;Dd.window||=global;Dd.self||=global;Dd.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__=[{type:1,value:7,isEnabled:!0},{type:2,value:"InternalApp",isEnabled:!0,isValid:!0},{type:2,value:"InternalAppContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdoutContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStderrContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdinContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalFocusContext",isEnabled:!0,isValid:!0}]});var JB=nr((yd,Im)=>{(function(t,r){typeof yd=="object"&&typeof Im=="object"?Im.exports=r():typeof define=="function"&&define.amd?define([],r):typeof yd=="object"?yd.ReactDevToolsBackend=r():t.ReactDevToolsBackend=r()})(self,()=>(()=>{var e={602:((s,a,u)=>{"use strict";var E;function I(se){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(W){return typeof W}:I=function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},I(se)}var C=u(206),y=u(189),D=Object.assign,R=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=[],G=null;function ne(){if(G===null){var se=new Map;try{J.useContext({_currentValue:null}),J.useState(null),J.useReducer(function(fe){return fe},null),J.useRef(null),typeof J.useCacheRefresh=="function"&&J.useCacheRefresh(),J.useLayoutEffect(function(){}),J.useInsertionEffect(function(){}),J.useEffect(function(){}),J.useImperativeHandle(void 0,function(){return null}),J.useDebugValue(null),J.useCallback(function(){}),J.useMemo(function(){return null}),typeof J.useMemoCache=="function"&&J.useMemoCache(0)}finally{var N=O;O=[]}for(var W=0;W"u"?J:new Proxy(J,X),ge=0;function he(se,N,W){var ae=N[W].source,fe=0;e:for(;feCe;Ce++)if(ce=he(V,Pe,Ce),ce!==-1){ge=Ce,Pe=ce;break e}Pe=-1}}e:{if(V=Ze,ce=ne().get(pt.primitive),ce!==void 0){for(Ce=0;CePe-V?null:Ze.slice(V,Pe-1),Ze!==null){if(Pe=0,fe!==null){for(;PePe;fe--)Ie=ke.pop()}for(fe=Ze.length-Pe-1;1<=fe;fe--)Pe=[],V=Ze[fe],(ce=Ze[fe-1].functionName)?(Ce=ce.lastIndexOf("."),Ce===-1&&(Ce=0),ce.slice(Ce,Ce+3)==="use"&&(Ce+=3),ce=ce.slice(Ce)):ce="",ce={id:null,isStateEditable:!1,name:ce,value:void 0,subHooks:Pe},W&&(ce.hookSource={lineNumber:V.lineNumber,columnNumber:V.columnNumber,functionName:V.functionName,fileName:V.fileName}),Ie.push(ce),ke.push(Ie),Ie=Pe;fe=Ze}Pe=pt.primitive,pt={id:Pe==="Context"||Pe==="DebugValue"?null:et++,isStateEditable:Pe==="Reducer"||Pe==="State",name:Pe,value:pt.value,subHooks:[]},W&&(Pe={lineNumber:null,functionName:null,fileName:null,columnNumber:null},Ze&&1<=Ze.length&&(Ze=Ze[0],Pe.lineNumber=Ze.lineNumber,Pe.functionName=Ze.functionName,Pe.fileName=Ze.fileName,Pe.columnNumber=Ze.columnNumber),pt.hookSource=Pe),Ie.push(pt)}return pe(ae,null),ae}function pe(se,N){for(var W=[],ae=0;ae{"use strict";s.exports=u(602)}),9:((s,a)=>{"use strict";var u;function E(pe){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(De){return typeof De}:E=function(De){return De&&typeof Symbol=="function"&&De.constructor===Symbol&&De!==Symbol.prototype?"symbol":typeof De},E(pe)}var I=Symbol.for("react.element"),C=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),G=Symbol.for("react.context"),ne=Symbol.for("react.server_context"),oe=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ge=Symbol.for("react.offscreen"),he=Symbol.for("react.cache"),ue=Symbol.for("react.client.reference");function Le(pe){if(E(pe)==="object"&&pe!==null){var ct=pe.$$typeof;switch(ct){case I:switch(pe=pe.type,pe){case y:case R:case D:case $:case J:return pe;default:switch(pe=pe&&pe.$$typeof,pe){case ne:case G:case oe:case Z:case X:case O:return pe;default:return ct}}case C:return ct}}}a.ContextConsumer=G,a.ContextProvider=O,u=I,a.ForwardRef=oe,a.Fragment=y,a.Lazy=Z,a.Memo=X,a.Portal=C,a.Profiler=R,a.StrictMode=D,a.Suspense=$,u=J,u=function(){return!1},u=function(){return!1},u=function(pe){return Le(pe)===G},u=function(pe){return Le(pe)===O},a.isElement=function(pe){return E(pe)==="object"&&pe!==null&&pe.$$typeof===I},u=function(pe){return Le(pe)===oe},u=function(pe){return Le(pe)===y},u=function(pe){return Le(pe)===Z},u=function(pe){return Le(pe)===X},u=function(pe){return Le(pe)===C},u=function(pe){return Le(pe)===R},u=function(pe){return Le(pe)===D},u=function(pe){return Le(pe)===$},u=function(pe){return Le(pe)===J},u=function(pe){return typeof pe=="string"||typeof pe=="function"||pe===y||pe===R||pe===D||pe===$||pe===J||pe===ge||pe===he||E(pe)==="object"&&pe!==null&&(pe.$$typeof===Z||pe.$$typeof===X||pe.$$typeof===O||pe.$$typeof===G||pe.$$typeof===oe||pe.$$typeof===ue||pe.getModuleId!==void 0)},a.typeOf=Le}),550:((s,a,u)=>{"use strict";s.exports=u(9)}),978:((s,a)=>{"use strict";function u(K){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(rt){return typeof rt}:u=function(rt){return rt&&typeof Symbol=="function"&&rt.constructor===Symbol&&rt!==Symbol.prototype?"symbol":typeof rt},u(K)}var E=Symbol.for("react.element"),I=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),O=Symbol.for("react.context"),G=Symbol.for("react.server_context"),ne=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Z=Symbol.for("react.debug_trace_mode"),ge=Symbol.for("react.offscreen"),he=Symbol.for("react.cache"),ue=Symbol.for("react.default_value"),Le=Symbol.for("react.postpone"),pe=Symbol.iterator;function ct(K){return K===null||u(K)!=="object"?null:(K=pe&&K[pe]||K["@@iterator"],typeof K=="function"?K:null)}var De={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ve=Object.assign,se={};function N(K,Ae,rt){this.props=K,this.context=Ae,this.refs=se,this.updater=rt||De}N.prototype.isReactComponent={},N.prototype.setState=function(K,Ae){if(u(K)!=="object"&&typeof K!="function"&&K!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,Ae,"setState")},N.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function W(){}W.prototype=N.prototype;function ae(K,Ae,rt){this.props=K,this.context=Ae,this.refs=se,this.updater=rt||De}var fe=ae.prototype=new W;fe.constructor=ae,ve(fe,N.prototype),fe.isPureReactComponent=!0;var Ie=Array.isArray,et=Object.prototype.hasOwnProperty,ke={current:null},ft={key:!0,ref:!0,__self:!0,__source:!0};function pt(K,Ae,rt){var dt,Ft={},_t=null,Xt=null;if(Ae!=null)for(dt in Ae.ref!==void 0&&(Xt=Ae.ref),Ae.key!==void 0&&(_t=""+Ae.key),Ae)et.call(Ae,dt)&&!ft.hasOwnProperty(dt)&&(Ft[dt]=Ae[dt]);var or=arguments.length-2;if(or===1)Ft.children=rt;else if(1{"use strict";s.exports=u(978)}),206:(function(s,a,u){var E,I,C;function y(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(O){return typeof O}:y=function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},y(D)}(function(D,R){"use strict";I=[u(430)],E=R,C=typeof E=="function"?E.apply(a,I):E,C!==void 0&&(s.exports=C)})(this,function(R){"use strict";var O=/(^|@)\S+:\d+/,G=/^\s*at .*(\S+:\d+|\(native\))/m,ne=/^(eval@)?(\[native code])?$/;return{parse:function($){if(typeof $.stacktrace<"u"||typeof $["opera#sourceloc"]<"u")return this.parseOpera($);if($.stack&&$.stack.match(G))return this.parseV8OrIE($);if($.stack)return this.parseFFOrSafari($);throw new Error("Cannot parse given Error object")},extractLocation:function($){if($.indexOf(":")===-1)return[$];var J=/(.+?)(?::(\d+))?(?::(\d+))?$/,X=J.exec($.replace(/[()]/g,""));return[X[1],X[2]||void 0,X[3]||void 0]},parseV8OrIE:function($){var J=$.stack.split(` -`).filter(function(X){return!!X.match(G)},this);return J.map(function(X){X.indexOf("(eval ")>-1&&(X=X.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var Z=X.replace(/^\s+/,"").replace(/\(eval code/g,"("),ge=Z.match(/ (\((.+):(\d+):(\d+)\)$)/);Z=ge?Z.replace(ge[0],""):Z;var he=Z.split(/\s+/).slice(1),ue=this.extractLocation(ge?ge[1]:he.pop()),Le=he.join(" ")||void 0,pe=["eval",""].indexOf(ue[0])>-1?void 0:ue[0];return new R({functionName:Le,fileName:pe,lineNumber:ue[1],columnNumber:ue[2],source:X})},this)},parseFFOrSafari:function($){var J=$.stack.split(` -`).filter(function(X){return!X.match(ne)},this);return J.map(function(X){if(X.indexOf(" > eval")>-1&&(X=X.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),X.indexOf("@")===-1&&X.indexOf(":")===-1)return new R({functionName:X});var Z=/((.*".+"[^@]*)?[^@]*)(?:@)/,ge=X.match(Z),he=ge&&ge[1]?ge[1]:void 0,ue=this.extractLocation(X.replace(Z,""));return new R({functionName:he,fileName:ue[0],lineNumber:ue[1],columnNumber:ue[2],source:X})},this)},parseOpera:function($){return!$.stacktrace||$.message.indexOf(` +`+r)}function Ja(e,t,r,i,s,a){if(e.listenerCount("wsClientError")){let u=new Error(s);Error.captureStackTrace(u,Ja),e.emit("wsClientError",u,r,t)}else pf(r,i,s,a)}});var S_,__,R_,b_,F_,x_,YB,k_,yd,hm=gE(()=>{S_=Le(MB(),1),__=Le(md(),1),R_=Le(Eu(),1),b_=Le(am(),1),F_=Le(cm(),1),x_=Le(mm(),1),YB=Le(Bd(),1),k_=Le(jB(),1),yd=YB.default});var Qd,VB=gE(()=>{hm();Qd=global;Qd.WebSocket||=yd;Qd.window||=global;Qd.self||=global;Qd.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__=[{type:1,value:7,isEnabled:!0},{type:2,value:"InternalApp",isEnabled:!0,isValid:!0},{type:2,value:"InternalAppContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdoutContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStderrContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdinContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalFocusContext",isEnabled:!0,isValid:!0}]});var qB=nr((wd,Cm)=>{(function(t,r){typeof wd=="object"&&typeof Cm=="object"?Cm.exports=r():typeof define=="function"&&define.amd?define([],r):typeof wd=="object"?wd.ReactDevToolsBackend=r():t.ReactDevToolsBackend=r()})(self,()=>(()=>{var e={602:((s,a,u)=>{"use strict";var E;function I(ie){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(H){return typeof H}:I=function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},I(ie)}var h=u(206),y=u(189),D=Object.assign,R=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=[],G=null;function ne(){if(G===null){var ie=new Map;try{Z.useContext({_currentValue:null}),Z.useState(null),Z.useReducer(function(ge){return ge},null),Z.useRef(null),typeof Z.useCacheRefresh=="function"&&Z.useCacheRefresh(),Z.useLayoutEffect(function(){}),Z.useInsertionEffect(function(){}),Z.useEffect(function(){}),Z.useImperativeHandle(void 0,function(){return null}),Z.useDebugValue(null),Z.useCallback(function(){}),Z.useMemo(function(){return null}),typeof Z.useMemoCache=="function"&&Z.useMemoCache(0)}finally{var k=O;O=[]}for(var H=0;H"u"?Z:new Proxy(Z,q),fe=0;function Be(ie,k,H){var se=k[H].source,ge=0;e:for(;gehe;he++)if(ce=Be(J,Ge,he),ce!==-1){fe=he,Ge=ce;break e}Ge=-1}}e:{if(J=it,ce=ne().get(at.primitive),ce!==void 0){for(he=0;heGe-J?null:it.slice(J,Ge-1),it!==null){if(Ge=0,ge!==null){for(;GeGe;ge--)Ee=Oe.pop()}for(ge=it.length-Ge-1;1<=ge;ge--)Ge=[],J=it[ge],(ce=it[ge-1].functionName)?(he=ce.lastIndexOf("."),he===-1&&(he=0),ce.slice(he,he+3)==="use"&&(he+=3),ce=ce.slice(he)):ce="",ce={id:null,isStateEditable:!1,name:ce,value:void 0,subHooks:Ge},H&&(ce.hookSource={lineNumber:J.lineNumber,columnNumber:J.columnNumber,functionName:J.functionName,fileName:J.fileName}),Ee.push(ce),Oe.push(Ee),Ee=Ge;ge=it}Ge=at.primitive,at={id:Ge==="Context"||Ge==="DebugValue"?null:Ze++,isStateEditable:Ge==="Reducer"||Ge==="State",name:Ge,value:at.value,subHooks:[]},H&&(Ge={lineNumber:null,functionName:null,fileName:null,columnNumber:null},it&&1<=it.length&&(it=it[0],Ge.lineNumber=it.lineNumber,Ge.functionName=it.functionName,Ge.fileName=it.fileName,Ge.columnNumber=it.columnNumber),at.hookSource=Ge),Ee.push(at)}return de(se,null),se}function de(ie,k){for(var H=[],se=0;se{"use strict";s.exports=u(602)}),9:((s,a)=>{"use strict";var u;function E(de){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(Ye){return typeof Ye}:E=function(Ye){return Ye&&typeof Symbol=="function"&&Ye.constructor===Symbol&&Ye!==Symbol.prototype?"symbol":typeof Ye},E(de)}var I=Symbol.for("react.element"),h=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),G=Symbol.for("react.context"),ne=Symbol.for("react.server_context"),oe=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),fe=Symbol.for("react.offscreen"),Be=Symbol.for("react.cache"),Ae=Symbol.for("react.client.reference");function xe(de){if(E(de)==="object"&&de!==null){var ft=de.$$typeof;switch(ft){case I:switch(de=de.type,de){case y:case R:case D:case $:case Z:return de;default:switch(de=de&&de.$$typeof,de){case ne:case G:case oe:case X:case q:case O:return de;default:return ft}}case h:return ft}}}a.ContextConsumer=G,a.ContextProvider=O,u=I,a.ForwardRef=oe,a.Fragment=y,a.Lazy=X,a.Memo=q,a.Portal=h,a.Profiler=R,a.StrictMode=D,a.Suspense=$,u=Z,u=function(){return!1},u=function(){return!1},u=function(de){return xe(de)===G},u=function(de){return xe(de)===O},a.isElement=function(de){return E(de)==="object"&&de!==null&&de.$$typeof===I},u=function(de){return xe(de)===oe},u=function(de){return xe(de)===y},u=function(de){return xe(de)===X},u=function(de){return xe(de)===q},u=function(de){return xe(de)===h},u=function(de){return xe(de)===R},u=function(de){return xe(de)===D},u=function(de){return xe(de)===$},u=function(de){return xe(de)===Z},u=function(de){return typeof de=="string"||typeof de=="function"||de===y||de===R||de===D||de===$||de===Z||de===fe||de===Be||E(de)==="object"&&de!==null&&(de.$$typeof===X||de.$$typeof===q||de.$$typeof===O||de.$$typeof===G||de.$$typeof===oe||de.$$typeof===Ae||de.getModuleId!==void 0)},a.typeOf=xe}),550:((s,a,u)=>{"use strict";s.exports=u(9)}),978:((s,a)=>{"use strict";function u(K){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(tt){return typeof tt}:u=function(tt){return tt&&typeof Symbol=="function"&&tt.constructor===Symbol&&tt!==Symbol.prototype?"symbol":typeof tt},u(K)}var E=Symbol.for("react.element"),I=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),O=Symbol.for("react.context"),G=Symbol.for("react.server_context"),ne=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),X=Symbol.for("react.debug_trace_mode"),fe=Symbol.for("react.offscreen"),Be=Symbol.for("react.cache"),Ae=Symbol.for("react.default_value"),xe=Symbol.for("react.postpone"),de=Symbol.iterator;function ft(K){return K===null||u(K)!=="object"?null:(K=de&&K[de]||K["@@iterator"],typeof K=="function"?K:null)}var Ye={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},we=Object.assign,ie={};function k(K,le,tt){this.props=K,this.context=le,this.refs=ie,this.updater=tt||Ye}k.prototype.isReactComponent={},k.prototype.setState=function(K,le){if(u(K)!=="object"&&typeof K!="function"&&K!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,le,"setState")},k.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function H(){}H.prototype=k.prototype;function se(K,le,tt){this.props=K,this.context=le,this.refs=ie,this.updater=tt||Ye}var ge=se.prototype=new H;ge.constructor=se,we(ge,k.prototype),ge.isPureReactComponent=!0;var Ee=Array.isArray,Ze=Object.prototype.hasOwnProperty,Oe={current:null},gt={key:!0,ref:!0,__self:!0,__source:!0};function at(K,le,tt){var pt,bt={},_t=null,Xt=null;if(le!=null)for(pt in le.ref!==void 0&&(Xt=le.ref),le.key!==void 0&&(_t=""+le.key),le)Ze.call(le,pt)&&!gt.hasOwnProperty(pt)&&(bt[pt]=le[pt]);var or=arguments.length-2;if(or===1)bt.children=tt;else if(1{"use strict";s.exports=u(978)}),206:(function(s,a,u){var E,I,h;function y(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(O){return typeof O}:y=function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},y(D)}(function(D,R){"use strict";I=[u(430)],E=R,h=typeof E=="function"?E.apply(a,I):E,h!==void 0&&(s.exports=h)})(this,function(R){"use strict";var O=/(^|@)\S+:\d+/,G=/^\s*at .*(\S+:\d+|\(native\))/m,ne=/^(eval@)?(\[native code])?$/;return{parse:function($){if(typeof $.stacktrace<"u"||typeof $["opera#sourceloc"]<"u")return this.parseOpera($);if($.stack&&$.stack.match(G))return this.parseV8OrIE($);if($.stack)return this.parseFFOrSafari($);throw new Error("Cannot parse given Error object")},extractLocation:function($){if($.indexOf(":")===-1)return[$];var Z=/(.+?)(?::(\d+))?(?::(\d+))?$/,q=Z.exec($.replace(/[()]/g,""));return[q[1],q[2]||void 0,q[3]||void 0]},parseV8OrIE:function($){var Z=$.stack.split(` +`).filter(function(q){return!!q.match(G)},this);return Z.map(function(q){q.indexOf("(eval ")>-1&&(q=q.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var X=q.replace(/^\s+/,"").replace(/\(eval code/g,"("),fe=X.match(/ (\((.+):(\d+):(\d+)\)$)/);X=fe?X.replace(fe[0],""):X;var Be=X.split(/\s+/).slice(1),Ae=this.extractLocation(fe?fe[1]:Be.pop()),xe=Be.join(" ")||void 0,de=["eval",""].indexOf(Ae[0])>-1?void 0:Ae[0];return new R({functionName:xe,fileName:de,lineNumber:Ae[1],columnNumber:Ae[2],source:q})},this)},parseFFOrSafari:function($){var Z=$.stack.split(` +`).filter(function(q){return!q.match(ne)},this);return Z.map(function(q){if(q.indexOf(" > eval")>-1&&(q=q.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),q.indexOf("@")===-1&&q.indexOf(":")===-1)return new R({functionName:q});var X=/((.*".+"[^@]*)?[^@]*)(?:@)/,fe=q.match(X),Be=fe&&fe[1]?fe[1]:void 0,Ae=this.extractLocation(q.replace(X,""));return new R({functionName:Be,fileName:Ae[0],lineNumber:Ae[1],columnNumber:Ae[2],source:q})},this)},parseOpera:function($){return!$.stacktrace||$.message.indexOf(` `)>-1&&$.message.split(` `).length>$.stacktrace.split(` -`).length?this.parseOpera9($):$.stack?this.parseOpera11($):this.parseOpera10($)},parseOpera9:function($){for(var J=/Line (\d+).*script (?:in )?(\S+)/i,X=$.message.split(` -`),Z=[],ge=2,he=X.length;ge/,"$2").replace(/\([^)]*\)/g,"")||void 0,Le;he.match(/\(([^)]*)\)/)&&(Le=he.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var pe=Le===void 0||Le==="[arguments not available]"?void 0:Le.split(",");return new R({functionName:ue,args:pe,fileName:ge[0],lineNumber:ge[1],columnNumber:ge[2],source:X})},this)}}})}),172:(s=>{function a(ve){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?a=function(N){return typeof N}:a=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},a(ve)}var u="Expected a function",E=NaN,I="[object Symbol]",C=/^\s+|\s+$/g,y=/^[-+]0x[0-9a-f]+$/i,D=/^0b[01]+$/i,R=/^0o[0-7]+$/i,O=parseInt,G=(typeof global>"u"?"undefined":a(global))=="object"&&global&&global.Object===Object&&global,ne=(typeof self>"u"?"undefined":a(self))=="object"&&self&&self.Object===Object&&self,oe=G||ne||Function("return this")(),$=Object.prototype,J=$.toString,X=Math.max,Z=Math.min,ge=function(){return oe.Date.now()};function he(ve,se,N){var W,ae,fe,Ie,et,ke,ft=0,pt=!1,Pe=!1,Ze=!0;if(typeof ve!="function")throw new TypeError(u);se=De(se)||0,Le(N)&&(pt=!!N.leading,Pe="maxWait"in N,fe=Pe?X(De(N.maxWait)||0,se):fe,Ze="trailing"in N?!!N.trailing:Ze);function V(je){var Br=W,Ar=ae;return W=ae=void 0,ft=je,Ie=ve.apply(Ar,Br),Ie}function ce(je){return ft=je,et=setTimeout(Ye,se),pt?V(je):Ie}function Ce(je){var Br=je-ke,Ar=je-ft,yr=se-Br;return Pe?Z(yr,fe-Ar):yr}function tt(je){var Br=je-ke,Ar=je-ft;return ke===void 0||Br>=se||Br<0||Pe&&Ar>=fe}function Ye(){var je=ge();if(tt(je))return Qt(je);et=setTimeout(Ye,Ce(je))}function Qt(je){return et=void 0,Ze&&W?V(je):(W=ae=void 0,Ie)}function ut(){et!==void 0&&clearTimeout(et),ft=0,W=ke=ae=et=void 0}function mt(){return et===void 0?Ie:Qt(ge())}function vt(){var je=ge(),Br=tt(je);if(W=arguments,ae=this,ke=je,Br){if(et===void 0)return ce(ke);if(Pe)return et=setTimeout(Ye,se),V(ke)}return et===void 0&&(et=setTimeout(Ye,se)),Ie}return vt.cancel=ut,vt.flush=mt,vt}function ue(ve,se,N){var W=!0,ae=!0;if(typeof ve!="function")throw new TypeError(u);return Le(N)&&(W="leading"in N?!!N.leading:W,ae="trailing"in N?!!N.trailing:ae),he(ve,se,{leading:W,maxWait:se,trailing:ae})}function Le(ve){var se=a(ve);return!!ve&&(se=="object"||se=="function")}function pe(ve){return!!ve&&a(ve)=="object"}function ct(ve){return a(ve)=="symbol"||pe(ve)&&J.call(ve)==I}function De(ve){if(typeof ve=="number")return ve;if(ct(ve))return E;if(Le(ve)){var se=typeof ve.valueOf=="function"?ve.valueOf():ve;ve=Le(se)?se+"":se}if(typeof ve!="string")return ve===0?ve:+ve;ve=ve.replace(C,"");var N=D.test(ve);return N||R.test(ve)?O(ve.slice(2),N?2:8):y.test(ve)?E:+ve}s.exports=ue}),730:((s,a,u)=>{"use strict";var E=u(169);s.exports=ue;var I=u(307),C=u(82),y=u(695),D=typeof Symbol=="function"&&E.env._nodeLRUCacheForceNoSymbol!=="1",R;D?R=function(W){return Symbol(W)}:R=function(W){return"_"+W};var O=R("max"),G=R("length"),ne=R("lengthCalculator"),oe=R("allowStale"),$=R("maxAge"),J=R("dispose"),X=R("noDisposeOnSet"),Z=R("lruList"),ge=R("cache");function he(){return 1}function ue(N){if(!(this instanceof ue))return new ue(N);typeof N=="number"&&(N={max:N}),N||(N={});var W=this[O]=N.max;(!W||typeof W!="number"||W<=0)&&(this[O]=1/0);var ae=N.length||he;typeof ae!="function"&&(ae=he),this[ne]=ae,this[oe]=N.stale||!1,this[$]=N.maxAge||0,this[J]=N.dispose,this[X]=N.noDisposeOnSet||!1,this.reset()}Object.defineProperty(ue.prototype,"max",{set:function(W){(!W||typeof W!="number"||W<=0)&&(W=1/0),this[O]=W,De(this)},get:function(){return this[O]},enumerable:!0}),Object.defineProperty(ue.prototype,"allowStale",{set:function(W){this[oe]=!!W},get:function(){return this[oe]},enumerable:!0}),Object.defineProperty(ue.prototype,"maxAge",{set:function(W){(!W||typeof W!="number"||W<0)&&(W=0),this[$]=W,De(this)},get:function(){return this[$]},enumerable:!0}),Object.defineProperty(ue.prototype,"lengthCalculator",{set:function(W){typeof W!="function"&&(W=he),W!==this[ne]&&(this[ne]=W,this[G]=0,this[Z].forEach(function(ae){ae.length=this[ne](ae.value,ae.key),this[G]+=ae.length},this)),De(this)},get:function(){return this[ne]},enumerable:!0}),Object.defineProperty(ue.prototype,"length",{get:function(){return this[G]},enumerable:!0}),Object.defineProperty(ue.prototype,"itemCount",{get:function(){return this[Z].length},enumerable:!0}),ue.prototype.rforEach=function(N,W){W=W||this;for(var ae=this[Z].tail;ae!==null;){var fe=ae.prev;Le(this,N,ae,W),ae=fe}};function Le(N,W,ae,fe){var Ie=ae.value;ct(N,Ie)&&(ve(N,ae),N[oe]||(Ie=void 0)),Ie&&W.call(fe,Ie.value,Ie.key,N)}ue.prototype.forEach=function(N,W){W=W||this;for(var ae=this[Z].head;ae!==null;){var fe=ae.next;Le(this,N,ae,W),ae=fe}},ue.prototype.keys=function(){return this[Z].toArray().map(function(N){return N.key},this)},ue.prototype.values=function(){return this[Z].toArray().map(function(N){return N.value},this)},ue.prototype.reset=function(){this[J]&&this[Z]&&this[Z].length&&this[Z].forEach(function(N){this[J](N.key,N.value)},this),this[ge]=new I,this[Z]=new y,this[G]=0},ue.prototype.dump=function(){return this[Z].map(function(N){if(!ct(this,N))return{k:N.key,v:N.value,e:N.now+(N.maxAge||0)}},this).toArray().filter(function(N){return N})},ue.prototype.dumpLru=function(){return this[Z]},ue.prototype.inspect=function(N,W){var ae="LRUCache {",fe=!1,Ie=this[oe];Ie&&(ae+=` - allowStale: true`,fe=!0);var et=this[O];et&&et!==1/0&&(fe&&(ae+=","),ae+=` - max: `+C.inspect(et,W),fe=!0);var ke=this[$];ke&&(fe&&(ae+=","),ae+=` - maxAge: `+C.inspect(ke,W),fe=!0);var ft=this[ne];ft&&ft!==he&&(fe&&(ae+=","),ae+=` - length: `+C.inspect(this[G],W),fe=!0);var pt=!1;return this[Z].forEach(function(Pe){pt?ae+=`, - `:(fe&&(ae+=`, -`),pt=!0,ae+=` - `);var Ze=C.inspect(Pe.key).split(` +`).length?this.parseOpera9($):$.stack?this.parseOpera11($):this.parseOpera10($)},parseOpera9:function($){for(var Z=/Line (\d+).*script (?:in )?(\S+)/i,q=$.message.split(` +`),X=[],fe=2,Be=q.length;fe/,"$2").replace(/\([^)]*\)/g,"")||void 0,xe;Be.match(/\(([^)]*)\)/)&&(xe=Be.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var de=xe===void 0||xe==="[arguments not available]"?void 0:xe.split(",");return new R({functionName:Ae,args:de,fileName:fe[0],lineNumber:fe[1],columnNumber:fe[2],source:q})},this)}}})}),172:(s=>{function a(we){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?a=function(k){return typeof k}:a=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},a(we)}var u="Expected a function",E=NaN,I="[object Symbol]",h=/^\s+|\s+$/g,y=/^[-+]0x[0-9a-f]+$/i,D=/^0b[01]+$/i,R=/^0o[0-7]+$/i,O=parseInt,G=(typeof global>"u"?"undefined":a(global))=="object"&&global&&global.Object===Object&&global,ne=(typeof self>"u"?"undefined":a(self))=="object"&&self&&self.Object===Object&&self,oe=G||ne||Function("return this")(),$=Object.prototype,Z=$.toString,q=Math.max,X=Math.min,fe=function(){return oe.Date.now()};function Be(we,ie,k){var H,se,ge,Ee,Ze,Oe,gt=0,at=!1,Ge=!1,it=!0;if(typeof we!="function")throw new TypeError(u);ie=Ye(ie)||0,xe(k)&&(at=!!k.leading,Ge="maxWait"in k,ge=Ge?q(Ye(k.maxWait)||0,ie):ge,it="trailing"in k?!!k.trailing:it);function J(Je){var Br=H,Ar=se;return H=se=void 0,gt=Je,Ee=we.apply(Ar,Br),Ee}function ce(Je){return gt=Je,Ze=setTimeout(je,ie),at?J(Je):Ee}function he(Je){var Br=Je-Oe,Ar=Je-gt,yr=ie-Br;return Ge?X(yr,ge-Ar):yr}function et(Je){var Br=Je-Oe,Ar=Je-gt;return Oe===void 0||Br>=ie||Br<0||Ge&&Ar>=ge}function je(){var Je=fe();if(et(Je))return Qt(Je);Ze=setTimeout(je,he(Je))}function Qt(Je){return Ze=void 0,it&&H?J(Je):(H=se=void 0,Ee)}function ct(){Ze!==void 0&&clearTimeout(Ze),gt=0,H=Oe=se=Ze=void 0}function mt(){return Ze===void 0?Ee:Qt(fe())}function wt(){var Je=fe(),Br=et(Je);if(H=arguments,se=this,Oe=Je,Br){if(Ze===void 0)return ce(Oe);if(Ge)return Ze=setTimeout(je,ie),J(Oe)}return Ze===void 0&&(Ze=setTimeout(je,ie)),Ee}return wt.cancel=ct,wt.flush=mt,wt}function Ae(we,ie,k){var H=!0,se=!0;if(typeof we!="function")throw new TypeError(u);return xe(k)&&(H="leading"in k?!!k.leading:H,se="trailing"in k?!!k.trailing:se),Be(we,ie,{leading:H,maxWait:ie,trailing:se})}function xe(we){var ie=a(we);return!!we&&(ie=="object"||ie=="function")}function de(we){return!!we&&a(we)=="object"}function ft(we){return a(we)=="symbol"||de(we)&&Z.call(we)==I}function Ye(we){if(typeof we=="number")return we;if(ft(we))return E;if(xe(we)){var ie=typeof we.valueOf=="function"?we.valueOf():we;we=xe(ie)?ie+"":ie}if(typeof we!="string")return we===0?we:+we;we=we.replace(h,"");var k=D.test(we);return k||R.test(we)?O(we.slice(2),k?2:8):y.test(we)?E:+we}s.exports=Ae}),730:((s,a,u)=>{"use strict";var E=u(169);s.exports=Ae;var I=u(307),h=u(82),y=u(695),D=typeof Symbol=="function"&&E.env._nodeLRUCacheForceNoSymbol!=="1",R;D?R=function(H){return Symbol(H)}:R=function(H){return"_"+H};var O=R("max"),G=R("length"),ne=R("lengthCalculator"),oe=R("allowStale"),$=R("maxAge"),Z=R("dispose"),q=R("noDisposeOnSet"),X=R("lruList"),fe=R("cache");function Be(){return 1}function Ae(k){if(!(this instanceof Ae))return new Ae(k);typeof k=="number"&&(k={max:k}),k||(k={});var H=this[O]=k.max;(!H||typeof H!="number"||H<=0)&&(this[O]=1/0);var se=k.length||Be;typeof se!="function"&&(se=Be),this[ne]=se,this[oe]=k.stale||!1,this[$]=k.maxAge||0,this[Z]=k.dispose,this[q]=k.noDisposeOnSet||!1,this.reset()}Object.defineProperty(Ae.prototype,"max",{set:function(H){(!H||typeof H!="number"||H<=0)&&(H=1/0),this[O]=H,Ye(this)},get:function(){return this[O]},enumerable:!0}),Object.defineProperty(Ae.prototype,"allowStale",{set:function(H){this[oe]=!!H},get:function(){return this[oe]},enumerable:!0}),Object.defineProperty(Ae.prototype,"maxAge",{set:function(H){(!H||typeof H!="number"||H<0)&&(H=0),this[$]=H,Ye(this)},get:function(){return this[$]},enumerable:!0}),Object.defineProperty(Ae.prototype,"lengthCalculator",{set:function(H){typeof H!="function"&&(H=Be),H!==this[ne]&&(this[ne]=H,this[G]=0,this[X].forEach(function(se){se.length=this[ne](se.value,se.key),this[G]+=se.length},this)),Ye(this)},get:function(){return this[ne]},enumerable:!0}),Object.defineProperty(Ae.prototype,"length",{get:function(){return this[G]},enumerable:!0}),Object.defineProperty(Ae.prototype,"itemCount",{get:function(){return this[X].length},enumerable:!0}),Ae.prototype.rforEach=function(k,H){H=H||this;for(var se=this[X].tail;se!==null;){var ge=se.prev;xe(this,k,se,H),se=ge}};function xe(k,H,se,ge){var Ee=se.value;ft(k,Ee)&&(we(k,se),k[oe]||(Ee=void 0)),Ee&&H.call(ge,Ee.value,Ee.key,k)}Ae.prototype.forEach=function(k,H){H=H||this;for(var se=this[X].head;se!==null;){var ge=se.next;xe(this,k,se,H),se=ge}},Ae.prototype.keys=function(){return this[X].toArray().map(function(k){return k.key},this)},Ae.prototype.values=function(){return this[X].toArray().map(function(k){return k.value},this)},Ae.prototype.reset=function(){this[Z]&&this[X]&&this[X].length&&this[X].forEach(function(k){this[Z](k.key,k.value)},this),this[fe]=new I,this[X]=new y,this[G]=0},Ae.prototype.dump=function(){return this[X].map(function(k){if(!ft(this,k))return{k:k.key,v:k.value,e:k.now+(k.maxAge||0)}},this).toArray().filter(function(k){return k})},Ae.prototype.dumpLru=function(){return this[X]},Ae.prototype.inspect=function(k,H){var se="LRUCache {",ge=!1,Ee=this[oe];Ee&&(se+=` + allowStale: true`,ge=!0);var Ze=this[O];Ze&&Ze!==1/0&&(ge&&(se+=","),se+=` + max: `+h.inspect(Ze,H),ge=!0);var Oe=this[$];Oe&&(ge&&(se+=","),se+=` + maxAge: `+h.inspect(Oe,H),ge=!0);var gt=this[ne];gt&>!==Be&&(ge&&(se+=","),se+=` + length: `+h.inspect(this[G],H),ge=!0);var at=!1;return this[X].forEach(function(Ge){at?se+=`, + `:(ge&&(se+=`, +`),at=!0,se+=` + `);var it=h.inspect(Ge.key).split(` `).join(` - `),V={value:Pe.value};Pe.maxAge!==ke&&(V.maxAge=Pe.maxAge),ft!==he&&(V.length=Pe.length),ct(this,Pe)&&(V.stale=!0),V=C.inspect(V,W).split(` + `),J={value:Ge.value};Ge.maxAge!==Oe&&(J.maxAge=Ge.maxAge),gt!==Be&&(J.length=Ge.length),ft(this,Ge)&&(J.stale=!0),J=h.inspect(J,H).split(` `).join(` - `),ae+=Ze+" => "+V}),(pt||fe)&&(ae+=` -`),ae+="}",ae},ue.prototype.set=function(N,W,ae){ae=ae||this[$];var fe=ae?Date.now():0,Ie=this[ne](W,N);if(this[ge].has(N)){if(Ie>this[O])return ve(this,this[ge].get(N)),!1;var et=this[ge].get(N),ke=et.value;return this[J]&&(this[X]||this[J](N,ke.value)),ke.now=fe,ke.maxAge=ae,ke.value=W,this[G]+=Ie-ke.length,ke.length=Ie,this.get(N),De(this),!0}var ft=new se(N,W,Ie,fe,ae);return ft.length>this[O]?(this[J]&&this[J](N,W),!1):(this[G]+=ft.length,this[Z].unshift(ft),this[ge].set(N,this[Z].head),De(this),!0)},ue.prototype.has=function(N){if(!this[ge].has(N))return!1;var W=this[ge].get(N).value;return!ct(this,W)},ue.prototype.get=function(N){return pe(this,N,!0)},ue.prototype.peek=function(N){return pe(this,N,!1)},ue.prototype.pop=function(){var N=this[Z].tail;return N?(ve(this,N),N.value):null},ue.prototype.del=function(N){ve(this,this[ge].get(N))},ue.prototype.load=function(N){this.reset();for(var W=Date.now(),ae=N.length-1;ae>=0;ae--){var fe=N[ae],Ie=fe.e||0;if(Ie===0)this.set(fe.k,fe.v);else{var et=Ie-W;et>0&&this.set(fe.k,fe.v,et)}}},ue.prototype.prune=function(){var N=this;this[ge].forEach(function(W,ae){pe(N,ae,!1)})};function pe(N,W,ae){var fe=N[ge].get(W);if(fe){var Ie=fe.value;ct(N,Ie)?(ve(N,fe),N[oe]||(Ie=void 0)):ae&&N[Z].unshiftNode(fe),Ie&&(Ie=Ie.value)}return Ie}function ct(N,W){if(!W||!W.maxAge&&!N[$])return!1;var ae=!1,fe=Date.now()-W.now;return W.maxAge?ae=fe>W.maxAge:ae=N[$]&&fe>N[$],ae}function De(N){if(N[G]>N[O])for(var W=N[Z].tail;N[G]>N[O]&&W!==null;){var ae=W.prev;ve(N,W),W=ae}}function ve(N,W){if(W){var ae=W.value;N[J]&&N[J](ae.key,ae.value),N[G]-=ae.length,N[ge].delete(ae.key),N[Z].removeNode(W)}}function se(N,W,ae,fe,Ie){this.key=N,this.value=W,this.length=ae,this.now=fe,this.maxAge=Ie||0}}),169:(s=>{var a=s.exports={},u,E;function I(){throw new Error("setTimeout has not been defined")}function C(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?u=setTimeout:u=I}catch{u=I}try{typeof clearTimeout=="function"?E=clearTimeout:E=C}catch{E=C}})();function y(Z){if(u===setTimeout)return setTimeout(Z,0);if((u===I||!u)&&setTimeout)return u=setTimeout,setTimeout(Z,0);try{return u(Z,0)}catch{try{return u.call(null,Z,0)}catch{return u.call(this,Z,0)}}}function D(Z){if(E===clearTimeout)return clearTimeout(Z);if((E===C||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(Z);try{return E(Z)}catch{try{return E.call(null,Z)}catch{return E.call(this,Z)}}}var R=[],O=!1,G,ne=-1;function oe(){!O||!G||(O=!1,G.length?R=G.concat(R):ne=-1,R.length&&$())}function $(){if(!O){var Z=y(oe);O=!0;for(var ge=R.length;ge;){for(G=R,R=[];++ne1)for(var he=1;he{var E=u(169);E.env.npm_package_name==="pseudomap"&&E.env.npm_lifecycle_script==="test"&&(E.env.TEST_PSEUDOMAP="true"),typeof Map=="function"&&!E.env.TEST_PSEUDOMAP?s.exports=Map:s.exports=u(761)}),761:(s=>{var a=Object.prototype.hasOwnProperty;s.exports=u;function u(D){if(!(this instanceof u))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),D)if(D instanceof u||typeof Map=="function"&&D instanceof Map)D.forEach(function(R,O){this.set(O,R)},this);else if(Array.isArray(D))D.forEach(function(R){this.set(R[0],R[1])},this);else throw new TypeError("invalid argument")}u.prototype.forEach=function(D,R){R=R||this,Object.keys(this._data).forEach(function(O){O!=="size"&&D.call(R,this._data[O].value,this._data[O].key)},this)},u.prototype.has=function(D){return!!C(this._data,D)},u.prototype.get=function(D){var R=C(this._data,D);return R&&R.value},u.prototype.set=function(D,R){y(this._data,D,R)},u.prototype.delete=function(D){var R=C(this._data,D);R&&(delete this._data[R._index],this._data.size--)},u.prototype.clear=function(){var D=Object.create(null);D.size=0,Object.defineProperty(this,"_data",{value:D,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(u.prototype,"size",{get:function(){return this._data.size},set:function(R){},enumerable:!0,configurable:!0}),u.prototype.values=u.prototype.keys=u.prototype.entries=function(){throw new Error("iterators are not implemented in this version")};function E(D,R){return D===R||D!==D&&R!==R}function I(D,R,O){this.key=D,this.value=R,this._index=O}function C(D,R){for(var O=0,G="_"+R,ne=G;a.call(D,ne);ne=G+O++)if(E(D[ne].key,R))return D[ne]}function y(D,R,O){for(var G=0,ne="_"+R,oe=ne;a.call(D,oe);oe=ne+G++)if(E(D[oe].key,R)){D[oe].value=O;return}D.size++,D[oe]=new I(R,O,oe)}}),430:(function(s,a){var u,E,I;function C(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(R){return typeof R}:C=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},C(y)}(function(y,D){"use strict";E=[],u=D,I=typeof u=="function"?u.apply(a,E):u,I!==void 0&&(s.exports=I)})(this,function(){"use strict";function y(he){return!isNaN(parseFloat(he))&&isFinite(he)}function D(he){return he.charAt(0).toUpperCase()+he.substring(1)}function R(he){return function(){return this[he]}}var O=["isConstructor","isEval","isNative","isToplevel"],G=["columnNumber","lineNumber"],ne=["fileName","functionName","source"],oe=["args"],$=O.concat(G,ne,oe);function J(he){if(he)for(var ue=0;ue<$.length;ue++)he[$[ue]]!==void 0&&this["set"+D($[ue])](he[$[ue]])}J.prototype={getArgs:function(){return this.args},setArgs:function(ue){if(Object.prototype.toString.call(ue)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=ue},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(ue){if(ue instanceof J)this.evalOrigin=ue;else if(ue instanceof Object)this.evalOrigin=new J(ue);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var ue=this.getFileName()||"",Le=this.getLineNumber()||"",pe=this.getColumnNumber()||"",ct=this.getFunctionName()||"";return this.getIsEval()?ue?"[eval] ("+ue+":"+Le+":"+pe+")":"[eval]:"+Le+":"+pe:ct?ct+" ("+ue+":"+Le+":"+pe+")":ue+":"+Le+":"+pe}},J.fromString=function(ue){var Le=ue.indexOf("("),pe=ue.lastIndexOf(")"),ct=ue.substring(0,Le),De=ue.substring(Le+1,pe).split(","),ve=ue.substring(pe+1);if(ve.indexOf("@")===0)var se=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(ve,""),N=se[1],W=se[2],ae=se[3];return new J({functionName:ct,args:De||void 0,fileName:N,lineNumber:W||void 0,columnNumber:ae||void 0})};for(var X=0;X{typeof Object.create=="function"?s.exports=function(u,E){u.super_=E,u.prototype=Object.create(E.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}})}:s.exports=function(u,E){u.super_=E;var I=function(){};I.prototype=E.prototype,u.prototype=new I,u.prototype.constructor=u}}),715:(s=>{function a(u){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?a=function(I){return typeof I}:a=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},a(u)}s.exports=function(E){return E&&a(E)==="object"&&typeof E.copy=="function"&&typeof E.fill=="function"&&typeof E.readUInt8=="function"}}),82:((s,a,u)=>{var E=u(169);function I(V){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(Ce){return typeof Ce}:I=function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},I(V)}var C=/%[sdj%]/g;a.format=function(V){if(!De(V)){for(var ce=[],Ce=0;Ce=Ye)return mt;switch(mt){case"%s":return String(tt[Ce++]);case"%d":return Number(tt[Ce++]);case"%j":try{return JSON.stringify(tt[Ce++])}catch{return"[Circular]"}default:return mt}}),ut=tt[Ce];Ce=3&&(Ce.depth=arguments[2]),arguments.length>=4&&(Ce.colors=arguments[3]),ue(ce)?Ce.showHidden=ce:ce&&a._extend(Ce,ce),se(Ce.showHidden)&&(Ce.showHidden=!1),se(Ce.depth)&&(Ce.depth=2),se(Ce.colors)&&(Ce.colors=!1),se(Ce.customInspect)&&(Ce.customInspect=!0),Ce.colors&&(Ce.stylize=O),oe(Ce,V,Ce.depth)}a.inspect=R,R.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},R.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function O(V,ce){var Ce=R.styles[ce];return Ce?"\x1B["+R.colors[Ce][0]+"m"+V+"\x1B["+R.colors[Ce][1]+"m":V}function G(V,ce){return V}function ne(V){var ce={};return V.forEach(function(Ce,tt){ce[Ce]=!0}),ce}function oe(V,ce,Ce){if(V.customInspect&&ce&&Ie(ce.inspect)&&ce.inspect!==a.inspect&&!(ce.constructor&&ce.constructor.prototype===ce)){var tt=ce.inspect(Ce,V);return De(tt)||(tt=oe(V,tt,Ce)),tt}var Ye=$(V,ce);if(Ye)return Ye;var Qt=Object.keys(ce),ut=ne(Qt);if(V.showHidden&&(Qt=Object.getOwnPropertyNames(ce)),fe(ce)&&(Qt.indexOf("message")>=0||Qt.indexOf("description")>=0))return J(ce);if(Qt.length===0){if(Ie(ce)){var mt=ce.name?": "+ce.name:"";return V.stylize("[Function"+mt+"]","special")}if(N(ce))return V.stylize(RegExp.prototype.toString.call(ce),"regexp");if(ae(ce))return V.stylize(Date.prototype.toString.call(ce),"date");if(fe(ce))return J(ce)}var vt="",je=!1,Br=["{","}"];if(he(ce)&&(je=!0,Br=["[","]"]),Ie(ce)){var Ar=ce.name?": "+ce.name:"";vt=" [Function"+Ar+"]"}if(N(ce)&&(vt=" "+RegExp.prototype.toString.call(ce)),ae(ce)&&(vt=" "+Date.prototype.toUTCString.call(ce)),fe(ce)&&(vt=" "+J(ce)),Qt.length===0&&(!je||ce.length==0))return Br[0]+vt+Br[1];if(Ce<0)return N(ce)?V.stylize(RegExp.prototype.toString.call(ce),"regexp"):V.stylize("[Object]","special");V.seen.push(ce);var yr;return je?yr=X(V,ce,Ce,ut,Qt):yr=Qt.map(function(Ur){return Z(V,ce,Ce,ut,Ur,je)}),V.seen.pop(),ge(yr,vt,Br)}function $(V,ce){if(se(ce))return V.stylize("undefined","undefined");if(De(ce)){var Ce="'"+JSON.stringify(ce).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return V.stylize(Ce,"string")}if(ct(ce))return V.stylize(""+ce,"number");if(ue(ce))return V.stylize(""+ce,"boolean");if(Le(ce))return V.stylize("null","null")}function J(V){return"["+Error.prototype.toString.call(V)+"]"}function X(V,ce,Ce,tt,Ye){for(var Qt=[],ut=0,mt=ce.length;ut "+J}),(at||ge)&&(se+=` +`),se+="}",se},Ae.prototype.set=function(k,H,se){se=se||this[$];var ge=se?Date.now():0,Ee=this[ne](H,k);if(this[fe].has(k)){if(Ee>this[O])return we(this,this[fe].get(k)),!1;var Ze=this[fe].get(k),Oe=Ze.value;return this[Z]&&(this[q]||this[Z](k,Oe.value)),Oe.now=ge,Oe.maxAge=se,Oe.value=H,this[G]+=Ee-Oe.length,Oe.length=Ee,this.get(k),Ye(this),!0}var gt=new ie(k,H,Ee,ge,se);return gt.length>this[O]?(this[Z]&&this[Z](k,H),!1):(this[G]+=gt.length,this[X].unshift(gt),this[fe].set(k,this[X].head),Ye(this),!0)},Ae.prototype.has=function(k){if(!this[fe].has(k))return!1;var H=this[fe].get(k).value;return!ft(this,H)},Ae.prototype.get=function(k){return de(this,k,!0)},Ae.prototype.peek=function(k){return de(this,k,!1)},Ae.prototype.pop=function(){var k=this[X].tail;return k?(we(this,k),k.value):null},Ae.prototype.del=function(k){we(this,this[fe].get(k))},Ae.prototype.load=function(k){this.reset();for(var H=Date.now(),se=k.length-1;se>=0;se--){var ge=k[se],Ee=ge.e||0;if(Ee===0)this.set(ge.k,ge.v);else{var Ze=Ee-H;Ze>0&&this.set(ge.k,ge.v,Ze)}}},Ae.prototype.prune=function(){var k=this;this[fe].forEach(function(H,se){de(k,se,!1)})};function de(k,H,se){var ge=k[fe].get(H);if(ge){var Ee=ge.value;ft(k,Ee)?(we(k,ge),k[oe]||(Ee=void 0)):se&&k[X].unshiftNode(ge),Ee&&(Ee=Ee.value)}return Ee}function ft(k,H){if(!H||!H.maxAge&&!k[$])return!1;var se=!1,ge=Date.now()-H.now;return H.maxAge?se=ge>H.maxAge:se=k[$]&&ge>k[$],se}function Ye(k){if(k[G]>k[O])for(var H=k[X].tail;k[G]>k[O]&&H!==null;){var se=H.prev;we(k,H),H=se}}function we(k,H){if(H){var se=H.value;k[Z]&&k[Z](se.key,se.value),k[G]-=se.length,k[fe].delete(se.key),k[X].removeNode(H)}}function ie(k,H,se,ge,Ee){this.key=k,this.value=H,this.length=se,this.now=ge,this.maxAge=Ee||0}}),169:(s=>{var a=s.exports={},u,E;function I(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?u=setTimeout:u=I}catch{u=I}try{typeof clearTimeout=="function"?E=clearTimeout:E=h}catch{E=h}})();function y(X){if(u===setTimeout)return setTimeout(X,0);if((u===I||!u)&&setTimeout)return u=setTimeout,setTimeout(X,0);try{return u(X,0)}catch{try{return u.call(null,X,0)}catch{return u.call(this,X,0)}}}function D(X){if(E===clearTimeout)return clearTimeout(X);if((E===h||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(X);try{return E(X)}catch{try{return E.call(null,X)}catch{return E.call(this,X)}}}var R=[],O=!1,G,ne=-1;function oe(){!O||!G||(O=!1,G.length?R=G.concat(R):ne=-1,R.length&&$())}function $(){if(!O){var X=y(oe);O=!0;for(var fe=R.length;fe;){for(G=R,R=[];++ne1)for(var Be=1;Be{var E=u(169);E.env.npm_package_name==="pseudomap"&&E.env.npm_lifecycle_script==="test"&&(E.env.TEST_PSEUDOMAP="true"),typeof Map=="function"&&!E.env.TEST_PSEUDOMAP?s.exports=Map:s.exports=u(761)}),761:(s=>{var a=Object.prototype.hasOwnProperty;s.exports=u;function u(D){if(!(this instanceof u))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),D)if(D instanceof u||typeof Map=="function"&&D instanceof Map)D.forEach(function(R,O){this.set(O,R)},this);else if(Array.isArray(D))D.forEach(function(R){this.set(R[0],R[1])},this);else throw new TypeError("invalid argument")}u.prototype.forEach=function(D,R){R=R||this,Object.keys(this._data).forEach(function(O){O!=="size"&&D.call(R,this._data[O].value,this._data[O].key)},this)},u.prototype.has=function(D){return!!h(this._data,D)},u.prototype.get=function(D){var R=h(this._data,D);return R&&R.value},u.prototype.set=function(D,R){y(this._data,D,R)},u.prototype.delete=function(D){var R=h(this._data,D);R&&(delete this._data[R._index],this._data.size--)},u.prototype.clear=function(){var D=Object.create(null);D.size=0,Object.defineProperty(this,"_data",{value:D,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(u.prototype,"size",{get:function(){return this._data.size},set:function(R){},enumerable:!0,configurable:!0}),u.prototype.values=u.prototype.keys=u.prototype.entries=function(){throw new Error("iterators are not implemented in this version")};function E(D,R){return D===R||D!==D&&R!==R}function I(D,R,O){this.key=D,this.value=R,this._index=O}function h(D,R){for(var O=0,G="_"+R,ne=G;a.call(D,ne);ne=G+O++)if(E(D[ne].key,R))return D[ne]}function y(D,R,O){for(var G=0,ne="_"+R,oe=ne;a.call(D,oe);oe=ne+G++)if(E(D[oe].key,R)){D[oe].value=O;return}D.size++,D[oe]=new I(R,O,oe)}}),430:(function(s,a){var u,E,I;function h(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(R){return typeof R}:h=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},h(y)}(function(y,D){"use strict";E=[],u=D,I=typeof u=="function"?u.apply(a,E):u,I!==void 0&&(s.exports=I)})(this,function(){"use strict";function y(Be){return!isNaN(parseFloat(Be))&&isFinite(Be)}function D(Be){return Be.charAt(0).toUpperCase()+Be.substring(1)}function R(Be){return function(){return this[Be]}}var O=["isConstructor","isEval","isNative","isToplevel"],G=["columnNumber","lineNumber"],ne=["fileName","functionName","source"],oe=["args"],$=O.concat(G,ne,oe);function Z(Be){if(Be)for(var Ae=0;Ae<$.length;Ae++)Be[$[Ae]]!==void 0&&this["set"+D($[Ae])](Be[$[Ae]])}Z.prototype={getArgs:function(){return this.args},setArgs:function(Ae){if(Object.prototype.toString.call(Ae)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=Ae},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(Ae){if(Ae instanceof Z)this.evalOrigin=Ae;else if(Ae instanceof Object)this.evalOrigin=new Z(Ae);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var Ae=this.getFileName()||"",xe=this.getLineNumber()||"",de=this.getColumnNumber()||"",ft=this.getFunctionName()||"";return this.getIsEval()?Ae?"[eval] ("+Ae+":"+xe+":"+de+")":"[eval]:"+xe+":"+de:ft?ft+" ("+Ae+":"+xe+":"+de+")":Ae+":"+xe+":"+de}},Z.fromString=function(Ae){var xe=Ae.indexOf("("),de=Ae.lastIndexOf(")"),ft=Ae.substring(0,xe),Ye=Ae.substring(xe+1,de).split(","),we=Ae.substring(de+1);if(we.indexOf("@")===0)var ie=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(we,""),k=ie[1],H=ie[2],se=ie[3];return new Z({functionName:ft,args:Ye||void 0,fileName:k,lineNumber:H||void 0,columnNumber:se||void 0})};for(var q=0;q{typeof Object.create=="function"?s.exports=function(u,E){u.super_=E,u.prototype=Object.create(E.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}})}:s.exports=function(u,E){u.super_=E;var I=function(){};I.prototype=E.prototype,u.prototype=new I,u.prototype.constructor=u}}),715:(s=>{function a(u){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?a=function(I){return typeof I}:a=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},a(u)}s.exports=function(E){return E&&a(E)==="object"&&typeof E.copy=="function"&&typeof E.fill=="function"&&typeof E.readUInt8=="function"}}),82:((s,a,u)=>{var E=u(169);function I(J){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(he){return typeof he}:I=function(he){return he&&typeof Symbol=="function"&&he.constructor===Symbol&&he!==Symbol.prototype?"symbol":typeof he},I(J)}var h=/%[sdj%]/g;a.format=function(J){if(!Ye(J)){for(var ce=[],he=0;he=je)return mt;switch(mt){case"%s":return String(et[he++]);case"%d":return Number(et[he++]);case"%j":try{return JSON.stringify(et[he++])}catch{return"[Circular]"}default:return mt}}),ct=et[he];he=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),Ae(ce)?he.showHidden=ce:ce&&a._extend(he,ce),ie(he.showHidden)&&(he.showHidden=!1),ie(he.depth)&&(he.depth=2),ie(he.colors)&&(he.colors=!1),ie(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=O),oe(he,J,he.depth)}a.inspect=R,R.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},R.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function O(J,ce){var he=R.styles[ce];return he?"\x1B["+R.colors[he][0]+"m"+J+"\x1B["+R.colors[he][1]+"m":J}function G(J,ce){return J}function ne(J){var ce={};return J.forEach(function(he,et){ce[he]=!0}),ce}function oe(J,ce,he){if(J.customInspect&&ce&&Ee(ce.inspect)&&ce.inspect!==a.inspect&&!(ce.constructor&&ce.constructor.prototype===ce)){var et=ce.inspect(he,J);return Ye(et)||(et=oe(J,et,he)),et}var je=$(J,ce);if(je)return je;var Qt=Object.keys(ce),ct=ne(Qt);if(J.showHidden&&(Qt=Object.getOwnPropertyNames(ce)),ge(ce)&&(Qt.indexOf("message")>=0||Qt.indexOf("description")>=0))return Z(ce);if(Qt.length===0){if(Ee(ce)){var mt=ce.name?": "+ce.name:"";return J.stylize("[Function"+mt+"]","special")}if(k(ce))return J.stylize(RegExp.prototype.toString.call(ce),"regexp");if(se(ce))return J.stylize(Date.prototype.toString.call(ce),"date");if(ge(ce))return Z(ce)}var wt="",Je=!1,Br=["{","}"];if(Be(ce)&&(Je=!0,Br=["[","]"]),Ee(ce)){var Ar=ce.name?": "+ce.name:"";wt=" [Function"+Ar+"]"}if(k(ce)&&(wt=" "+RegExp.prototype.toString.call(ce)),se(ce)&&(wt=" "+Date.prototype.toUTCString.call(ce)),ge(ce)&&(wt=" "+Z(ce)),Qt.length===0&&(!Je||ce.length==0))return Br[0]+wt+Br[1];if(he<0)return k(ce)?J.stylize(RegExp.prototype.toString.call(ce),"regexp"):J.stylize("[Object]","special");J.seen.push(ce);var yr;return Je?yr=q(J,ce,he,ct,Qt):yr=Qt.map(function(Ur){return X(J,ce,he,ct,Ur,Je)}),J.seen.pop(),fe(yr,wt,Br)}function $(J,ce){if(ie(ce))return J.stylize("undefined","undefined");if(Ye(ce)){var he="'"+JSON.stringify(ce).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return J.stylize(he,"string")}if(ft(ce))return J.stylize(""+ce,"number");if(Ae(ce))return J.stylize(""+ce,"boolean");if(xe(ce))return J.stylize("null","null")}function Z(J){return"["+Error.prototype.toString.call(J)+"]"}function q(J,ce,he,et,je){for(var Qt=[],ct=0,mt=ce.length;ct-1&&(Qt?mt=mt.split(` -`).map(function(je){return" "+je}).join(` +`).map(function(Je){return" "+Je}).join(` `).substr(2):mt=` `+mt.split(` -`).map(function(je){return" "+je}).join(` -`))):mt=V.stylize("[Circular]","special")),se(ut)){if(Qt&&Ye.match(/^\d+$/))return mt;ut=JSON.stringify(""+Ye),ut.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ut=ut.substr(1,ut.length-2),ut=V.stylize(ut,"name")):(ut=ut.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ut=V.stylize(ut,"string"))}return ut+": "+mt}function ge(V,ce,Ce){var tt=0,Ye=V.reduce(function(Qt,ut){return tt++,ut.indexOf(` -`)>=0&&tt++,Qt+ut.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ye>60?Ce[0]+(ce===""?"":ce+` - `)+" "+V.join(`, - `)+" "+Ce[1]:Ce[0]+ce+" "+V.join(", ")+" "+Ce[1]}function he(V){return Array.isArray(V)}a.isArray=he;function ue(V){return typeof V=="boolean"}a.isBoolean=ue;function Le(V){return V===null}a.isNull=Le;function pe(V){return V==null}a.isNullOrUndefined=pe;function ct(V){return typeof V=="number"}a.isNumber=ct;function De(V){return typeof V=="string"}a.isString=De;function ve(V){return I(V)==="symbol"}a.isSymbol=ve;function se(V){return V===void 0}a.isUndefined=se;function N(V){return W(V)&&ke(V)==="[object RegExp]"}a.isRegExp=N;function W(V){return I(V)==="object"&&V!==null}a.isObject=W;function ae(V){return W(V)&&ke(V)==="[object Date]"}a.isDate=ae;function fe(V){return W(V)&&(ke(V)==="[object Error]"||V instanceof Error)}a.isError=fe;function Ie(V){return typeof V=="function"}a.isFunction=Ie;function et(V){return V===null||typeof V=="boolean"||typeof V=="number"||typeof V=="string"||I(V)==="symbol"||typeof V>"u"}a.isPrimitive=et,a.isBuffer=u(715);function ke(V){return Object.prototype.toString.call(V)}function ft(V){return V<10?"0"+V.toString(10):V.toString(10)}var pt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Pe(){var V=new Date,ce=[ft(V.getHours()),ft(V.getMinutes()),ft(V.getSeconds())].join(":");return[V.getDate(),pt[V.getMonth()],ce].join(" ")}a.log=function(){console.log("%s - %s",Pe(),a.format.apply(a,arguments))},a.inherits=u(718),a._extend=function(V,ce){if(!ce||!W(ce))return V;for(var Ce=Object.keys(ce),tt=Ce.length;tt--;)V[Ce[tt]]=ce[Ce[tt]];return V};function Ze(V,ce){return Object.prototype.hasOwnProperty.call(V,ce)}}),695:(s=>{s.exports=a,a.Node=I,a.create=a;function a(C){var y=this;if(y instanceof a||(y=new a),y.tail=null,y.head=null,y.length=0,C&&typeof C.forEach=="function")C.forEach(function(O){y.push(O)});else if(arguments.length>0)for(var D=0,R=arguments.length;D1)D=y;else if(this.head)R=this.head.next,D=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var O=0;R!==null;O++)D=C(D,R.value,O),R=R.next;return D},a.prototype.reduceReverse=function(C,y){var D,R=this.tail;if(arguments.length>1)D=y;else if(this.tail)R=this.tail.prev,D=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var O=this.length-1;R!==null;O--)D=C(D,R.value,O),R=R.prev;return D},a.prototype.toArray=function(){for(var C=new Array(this.length),y=0,D=this.head;D!==null;y++)C[y]=D.value,D=D.next;return C},a.prototype.toArrayReverse=function(){for(var C=new Array(this.length),y=0,D=this.tail;D!==null;y++)C[y]=D.value,D=D.prev;return C},a.prototype.slice=function(C,y){y=y||this.length,y<0&&(y+=this.length),C=C||0,C<0&&(C+=this.length);var D=new a;if(ythis.length&&(y=this.length);for(var R=0,O=this.head;O!==null&&Rthis.length&&(y=this.length);for(var R=this.length,O=this.tail;O!==null&&R>y;R--)O=O.prev;for(;O!==null&&R>C;R--,O=O.prev)D.push(O.value);return D},a.prototype.reverse=function(){for(var C=this.head,y=this.tail,D=C;D!==null;D=D.prev){var R=D.prev;D.prev=D.next,D.next=R}return this.head=y,this.tail=C,this};function u(C,y){C.tail=new I(y,C.tail,null,C),C.head||(C.head=C.tail),C.length++}function E(C,y){C.head=new I(y,null,C.head,C),C.tail||(C.tail=C.head),C.length++}function I(C,y,D,R){if(!(this instanceof I))return new I(C,y,D,R);this.list=R,this.value=C,y?(y.next=this,this.prev=y):this.prev=null,D?(D.prev=this,this.next=D):this.next=null}})},t={};function r(s){var a=t[s];if(a!==void 0)return a.exports;var u=t[s]={exports:{}};return e[s].call(u.exports,u,u.exports,r),u.exports}r.n=s=>{var a=s&&s.__esModule?()=>s.default:()=>s;return r.d(a,{a}),a},r.d=(s,a)=>{for(var u in a)r.o(a,u)&&!r.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:a[u]})},r.o=(s,a)=>Object.prototype.hasOwnProperty.call(s,a),r.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{connectToDevTools:()=>Ve});function s(A,f){if(!(A instanceof f))throw new TypeError("Cannot call a class as a function")}function a(A,f){for(var g=0;g1?d-1:0),S=1;S=0&&d.splice(B,1)}}}]),A})(),C=r(172),y=r.n(C),D="fmkadmapgofadopljbjfkapdkoienihi",R="dnjnjgbfilfphmojnmhliehogmojhclc",O="ikiahnapldjmdmpkmfhjdjilojjhgcbf",G=!1,ne=!1,oe=1,$=2,J=3,X=4,Z=5,ge=6,he=7,ue=1,Le=2,pe="React::DevTools::defaultTab",ct="React::DevTools::componentFilters",De="React::DevTools::lastSelection",ve="React::DevTools::openInEditorUrl",se="React::DevTools::openInEditorUrlPreset",N="React::DevTools::parseHookNames",W="React::DevTools::recordChangeDescriptions",ae="React::DevTools::reloadAndProfile",fe="React::DevTools::breakOnConsoleErrors",Ie="React::DevTools::theme",et="React::DevTools::appendComponentStack",ke="React::DevTools::showInlineWarningsAndErrors",ft="React::DevTools::traceUpdatesEnabled",pt="React::DevTools::hideConsoleLogsInStrictMode",Pe="React::DevTools::supportsProfiling",Ze=5;function V(A){try{return localStorage.getItem(A)}catch{return null}}function ce(A){try{localStorage.removeItem(A)}catch{}}function Ce(A,f){try{return localStorage.setItem(A,f)}catch{}}function tt(A){try{return sessionStorage.getItem(A)}catch{return null}}function Ye(A){try{sessionStorage.removeItem(A)}catch{}}function Qt(A,f){try{return sessionStorage.setItem(A,f)}catch{}}var ut=function(f,g){return f===g};function mt(A){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ut,g=void 0,m=[],d=void 0,B=!1,S=function(T,P){return f(T,m[P])},x=function(){for(var T=arguments.length,P=Array(T),Y=0;YB.length;){var S=this.rects.pop();S.remove()}if(B.length!==0){for(;this.rects.lengthf.left+f.width&&(x=f.left+f.width-d-B),S+="px",x+="px",{style:{top:S,left:x}}}function ir(A,f,g){dt(g.style,{borderTopWidth:A[f+"Top"]+"px",borderLeftWidth:A[f+"Left"]+"px",borderRightWidth:A[f+"Right"]+"px",borderBottomWidth:A[f+"Bottom"]+"px",borderStyle:"solid"})}var tn={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"},Ss=2e3,Uo=null,Wn=null;function xn(A){if(window.document==null){A.emit("hideNativeHighlight");return}Uo=null,Wn!==null&&(Wn.remove(),Wn=null)}function Ai(A,f,g,m){if(window.document==null){A!=null&&A[0]!=null&&g.emit("showNativeHighlight",A[0]);return}Uo!==null&&clearTimeout(Uo),A!=null&&(Wn===null&&(Wn=new Xt(g)),Wn.inspect(A,f),m&&(Uo=setTimeout(function(){return xn(g)},Ss)))}var ai=new Set;function Go(A,f){A.addListener("clearNativeElementHighlight",S),A.addListener("highlightNativeElement",x),A.addListener("shutdown",d),A.addListener("startInspectingNative",g),A.addListener("stopInspectingNative",d);function g(){m(window)}function m(Ge){Ge&&typeof Ge.addEventListener=="function"?(Ge.addEventListener("click",w,!0),Ge.addEventListener("mousedown",T,!0),Ge.addEventListener("mouseover",T,!0),Ge.addEventListener("mouseup",T,!0),Ge.addEventListener("pointerdown",P,!0),Ge.addEventListener("pointermove",j,!0),Ge.addEventListener("pointerup",le,!0)):f.emit("startInspectingNative")}function d(){xn(f),B(window),ai.forEach(function(Ge){try{B(Ge.contentWindow)}catch{}}),ai=new Set}function B(Ge){Ge&&typeof Ge.removeEventListener=="function"?(Ge.removeEventListener("click",w,!0),Ge.removeEventListener("mousedown",T,!0),Ge.removeEventListener("mouseover",T,!0),Ge.removeEventListener("mouseup",T,!0),Ge.removeEventListener("pointerdown",P,!0),Ge.removeEventListener("pointermove",j,!0),Ge.removeEventListener("pointerup",le,!0)):f.emit("stopInspectingNative")}function S(){xn(f)}function x(Ge){var Ct=Ge.displayName,Lt=Ge.hideAfterTimeout,sr=Ge.id,Xe=Ge.openNativeElementsPanel,er=Ge.rendererID,pr=Ge.scrollIntoView,zt=f.rendererInterfaces[er];if(zt==null){console.warn('Invalid renderer id "'.concat(er,'" for element "').concat(sr,'"')),xn(f);return}if(!zt.hasFiberWithId(sr)){xn(f);return}var Dr=zt.findNativeNodesForFiberID(sr);if(Dr!=null&&Dr[0]!=null){var Er=Dr[0];pr&&typeof Er.scrollIntoView=="function"&&Er.scrollIntoView({block:"nearest",inline:"nearest"}),Ai(Dr,Ct,f,Lt),Xe&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0=Er,A.send("syncSelectionToNativeElementsPanel"))}else xn(f)}function w(Ge){Ge.preventDefault(),Ge.stopPropagation(),d(),A.send("stopInspectingNative",!0)}function T(Ge){Ge.preventDefault(),Ge.stopPropagation()}function P(Ge){Ge.preventDefault(),Ge.stopPropagation(),Ue(st(Ge))}var Y=null;function j(Ge){Ge.preventDefault(),Ge.stopPropagation();var Ct=st(Ge);if(Y!==Ct){if(Y=Ct,Ct.tagName==="IFRAME"){var Lt=Ct;try{if(!ai.has(Lt)){var sr=Lt.contentWindow;m(sr),ai.add(Lt)}}catch{}}Ai([Ct],null,f,!1),Ue(Ct)}}function le(Ge){Ge.preventDefault(),Ge.stopPropagation()}var Ue=y()(mt(function(Ge){var Ct=f.getIDForNode(Ge);Ct!==null&&A.send("selectFiber",Ct)}),200,{leading:!1});function st(Ge){return Ge.composed?Ge.composedPath()[0]:Ge.target}}var kn="#f0f0f0",li=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],Xr=null;function As(A,f){if(window.document==null){var g=[];ro(A,function(B,S,x){g.push({node:x,color:S})}),f.emit("drawTraceUpdates",g);return}Xr===null&&_s();var m=Xr;m.width=window.innerWidth,m.height=window.innerHeight;var d=m.getContext("2d");d.clearRect(0,0,m.width,m.height),ro(A,function(B,S){B!==null&&as(d,B,S)})}function ro(A,f){A.forEach(function(g,m){var d=g.count,B=g.rect,S=Math.min(li.length-1,d-1),x=li[S];f(B,x,m)})}function as(A,f,g){var m=f.height,d=f.left,B=f.top,S=f.width;A.lineWidth=1,A.strokeStyle=kn,A.strokeRect(d-1,B-1,S+2,m+2),A.lineWidth=1,A.strokeStyle=kn,A.strokeRect(d+1,B+1,S-1,m-1),A.strokeStyle=g,A.setLineDash([0]),A.lineWidth=1,A.strokeRect(d,B,S-1,m-1),A.setLineDash([0])}function po(A){if(window.document==null){A.emit("disableTraceUpdates");return}Xr!==null&&(Xr.parentNode!=null&&Xr.parentNode.removeChild(Xr),Xr=null)}function _s(){Xr=window.document.createElement("canvas"),Xr.style.cssText=` +`).map(function(Je){return" "+Je}).join(` +`))):mt=J.stylize("[Circular]","special")),ie(ct)){if(Qt&&je.match(/^\d+$/))return mt;ct=JSON.stringify(""+je),ct.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ct=ct.substr(1,ct.length-2),ct=J.stylize(ct,"name")):(ct=ct.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ct=J.stylize(ct,"string"))}return ct+": "+mt}function fe(J,ce,he){var et=0,je=J.reduce(function(Qt,ct){return et++,ct.indexOf(` +`)>=0&&et++,Qt+ct.replace(/\u001b\[\d\d?m/g,"").length+1},0);return je>60?he[0]+(ce===""?"":ce+` + `)+" "+J.join(`, + `)+" "+he[1]:he[0]+ce+" "+J.join(", ")+" "+he[1]}function Be(J){return Array.isArray(J)}a.isArray=Be;function Ae(J){return typeof J=="boolean"}a.isBoolean=Ae;function xe(J){return J===null}a.isNull=xe;function de(J){return J==null}a.isNullOrUndefined=de;function ft(J){return typeof J=="number"}a.isNumber=ft;function Ye(J){return typeof J=="string"}a.isString=Ye;function we(J){return I(J)==="symbol"}a.isSymbol=we;function ie(J){return J===void 0}a.isUndefined=ie;function k(J){return H(J)&&Oe(J)==="[object RegExp]"}a.isRegExp=k;function H(J){return I(J)==="object"&&J!==null}a.isObject=H;function se(J){return H(J)&&Oe(J)==="[object Date]"}a.isDate=se;function ge(J){return H(J)&&(Oe(J)==="[object Error]"||J instanceof Error)}a.isError=ge;function Ee(J){return typeof J=="function"}a.isFunction=Ee;function Ze(J){return J===null||typeof J=="boolean"||typeof J=="number"||typeof J=="string"||I(J)==="symbol"||typeof J>"u"}a.isPrimitive=Ze,a.isBuffer=u(715);function Oe(J){return Object.prototype.toString.call(J)}function gt(J){return J<10?"0"+J.toString(10):J.toString(10)}var at=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ge(){var J=new Date,ce=[gt(J.getHours()),gt(J.getMinutes()),gt(J.getSeconds())].join(":");return[J.getDate(),at[J.getMonth()],ce].join(" ")}a.log=function(){console.log("%s - %s",Ge(),a.format.apply(a,arguments))},a.inherits=u(718),a._extend=function(J,ce){if(!ce||!H(ce))return J;for(var he=Object.keys(ce),et=he.length;et--;)J[he[et]]=ce[he[et]];return J};function it(J,ce){return Object.prototype.hasOwnProperty.call(J,ce)}}),695:(s=>{s.exports=a,a.Node=I,a.create=a;function a(h){var y=this;if(y instanceof a||(y=new a),y.tail=null,y.head=null,y.length=0,h&&typeof h.forEach=="function")h.forEach(function(O){y.push(O)});else if(arguments.length>0)for(var D=0,R=arguments.length;D1)D=y;else if(this.head)R=this.head.next,D=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var O=0;R!==null;O++)D=h(D,R.value,O),R=R.next;return D},a.prototype.reduceReverse=function(h,y){var D,R=this.tail;if(arguments.length>1)D=y;else if(this.tail)R=this.tail.prev,D=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var O=this.length-1;R!==null;O--)D=h(D,R.value,O),R=R.prev;return D},a.prototype.toArray=function(){for(var h=new Array(this.length),y=0,D=this.head;D!==null;y++)h[y]=D.value,D=D.next;return h},a.prototype.toArrayReverse=function(){for(var h=new Array(this.length),y=0,D=this.tail;D!==null;y++)h[y]=D.value,D=D.prev;return h},a.prototype.slice=function(h,y){y=y||this.length,y<0&&(y+=this.length),h=h||0,h<0&&(h+=this.length);var D=new a;if(ythis.length&&(y=this.length);for(var R=0,O=this.head;O!==null&&Rthis.length&&(y=this.length);for(var R=this.length,O=this.tail;O!==null&&R>y;R--)O=O.prev;for(;O!==null&&R>h;R--,O=O.prev)D.push(O.value);return D},a.prototype.reverse=function(){for(var h=this.head,y=this.tail,D=h;D!==null;D=D.prev){var R=D.prev;D.prev=D.next,D.next=R}return this.head=y,this.tail=h,this};function u(h,y){h.tail=new I(y,h.tail,null,h),h.head||(h.head=h.tail),h.length++}function E(h,y){h.head=new I(y,null,h.head,h),h.tail||(h.tail=h.head),h.length++}function I(h,y,D,R){if(!(this instanceof I))return new I(h,y,D,R);this.list=R,this.value=h,y?(y.next=this,this.prev=y):this.prev=null,D?(D.prev=this,this.next=D):this.next=null}})},t={};function r(s){var a=t[s];if(a!==void 0)return a.exports;var u=t[s]={exports:{}};return e[s].call(u.exports,u,u.exports,r),u.exports}r.n=s=>{var a=s&&s.__esModule?()=>s.default:()=>s;return r.d(a,{a}),a},r.d=(s,a)=>{for(var u in a)r.o(a,u)&&!r.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:a[u]})},r.o=(s,a)=>Object.prototype.hasOwnProperty.call(s,a),r.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{connectToDevTools:()=>Ve});function s(A,f){if(!(A instanceof f))throw new TypeError("Cannot call a class as a function")}function a(A,f){for(var g=0;g1?d-1:0),S=1;S=0&&d.splice(B,1)}}}]),A})(),h=r(172),y=r.n(h),D="fmkadmapgofadopljbjfkapdkoienihi",R="dnjnjgbfilfphmojnmhliehogmojhclc",O="ikiahnapldjmdmpkmfhjdjilojjhgcbf",G=!1,ne=!1,oe=1,$=2,Z=3,q=4,X=5,fe=6,Be=7,Ae=1,xe=2,de="React::DevTools::defaultTab",ft="React::DevTools::componentFilters",Ye="React::DevTools::lastSelection",we="React::DevTools::openInEditorUrl",ie="React::DevTools::openInEditorUrlPreset",k="React::DevTools::parseHookNames",H="React::DevTools::recordChangeDescriptions",se="React::DevTools::reloadAndProfile",ge="React::DevTools::breakOnConsoleErrors",Ee="React::DevTools::theme",Ze="React::DevTools::appendComponentStack",Oe="React::DevTools::showInlineWarningsAndErrors",gt="React::DevTools::traceUpdatesEnabled",at="React::DevTools::hideConsoleLogsInStrictMode",Ge="React::DevTools::supportsProfiling",it=5;function J(A){try{return localStorage.getItem(A)}catch{return null}}function ce(A){try{localStorage.removeItem(A)}catch{}}function he(A,f){try{return localStorage.setItem(A,f)}catch{}}function et(A){try{return sessionStorage.getItem(A)}catch{return null}}function je(A){try{sessionStorage.removeItem(A)}catch{}}function Qt(A,f){try{return sessionStorage.setItem(A,f)}catch{}}var ct=function(f,g){return f===g};function mt(A){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ct,g=void 0,m=[],d=void 0,B=!1,S=function(T,P){return f(T,m[P])},x=function(){for(var T=arguments.length,P=Array(T),Y=0;YB.length;){var S=this.rects.pop();S.remove()}if(B.length!==0){for(;this.rects.lengthf.left+f.width&&(x=f.left+f.width-d-B),S+="px",x+="px",{style:{top:S,left:x}}}function ir(A,f,g){pt(g.style,{borderTopWidth:A[f+"Top"]+"px",borderLeftWidth:A[f+"Left"]+"px",borderRightWidth:A[f+"Right"]+"px",borderBottomWidth:A[f+"Bottom"]+"px",borderStyle:"solid"})}var tn={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"},Ss=2e3,Uo=null,Wn=null;function xn(A){if(window.document==null){A.emit("hideNativeHighlight");return}Uo=null,Wn!==null&&(Wn.remove(),Wn=null)}function Ai(A,f,g,m){if(window.document==null){A!=null&&A[0]!=null&&g.emit("showNativeHighlight",A[0]);return}Uo!==null&&clearTimeout(Uo),A!=null&&(Wn===null&&(Wn=new Xt(g)),Wn.inspect(A,f),m&&(Uo=setTimeout(function(){return xn(g)},Ss)))}var ai=new Set;function Go(A,f){A.addListener("clearNativeElementHighlight",S),A.addListener("highlightNativeElement",x),A.addListener("shutdown",d),A.addListener("startInspectingNative",g),A.addListener("stopInspectingNative",d);function g(){m(window)}function m(Pe){Pe&&typeof Pe.addEventListener=="function"?(Pe.addEventListener("click",v,!0),Pe.addEventListener("mousedown",T,!0),Pe.addEventListener("mouseover",T,!0),Pe.addEventListener("mouseup",T,!0),Pe.addEventListener("pointerdown",P,!0),Pe.addEventListener("pointermove",j,!0),Pe.addEventListener("pointerup",ue,!0)):f.emit("startInspectingNative")}function d(){xn(f),B(window),ai.forEach(function(Pe){try{B(Pe.contentWindow)}catch{}}),ai=new Set}function B(Pe){Pe&&typeof Pe.removeEventListener=="function"?(Pe.removeEventListener("click",v,!0),Pe.removeEventListener("mousedown",T,!0),Pe.removeEventListener("mouseover",T,!0),Pe.removeEventListener("mouseup",T,!0),Pe.removeEventListener("pointerdown",P,!0),Pe.removeEventListener("pointermove",j,!0),Pe.removeEventListener("pointerup",ue,!0)):f.emit("stopInspectingNative")}function S(){xn(f)}function x(Pe){var Ct=Pe.displayName,Lt=Pe.hideAfterTimeout,sr=Pe.id,Xe=Pe.openNativeElementsPanel,er=Pe.rendererID,pr=Pe.scrollIntoView,zt=f.rendererInterfaces[er];if(zt==null){console.warn('Invalid renderer id "'.concat(er,'" for element "').concat(sr,'"')),xn(f);return}if(!zt.hasFiberWithId(sr)){xn(f);return}var Dr=zt.findNativeNodesForFiberID(sr);if(Dr!=null&&Dr[0]!=null){var Er=Dr[0];pr&&typeof Er.scrollIntoView=="function"&&Er.scrollIntoView({block:"nearest",inline:"nearest"}),Ai(Dr,Ct,f,Lt),Xe&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0=Er,A.send("syncSelectionToNativeElementsPanel"))}else xn(f)}function v(Pe){Pe.preventDefault(),Pe.stopPropagation(),d(),A.send("stopInspectingNative",!0)}function T(Pe){Pe.preventDefault(),Pe.stopPropagation()}function P(Pe){Pe.preventDefault(),Pe.stopPropagation(),Me(st(Pe))}var Y=null;function j(Pe){Pe.preventDefault(),Pe.stopPropagation();var Ct=st(Pe);if(Y!==Ct){if(Y=Ct,Ct.tagName==="IFRAME"){var Lt=Ct;try{if(!ai.has(Lt)){var sr=Lt.contentWindow;m(sr),ai.add(Lt)}}catch{}}Ai([Ct],null,f,!1),Me(Ct)}}function ue(Pe){Pe.preventDefault(),Pe.stopPropagation()}var Me=y()(mt(function(Pe){var Ct=f.getIDForNode(Pe);Ct!==null&&A.send("selectFiber",Ct)}),200,{leading:!1});function st(Pe){return Pe.composed?Pe.composedPath()[0]:Pe.target}}var kn="#f0f0f0",li=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],Xr=null;function As(A,f){if(window.document==null){var g=[];ro(A,function(B,S,x){g.push({node:x,color:S})}),f.emit("drawTraceUpdates",g);return}Xr===null&&_s();var m=Xr;m.width=window.innerWidth,m.height=window.innerHeight;var d=m.getContext("2d");d.clearRect(0,0,m.width,m.height),ro(A,function(B,S){B!==null&&as(d,B,S)})}function ro(A,f){A.forEach(function(g,m){var d=g.count,B=g.rect,S=Math.min(li.length-1,d-1),x=li[S];f(B,x,m)})}function as(A,f,g){var m=f.height,d=f.left,B=f.top,S=f.width;A.lineWidth=1,A.strokeStyle=kn,A.strokeRect(d-1,B-1,S+2,m+2),A.lineWidth=1,A.strokeStyle=kn,A.strokeRect(d+1,B+1,S-1,m-1),A.strokeStyle=g,A.setLineDash([0]),A.lineWidth=1,A.strokeRect(d,B,S-1,m-1),A.setLineDash([0])}function po(A){if(window.document==null){A.emit("disableTraceUpdates");return}Xr!==null&&(Xr.parentNode!=null&&Xr.parentNode.removeChild(Xr),Xr=null)}function _s(){Xr=window.document.createElement("canvas"),Xr.style.cssText=` xx-background-color: red; xx-opacity: 0.5; bottom: 0; @@ -54,47 +54,47 @@ No matching component was found for: right: 0; top: 0; z-index: 1000000000; - `;var A=window.document.documentElement;A.insertBefore(Xr,A.firstChild)}function ui(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ui=function(g){return typeof g}:ui=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},ui(A)}var Fi=250,Qo=3e3,EA=250,ls=(typeof performance>"u"?"undefined":ui(performance))==="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()},Ho=new Map,Nn=null,vo=null,Rs=!1,wr=null;function us(A){Nn=A,Nn.addListener("traceUpdates",Te)}function Se(A){Rs=A,Rs||(Ho.clear(),vo!==null&&(cancelAnimationFrame(vo),vo=null),wr!==null&&(clearTimeout(wr),wr=null),po(Nn))}function Te(A){Rs&&(A.forEach(function(f){var g=Ho.get(f),m=ls(),d=g!=null?g.lastMeasuredAt:0,B=g!=null?g.rect:null;(B===null||d+EAA.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"||!(Symbol.iterator in Object(A)))){var g=[],m=!0,d=!1,B=void 0;try{for(var S=A[Symbol.iterator](),x;!(m=(x=S.next()).done)&&(g.push(x.value),!(f&&g.length===f));m=!0);}catch(w){d=!0,B=w}finally{try{!m&&S.return!=null&&S.return()}finally{if(d)throw B}}return g}}function Pu(A){if(Array.isArray(A))return A}var ea=function(f,g){var m=mA(f),d=mA(g),B=m.pop(),S=d.pop(),x=Wo(m,d);return x!==0?x:B&&S?Wo(B.split("."),S.split(".")):B||S?B?-1:1:0},bf=function(f){return typeof f=="string"&&/^[v\d]/.test(f)&&Fs.test(f)},Uu=function(f,g,m){Ko(m);var d=ea(f,g);return CA[m].includes(d)},Gu=function(f,g){var m=g.match(/^([<>=~^]+)/),d=m?m[1]:"=";if(d!=="^"&&d!=="~")return Uu(f,g,d);var B=mA(f),S=at(B,5),x=S[0],w=S[1],T=S[2],P=S[4],Y=mA(g),j=at(Y,5),le=j[0],Ue=j[1],st=j[2],Ge=j[4],Ct=[x,w,T],Lt=[le,Ue??"x",st??"x"];if(Ge&&(!P||Wo(Ct,Lt)!==0||Wo(P.split("."),Ge.split("."))===-1))return!1;var sr=Lt.findIndex(function(er){return er!=="0"})+1,Xe=d==="~"?2:sr>1?sr:1;return!(Wo(Ct.slice(0,Xe),Lt.slice(0,Xe))!==0||Wo(Ct.slice(Xe),Lt.slice(Xe))===-1)},Fs=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,mA=function(f){if(typeof f!="string")throw new TypeError("Invalid argument expected string");var g=f.match(Fs);if(!g)throw new Error("Invalid argument not valid semver ('".concat(f,"' received)"));return g.shift(),g},IA=function(f){return f==="*"||f==="x"||f==="X"},bi=function(f){var g=parseInt(f,10);return isNaN(g)?f:g},ta=function(f,g){return dr(f)!==dr(g)?[String(f),String(g)]:[f,g]},hA=function(f,g){if(IA(f)||IA(g))return 0;var m=ta(bi(f),bi(g)),d=at(m,2),B=d[0],S=d[1];return B>S?1:B":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},xi=Object.keys(CA),Ko=function(f){if(typeof f!="string")throw new TypeError("Invalid operator type, expected string but got ".concat(dr(f)));if(xi.indexOf(f)===-1)throw new Error("Invalid operator, expected one of ".concat(xi.join("|")))},ar=r(730),Wt=r.n(ar),Sr=r(550);function Gr(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gr=function(g){return typeof g}:Gr=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Gr(A)}var Q=Symbol.for("react.element"),_=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),de=Symbol.for("react.provider"),Re=Symbol.for("react.context"),Fe=Symbol.for("react.server_context"),We=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),$e=Symbol.for("react.suspense_list"),Bt=Symbol.for("react.memo"),Vt=Symbol.for("react.lazy"),_r=Symbol.for("react.scope"),qt=Symbol.for("react.debug_trace_mode"),mn=Symbol.for("react.offscreen"),Kn=Symbol.for("react.legacy_hidden"),BA=Symbol.for("react.cache"),Jo=Symbol.for("react.tracing_marker"),ra=Symbol.for("react.default_value"),nl=Symbol.for("react.memo_cache_sentinel"),xf=Symbol.for("react.postpone"),DA=Symbol.iterator,Ip="@@iterator";function kf(A){if(A===null||Gr(A)!=="object")return null;var f=DA&&A[DA]||A[Ip];return typeof f=="function"?f:null}var Tt=1,ol=2,jo=5,bs=6,na=7,yA=8,fr=9,Hu=10,il=11,Wu=12,hp=13,sl=14,Yo=1,Cp=2,Bp=3,Vo=4,ki=1,Al=Array.isArray;let wo=Al;var Ku=r(169);function al(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?al=function(g){return typeof g}:al=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},al(A)}function qo(A){return ul(A)||ll(A)||vA(A)||QA()}function QA(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vA(A,f){if(A){if(typeof A=="string")return no(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return no(A,f)}}function ll(A){if(typeof Symbol<"u"&&Symbol.iterator in Object(A))return Array.from(A)}function ul(A){if(Array.isArray(A))return no(A)}function no(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);gf.toString()?1:f.toString()>A.toString()?-1:0}function Ti(A){for(var f=new Set,g=A,m=function(){var B=[].concat(qo(Object.keys(g)),qo(Object.getOwnPropertySymbols(g))),S=Object.getOwnPropertyDescriptors(g);B.forEach(function(x){S[x].enumerable&&f.add(x)}),g=Object.getPrototypeOf(g)};g!=null;)m();return f}function Ju(A,f,g,m){var d=A.displayName;return d||"".concat(g,"(").concat(xs(f,m),")")}function xs(A){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Anonymous",g=cs.get(A);if(g!=null)return g;var m=f;return typeof A.displayName=="string"?m=A.displayName:typeof A.name=="string"&&A.name!==""&&(m=A.name),cs.set(A,m),m}var ju=0;function oo(){return++ju}function So(A){for(var f="",g=0;g=0){var m=A.match(/[^()]+/g);m!=null&&(A=m.pop(),g=m)}break;default:break}return[A,g]}function Yu(A,f){for(var g in A)if(!(g in f))return!0;for(var m in f)if(A[m]!==f[m])return!0;return!1}function $o(A,f){return f.reduce(function(g,m){if(g){if(Jn.call(g,m))return g[m];if(typeof g[Symbol.iterator]=="function")return Array.from(g)[m]}return null},A)}function sa(A,f){var g=f.length,m=f[g-1];if(A!=null){var d=$o(A,f.slice(0,g-1));d&&(wo(d)?d.splice(m,1):delete d[m])}}function Li(A,f,g){var m=f.length;if(A!=null){var d=$o(A,f.slice(0,m-1));if(d){var B=f[m-1],S=g[m-1];d[S]=d[B],wo(d)?d.splice(B,1):delete d[B]}}}function Aa(A,f,g){var m=f.length,d=f[m-1];if(A!=null){var B=$o(A,f.slice(0,m-1));B&&(B[d]=g)}}function aa(A){if(A===null)return"null";if(A===void 0)return"undefined";if((0,Sr.isElement)(A))return"react_element";if(typeof HTMLElement<"u"&&A instanceof HTMLElement)return"html_element";var f=al(A);switch(f){case"bigint":return"bigint";case"boolean":return"boolean";case"function":return"function";case"number":return Number.isNaN(A)?"nan":Number.isFinite(A)?"number":"infinity";case"object":if(wo(A))return"array";if(ArrayBuffer.isView(A))return Jn.call(A.constructor,"BYTES_PER_ELEMENT")?"typed_array":"data_view";if(A.constructor&&A.constructor.name==="ArrayBuffer")return"array_buffer";if(typeof A[Symbol.iterator]=="function"){var g=A[Symbol.iterator]();if(g)return g===A?"opaque_iterator":"iterator"}else{if(A.constructor&&A.constructor.name==="RegExp")return"regexp";var m=Object.prototype.toString.call(A);if(m==="[object Date]")return"date";if(m==="[object HTMLAllCollection]")return"html_all_collection"}return Of(A)?"object":"class_instance";case"string":return"string";case"symbol":return"symbol";case"undefined":return Object.prototype.toString.call(A)==="[object HTMLAllCollection]"?"html_all_collection":"undefined";default:return"unknown"}}function la(A){var f=(0,Sr.typeOf)(A);switch(f){case Sr.ContextConsumer:return"ContextConsumer";case Sr.ContextProvider:return"ContextProvider";case Sr.ForwardRef:return"ForwardRef";case Sr.Fragment:return"Fragment";case Sr.Lazy:return"Lazy";case Sr.Memo:return"Memo";case Sr.Portal:return"Portal";case Sr.Profiler:return"Profiler";case Sr.StrictMode:return"StrictMode";case Sr.Suspense:return"Suspense";case $e:return"SuspenseList";case Jo:return"TracingMarker";default:var g=A.type;return typeof g=="string"?g:typeof g=="function"?xs(g,"Anonymous"):g!=null?"NotImplementedInDevtools":"Element"}}var fi=50;function Eo(A){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fi;return A.length>f?A.slice(0,f)+"\u2026":A}function rr(A,f){if(A!=null&&Jn.call(A,Ot.type))return f?A[Ot.preview_long]:A[Ot.preview_short];var g=aa(A);switch(g){case"html_element":return"<".concat(Eo(A.tagName.toLowerCase())," />");case"function":return Eo("\u0192 ".concat(typeof A.name=="function"?"":A.name,"() {}"));case"string":return'"'.concat(A,'"');case"bigint":return Eo(A.toString()+"n");case"regexp":return Eo(A.toString());case"symbol":return Eo(A.toString());case"react_element":return"<".concat(Eo(la(A)||"Unknown")," />");case"array_buffer":return"ArrayBuffer(".concat(A.byteLength,")");case"data_view":return"DataView(".concat(A.buffer.byteLength,")");case"array":if(f){for(var m="",d=0;d0&&(m+=", "),m+=rr(A[d],!1),!(m.length>fi));d++);return"[".concat(Eo(m),"]")}else{var B=Jn.call(A,Ot.size)?A[Ot.size]:A.length;return"Array(".concat(B,")")}case"typed_array":var S="".concat(A.constructor.name,"(").concat(A.length,")");if(f){for(var x="",w=0;w0&&(x+=", "),x+=A[w],!(x.length>fi));w++);return"".concat(S," [").concat(Eo(x),"]")}else return S;case"iterator":var T=A.constructor.name;if(f){for(var P=Array.from(A),Y="",j=0;j0&&(Y+=", "),wo(le)){var Ue=rr(le[0],!0),st=rr(le[1],!1);Y+="".concat(Ue," => ").concat(st)}else Y+=rr(le,!1);if(Y.length>fi)break}return"".concat(T,"(").concat(A.size,") {").concat(Eo(Y),"}")}else return"".concat(T,"(").concat(A.size,")");case"opaque_iterator":return A[Symbol.toStringTag];case"date":return A.toString();case"class_instance":return A.constructor.name;case"object":if(f){for(var Ge=Array.from(Ti(A)).sort(Ni),Ct="",Lt=0;Lt0&&(Ct+=", "),Ct+="".concat(sr.toString(),": ").concat(rr(A[sr],!1)),Ct.length>fi)break}return"{".concat(Eo(Ct),"}")}else return"{\u2026}";case"boolean":case"number":case"infinity":case"nan":case"null":case"undefined":return A;default:try{return Eo(String(A))}catch{return"unserializable"}}}var Of=function(f){var g=Object.getPrototypeOf(f);if(!g)return!0;var m=Object.getPrototypeOf(g);return!m};function dl(A,f){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(A);f&&(m=m.filter(function(d){return Object.getOwnPropertyDescriptor(A,d).enumerable})),g.push.apply(g,m)}return g}function Vu(A){for(var f=1;f5&&arguments[5]!==void 0?arguments[5]:0,S=aa(A),x;switch(S){case"html_element":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.tagName,type:S};case"function":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:typeof A.name=="function"||!A.name?"function":A.name,type:S};case"string":return x=d(m),x||A.length<=500?A:A.slice(0,500)+"...";case"bigint":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"symbol":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"react_element":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:la(A)||"Unknown",type:S};case"array_buffer":case"data_view":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:S==="data_view"?"DataView":"ArrayBuffer",size:A.byteLength,type:S};case"array":return x=d(m),B>=gi&&!x?_A(S,!0,A,f,m):A.map(function(Y,j){return RA(Y,f,g,m.concat([j]),d,x?1:B+1)});case"html_all_collection":case"typed_array":case"iterator":if(x=d(m),B>=gi&&!x)return _A(S,!0,A,f,m);var w={unserializable:!0,type:S,readonly:!0,size:S==="typed_array"?A.length:void 0,preview_short:rr(A,!1),preview_long:rr(A,!0),name:!A.constructor||A.constructor.name==="Object"?"":A.constructor.name};return Array.from(A).forEach(function(Y,j){return w[j]=RA(Y,f,g,m.concat([j]),d,x?1:B+1)}),g.push(m),w;case"opaque_iterator":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A[Symbol.toStringTag],type:S};case"date":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"regexp":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"object":if(x=d(m),B>=gi&&!x)return _A(S,!0,A,f,m);var T={};return Ti(A).forEach(function(Y){var j=Y.toString();T[j]=RA(A[Y],f,g,m.concat([j]),d,x?1:B+1)}),T;case"class_instance":if(x=d(m),B>=gi&&!x)return _A(S,!0,A,f,m);var P={unserializable:!0,type:S,readonly:!0,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.constructor.name};return Ti(A).forEach(function(Y){var j=Y.toString();P[j]=RA(A[Y],f,g,m.concat([j]),d,x?1:B+1)}),g.push(m),P;case"infinity":case"nan":case"undefined":return f.push(m),{type:S};default:return A}}function Mi(A,f,g,m){var d=getInObject(A,g);if(d!=null&&(d[Ot.unserializable]||(delete d[Ot.inspectable],delete d[Ot.inspected],delete d[Ot.name],delete d[Ot.preview_long],delete d[Ot.preview_short],delete d[Ot.readonly],delete d[Ot.size],delete d[Ot.type])),m!==null&&f.unserializable.length>0){for(var B=f.unserializable[0],S=B.length===g.length,x=0;xA.length)&&(f=A.length);for(var g=0,m=new Array(f);g2&&arguments[2]!==void 0?arguments[2]:[];if(A!==null){var m=[],d=[],B=RA(A,m,d,g,f);return{data:B,cleaned:m,unserializable:d}}else return null}function Qr(A,f){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,m=f[g],d=jn(A)?A.slice():_o({},A);return g+1===f.length?jn(d)?d.splice(m,1):delete d[m]:d[m]=Qr(A[m],f,g+1),d}function bA(A,f,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,d=f[m],B=jn(A)?A.slice():_o({},A);if(m+1===f.length){var S=g[m];B[S]=B[d],jn(B)?B.splice(d,1):delete B[d]}else B[d]=bA(A[d],f,g,m+1);return B}function fa(A,f,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(m>=f.length)return g;var d=f[m],B=jn(A)?A.slice():_o({},A);return B[d]=fa(A[d],f,g,m+1),B}function zu(A){var f=null,g=null,m=A.current;if(m!=null){var d=m.stateNode;d!=null&&(f=d.effectDuration!=null?d.effectDuration:null,g=d.passiveEffectDuration!=null?d.passiveEffectDuration:null)}return{effectDuration:f,passiveEffectDuration:g}}function ga(A){if(A===void 0)return"undefined";var f=new Set;return JSON.stringify(A,function(g,m){if(Ui(m)==="object"&&m!==null){if(f.has(m))return;f.add(m)}return typeof m=="bigint"?m.toString()+"n":m},2)}function $u(A,f){if(A==null||A.length===0||typeof A[0]=="string"&&A[0].match(/([^%]|^)(%c)/g)||f===void 0)return A;var g=/([^%]|^)((%%)*)(%([oOdisf]))/g;if(typeof A[0]=="string"&&A[0].match(g))return["%c".concat(A[0]),f].concat(ua(A.slice(1)));var m=A.reduce(function(d,B,S){switch(S>0&&(d+=" "),Ui(B)){case"string":case"boolean":case"symbol":return d+="%s";case"number":var x=Number.isInteger(B)?"%i":"%f";return d+=x;default:return d+="%o"}},"%c");return[m,f].concat(ua(A))}function fs(A){for(var f=arguments.length,g=new Array(f>1?f-1:0),m=1;m0&&arguments[0]!==void 0?arguments[0]:"",f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ea(A,f)===1}function Fr(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ea(A,f)>-1}var ml=r(987),Ts=60111,Os="Symbol(react.concurrent_mode)",Xu=60110,In="Symbol(react.context)",Zu="Symbol(react.server_context)",da="Symbol(react.async_mode)",Gf=60103,Gi="Symbol(react.element)",Xo=60129,Il="Symbol(react.debug_trace_mode)",ec=60112,tc="Symbol(react.forward_ref)",Qp=60107,vp="Symbol(react.fragment)",wp=60116,Sp="Symbol(react.lazy)",Hf=60115,Wf="Symbol(react.memo)",_p=60106,Rp="Symbol(react.portal)",xA=60114,rc="Symbol(react.profiler)",kA=60109,NA="Symbol(react.provider)",Kf=60119,nc="Symbol(react.scope)",hl=60108,Cl="Symbol(react.strict_mode)",Fp=60113,bp="Symbol(react.suspense)",Jf=60120,xp="Symbol(react.suspense_list)",kp="Symbol(react.server_context.defaultValue)",oc=!1,LI=!1,jf=!1,MI=!1;function Np(A,f){return A===f&&(A!==0||1/A===1/f)||A!==A&&f!==f}var Yf=typeof Object.is=="function"?Object.is:Np;let Vf=Yf;var qf=Object.prototype.hasOwnProperty;let Bl=qf;var ic=new Map;function Tp(A){var f=new Set,g={};return sc(A,f,g),{sources:Array.from(f).sort(),resolvedStyles:g}}function sc(A,f,g){A!=null&&(wo(A)?A.forEach(function(m){m!=null&&(wo(m)?sc(m,f,g):Ro(m,f,g))}):Ro(A,f,g),g=Object.fromEntries(Object.entries(g).sort()))}function Ro(A,f,g){var m=Object.keys(A);m.forEach(function(d){var B=A[d];if(typeof B=="string")if(d===B)f.add(d);else{var S=Ac(B);S!=null&&(g[d]=S)}else{var x={};g[d]=x,sc([B],f,x)}})}function Ac(A){if(ic.has(A))return ic.get(A);for(var f=0;f"u"?"undefined":OA(Reflect))==="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(st){d=st}Reflect.construct(A,[],x)}else{try{x.call()}catch(st){d=st}A.call(x.prototype)}}else{try{throw Error()}catch(st){d=st}A()}}catch(st){if(st&&d&&typeof st.stack=="string"){for(var w=st.stack.split(` + `;var A=window.document.documentElement;A.insertBefore(Xr,A.firstChild)}function ui(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ui=function(g){return typeof g}:ui=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},ui(A)}var bi=250,Qo=3e3,EA=250,ls=(typeof performance>"u"?"undefined":ui(performance))==="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()},Ho=new Map,Nn=null,wo=null,Rs=!1,vr=null;function us(A){Nn=A,Nn.addListener("traceUpdates",Ne)}function ve(A){Rs=A,Rs||(Ho.clear(),wo!==null&&(cancelAnimationFrame(wo),wo=null),vr!==null&&(clearTimeout(vr),vr=null),po(Nn))}function Ne(A){Rs&&(A.forEach(function(f){var g=Ho.get(f),m=ls(),d=g!=null?g.lastMeasuredAt:0,B=g!=null?g.rect:null;(B===null||d+EAA.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"||!(Symbol.iterator in Object(A)))){var g=[],m=!0,d=!1,B=void 0;try{for(var S=A[Symbol.iterator](),x;!(m=(x=S.next()).done)&&(g.push(x.value),!(f&&g.length===f));m=!0);}catch(v){d=!0,B=v}finally{try{!m&&S.return!=null&&S.return()}finally{if(d)throw B}}return g}}function Uu(A){if(Array.isArray(A))return A}var ta=function(f,g){var m=mA(f),d=mA(g),B=m.pop(),S=d.pop(),x=Wo(m,d);return x!==0?x:B&&S?Wo(B.split("."),S.split(".")):B||S?B?-1:1:0},kf=function(f){return typeof f=="string"&&/^[v\d]/.test(f)&&bs.test(f)},Gu=function(f,g,m){Ko(m);var d=ta(f,g);return CA[m].includes(d)},Hu=function(f,g){var m=g.match(/^([<>=~^]+)/),d=m?m[1]:"=";if(d!=="^"&&d!=="~")return Gu(f,g,d);var B=mA(f),S=lt(B,5),x=S[0],v=S[1],T=S[2],P=S[4],Y=mA(g),j=lt(Y,5),ue=j[0],Me=j[1],st=j[2],Pe=j[4],Ct=[x,v,T],Lt=[ue,Me??"x",st??"x"];if(Pe&&(!P||Wo(Ct,Lt)!==0||Wo(P.split("."),Pe.split("."))===-1))return!1;var sr=Lt.findIndex(function(er){return er!=="0"})+1,Xe=d==="~"?2:sr>1?sr:1;return!(Wo(Ct.slice(0,Xe),Lt.slice(0,Xe))!==0||Wo(Ct.slice(Xe),Lt.slice(Xe))===-1)},bs=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,mA=function(f){if(typeof f!="string")throw new TypeError("Invalid argument expected string");var g=f.match(bs);if(!g)throw new Error("Invalid argument not valid semver ('".concat(f,"' received)"));return g.shift(),g},IA=function(f){return f==="*"||f==="x"||f==="X"},Fi=function(f){var g=parseInt(f,10);return isNaN(g)?f:g},ra=function(f,g){return dr(f)!==dr(g)?[String(f),String(g)]:[f,g]},hA=function(f,g){if(IA(f)||IA(g))return 0;var m=ra(Fi(f),Fi(g)),d=lt(m,2),B=d[0],S=d[1];return B>S?1:B":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},xi=Object.keys(CA),Ko=function(f){if(typeof f!="string")throw new TypeError("Invalid operator type, expected string but got ".concat(dr(f)));if(xi.indexOf(f)===-1)throw new Error("Invalid operator, expected one of ".concat(xi.join("|")))},ar=r(730),Wt=r.n(ar),Sr=r(550);function Gr(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gr=function(g){return typeof g}:Gr=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Gr(A)}var Q=Symbol.for("react.element"),_=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),pe=Symbol.for("react.provider"),_e=Symbol.for("react.context"),Re=Symbol.for("react.server_context"),He=Symbol.for("react.forward_ref"),Fe=Symbol.for("react.suspense"),$e=Symbol.for("react.suspense_list"),Bt=Symbol.for("react.memo"),Vt=Symbol.for("react.lazy"),_r=Symbol.for("react.scope"),qt=Symbol.for("react.debug_trace_mode"),mn=Symbol.for("react.offscreen"),Kn=Symbol.for("react.legacy_hidden"),BA=Symbol.for("react.cache"),Jo=Symbol.for("react.tracing_marker"),na=Symbol.for("react.default_value"),ol=Symbol.for("react.memo_cache_sentinel"),Nf=Symbol.for("react.postpone"),DA=Symbol.iterator,Cp="@@iterator";function Tf(A){if(A===null||Gr(A)!=="object")return null;var f=DA&&A[DA]||A[Cp];return typeof f=="function"?f:null}var Tt=1,il=2,jo=5,Fs=6,oa=7,yA=8,fr=9,Wu=10,sl=11,Ku=12,Bp=13,Al=14,Yo=1,Dp=2,yp=3,Vo=4,ki=1,al=Array.isArray;let vo=al;var Ju=r(169);function ll(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ll=function(g){return typeof g}:ll=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},ll(A)}function qo(A){return cl(A)||ul(A)||wA(A)||QA()}function QA(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wA(A,f){if(A){if(typeof A=="string")return no(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return no(A,f)}}function ul(A){if(typeof Symbol<"u"&&Symbol.iterator in Object(A))return Array.from(A)}function cl(A){if(Array.isArray(A))return no(A)}function no(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);gf.toString()?1:f.toString()>A.toString()?-1:0}function Ti(A){for(var f=new Set,g=A,m=function(){var B=[].concat(qo(Object.keys(g)),qo(Object.getOwnPropertySymbols(g))),S=Object.getOwnPropertyDescriptors(g);B.forEach(function(x){S[x].enumerable&&f.add(x)}),g=Object.getPrototypeOf(g)};g!=null;)m();return f}function ju(A,f,g,m){var d=A.displayName;return d||"".concat(g,"(").concat(xs(f,m),")")}function xs(A){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Anonymous",g=cs.get(A);if(g!=null)return g;var m=f;return typeof A.displayName=="string"?m=A.displayName:typeof A.name=="string"&&A.name!==""&&(m=A.name),cs.set(A,m),m}var Yu=0;function oo(){return++Yu}function So(A){for(var f="",g=0;g=0){var m=A.match(/[^()]+/g);m!=null&&(A=m.pop(),g=m)}break;default:break}return[A,g]}function Vu(A,f){for(var g in A)if(!(g in f))return!0;for(var m in f)if(A[m]!==f[m])return!0;return!1}function $o(A,f){return f.reduce(function(g,m){if(g){if(Jn.call(g,m))return g[m];if(typeof g[Symbol.iterator]=="function")return Array.from(g)[m]}return null},A)}function Aa(A,f){var g=f.length,m=f[g-1];if(A!=null){var d=$o(A,f.slice(0,g-1));d&&(vo(d)?d.splice(m,1):delete d[m])}}function Li(A,f,g){var m=f.length;if(A!=null){var d=$o(A,f.slice(0,m-1));if(d){var B=f[m-1],S=g[m-1];d[S]=d[B],vo(d)?d.splice(B,1):delete d[B]}}}function aa(A,f,g){var m=f.length,d=f[m-1];if(A!=null){var B=$o(A,f.slice(0,m-1));B&&(B[d]=g)}}function la(A){if(A===null)return"null";if(A===void 0)return"undefined";if((0,Sr.isElement)(A))return"react_element";if(typeof HTMLElement<"u"&&A instanceof HTMLElement)return"html_element";var f=ll(A);switch(f){case"bigint":return"bigint";case"boolean":return"boolean";case"function":return"function";case"number":return Number.isNaN(A)?"nan":Number.isFinite(A)?"number":"infinity";case"object":if(vo(A))return"array";if(ArrayBuffer.isView(A))return Jn.call(A.constructor,"BYTES_PER_ELEMENT")?"typed_array":"data_view";if(A.constructor&&A.constructor.name==="ArrayBuffer")return"array_buffer";if(typeof A[Symbol.iterator]=="function"){var g=A[Symbol.iterator]();if(g)return g===A?"opaque_iterator":"iterator"}else{if(A.constructor&&A.constructor.name==="RegExp")return"regexp";var m=Object.prototype.toString.call(A);if(m==="[object Date]")return"date";if(m==="[object HTMLAllCollection]")return"html_all_collection"}return Mf(A)?"object":"class_instance";case"string":return"string";case"symbol":return"symbol";case"undefined":return Object.prototype.toString.call(A)==="[object HTMLAllCollection]"?"html_all_collection":"undefined";default:return"unknown"}}function ua(A){var f=(0,Sr.typeOf)(A);switch(f){case Sr.ContextConsumer:return"ContextConsumer";case Sr.ContextProvider:return"ContextProvider";case Sr.ForwardRef:return"ForwardRef";case Sr.Fragment:return"Fragment";case Sr.Lazy:return"Lazy";case Sr.Memo:return"Memo";case Sr.Portal:return"Portal";case Sr.Profiler:return"Profiler";case Sr.StrictMode:return"StrictMode";case Sr.Suspense:return"Suspense";case $e:return"SuspenseList";case Jo:return"TracingMarker";default:var g=A.type;return typeof g=="string"?g:typeof g=="function"?xs(g,"Anonymous"):g!=null?"NotImplementedInDevtools":"Element"}}var fi=50;function Eo(A){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fi;return A.length>f?A.slice(0,f)+"\u2026":A}function rr(A,f){if(A!=null&&Jn.call(A,Ot.type))return f?A[Ot.preview_long]:A[Ot.preview_short];var g=la(A);switch(g){case"html_element":return"<".concat(Eo(A.tagName.toLowerCase())," />");case"function":return Eo("\u0192 ".concat(typeof A.name=="function"?"":A.name,"() {}"));case"string":return'"'.concat(A,'"');case"bigint":return Eo(A.toString()+"n");case"regexp":return Eo(A.toString());case"symbol":return Eo(A.toString());case"react_element":return"<".concat(Eo(ua(A)||"Unknown")," />");case"array_buffer":return"ArrayBuffer(".concat(A.byteLength,")");case"data_view":return"DataView(".concat(A.buffer.byteLength,")");case"array":if(f){for(var m="",d=0;d0&&(m+=", "),m+=rr(A[d],!1),!(m.length>fi));d++);return"[".concat(Eo(m),"]")}else{var B=Jn.call(A,Ot.size)?A[Ot.size]:A.length;return"Array(".concat(B,")")}case"typed_array":var S="".concat(A.constructor.name,"(").concat(A.length,")");if(f){for(var x="",v=0;v0&&(x+=", "),x+=A[v],!(x.length>fi));v++);return"".concat(S," [").concat(Eo(x),"]")}else return S;case"iterator":var T=A.constructor.name;if(f){for(var P=Array.from(A),Y="",j=0;j0&&(Y+=", "),vo(ue)){var Me=rr(ue[0],!0),st=rr(ue[1],!1);Y+="".concat(Me," => ").concat(st)}else Y+=rr(ue,!1);if(Y.length>fi)break}return"".concat(T,"(").concat(A.size,") {").concat(Eo(Y),"}")}else return"".concat(T,"(").concat(A.size,")");case"opaque_iterator":return A[Symbol.toStringTag];case"date":return A.toString();case"class_instance":return A.constructor.name;case"object":if(f){for(var Pe=Array.from(Ti(A)).sort(Ni),Ct="",Lt=0;Lt0&&(Ct+=", "),Ct+="".concat(sr.toString(),": ").concat(rr(A[sr],!1)),Ct.length>fi)break}return"{".concat(Eo(Ct),"}")}else return"{\u2026}";case"boolean":case"number":case"infinity":case"nan":case"null":case"undefined":return A;default:try{return Eo(String(A))}catch{return"unserializable"}}}var Mf=function(f){var g=Object.getPrototypeOf(f);if(!g)return!0;var m=Object.getPrototypeOf(g);return!m};function pl(A,f){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(A);f&&(m=m.filter(function(d){return Object.getOwnPropertyDescriptor(A,d).enumerable})),g.push.apply(g,m)}return g}function qu(A){for(var f=1;f5&&arguments[5]!==void 0?arguments[5]:0,S=la(A),x;switch(S){case"html_element":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.tagName,type:S};case"function":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:typeof A.name=="function"||!A.name?"function":A.name,type:S};case"string":return x=d(m),x||A.length<=500?A:A.slice(0,500)+"...";case"bigint":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"symbol":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"react_element":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:ua(A)||"Unknown",type:S};case"array_buffer":case"data_view":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:S==="data_view"?"DataView":"ArrayBuffer",size:A.byteLength,type:S};case"array":return x=d(m),B>=gi&&!x?_A(S,!0,A,f,m):A.map(function(Y,j){return RA(Y,f,g,m.concat([j]),d,x?1:B+1)});case"html_all_collection":case"typed_array":case"iterator":if(x=d(m),B>=gi&&!x)return _A(S,!0,A,f,m);var v={unserializable:!0,type:S,readonly:!0,size:S==="typed_array"?A.length:void 0,preview_short:rr(A,!1),preview_long:rr(A,!0),name:!A.constructor||A.constructor.name==="Object"?"":A.constructor.name};return Array.from(A).forEach(function(Y,j){return v[j]=RA(Y,f,g,m.concat([j]),d,x?1:B+1)}),g.push(m),v;case"opaque_iterator":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A[Symbol.toStringTag],type:S};case"date":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"regexp":return f.push(m),{inspectable:!1,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.toString(),type:S};case"object":if(x=d(m),B>=gi&&!x)return _A(S,!0,A,f,m);var T={};return Ti(A).forEach(function(Y){var j=Y.toString();T[j]=RA(A[Y],f,g,m.concat([j]),d,x?1:B+1)}),T;case"class_instance":if(x=d(m),B>=gi&&!x)return _A(S,!0,A,f,m);var P={unserializable:!0,type:S,readonly:!0,preview_short:rr(A,!1),preview_long:rr(A,!0),name:A.constructor.name};return Ti(A).forEach(function(Y){var j=Y.toString();P[j]=RA(A[Y],f,g,m.concat([j]),d,x?1:B+1)}),g.push(m),P;case"infinity":case"nan":case"undefined":return f.push(m),{type:S};default:return A}}function Mi(A,f,g,m){var d=getInObject(A,g);if(d!=null&&(d[Ot.unserializable]||(delete d[Ot.inspectable],delete d[Ot.inspected],delete d[Ot.name],delete d[Ot.preview_long],delete d[Ot.preview_short],delete d[Ot.readonly],delete d[Ot.size],delete d[Ot.type])),m!==null&&f.unserializable.length>0){for(var B=f.unserializable[0],S=B.length===g.length,x=0;xA.length)&&(f=A.length);for(var g=0,m=new Array(f);g2&&arguments[2]!==void 0?arguments[2]:[];if(A!==null){var m=[],d=[],B=RA(A,m,d,g,f);return{data:B,cleaned:m,unserializable:d}}else return null}function Qr(A,f){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,m=f[g],d=jn(A)?A.slice():_o({},A);return g+1===f.length?jn(d)?d.splice(m,1):delete d[m]:d[m]=Qr(A[m],f,g+1),d}function FA(A,f,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,d=f[m],B=jn(A)?A.slice():_o({},A);if(m+1===f.length){var S=g[m];B[S]=B[d],jn(B)?B.splice(d,1):delete B[d]}else B[d]=FA(A[d],f,g,m+1);return B}function ga(A,f,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(m>=f.length)return g;var d=f[m],B=jn(A)?A.slice():_o({},A);return B[d]=ga(A[d],f,g,m+1),B}function $u(A){var f=null,g=null,m=A.current;if(m!=null){var d=m.stateNode;d!=null&&(f=d.effectDuration!=null?d.effectDuration:null,g=d.passiveEffectDuration!=null?d.passiveEffectDuration:null)}return{effectDuration:f,passiveEffectDuration:g}}function da(A){if(A===void 0)return"undefined";var f=new Set;return JSON.stringify(A,function(g,m){if(Ui(m)==="object"&&m!==null){if(f.has(m))return;f.add(m)}return typeof m=="bigint"?m.toString()+"n":m},2)}function Xu(A,f){if(A==null||A.length===0||typeof A[0]=="string"&&A[0].match(/([^%]|^)(%c)/g)||f===void 0)return A;var g=/([^%]|^)((%%)*)(%([oOdisf]))/g;if(typeof A[0]=="string"&&A[0].match(g))return["%c".concat(A[0]),f].concat(ca(A.slice(1)));var m=A.reduce(function(d,B,S){switch(S>0&&(d+=" "),Ui(B)){case"string":case"boolean":case"symbol":return d+="%s";case"number":var x=Number.isInteger(B)?"%i":"%f";return d+=x;default:return d+="%o"}},"%c");return[m,f].concat(ca(A))}function fs(A){for(var f=arguments.length,g=new Array(f>1?f-1:0),m=1;m0&&arguments[0]!==void 0?arguments[0]:"",f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ta(A,f)===1}function br(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ta(A,f)>-1}var Il=r(987),Ts=60111,Os="Symbol(react.concurrent_mode)",Zu=60110,In="Symbol(react.context)",ec="Symbol(react.server_context)",pa="Symbol(react.async_mode)",Wf=60103,Gi="Symbol(react.element)",Xo=60129,hl="Symbol(react.debug_trace_mode)",tc=60112,rc="Symbol(react.forward_ref)",vp=60107,Sp="Symbol(react.fragment)",_p=60116,Rp="Symbol(react.lazy)",Kf=60115,Jf="Symbol(react.memo)",bp=60106,Fp="Symbol(react.portal)",xA=60114,nc="Symbol(react.profiler)",kA=60109,NA="Symbol(react.provider)",jf=60119,oc="Symbol(react.scope)",Cl=60108,Bl="Symbol(react.strict_mode)",xp=60113,kp="Symbol(react.suspense)",Yf=60120,Np="Symbol(react.suspense_list)",Tp="Symbol(react.server_context.defaultValue)",ic=!1,GI=!1,Vf=!1,HI=!1;function Op(A,f){return A===f&&(A!==0||1/A===1/f)||A!==A&&f!==f}var qf=typeof Object.is=="function"?Object.is:Op;let zf=qf;var $f=Object.prototype.hasOwnProperty;let Dl=$f;var sc=new Map;function Lp(A){var f=new Set,g={};return Ac(A,f,g),{sources:Array.from(f).sort(),resolvedStyles:g}}function Ac(A,f,g){A!=null&&(vo(A)?A.forEach(function(m){m!=null&&(vo(m)?Ac(m,f,g):Ro(m,f,g))}):Ro(A,f,g),g=Object.fromEntries(Object.entries(g).sort()))}function Ro(A,f,g){var m=Object.keys(A);m.forEach(function(d){var B=A[d];if(typeof B=="string")if(d===B)f.add(d);else{var S=ac(B);S!=null&&(g[d]=S)}else{var x={};g[d]=x,Ac([B],f,x)}})}function ac(A){if(sc.has(A))return sc.get(A);for(var f=0;f"u"?"undefined":OA(Reflect))==="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(st){d=st}Reflect.construct(A,[],x)}else{try{x.call()}catch(st){d=st}A.call(x.prototype)}}else{try{throw Error()}catch(st){d=st}A()}}catch(st){if(st&&d&&typeof st.stack=="string"){for(var v=st.stack.split(` `),T=d.stack.split(` -`),P=w.length-1,Y=T.length-1;P>=1&&Y>=0&&w[P]!==T[Y];)Y--;for(;P>=1&&Y>=0;P--,Y--)if(w[P]!==T[Y]){if(P!==1||Y!==1)do if(P--,Y--,Y<0||w[P]!==T[Y]){var j=` -`+w[P].replace(" at new "," at ");return j}while(P>=1&&Y>=0);break}}}finally{yl=!1,Error.prepareStackTrace=B,g.current=S,mc()}var le=A?A.displayName||A.name:"",Ue=le?Hi(le):"";return Ue}function Ic(A,f,g){return Ql(A,!0,g)}function LA(A,f,g){return Ql(A,!1,g)}function Mp(A){var f=A.prototype;return!!(f&&f.isReactComponent)}function hc(A,f,g){return"";switch(A){case SUSPENSE_NUMBER:case SUSPENSE_SYMBOL_STRING:return Hi("Suspense",f);case SUSPENSE_LIST_NUMBER:case SUSPENSE_LIST_SYMBOL_STRING:return Hi("SuspenseList",f)}if(OA(A)==="object")switch(A.$$typeof){case FORWARD_REF_NUMBER:case FORWARD_REF_SYMBOL_STRING:return LA(A.render,f,g);case MEMO_NUMBER:case MEMO_SYMBOL_STRING:return hc(A.type,f,g);case LAZY_NUMBER:case LAZY_SYMBOL_STRING:{var m=A,d=m._payload,B=m._init;try{return hc(B(d),f,g)}catch{}}}}function vl(A,f,g){var m=A.HostComponent,d=A.LazyComponent,B=A.SuspenseComponent,S=A.SuspenseListComponent,x=A.FunctionComponent,w=A.IndeterminateComponent,T=A.SimpleMemoComponent,P=A.ForwardRef,Y=A.ClassComponent,j=null;switch(f.tag){case m:return Hi(f.type,j);case d:return Hi("Lazy",j);case B:return Hi("Suspense",j);case S:return Hi("SuspenseList",j);case x:case w:case T:return LA(f.type,j,g);case P:return LA(f.type.render,j,g);case Y:return Ic(f.type,j,g);default:return""}}function rg(A,f,g){try{var m="",d=f;do m+=vl(A,d,g),d=d.return;while(d);return m}catch(B){return` +`),P=v.length-1,Y=T.length-1;P>=1&&Y>=0&&v[P]!==T[Y];)Y--;for(;P>=1&&Y>=0;P--,Y--)if(v[P]!==T[Y]){if(P!==1||Y!==1)do if(P--,Y--,Y<0||v[P]!==T[Y]){var j=` +`+v[P].replace(" at new "," at ");return j}while(P>=1&&Y>=0);break}}}finally{Ql=!1,Error.prepareStackTrace=B,g.current=S,Ic()}var ue=A?A.displayName||A.name:"",Me=ue?Hi(ue):"";return Me}function hc(A,f,g){return wl(A,!0,g)}function LA(A,f,g){return wl(A,!1,g)}function Up(A){var f=A.prototype;return!!(f&&f.isReactComponent)}function Cc(A,f,g){return"";switch(A){case SUSPENSE_NUMBER:case SUSPENSE_SYMBOL_STRING:return Hi("Suspense",f);case SUSPENSE_LIST_NUMBER:case SUSPENSE_LIST_SYMBOL_STRING:return Hi("SuspenseList",f)}if(OA(A)==="object")switch(A.$$typeof){case FORWARD_REF_NUMBER:case FORWARD_REF_SYMBOL_STRING:return LA(A.render,f,g);case MEMO_NUMBER:case MEMO_SYMBOL_STRING:return Cc(A.type,f,g);case LAZY_NUMBER:case LAZY_SYMBOL_STRING:{var m=A,d=m._payload,B=m._init;try{return Cc(B(d),f,g)}catch{}}}}function vl(A,f,g){var m=A.HostComponent,d=A.LazyComponent,B=A.SuspenseComponent,S=A.SuspenseListComponent,x=A.FunctionComponent,v=A.IndeterminateComponent,T=A.SimpleMemoComponent,P=A.ForwardRef,Y=A.ClassComponent,j=null;switch(f.tag){case m:return Hi(f.type,j);case d:return Hi("Lazy",j);case B:return Hi("Suspense",j);case S:return Hi("SuspenseList",j);case x:case v:case T:return LA(f.type,j,g);case P:return LA(f.type.render,j,g);case Y:return hc(f.type,j,g);default:return""}}function og(A,f,g){try{var m="",d=f;do m+=vl(A,d,g),d=d.return;while(d);return m}catch(B){return` Error generating stack: `+B.message+` -`+B.stack}}function ma(A,f){return Ia(A)||ng(A,f)||Pp(A,f)||Wi()}function Wi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pp(A,f){if(A){if(typeof A=="string")return Zo(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Zo(A,f)}}function Zo(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"||!(Symbol.iterator in Object(A)))){var g=[],m=!0,d=!1,B=void 0;try{for(var S=A[Symbol.iterator](),x;!(m=(x=S.next()).done)&&(g.push(x.value),!(f&&g.length===f));m=!0);}catch(w){d=!0,B=w}finally{try{!m&&S.return!=null&&S.return()}finally{if(d)throw B}}return g}}function Ia(A){if(Array.isArray(A))return A}function Ki(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ki=function(g){return typeof g}:Ki=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Ki(A)}var ha=10,Ls=null,Cc=typeof performance<"u"&&typeof performance.mark=="function"&&typeof performance.clearMarks=="function",bt=!1;if(Cc){var vn="__v3",og={};Object.defineProperty(og,"startTime",{get:function(){return bt=!0,0},set:function(){}});try{performance.mark(vn,og)}catch{}finally{performance.clearMarks(vn)}}bt&&(Ls=performance);var Up=(typeof performance>"u"?"undefined":Ki(performance))==="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Bc(A){Ls=A,Cc=A!==null,bt=A!==null}function On(A){var f=A.getDisplayNameForFiber,g=A.getIsProfiling,m=A.getLaneLabelMap,d=A.workTagMap,B=A.currentDispatcherRef,S=A.reactVersion,x=0,w=null,T=[],P=null,Y=new Map,j=!1,le=!1;function Ue(){var qe=Up();return P?(P.startTime===0&&(P.startTime=qe-ha),qe-P.startTime):0}function st(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges=="function"){var qe=__REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges();if(jn(qe))return qe}return null}function Ge(){return P}function Ct(qe){for(var gt=[],Gt=1,$t=0;$t0){var $t=T[T.length-1];Gt=$t.type==="render-idle"?$t.depth:$t.depth+1}var en=Ct(gt),Tr={type:qe,batchUID:x,depth:Gt,lanes:en,timestamp:Ue(),duration:0};if(T.push(Tr),P){var Mn=P,ao=Mn.batchUIDToMeasuresMap,Sn=Mn.laneToReactMeasureMap,ni=ao.get(x);ni!=null?ni.push(Tr):ao.set(x,[Tr]),en.forEach(function(Ys){ni=Sn.get(Ys),ni&&ni.push(Tr)})}}function pr(qe){var gt=Ue();if(T.length===0){console.error('Unexpected type "%s" completed at %sms while currentReactMeasuresStack is empty.',qe,gt);return}var Gt=T.pop();Gt.type!==qe&&console.error('Unexpected type "%s" completed at %sms before "%s" completed.',qe,gt,Gt.type),Gt.duration=gt-Gt.timestamp,P&&(P.duration=Ue()+ha)}function zt(qe){j&&(er("commit",qe),le=!0),bt&&(Xe("--commit-start-".concat(qe)),sr())}function Dr(){j&&(pr("commit"),pr("render-idle")),bt&&Xe("--commit-stop")}function Er(qe){if(j||bt){var gt=f(qe)||"Unknown";j&&j&&(w={componentName:gt,duration:0,timestamp:Ue(),type:"render",warning:null}),bt&&Xe("--component-render-start-".concat(gt))}}function gn(){j&&w&&(P&&P.componentMeasures.push(w),w.duration=Ue()-w.timestamp,w=null),bt&&Xe("--component-render-stop")}function kt(qe){if(j||bt){var gt=f(qe)||"Unknown";j&&j&&(w={componentName:gt,duration:0,timestamp:Ue(),type:"layout-effect-mount",warning:null}),bt&&Xe("--component-layout-effect-mount-start-".concat(gt))}}function Cn(){j&&w&&(P&&P.componentMeasures.push(w),w.duration=Ue()-w.timestamp,w=null),bt&&Xe("--component-layout-effect-mount-stop")}function Zr(qe){if(j||bt){var gt=f(qe)||"Unknown";j&&j&&(w={componentName:gt,duration:0,timestamp:Ue(),type:"layout-effect-unmount",warning:null}),bt&&Xe("--component-layout-effect-unmount-start-".concat(gt))}}function Wr(){j&&w&&(P&&P.componentMeasures.push(w),w.duration=Ue()-w.timestamp,w=null),bt&&Xe("--component-layout-effect-unmount-stop")}function St(qe){if(j||bt){var gt=f(qe)||"Unknown";j&&j&&(w={componentName:gt,duration:0,timestamp:Ue(),type:"passive-effect-mount",warning:null}),bt&&Xe("--component-passive-effect-mount-start-".concat(gt))}}function mr(){j&&w&&(P&&P.componentMeasures.push(w),w.duration=Ue()-w.timestamp,w=null),bt&&Xe("--component-passive-effect-mount-stop")}function Bn(qe){if(j||bt){var gt=f(qe)||"Unknown";j&&j&&(w={componentName:gt,duration:0,timestamp:Ue(),type:"passive-effect-unmount",warning:null}),bt&&Xe("--component-passive-effect-unmount-start-".concat(gt))}}function Xn(){j&&w&&(P&&P.componentMeasures.push(w),w.duration=Ue()-w.timestamp,w=null),bt&&Xe("--component-passive-effect-unmount-stop")}function Je(qe,gt,Gt){if(j||bt){var $t=f(qe)||"Unknown",en=qe.alternate===null?"mount":"update",Tr="";gt!==null&&Ki(gt)==="object"&&typeof gt.message=="string"?Tr=gt.message:typeof gt=="string"&&(Tr=gt),j&&P&&P.thrownErrors.push({componentName:$t,message:Tr,phase:en,timestamp:Ue(),type:"thrown-error"}),bt&&Xe("--error-".concat($t,"-").concat(en,"-").concat(Tr))}}var lt=typeof WeakMap=="function"?WeakMap:Map,It=new lt,Nr=0;function on(qe){return It.has(qe)||It.set(qe,Nr++),It.get(qe)}function Kr(qe,gt,Gt){if(j||bt){var $t=It.has(gt)?"resuspend":"suspend",en=on(gt),Tr=f(qe)||"Unknown",Mn=qe.alternate===null?"mount":"update",ao=gt.displayName||"",Sn=null;j&&(Sn={componentName:Tr,depth:0,duration:0,id:"".concat(en),phase:Mn,promiseName:ao,resolution:"unresolved",timestamp:Ue(),type:"suspense",warning:null},P&&P.suspenseEvents.push(Sn)),bt&&Xe("--suspense-".concat($t,"-").concat(en,"-").concat(Tr,"-").concat(Mn,"-").concat(Gt,"-").concat(ao)),gt.then(function(){Sn&&(Sn.duration=Ue()-Sn.timestamp,Sn.resolution="resolved"),bt&&Xe("--suspense-resolved-".concat(en,"-").concat(Tr))},function(){Sn&&(Sn.duration=Ue()-Sn.timestamp,Sn.resolution="rejected"),bt&&Xe("--suspense-rejected-".concat(en,"-").concat(Tr))})}}function sn(qe){j&&er("layout-effects",qe),bt&&Xe("--layout-effects-start-".concat(qe))}function wn(){j&&pr("layout-effects"),bt&&Xe("--layout-effects-stop")}function js(qe){j&&er("passive-effects",qe),bt&&Xe("--passive-effects-start-".concat(qe))}function ri(){j&&pr("passive-effects"),bt&&Xe("--passive-effects-stop")}function ms(qe){j&&(le&&(le=!1,x++),(T.length===0||T[T.length-1].type!=="render-idle")&&er("render-idle",qe),er("render",qe)),bt&&Xe("--render-start-".concat(qe))}function Is(){j&&pr("render"),bt&&Xe("--render-yield")}function Vi(){j&&pr("render"),bt&&Xe("--render-stop")}function qi(qe){j&&P&&P.schedulingEvents.push({lanes:Ct(qe),timestamp:Ue(),type:"schedule-render",warning:null}),bt&&Xe("--schedule-render-".concat(qe))}function GA(qe,gt){if(j||bt){var Gt=f(qe)||"Unknown";j&&P&&P.schedulingEvents.push({componentName:Gt,lanes:Ct(gt),timestamp:Ue(),type:"schedule-force-update",warning:null}),bt&&Xe("--schedule-forced-update-".concat(gt,"-").concat(Gt))}}function hs(qe){for(var gt=[],Gt=qe;Gt!==null;)gt.push(Gt),Gt=Gt.return;return gt}function kc(qe,gt){if(j||bt){var Gt=f(qe)||"Unknown";if(j&&P){var $t={componentName:Gt,lanes:Ct(gt),timestamp:Ue(),type:"schedule-state-update",warning:null};Y.set($t,hs(qe)),P.schedulingEvents.push($t)}bt&&Xe("--schedule-state-update-".concat(gt,"-").concat(Gt))}}function Nc(qe){if(j!==qe)if(j=qe,j){var gt=new Map;if(bt){var Gt=st();if(Gt)for(var $t=0;$t=0)&&Object.prototype.propertyIsEnumerable.call(A,m)&&(g[m]=A[m])}return g}function nt(A,f){if(A==null)return{};var g={},m=Object.keys(A),d,B;for(B=0;B=0)&&(g[d]=A[d]);return g}function Ms(A,f){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(A);f&&(m=m.filter(function(d){return Object.getOwnPropertyDescriptor(A,d).enumerable})),g.push.apply(g,m)}return g}function Ca(A){for(var f=1;f"u"||!(Symbol.iterator in Object(A)))){var g=[],m=!0,d=!1,B=void 0;try{for(var S=A[Symbol.iterator](),x;!(m=(x=S.next()).done)&&(g.push(x.value),!(f&&g.length===f));m=!0);}catch(w){d=!0,B=w}finally{try{!m&&S.return!=null&&S.return()}finally{if(d)throw B}}return g}}function Dc(A){if(Array.isArray(A))return A}function Sl(A){return yc(A)||ag(A)||an(A)||Ag()}function Ag(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ag(A){if(typeof Symbol<"u"&&Symbol.iterator in Object(A))return Array.from(A)}function yc(A){if(Array.isArray(A))return mo(A)}function Ps(A,f){var g;if(typeof Symbol>"u"||A[Symbol.iterator]==null){if(Array.isArray(A)||(g=an(A))||f&&A&&typeof A.length=="number"){g&&(A=g);var m=0,d=function(){};return{s:d,n:function(){return m>=A.length?{done:!0}:{done:!1,value:A[m++]}},e:function(T){throw T},f:d}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=!0,S=!1,x;return{s:function(){g=A[Symbol.iterator]()},n:function(){var T=g.next();return B=T.done,T},e:function(T){S=!0,x=T},f:function(){try{!B&&g.return!=null&&g.return()}finally{if(S)throw x}}}}function an(A,f){if(A){if(typeof A=="string")return mo(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return mo(A,f)}}function mo(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"?"undefined":Ln(performance))==="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Fo(A){var f={ImmediatePriority:99,UserBlockingPriority:98,NormalPriority:97,LowPriority:96,IdlePriority:95,NoPriority:90};nn(A,"17.0.2")&&(f={ImmediatePriority:1,UserBlockingPriority:2,NormalPriority:3,LowPriority:4,IdlePriority:5,NoPriority:0});var g=0;Fr(A,"18.0.0-alpha")?g=24:Fr(A,"16.9.0")?g=1:Fr(A,"16.3.0")&&(g=2);var m=null;nn(A,"17.0.1")?m={CacheComponent:24,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:26,HostSingleton:27,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:23,MemoComponent:14,Mode:8,OffscreenComponent:22,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,TracingMarkerComponent:25,YieldComponent:-1}:Fr(A,"17.0.0-alpha")?m={CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:-1,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:24,MemoComponent:14,Mode:8,OffscreenComponent:23,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,TracingMarkerComponent:-1,YieldComponent:-1}:Fr(A,"16.6.0-beta.0")?m={CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:-1,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:-1,MemoComponent:14,Mode:8,OffscreenComponent:-1,Profiler:12,ScopeComponent:-1,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,TracingMarkerComponent:-1,YieldComponent:-1}:Fr(A,"16.4.3-alpha")?m={CacheComponent:-1,ClassComponent:2,ContextConsumer:11,ContextProvider:12,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:-1,ForwardRef:13,Fragment:9,FunctionComponent:0,HostComponent:7,HostPortal:6,HostRoot:5,HostHoistable:-1,HostSingleton:-1,HostText:8,IncompleteClassComponent:-1,IndeterminateComponent:4,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:10,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,TracingMarkerComponent:-1,YieldComponent:-1}:m={CacheComponent:-1,ClassComponent:2,ContextConsumer:12,ContextProvider:13,CoroutineComponent:7,CoroutineHandlerPhase:8,DehydratedSuspenseComponent:-1,ForwardRef:14,Fragment:10,FunctionComponent:1,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:-1,HostSingleton:-1,HostText:6,IncompleteClassComponent:-1,IndeterminateComponent:0,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:11,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,TracingMarkerComponent:-1,YieldComponent:9};function d(St){var mr=Ln(St)==="object"&&St!==null?St.$$typeof:St;return Ln(mr)==="symbol"?mr.toString():mr}var B=m,S=B.CacheComponent,x=B.ClassComponent,w=B.IncompleteClassComponent,T=B.FunctionComponent,P=B.IndeterminateComponent,Y=B.ForwardRef,j=B.HostRoot,le=B.HostHoistable,Ue=B.HostSingleton,st=B.HostComponent,Ge=B.HostPortal,Ct=B.HostText,Lt=B.Fragment,sr=B.LazyComponent,Xe=B.LegacyHiddenComponent,er=B.MemoComponent,pr=B.OffscreenComponent,zt=B.Profiler,Dr=B.ScopeComponent,Er=B.SimpleMemoComponent,gn=B.SuspenseComponent,kt=B.SuspenseListComponent,Cn=B.TracingMarkerComponent;function Zr(St){var mr=d(St);switch(mr){case Hf:case Wf:return Zr(St.type);case ec:case tc:return St.render;default:return St}}function Wr(St){var mr=St.elementType,Bn=St.type,Xn=St.tag,Je=Bn;Ln(Bn)==="object"&&Bn!==null&&(Je=Zr(Bn));var lt=null;switch(Xn){case S:return"Cache";case x:case w:return xs(Je);case T:case P:return xs(Je);case Y:return Ju(mr,Je,"ForwardRef","Anonymous");case j:var It=St.stateNode;return It!=null&&It._debugRootType!==null?It._debugRootType:null;case st:case Ue:case le:return Bn;case Ge:case Ct:return null;case Lt:return"Fragment";case sr:return"Lazy";case er:case Er:return Ju(mr,Je,"Memo","Anonymous");case gn:return"Suspense";case Xe:return"LegacyHidden";case pr:return"Offscreen";case Dr:return"Scope";case kt:return"SuspenseList";case zt:return"Profiler";case Cn:return"TracingMarker";default:var Nr=d(Bn);switch(Nr){case Ts:case Os:case da:return null;case kA:case NA:return lt=St.type._context||St.type.context,"".concat(lt.displayName||"Context",".Provider");case Xu:case In:case Zu:return lt=St.type._context||St.type,"".concat(lt.displayName||"Context",".Consumer");case hl:case Cl:return null;case xA:case rc:return"Profiler(".concat(St.memoizedProps.id,")");case Kf:case nc:return"Scope";default:return null}}}return{getDisplayNameForFiber:Wr,getTypeSymbol:d,ReactPriorityLevels:f,ReactTypeOfWork:m,StrictModeBits:g}}var qn=new Map,br=new Map;function Hp(A,f,g,m){var d=g.reconcilerVersion||g.version,B=Fo(d),S=B.getDisplayNameForFiber,x=B.getTypeSymbol,w=B.ReactPriorityLevels,T=B.ReactTypeOfWork,P=B.StrictModeBits,Y=T.CacheComponent,j=T.ClassComponent,le=T.ContextConsumer,Ue=T.DehydratedSuspenseComponent,st=T.ForwardRef,Ge=T.Fragment,Ct=T.FunctionComponent,Lt=T.HostRoot,sr=T.HostHoistable,Xe=T.HostSingleton,er=T.HostPortal,pr=T.HostComponent,zt=T.HostText,Dr=T.IncompleteClassComponent,Er=T.IndeterminateComponent,gn=T.LegacyHiddenComponent,kt=T.MemoComponent,Cn=T.OffscreenComponent,Zr=T.SimpleMemoComponent,Wr=T.SuspenseComponent,St=T.SuspenseListComponent,mr=T.TracingMarkerComponent,Bn=w.ImmediatePriority,Xn=w.UserBlockingPriority,Je=w.NormalPriority,lt=w.LowPriority,It=w.IdlePriority,Nr=w.NoPriority,on=g.getLaneLabelMap,Kr=g.injectProfilingHooks,sn=g.overrideHookState,wn=g.overrideHookStateDeletePath,js=g.overrideHookStateRenamePath,ri=g.overrideProps,ms=g.overridePropsDeletePath,Is=g.overridePropsRenamePath,Vi=g.scheduleRefresh,qi=g.setErrorHandler,GA=g.setSuspenseHandler,hs=g.scheduleUpdate,kc=typeof qi=="function"&&typeof hs=="function",Nc=typeof GA=="function"&&typeof hs=="function";typeof Vi=="function"&&(g.scheduleRefresh=function(){try{A.emit("fastRefreshScheduled")}finally{return Vi.apply(void 0,arguments)}});var qe=null,gt=null;if(typeof Kr=="function"){var Gt=On({getDisplayNameForFiber:S,getIsProfiling:function(){return Di},getLaneLabelMap:on,currentDispatcherRef:g.currentDispatcherRef,workTagMap:T,reactVersion:d});Kr(Gt.profilingHooks),qe=Gt.getTimelineData,gt=Gt.toggleProfilingStatus}var $t=new Set,en=new Map,Tr=new Map,Mn=new Map,ao=new Map;function Sn(){var v=Ps(Mn.keys()),F;try{for(v.s();!(F=v.n()).done;){var L=F.value,M=br.get(L);M!=null&&($t.add(M),Be(L))}}catch(Dt){v.e(Dt)}finally{v.f()}var ee=Ps(ao.keys()),Ee;try{for(ee.s();!(Ee=ee.n()).done;){var Ne=Ee.value,ht=br.get(Ne);ht!=null&&($t.add(ht),Be(Ne))}}catch(Dt){ee.e(Dt)}finally{ee.f()}Mn.clear(),ao.clear(),xa()}function ni(v,F,L){var M=br.get(v);M!=null&&(en.delete(M),L.has(v)?(L.delete(v),$t.add(M),xa(),Be(v)):$t.delete(M))}function Ys(v){ni(v,en,Mn)}function HA(v){ni(v,Tr,ao)}function Be(v){Co!==null&&Co.id===v&&(Pc=!0)}function ye(v,F,L){if(F==="error"){var M=Ci(v);if(M!=null&&$i.get(M)===!0)return}var ee=fs.apply(void 0,Sl(L));G&&we("onErrorOrWarning",v,null,"".concat(F,': "').concat(ee,'"')),$t.add(v);var Ee=F==="error"?en:Tr,Ne=Ee.get(v);if(Ne!=null){var ht=Ne.get(ee)||0;Ne.set(ee,ht+1)}else Ee.set(v,new Map([[ee,1]]));v0()}hn(g,ye),Nl();var we=function(F,L,M){var ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";if(G){var Ee=L.tag+":"+(S(L)||"null"),Ne=Ci(L)||"",ht=M?M.tag+":"+(S(M)||"null"):"",Dt=M?Ci(M)||"":"";console.groupCollapsed("[renderer] %c".concat(F," %c").concat(Ee," (").concat(Ne,") %c").concat(M?"".concat(ht," (").concat(Dt,")"):""," %c").concat(ee),"color: red; font-weight: bold;","color: blue;","color: purple;","color: black;"),console.log(new Error().stack.split(` +`+B.stack}}function Ia(A,f){return ha(A)||ig(A,f)||Gp(A,f)||Wi()}function Wi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gp(A,f){if(A){if(typeof A=="string")return Zo(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Zo(A,f)}}function Zo(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"||!(Symbol.iterator in Object(A)))){var g=[],m=!0,d=!1,B=void 0;try{for(var S=A[Symbol.iterator](),x;!(m=(x=S.next()).done)&&(g.push(x.value),!(f&&g.length===f));m=!0);}catch(v){d=!0,B=v}finally{try{!m&&S.return!=null&&S.return()}finally{if(d)throw B}}return g}}function ha(A){if(Array.isArray(A))return A}function Ki(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ki=function(g){return typeof g}:Ki=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Ki(A)}var Ca=10,Ls=null,Bc=typeof performance<"u"&&typeof performance.mark=="function"&&typeof performance.clearMarks=="function",Ft=!1;if(Bc){var vn="__v3",sg={};Object.defineProperty(sg,"startTime",{get:function(){return Ft=!0,0},set:function(){}});try{performance.mark(vn,sg)}catch{}finally{performance.clearMarks(vn)}}Ft&&(Ls=performance);var Hp=(typeof performance>"u"?"undefined":Ki(performance))==="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Dc(A){Ls=A,Bc=A!==null,Ft=A!==null}function On(A){var f=A.getDisplayNameForFiber,g=A.getIsProfiling,m=A.getLaneLabelMap,d=A.workTagMap,B=A.currentDispatcherRef,S=A.reactVersion,x=0,v=null,T=[],P=null,Y=new Map,j=!1,ue=!1;function Me(){var qe=Hp();return P?(P.startTime===0&&(P.startTime=qe-Ca),qe-P.startTime):0}function st(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges=="function"){var qe=__REACT_DEVTOOLS_GLOBAL_HOOK__.getInternalModuleRanges();if(jn(qe))return qe}return null}function Pe(){return P}function Ct(qe){for(var dt=[],Gt=1,$t=0;$t0){var $t=T[T.length-1];Gt=$t.type==="render-idle"?$t.depth:$t.depth+1}var en=Ct(dt),Tr={type:qe,batchUID:x,depth:Gt,lanes:en,timestamp:Me(),duration:0};if(T.push(Tr),P){var Mn=P,ao=Mn.batchUIDToMeasuresMap,_n=Mn.laneToReactMeasureMap,ni=ao.get(x);ni!=null?ni.push(Tr):ao.set(x,[Tr]),en.forEach(function(Ys){ni=_n.get(Ys),ni&&ni.push(Tr)})}}function pr(qe){var dt=Me();if(T.length===0){console.error('Unexpected type "%s" completed at %sms while currentReactMeasuresStack is empty.',qe,dt);return}var Gt=T.pop();Gt.type!==qe&&console.error('Unexpected type "%s" completed at %sms before "%s" completed.',qe,dt,Gt.type),Gt.duration=dt-Gt.timestamp,P&&(P.duration=Me()+Ca)}function zt(qe){j&&(er("commit",qe),ue=!0),Ft&&(Xe("--commit-start-".concat(qe)),sr())}function Dr(){j&&(pr("commit"),pr("render-idle")),Ft&&Xe("--commit-stop")}function Er(qe){if(j||Ft){var dt=f(qe)||"Unknown";j&&j&&(v={componentName:dt,duration:0,timestamp:Me(),type:"render",warning:null}),Ft&&Xe("--component-render-start-".concat(dt))}}function gn(){j&&v&&(P&&P.componentMeasures.push(v),v.duration=Me()-v.timestamp,v=null),Ft&&Xe("--component-render-stop")}function kt(qe){if(j||Ft){var dt=f(qe)||"Unknown";j&&j&&(v={componentName:dt,duration:0,timestamp:Me(),type:"layout-effect-mount",warning:null}),Ft&&Xe("--component-layout-effect-mount-start-".concat(dt))}}function Cn(){j&&v&&(P&&P.componentMeasures.push(v),v.duration=Me()-v.timestamp,v=null),Ft&&Xe("--component-layout-effect-mount-stop")}function Zr(qe){if(j||Ft){var dt=f(qe)||"Unknown";j&&j&&(v={componentName:dt,duration:0,timestamp:Me(),type:"layout-effect-unmount",warning:null}),Ft&&Xe("--component-layout-effect-unmount-start-".concat(dt))}}function Wr(){j&&v&&(P&&P.componentMeasures.push(v),v.duration=Me()-v.timestamp,v=null),Ft&&Xe("--component-layout-effect-unmount-stop")}function St(qe){if(j||Ft){var dt=f(qe)||"Unknown";j&&j&&(v={componentName:dt,duration:0,timestamp:Me(),type:"passive-effect-mount",warning:null}),Ft&&Xe("--component-passive-effect-mount-start-".concat(dt))}}function mr(){j&&v&&(P&&P.componentMeasures.push(v),v.duration=Me()-v.timestamp,v=null),Ft&&Xe("--component-passive-effect-mount-stop")}function Bn(qe){if(j||Ft){var dt=f(qe)||"Unknown";j&&j&&(v={componentName:dt,duration:0,timestamp:Me(),type:"passive-effect-unmount",warning:null}),Ft&&Xe("--component-passive-effect-unmount-start-".concat(dt))}}function Xn(){j&&v&&(P&&P.componentMeasures.push(v),v.duration=Me()-v.timestamp,v=null),Ft&&Xe("--component-passive-effect-unmount-stop")}function Ke(qe,dt,Gt){if(j||Ft){var $t=f(qe)||"Unknown",en=qe.alternate===null?"mount":"update",Tr="";dt!==null&&Ki(dt)==="object"&&typeof dt.message=="string"?Tr=dt.message:typeof dt=="string"&&(Tr=dt),j&&P&&P.thrownErrors.push({componentName:$t,message:Tr,phase:en,timestamp:Me(),type:"thrown-error"}),Ft&&Xe("--error-".concat($t,"-").concat(en,"-").concat(Tr))}}var ut=typeof WeakMap=="function"?WeakMap:Map,It=new ut,Nr=0;function on(qe){return It.has(qe)||It.set(qe,Nr++),It.get(qe)}function Kr(qe,dt,Gt){if(j||Ft){var $t=It.has(dt)?"resuspend":"suspend",en=on(dt),Tr=f(qe)||"Unknown",Mn=qe.alternate===null?"mount":"update",ao=dt.displayName||"",_n=null;j&&(_n={componentName:Tr,depth:0,duration:0,id:"".concat(en),phase:Mn,promiseName:ao,resolution:"unresolved",timestamp:Me(),type:"suspense",warning:null},P&&P.suspenseEvents.push(_n)),Ft&&Xe("--suspense-".concat($t,"-").concat(en,"-").concat(Tr,"-").concat(Mn,"-").concat(Gt,"-").concat(ao)),dt.then(function(){_n&&(_n.duration=Me()-_n.timestamp,_n.resolution="resolved"),Ft&&Xe("--suspense-resolved-".concat(en,"-").concat(Tr))},function(){_n&&(_n.duration=Me()-_n.timestamp,_n.resolution="rejected"),Ft&&Xe("--suspense-rejected-".concat(en,"-").concat(Tr))})}}function sn(qe){j&&er("layout-effects",qe),Ft&&Xe("--layout-effects-start-".concat(qe))}function Sn(){j&&pr("layout-effects"),Ft&&Xe("--layout-effects-stop")}function js(qe){j&&er("passive-effects",qe),Ft&&Xe("--passive-effects-start-".concat(qe))}function ri(){j&&pr("passive-effects"),Ft&&Xe("--passive-effects-stop")}function ms(qe){j&&(ue&&(ue=!1,x++),(T.length===0||T[T.length-1].type!=="render-idle")&&er("render-idle",qe),er("render",qe)),Ft&&Xe("--render-start-".concat(qe))}function Is(){j&&pr("render"),Ft&&Xe("--render-yield")}function Vi(){j&&pr("render"),Ft&&Xe("--render-stop")}function qi(qe){j&&P&&P.schedulingEvents.push({lanes:Ct(qe),timestamp:Me(),type:"schedule-render",warning:null}),Ft&&Xe("--schedule-render-".concat(qe))}function GA(qe,dt){if(j||Ft){var Gt=f(qe)||"Unknown";j&&P&&P.schedulingEvents.push({componentName:Gt,lanes:Ct(dt),timestamp:Me(),type:"schedule-force-update",warning:null}),Ft&&Xe("--schedule-forced-update-".concat(dt,"-").concat(Gt))}}function hs(qe){for(var dt=[],Gt=qe;Gt!==null;)dt.push(Gt),Gt=Gt.return;return dt}function Nc(qe,dt){if(j||Ft){var Gt=f(qe)||"Unknown";if(j&&P){var $t={componentName:Gt,lanes:Ct(dt),timestamp:Me(),type:"schedule-state-update",warning:null};Y.set($t,hs(qe)),P.schedulingEvents.push($t)}Ft&&Xe("--schedule-state-update-".concat(dt,"-").concat(Gt))}}function Tc(qe){if(j!==qe)if(j=qe,j){var dt=new Map;if(Ft){var Gt=st();if(Gt)for(var $t=0;$t=0)&&Object.prototype.propertyIsEnumerable.call(A,m)&&(g[m]=A[m])}return g}function rt(A,f){if(A==null)return{};var g={},m=Object.keys(A),d,B;for(B=0;B=0)&&(g[d]=A[d]);return g}function Ms(A,f){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(A);f&&(m=m.filter(function(d){return Object.getOwnPropertyDescriptor(A,d).enumerable})),g.push.apply(g,m)}return g}function Ba(A){for(var f=1;f"u"||!(Symbol.iterator in Object(A)))){var g=[],m=!0,d=!1,B=void 0;try{for(var S=A[Symbol.iterator](),x;!(m=(x=S.next()).done)&&(g.push(x.value),!(f&&g.length===f));m=!0);}catch(v){d=!0,B=v}finally{try{!m&&S.return!=null&&S.return()}finally{if(d)throw B}}return g}}function yc(A){if(Array.isArray(A))return A}function _l(A){return Qc(A)||ug(A)||an(A)||lg()}function lg(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ug(A){if(typeof Symbol<"u"&&Symbol.iterator in Object(A))return Array.from(A)}function Qc(A){if(Array.isArray(A))return mo(A)}function Ps(A,f){var g;if(typeof Symbol>"u"||A[Symbol.iterator]==null){if(Array.isArray(A)||(g=an(A))||f&&A&&typeof A.length=="number"){g&&(A=g);var m=0,d=function(){};return{s:d,n:function(){return m>=A.length?{done:!0}:{done:!1,value:A[m++]}},e:function(T){throw T},f:d}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=!0,S=!1,x;return{s:function(){g=A[Symbol.iterator]()},n:function(){var T=g.next();return B=T.done,T},e:function(T){S=!0,x=T},f:function(){try{!B&&g.return!=null&&g.return()}finally{if(S)throw x}}}}function an(A,f){if(A){if(typeof A=="string")return mo(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return mo(A,f)}}function mo(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"?"undefined":Ln(performance))==="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function bo(A){var f={ImmediatePriority:99,UserBlockingPriority:98,NormalPriority:97,LowPriority:96,IdlePriority:95,NoPriority:90};nn(A,"17.0.2")&&(f={ImmediatePriority:1,UserBlockingPriority:2,NormalPriority:3,LowPriority:4,IdlePriority:5,NoPriority:0});var g=0;br(A,"18.0.0-alpha")?g=24:br(A,"16.9.0")?g=1:br(A,"16.3.0")&&(g=2);var m=null;nn(A,"17.0.1")?m={CacheComponent:24,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:26,HostSingleton:27,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:23,MemoComponent:14,Mode:8,OffscreenComponent:22,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,TracingMarkerComponent:25,YieldComponent:-1}:br(A,"17.0.0-alpha")?m={CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:-1,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:24,MemoComponent:14,Mode:8,OffscreenComponent:23,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,TracingMarkerComponent:-1,YieldComponent:-1}:br(A,"16.6.0-beta.0")?m={CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:-1,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:-1,MemoComponent:14,Mode:8,OffscreenComponent:-1,Profiler:12,ScopeComponent:-1,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,TracingMarkerComponent:-1,YieldComponent:-1}:br(A,"16.4.3-alpha")?m={CacheComponent:-1,ClassComponent:2,ContextConsumer:11,ContextProvider:12,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:-1,ForwardRef:13,Fragment:9,FunctionComponent:0,HostComponent:7,HostPortal:6,HostRoot:5,HostHoistable:-1,HostSingleton:-1,HostText:8,IncompleteClassComponent:-1,IndeterminateComponent:4,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:10,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,TracingMarkerComponent:-1,YieldComponent:-1}:m={CacheComponent:-1,ClassComponent:2,ContextConsumer:12,ContextProvider:13,CoroutineComponent:7,CoroutineHandlerPhase:8,DehydratedSuspenseComponent:-1,ForwardRef:14,Fragment:10,FunctionComponent:1,HostComponent:5,HostPortal:4,HostRoot:3,HostHoistable:-1,HostSingleton:-1,HostText:6,IncompleteClassComponent:-1,IndeterminateComponent:0,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:11,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,TracingMarkerComponent:-1,YieldComponent:9};function d(St){var mr=Ln(St)==="object"&&St!==null?St.$$typeof:St;return Ln(mr)==="symbol"?mr.toString():mr}var B=m,S=B.CacheComponent,x=B.ClassComponent,v=B.IncompleteClassComponent,T=B.FunctionComponent,P=B.IndeterminateComponent,Y=B.ForwardRef,j=B.HostRoot,ue=B.HostHoistable,Me=B.HostSingleton,st=B.HostComponent,Pe=B.HostPortal,Ct=B.HostText,Lt=B.Fragment,sr=B.LazyComponent,Xe=B.LegacyHiddenComponent,er=B.MemoComponent,pr=B.OffscreenComponent,zt=B.Profiler,Dr=B.ScopeComponent,Er=B.SimpleMemoComponent,gn=B.SuspenseComponent,kt=B.SuspenseListComponent,Cn=B.TracingMarkerComponent;function Zr(St){var mr=d(St);switch(mr){case Kf:case Jf:return Zr(St.type);case tc:case rc:return St.render;default:return St}}function Wr(St){var mr=St.elementType,Bn=St.type,Xn=St.tag,Ke=Bn;Ln(Bn)==="object"&&Bn!==null&&(Ke=Zr(Bn));var ut=null;switch(Xn){case S:return"Cache";case x:case v:return xs(Ke);case T:case P:return xs(Ke);case Y:return ju(mr,Ke,"ForwardRef","Anonymous");case j:var It=St.stateNode;return It!=null&&It._debugRootType!==null?It._debugRootType:null;case st:case Me:case ue:return Bn;case Pe:case Ct:return null;case Lt:return"Fragment";case sr:return"Lazy";case er:case Er:return ju(mr,Ke,"Memo","Anonymous");case gn:return"Suspense";case Xe:return"LegacyHidden";case pr:return"Offscreen";case Dr:return"Scope";case kt:return"SuspenseList";case zt:return"Profiler";case Cn:return"TracingMarker";default:var Nr=d(Bn);switch(Nr){case Ts:case Os:case pa:return null;case kA:case NA:return ut=St.type._context||St.type.context,"".concat(ut.displayName||"Context",".Provider");case Zu:case In:case ec:return ut=St.type._context||St.type,"".concat(ut.displayName||"Context",".Consumer");case Cl:case Bl:return null;case xA:case nc:return"Profiler(".concat(St.memoizedProps.id,")");case jf:case oc:return"Scope";default:return null}}}return{getDisplayNameForFiber:Wr,getTypeSymbol:d,ReactPriorityLevels:f,ReactTypeOfWork:m,StrictModeBits:g}}var qn=new Map,Fr=new Map;function Kp(A,f,g,m){var d=g.reconcilerVersion||g.version,B=bo(d),S=B.getDisplayNameForFiber,x=B.getTypeSymbol,v=B.ReactPriorityLevels,T=B.ReactTypeOfWork,P=B.StrictModeBits,Y=T.CacheComponent,j=T.ClassComponent,ue=T.ContextConsumer,Me=T.DehydratedSuspenseComponent,st=T.ForwardRef,Pe=T.Fragment,Ct=T.FunctionComponent,Lt=T.HostRoot,sr=T.HostHoistable,Xe=T.HostSingleton,er=T.HostPortal,pr=T.HostComponent,zt=T.HostText,Dr=T.IncompleteClassComponent,Er=T.IndeterminateComponent,gn=T.LegacyHiddenComponent,kt=T.MemoComponent,Cn=T.OffscreenComponent,Zr=T.SimpleMemoComponent,Wr=T.SuspenseComponent,St=T.SuspenseListComponent,mr=T.TracingMarkerComponent,Bn=v.ImmediatePriority,Xn=v.UserBlockingPriority,Ke=v.NormalPriority,ut=v.LowPriority,It=v.IdlePriority,Nr=v.NoPriority,on=g.getLaneLabelMap,Kr=g.injectProfilingHooks,sn=g.overrideHookState,Sn=g.overrideHookStateDeletePath,js=g.overrideHookStateRenamePath,ri=g.overrideProps,ms=g.overridePropsDeletePath,Is=g.overridePropsRenamePath,Vi=g.scheduleRefresh,qi=g.setErrorHandler,GA=g.setSuspenseHandler,hs=g.scheduleUpdate,Nc=typeof qi=="function"&&typeof hs=="function",Tc=typeof GA=="function"&&typeof hs=="function";typeof Vi=="function"&&(g.scheduleRefresh=function(){try{A.emit("fastRefreshScheduled")}finally{return Vi.apply(void 0,arguments)}});var qe=null,dt=null;if(typeof Kr=="function"){var Gt=On({getDisplayNameForFiber:S,getIsProfiling:function(){return Di},getLaneLabelMap:on,currentDispatcherRef:g.currentDispatcherRef,workTagMap:T,reactVersion:d});Kr(Gt.profilingHooks),qe=Gt.getTimelineData,dt=Gt.toggleProfilingStatus}var $t=new Set,en=new Map,Tr=new Map,Mn=new Map,ao=new Map;function _n(){var w=Ps(Mn.keys()),b;try{for(w.s();!(b=w.n()).done;){var L=b.value,M=Fr.get(L);M!=null&&($t.add(M),Ce(L))}}catch(Dt){w.e(Dt)}finally{w.f()}var ee=Ps(ao.keys()),me;try{for(ee.s();!(me=ee.n()).done;){var ke=me.value,ht=Fr.get(ke);ht!=null&&($t.add(ht),Ce(ke))}}catch(Dt){ee.e(Dt)}finally{ee.f()}Mn.clear(),ao.clear(),ka()}function ni(w,b,L){var M=Fr.get(w);M!=null&&(en.delete(M),L.has(w)?(L.delete(w),$t.add(M),ka(),Ce(w)):$t.delete(M))}function Ys(w){ni(w,en,Mn)}function HA(w){ni(w,Tr,ao)}function Ce(w){Co!==null&&Co.id===w&&(Uc=!0)}function De(w,b,L){if(b==="error"){var M=Ci(w);if(M!=null&&$i.get(M)===!0)return}var ee=fs.apply(void 0,_l(L));G&&Qe("onErrorOrWarning",w,null,"".concat(b,': "').concat(ee,'"')),$t.add(w);var me=b==="error"?en:Tr,ke=me.get(w);if(ke!=null){var ht=ke.get(ee)||0;ke.set(ee,ht+1)}else me.set(w,new Map([[ee,1]]));R0()}hn(g,De),Tl();var Qe=function(b,L,M){var ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";if(G){var me=L.tag+":"+(S(L)||"null"),ke=Ci(L)||"",ht=M?M.tag+":"+(S(M)||"null"):"",Dt=M?Ci(M)||"":"";console.groupCollapsed("[renderer] %c".concat(b," %c").concat(me," (").concat(ke,") %c").concat(M?"".concat(ht," (").concat(Dt,")"):""," %c").concat(ee),"color: red; font-weight: bold;","color: blue;","color: purple;","color: black;"),console.log(new Error().stack.split(` `).slice(1).join(` -`)),console.groupEnd()}},Oe=new Set,At=new Set,Mt=new Set,Ht=!1,lr=new Set;function Dn(v){Mt.clear(),Oe.clear(),At.clear(),v.forEach(function(F){if(F.isEnabled)switch(F.type){case Cp:F.isValid&&F.value!==""&&Oe.add(new RegExp(F.value,"i"));break;case Yo:Mt.add(F.value);break;case Bp:F.isValid&&F.value!==""&&At.add(new RegExp(F.value,"i"));break;case Vo:Oe.add(new RegExp("\\("));break;default:console.warn('Invalid component filter type "'.concat(F.type,'"'));break}})}window.__REACT_DEVTOOLS_COMPONENT_FILTERS__!=null?Dn(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__):Dn(cl());function Zn(v){if(Di)throw Error("Cannot modify filter preferences while profiling");A.getFiberRoots(f).forEach(function(F){yn=Cs(F.current),Ir(ge),xa(F),yn=-1}),Dn(v),Zl.clear(),A.getFiberRoots(f).forEach(function(F){yn=Cs(F.current),xg(yn,F.current),zi(F.current,null,!1,!1),xa(F),yn=-1}),w0(),xa()}function mi(v){var F=v._debugSource,L=v.tag,M=v.type,ee=v.key;switch(L){case Ue:return!0;case er:case zt:case gn:case Cn:return!0;case Lt:return!1;case Ge:return ee===null;default:var Ee=x(M);switch(Ee){case Ts:case Os:case da:case hl:case Cl:return!0;default:break}}var Ne=_n(v);if(Mt.has(Ne))return!0;if(Oe.size>0){var ht=S(v);if(ht!=null){var Dt=Ps(Oe),Et;try{for(Dt.s();!(Et=Dt.n()).done;){var yt=Et.value;if(yt.test(ht))return!0}}catch(xo){Dt.e(xo)}finally{Dt.f()}}}if(F!=null&&At.size>0){var Kt=F.fileName,Rn=Ps(At),Pr;try{for(Rn.s();!(Pr=Rn.n()).done;){var lo=Pr.value;if(lo.test(Kt))return!0}}catch(xo){Rn.e(xo)}finally{Rn.f()}}return!1}function _n(v){var F=v.type,L=v.tag;switch(L){case j:case Dr:return Tt;case Ct:case Er:return jo;case st:return bs;case Lt:return il;case pr:case sr:case Xe:return na;case er:case zt:case Ge:return fr;case kt:case Zr:return yA;case Wr:return Wu;case St:return hp;case mr:return sl;default:var M=x(F);switch(M){case Ts:case Os:case da:return fr;case kA:case NA:return ol;case Xu:case In:return ol;case hl:case Cl:return fr;case xA:case rc:return Hu;default:return fr}}}var Ii=new Map,Fa=new Map,yn=-1;function Cs(v){var F=null;if(qn.has(v))F=qn.get(v);else{var L=v.alternate;L!==null&&qn.has(L)&&(F=qn.get(L))}var M=!1;F===null&&(M=!0,F=oo());var ee=F;qn.has(v)||(qn.set(v,ee),br.set(ee,v));var Ee=v.alternate;return Ee!==null&&(qn.has(Ee)||qn.set(Ee,ee)),G&&M&&we("getOrGenerateFiberID()",v,v.return,"Generated a new UID"),ee}function hi(v){var F=Ci(v);if(F!==null)return F;throw Error('Could not find ID for Fiber "'.concat(S(v)||"",'"'))}function Ci(v){if(qn.has(v))return qn.get(v);var F=v.alternate;return F!==null&&qn.has(F)?qn.get(F):null}function h0(v){G&&we("untrackFiberID()",v,v.return,"schedule after delay"),Tc.add(v);var F=v.alternate;F!==null&&Tc.add(F),Oc===null&&(Oc=setTimeout(UI,1e3))}var Tc=new Set,Oc=null;function UI(){Oc!==null&&(clearTimeout(Oc),Oc=null),Tc.forEach(function(v){var F=Ci(v);F!==null&&(br.delete(F),Ys(F),HA(F)),qn.delete(v);var L=v.alternate;L!==null&&qn.delete(L),$i.has(F)&&($i.delete(F),$i.size===0&&qi!=null&&qi(sh))}),Tc.clear()}function C0(v,F){switch(_n(F)){case Tt:case jo:case yA:case bs:if(v===null)return{context:null,didHooksChange:!1,isFirstMount:!0,props:null,state:null};var L={context:B0(F),didHooksChange:!1,isFirstMount:!1,props:zp(v.memoizedProps,F.memoizedProps),state:zp(v.memoizedState,F.memoizedState)},M=Q0(v.memoizedState,F.memoizedState);return L.hooks=M,L.didHooksChange=M!==null&&M.length>0,L;default:return null}}function GI(v){switch(_n(v)){case Tt:case bs:case jo:case yA:if($l!==null){var F=hi(v),L=HI(v);L!==null&&$l.set(F,L)}break;default:break}}var Yl={};function HI(v){var F=Yl,L=Yl;switch(_n(v)){case Tt:var M=v.stateNode;return M!=null&&(M.constructor&&M.constructor.contextType!=null?L=M.context:(F=M.context,F&&Object.keys(F).length===0&&(F=Yl))),[F,L];case bs:case jo:case yA:var ee=v.dependencies;return ee&&ee.firstContext&&(L=ee.firstContext),[F,L];default:return null}}function WI(v){var F=Ci(v);if(F!==null){GI(v);for(var L=v.child;L!==null;)WI(L),L=L.sibling}}function B0(v){if($l!==null){var F=hi(v),L=$l.has(F)?$l.get(F):null,M=HI(v);if(L==null||M==null)return null;var ee=sg(L,2),Ee=ee[0],Ne=ee[1],ht=sg(M,2),Dt=ht[0],Et=ht[1];switch(_n(v)){case Tt:if(L&&M){if(Dt!==Yl)return zp(Ee,Dt);if(Et!==Yl)return Ne!==Et}break;case bs:case jo:case yA:if(Et!==Yl){for(var yt=Ne,Kt=Et;yt&&Kt;){if(!Vf(yt.memoizedValue,Kt.memoizedValue))return!0;yt=yt.next,Kt=Kt.next}return!1}break;default:break}}return null}function D0(v){var F=v.queue;if(!F)return!1;var L=Bl.bind(F);return L("pending")?!0:L("value")&&L("getSnapshot")&&typeof F.getSnapshot=="function"}function y0(v,F){var L=v.memoizedState,M=F.memoizedState;return D0(v)?L!==M:!1}function Q0(v,F){if(v==null||F==null)return null;var L=[],M=0;if(F.hasOwnProperty("baseState")&&F.hasOwnProperty("memoizedState")&&F.hasOwnProperty("next")&&F.hasOwnProperty("queue"))for(;F!==null;)y0(v,F)&&L.push(M),F=F.next,v=v.next,M++;return L}function zp(v,F){if(v==null||F==null||F.hasOwnProperty("baseState")&&F.hasOwnProperty("memoizedState")&&F.hasOwnProperty("next")&&F.hasOwnProperty("queue"))return null;var L=new Set([].concat(Sl(Object.keys(v)),Sl(Object.keys(F)))),M=[],ee=Ps(L),Ee;try{for(ee.s();!(Ee=ee.n()).done;){var Ne=Ee.value;v[Ne]!==F[Ne]&&M.push(Ne)}}catch(ht){ee.e(ht)}finally{ee.f()}return M}function $p(v,F){switch(F.tag){case j:case Ct:case le:case kt:case Zr:case st:var L=1;return(Qc(F)&L)===L;default:return v.memoizedProps!==F.memoizedProps||v.memoizedState!==F.memoizedState||v.ref!==F.ref}}var Bi=[],Vl=[],ba=[],wg=[],Lc=new Map,Sg=0,ql=null;function Ir(v){Bi.push(v)}function _g(){return Di&&Bs!=null&&Bs.durations.length>0?!1:Bi.length===0&&Vl.length===0&&ba.length===0&&ql===null}function KI(v){_g()||(wg!==null?wg.push(v):A.emit("operations",v))}var Mc=null;function JI(){Mc!==null&&(clearTimeout(Mc),Mc=null)}function v0(){JI(),Mc=setTimeout(function(){if(Mc=null,!(Bi.length>0)&&(Xp(),!_g())){var v=new Array(3+Bi.length);v[0]=f,v[1]=yn,v[2]=0;for(var F=0;F0?2+F:0)+Bi.length),M=0;if(L[M++]=f,L[M++]=yn,L[M++]=Sg,Lc.forEach(function(ht,Dt){var Et=ht.encodedString,yt=Et.length;L[M++]=yt;for(var Kt=0;Kt0){L[M++]=$,L[M++]=F;for(var ee=Vl.length-1;ee>=0;ee--)L[M++]=Vl[ee];for(var Ee=0;Ee0?v.forEach(function(F){A.emit("operations",F)}):(WA!==null&&(KA=!0),A.getFiberRoots(f).forEach(function(F){yn=Cs(F.current),xg(yn,F.current),Di&&tE(F)&&(Bs={changeDescriptions:Hc?new Map:null,durations:[],commitTime:_l()-oE,maxActualDuration:0,priorityLevel:null,updaters:$I(F),effectDuration:null,passiveEffectDuration:null}),zi(F.current,null,!1,!1),xa(F),yn=-1}))}function $I(v){return v.memoizedUpdaters!=null?Array.from(v.memoizedUpdaters).filter(function(F){return Ci(F)!==null}).map(Rg):null}function b0(v){Tc.has(v)||Zp(v,!1)}function x0(v){if(Di&&tE(v)&&Bs!==null){var F=zu(v),L=F.effectDuration,M=F.passiveEffectDuration;Bs.effectDuration=L,Bs.passiveEffectDuration=M}}function k0(v,F){var L=v.current,M=L.alternate;UI(),yn=Cs(L),WA!==null&&(KA=!0),Ht&&lr.clear();var ee=tE(v);if(Di&&ee&&(Bs={changeDescriptions:Hc?new Map:null,durations:[],commitTime:_l()-oE,maxActualDuration:0,priorityLevel:F==null?null:lv(F),updaters:$I(v),effectDuration:null,passiveEffectDuration:null}),M){var Ee=M.memoizedState!=null&&M.memoizedState.element!=null&&M.memoizedState.isDehydrated!==!0,Ne=L.memoizedState!=null&&L.memoizedState.element!=null&&L.memoizedState.isDehydrated!==!0;!Ee&&Ne?(xg(yn,L),zi(L,null,!1,!1)):Ee&&Ne?eE(L,M,null,!1):Ee&&!Ne&&(sv(yn),Zp(L,!1))}else xg(yn,L),zi(L,null,!1,!1);if(Di&&ee&&!_g()){var ht=Wc.get(yn);ht!=null?ht.push(Bs):Wc.set(yn,[Bs])}xa(v),Ht&&A.emit("traceUpdates",lr),yn=-1}function XI(v){var F=[],L=Vs(v);if(!L)return F;for(var M=L;;){if(M.tag===pr||M.tag===zt)F.push(M);else if(M.child){M.child.return=M,M=M.child;continue}if(M===L)return F;for(;!M.sibling;){if(!M.return||M.return===L)return F;M=M.return}M.sibling.return=M.return,M=M.sibling}return F}function ZI(v){try{var F=Vs(v);if(F===null)return null;var L=XI(v);return L.map(function(M){return M.stateNode}).filter(Boolean)}catch{return null}}function N0(v){var F=br.get(v);return F!=null?S(F):null}function T0(v){return g.findFiberByHostInstance(v)}function O0(v){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=g.findFiberByHostInstance(v);if(L!=null){if(F)for(;L!==null&&mi(L);)L=L.return;return hi(L)}return null}function eh(v){if(th(v)!==v)throw new Error("Unable to find node on an unmounted component.")}function th(v){var F=v,L=v;if(v.alternate)for(;F.return;)F=F.return;else{var M=F;do{F=M;var ee=2,Ee=4096;(F.flags&(ee|Ee))!==0&&(L=F.return),M=F.return}while(M)}return F.tag===Lt?L:null}function Vs(v){var F=br.get(v);if(F==null)return console.warn('Could not find Fiber with id "'.concat(v,'"')),null;var L=F.alternate;if(!L){var M=th(F);if(M===null)throw new Error("Unable to find node on an unmounted component.");return M!==F?null:F}for(var ee=F,Ee=L;;){var Ne=ee.return;if(Ne===null)break;var ht=Ne.alternate;if(ht===null){var Dt=Ne.return;if(Dt!==null){ee=Ee=Dt;continue}break}if(Ne.child===ht.child){for(var Et=Ne.child;Et;){if(Et===ee)return eh(Ne),F;if(Et===Ee)return eh(Ne),L;Et=Et.sibling}throw new Error("Unable to find node on an unmounted component.")}if(ee.return!==Ee.return)ee=Ne,Ee=ht;else{for(var yt=!1,Kt=Ne.child;Kt;){if(Kt===ee){yt=!0,ee=Ne,Ee=ht;break}if(Kt===Ee){yt=!0,Ee=Ne,ee=ht;break}Kt=Kt.sibling}if(!yt){for(Kt=ht.child;Kt;){if(Kt===ee){yt=!0,ee=ht,Ee=Ne;break}if(Kt===Ee){yt=!0,Ee=ht,ee=Ne;break}Kt=Kt.sibling}if(!yt)throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(ee.alternate!==Ee)throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(ee.tag!==Lt)throw new Error("Unable to find node on an unmounted component.");return ee.stateNode.current===ee?F:L}function L0(v,F){Uc(v)&&(window.$attribute=$o(Co,F))}function M0(v){var F=br.get(v);if(F==null){console.warn('Could not find Fiber with id "'.concat(v,'"'));return}var L=F.elementType,M=F.tag,ee=F.type;switch(M){case j:case Dr:case Er:case Ct:m.$type=ee;break;case st:m.$type=ee.render;break;case kt:case Zr:m.$type=L!=null&&L.type!=null?L.type:ee;break;default:m.$type=null;break}}function Rg(v){return{displayName:S(v)||"Anonymous",id:hi(v),key:v.key,type:_n(v)}}function P0(v){var F=Vs(v);if(F==null)return null;var L=F._debugOwner,M=[Rg(F)];if(L)for(var ee=L;ee!==null;)M.unshift(Rg(ee)),ee=ee._debugOwner||null;return M}function U0(v){var F=null,L=null,M=Vs(v);return M!==null&&(F=M.stateNode,M.memoizedProps!==null&&(L=M.memoizedProps.style)),{instance:F,style:L}}function rh(v){var F=v.tag,L=v.type;switch(F){case j:case Dr:var M=v.stateNode;return typeof L.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function";default:return!1}}function nh(v){for(var F=v.return;F!==null;){if(rh(F))return Ci(F);F=F.return}return null}function oh(v){var F=Vs(v);if(F==null)return null;var L=F._debugOwner,M=F._debugSource,ee=F.stateNode,Ee=F.key,Ne=F.memoizedProps,ht=F.memoizedState,Dt=F.dependencies,Et=F.tag,yt=F.type,Kt=_n(F),Rn=(Et===Ct||Et===Zr||Et===st)&&(!!ht||!!Dt),Pr=!Rn&&Et!==Y,lo=x(yt),xo=!1,Bo=null;if(Et===j||Et===Ct||Et===Dr||Et===Er||Et===kt||Et===st||Et===Zr){if(xo=!0,ee&&ee.context!=null){var eu=Kt===Tt&&!(yt.contextTypes||yt.contextType);eu||(Bo=ee.context)}}else if(lo===Xu||lo===In){var yi=yt._context||yt;Bo=yi._currentValue||null;for(var oi=F.return;oi!==null;){var JA=oi.type,tu=x(JA);if(tu===kA||tu===NA){var Jc=JA._context||JA.context;if(Jc===yi){Bo=oi.memoizedProps.value;break}}oi=oi.return}}var zs=!1;Bo!==null&&(zs=!!yt.contextTypes,Bo={value:Bo});var $s=null;if(L){$s=[];for(var Qi=L;Qi!==null;)$s.push(Rg(Qi)),Qi=Qi._debugOwner||null}var kg=Et===Wr&&ht!==null,lh=null;if(Rn){var sE={};for(var AE in console)try{sE[AE]=console[AE],console[AE]=function(){}}catch{}try{lh=(0,ml.inspectHooksOfFiber)(F,g.currentDispatcherRef,!0)}finally{for(var uh in sE)try{console[uh]=sE[uh]}catch{}}}for(var ch=null,Ng=F;Ng.return!==null;)Ng=Ng.return;var aE=Ng.stateNode;aE!=null&&aE._debugRootType!==null&&(ch=aE._debugRootType);var fv=Mn.get(v)||new Map,gv=ao.get(v)||new Map,lE=!1,Tg;if(rh(F)){var dv=128;lE=(F.flags&dv)!==0||$i.get(v)===!0,Tg=lE?v:nh(F)}else Tg=nh(F);var fh={stylex:null};return jf&&Ne!=null&&Ne.hasOwnProperty("xstyle")&&(fh.stylex=Tp(Ne.xstyle)),{id:v,canEditHooks:typeof sn=="function",canEditFunctionProps:typeof ri=="function",canEditHooksAndDeletePaths:typeof wn=="function",canEditHooksAndRenamePaths:typeof js=="function",canEditFunctionPropsDeletePaths:typeof ms=="function",canEditFunctionPropsRenamePaths:typeof Is=="function",canToggleError:kc&&Tg!=null,isErrored:lE,targetErrorBoundaryID:Tg,canToggleSuspense:Nc&&(!kg||Xl.has(v)),canViewSource:xo,hasLegacyContext:zs,key:Ee??null,displayName:S(F),type:Kt,context:Bo,hooks:lh,props:Ne,state:Pr?ht:null,errors:Array.from(fv.entries()),warnings:Array.from(gv.entries()),owners:$s,source:M||null,rootType:ch,rendererPackageName:g.rendererPackageName,rendererVersion:g.version,plugins:fh}}var Co=null,Pc=!1,Fg={};function Uc(v){return Co!==null&&Co.id===v}function G0(v){return Uc(v)&&!Pc}function H0(v){var F=Fg;v.forEach(function(L){F[L]||(F[L]={}),F=F[L]})}function Gc(v,F){return function(M){switch(F){case"hooks":if(M.length===1||M[M.length-2]==="hookSource"&&M[M.length-1]==="fileName"||M[M.length-1]==="subHooks"||M[M.length-2]==="subHooks")return!0;break;default:break}var ee=v===null?Fg:Fg[v];if(!ee)return!1;for(var Ee=0;Ee0){var ht=S(w);if(ht!=null){var Dt=Ps(Te),Et;try{for(Dt.s();!(Et=Dt.n()).done;){var yt=Et.value;if(yt.test(ht))return!0}}catch(xo){Dt.e(xo)}finally{Dt.f()}}}if(b!=null&&At.size>0){var Kt=b.fileName,bn=Ps(At),Pr;try{for(bn.s();!(Pr=bn.n()).done;){var lo=Pr.value;if(lo.test(Kt))return!0}}catch(xo){bn.e(xo)}finally{bn.f()}}return!1}function Rn(w){var b=w.type,L=w.tag;switch(L){case j:case Dr:return Tt;case Ct:case Er:return jo;case st:return Fs;case Lt:return sl;case pr:case sr:case Xe:return oa;case er:case zt:case Pe:return fr;case kt:case Zr:return yA;case Wr:return Ku;case St:return Bp;case mr:return Al;default:var M=x(b);switch(M){case Ts:case Os:case pa:return fr;case kA:case NA:return il;case Zu:case In:return il;case Cl:case Bl:return fr;case xA:case nc:return Wu;default:return fr}}}var Ii=new Map,Fa=new Map,yn=-1;function Cs(w){var b=null;if(qn.has(w))b=qn.get(w);else{var L=w.alternate;L!==null&&qn.has(L)&&(b=qn.get(L))}var M=!1;b===null&&(M=!0,b=oo());var ee=b;qn.has(w)||(qn.set(w,ee),Fr.set(ee,w));var me=w.alternate;return me!==null&&(qn.has(me)||qn.set(me,ee)),G&&M&&Qe("getOrGenerateFiberID()",w,w.return,"Generated a new UID"),ee}function hi(w){var b=Ci(w);if(b!==null)return b;throw Error('Could not find ID for Fiber "'.concat(S(w)||"",'"'))}function Ci(w){if(qn.has(w))return qn.get(w);var b=w.alternate;return b!==null&&qn.has(b)?qn.get(b):null}function y0(w){G&&Qe("untrackFiberID()",w,w.return,"schedule after delay"),Oc.add(w);var b=w.alternate;b!==null&&Oc.add(b),Lc===null&&(Lc=setTimeout(KI,1e3))}var Oc=new Set,Lc=null;function KI(){Lc!==null&&(clearTimeout(Lc),Lc=null),Oc.forEach(function(w){var b=Ci(w);b!==null&&(Fr.delete(b),Ys(b),HA(b)),qn.delete(w);var L=w.alternate;L!==null&&qn.delete(L),$i.has(b)&&($i.delete(b),$i.size===0&&qi!=null&&qi(uh))}),Oc.clear()}function Q0(w,b){switch(Rn(b)){case Tt:case jo:case yA:case Fs:if(w===null)return{context:null,didHooksChange:!1,isFirstMount:!0,props:null,state:null};var L={context:w0(b),didHooksChange:!1,isFirstMount:!1,props:Xp(w.memoizedProps,b.memoizedProps),state:Xp(w.memoizedState,b.memoizedState)},M=_0(w.memoizedState,b.memoizedState);return L.hooks=M,L.didHooksChange=M!==null&&M.length>0,L;default:return null}}function JI(w){switch(Rn(w)){case Tt:case Fs:case jo:case yA:if(Xl!==null){var b=hi(w),L=jI(w);L!==null&&Xl.set(b,L)}break;default:break}}var Vl={};function jI(w){var b=Vl,L=Vl;switch(Rn(w)){case Tt:var M=w.stateNode;return M!=null&&(M.constructor&&M.constructor.contextType!=null?L=M.context:(b=M.context,b&&Object.keys(b).length===0&&(b=Vl))),[b,L];case Fs:case jo:case yA:var ee=w.dependencies;return ee&&ee.firstContext&&(L=ee.firstContext),[b,L];default:return null}}function YI(w){var b=Ci(w);if(b!==null){JI(w);for(var L=w.child;L!==null;)YI(L),L=L.sibling}}function w0(w){if(Xl!==null){var b=hi(w),L=Xl.has(b)?Xl.get(b):null,M=jI(w);if(L==null||M==null)return null;var ee=ag(L,2),me=ee[0],ke=ee[1],ht=ag(M,2),Dt=ht[0],Et=ht[1];switch(Rn(w)){case Tt:if(L&&M){if(Dt!==Vl)return Xp(me,Dt);if(Et!==Vl)return ke!==Et}break;case Fs:case jo:case yA:if(Et!==Vl){for(var yt=ke,Kt=Et;yt&&Kt;){if(!zf(yt.memoizedValue,Kt.memoizedValue))return!0;yt=yt.next,Kt=Kt.next}return!1}break;default:break}}return null}function v0(w){var b=w.queue;if(!b)return!1;var L=Dl.bind(b);return L("pending")?!0:L("value")&&L("getSnapshot")&&typeof b.getSnapshot=="function"}function S0(w,b){var L=w.memoizedState,M=b.memoizedState;return v0(w)?L!==M:!1}function _0(w,b){if(w==null||b==null)return null;var L=[],M=0;if(b.hasOwnProperty("baseState")&&b.hasOwnProperty("memoizedState")&&b.hasOwnProperty("next")&&b.hasOwnProperty("queue"))for(;b!==null;)S0(w,b)&&L.push(M),b=b.next,w=w.next,M++;return L}function Xp(w,b){if(w==null||b==null||b.hasOwnProperty("baseState")&&b.hasOwnProperty("memoizedState")&&b.hasOwnProperty("next")&&b.hasOwnProperty("queue"))return null;var L=new Set([].concat(_l(Object.keys(w)),_l(Object.keys(b)))),M=[],ee=Ps(L),me;try{for(ee.s();!(me=ee.n()).done;){var ke=me.value;w[ke]!==b[ke]&&M.push(ke)}}catch(ht){ee.e(ht)}finally{ee.f()}return M}function Zp(w,b){switch(b.tag){case j:case Ct:case ue:case kt:case Zr:case st:var L=1;return(wc(b)&L)===L;default:return w.memoizedProps!==b.memoizedProps||w.memoizedState!==b.memoizedState||w.ref!==b.ref}}var Bi=[],ql=[],xa=[],_g=[],Mc=new Map,Rg=0,zl=null;function Ir(w){Bi.push(w)}function bg(){return Di&&Bs!=null&&Bs.durations.length>0?!1:Bi.length===0&&ql.length===0&&xa.length===0&&zl===null}function VI(w){bg()||(_g!==null?_g.push(w):A.emit("operations",w))}var Pc=null;function qI(){Pc!==null&&(clearTimeout(Pc),Pc=null)}function R0(){qI(),Pc=setTimeout(function(){if(Pc=null,!(Bi.length>0)&&(eE(),!bg())){var w=new Array(3+Bi.length);w[0]=f,w[1]=yn,w[2]=0;for(var b=0;b0?2+b:0)+Bi.length),M=0;if(L[M++]=f,L[M++]=yn,L[M++]=Rg,Mc.forEach(function(ht,Dt){var Et=ht.encodedString,yt=Et.length;L[M++]=yt;for(var Kt=0;Kt0){L[M++]=$,L[M++]=b;for(var ee=ql.length-1;ee>=0;ee--)L[M++]=ql[ee];for(var me=0;me0?w.forEach(function(b){A.emit("operations",b)}):(WA!==null&&(KA=!0),A.getFiberRoots(f).forEach(function(b){yn=Cs(b.current),Ng(yn,b.current),Di&&nE(b)&&(Bs={changeDescriptions:Wc?new Map:null,durations:[],commitTime:Rl()-sE,maxActualDuration:0,priorityLevel:null,updaters:th(b),effectDuration:null,passiveEffectDuration:null}),zi(b.current,null,!1,!1),ka(b),yn=-1}))}function th(w){return w.memoizedUpdaters!=null?Array.from(w.memoizedUpdaters).filter(function(b){return Ci(b)!==null}).map(Fg):null}function T0(w){Oc.has(w)||tE(w,!1)}function O0(w){if(Di&&nE(w)&&Bs!==null){var b=$u(w),L=b.effectDuration,M=b.passiveEffectDuration;Bs.effectDuration=L,Bs.passiveEffectDuration=M}}function L0(w,b){var L=w.current,M=L.alternate;KI(),yn=Cs(L),WA!==null&&(KA=!0),Ht&&lr.clear();var ee=nE(w);if(Di&&ee&&(Bs={changeDescriptions:Wc?new Map:null,durations:[],commitTime:Rl()-sE,maxActualDuration:0,priorityLevel:b==null?null:gw(b),updaters:th(w),effectDuration:null,passiveEffectDuration:null}),M){var me=M.memoizedState!=null&&M.memoizedState.element!=null&&M.memoizedState.isDehydrated!==!0,ke=L.memoizedState!=null&&L.memoizedState.element!=null&&L.memoizedState.isDehydrated!==!0;!me&&ke?(Ng(yn,L),zi(L,null,!1,!1)):me&&ke?rE(L,M,null,!1):me&&!ke&&(uw(yn),tE(L,!1))}else Ng(yn,L),zi(L,null,!1,!1);if(Di&&ee&&!bg()){var ht=Kc.get(yn);ht!=null?ht.push(Bs):Kc.set(yn,[Bs])}ka(w),Ht&&A.emit("traceUpdates",lr),yn=-1}function rh(w){var b=[],L=Vs(w);if(!L)return b;for(var M=L;;){if(M.tag===pr||M.tag===zt)b.push(M);else if(M.child){M.child.return=M,M=M.child;continue}if(M===L)return b;for(;!M.sibling;){if(!M.return||M.return===L)return b;M=M.return}M.sibling.return=M.return,M=M.sibling}return b}function nh(w){try{var b=Vs(w);if(b===null)return null;var L=rh(w);return L.map(function(M){return M.stateNode}).filter(Boolean)}catch{return null}}function M0(w){var b=Fr.get(w);return b!=null?S(b):null}function P0(w){return g.findFiberByHostInstance(w)}function U0(w){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=g.findFiberByHostInstance(w);if(L!=null){if(b)for(;L!==null&&mi(L);)L=L.return;return hi(L)}return null}function oh(w){if(ih(w)!==w)throw new Error("Unable to find node on an unmounted component.")}function ih(w){var b=w,L=w;if(w.alternate)for(;b.return;)b=b.return;else{var M=b;do{b=M;var ee=2,me=4096;(b.flags&(ee|me))!==0&&(L=b.return),M=b.return}while(M)}return b.tag===Lt?L:null}function Vs(w){var b=Fr.get(w);if(b==null)return console.warn('Could not find Fiber with id "'.concat(w,'"')),null;var L=b.alternate;if(!L){var M=ih(b);if(M===null)throw new Error("Unable to find node on an unmounted component.");return M!==b?null:b}for(var ee=b,me=L;;){var ke=ee.return;if(ke===null)break;var ht=ke.alternate;if(ht===null){var Dt=ke.return;if(Dt!==null){ee=me=Dt;continue}break}if(ke.child===ht.child){for(var Et=ke.child;Et;){if(Et===ee)return oh(ke),b;if(Et===me)return oh(ke),L;Et=Et.sibling}throw new Error("Unable to find node on an unmounted component.")}if(ee.return!==me.return)ee=ke,me=ht;else{for(var yt=!1,Kt=ke.child;Kt;){if(Kt===ee){yt=!0,ee=ke,me=ht;break}if(Kt===me){yt=!0,me=ke,ee=ht;break}Kt=Kt.sibling}if(!yt){for(Kt=ht.child;Kt;){if(Kt===ee){yt=!0,ee=ht,me=ke;break}if(Kt===me){yt=!0,me=ht,ee=ke;break}Kt=Kt.sibling}if(!yt)throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(ee.alternate!==me)throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(ee.tag!==Lt)throw new Error("Unable to find node on an unmounted component.");return ee.stateNode.current===ee?b:L}function G0(w,b){Gc(w)&&(window.$attribute=$o(Co,b))}function H0(w){var b=Fr.get(w);if(b==null){console.warn('Could not find Fiber with id "'.concat(w,'"'));return}var L=b.elementType,M=b.tag,ee=b.type;switch(M){case j:case Dr:case Er:case Ct:m.$type=ee;break;case st:m.$type=ee.render;break;case kt:case Zr:m.$type=L!=null&&L.type!=null?L.type:ee;break;default:m.$type=null;break}}function Fg(w){return{displayName:S(w)||"Anonymous",id:hi(w),key:w.key,type:Rn(w)}}function W0(w){var b=Vs(w);if(b==null)return null;var L=b._debugOwner,M=[Fg(b)];if(L)for(var ee=L;ee!==null;)M.unshift(Fg(ee)),ee=ee._debugOwner||null;return M}function K0(w){var b=null,L=null,M=Vs(w);return M!==null&&(b=M.stateNode,M.memoizedProps!==null&&(L=M.memoizedProps.style)),{instance:b,style:L}}function sh(w){var b=w.tag,L=w.type;switch(b){case j:case Dr:var M=w.stateNode;return typeof L.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function";default:return!1}}function Ah(w){for(var b=w.return;b!==null;){if(sh(b))return Ci(b);b=b.return}return null}function ah(w){var b=Vs(w);if(b==null)return null;var L=b._debugOwner,M=b._debugSource,ee=b.stateNode,me=b.key,ke=b.memoizedProps,ht=b.memoizedState,Dt=b.dependencies,Et=b.tag,yt=b.type,Kt=Rn(b),bn=(Et===Ct||Et===Zr||Et===st)&&(!!ht||!!Dt),Pr=!bn&&Et!==Y,lo=x(yt),xo=!1,Bo=null;if(Et===j||Et===Ct||Et===Dr||Et===Er||Et===kt||Et===st||Et===Zr){if(xo=!0,ee&&ee.context!=null){var tu=Kt===Tt&&!(yt.contextTypes||yt.contextType);tu||(Bo=ee.context)}}else if(lo===Zu||lo===In){var yi=yt._context||yt;Bo=yi._currentValue||null;for(var oi=b.return;oi!==null;){var JA=oi.type,ru=x(JA);if(ru===kA||ru===NA){var jc=JA._context||JA.context;if(jc===yi){Bo=oi.memoizedProps.value;break}}oi=oi.return}}var zs=!1;Bo!==null&&(zs=!!yt.contextTypes,Bo={value:Bo});var $s=null;if(L){$s=[];for(var Qi=L;Qi!==null;)$s.push(Fg(Qi)),Qi=Qi._debugOwner||null}var Tg=Et===Wr&&ht!==null,gh=null;if(bn){var aE={};for(var lE in console)try{aE[lE]=console[lE],console[lE]=function(){}}catch{}try{gh=(0,Il.inspectHooksOfFiber)(b,g.currentDispatcherRef,!0)}finally{for(var dh in aE)try{console[dh]=aE[dh]}catch{}}}for(var ph=null,Og=b;Og.return!==null;)Og=Og.return;var uE=Og.stateNode;uE!=null&&uE._debugRootType!==null&&(ph=uE._debugRootType);var Ew=Mn.get(w)||new Map,mw=ao.get(w)||new Map,cE=!1,Lg;if(sh(b)){var Iw=128;cE=(b.flags&Iw)!==0||$i.get(w)===!0,Lg=cE?w:Ah(b)}else Lg=Ah(b);var Eh={stylex:null};return Vf&&ke!=null&&ke.hasOwnProperty("xstyle")&&(Eh.stylex=Lp(ke.xstyle)),{id:w,canEditHooks:typeof sn=="function",canEditFunctionProps:typeof ri=="function",canEditHooksAndDeletePaths:typeof Sn=="function",canEditHooksAndRenamePaths:typeof js=="function",canEditFunctionPropsDeletePaths:typeof ms=="function",canEditFunctionPropsRenamePaths:typeof Is=="function",canToggleError:Nc&&Lg!=null,isErrored:cE,targetErrorBoundaryID:Lg,canToggleSuspense:Tc&&(!Tg||Zl.has(w)),canViewSource:xo,hasLegacyContext:zs,key:me??null,displayName:S(b),type:Kt,context:Bo,hooks:gh,props:ke,state:Pr?ht:null,errors:Array.from(Ew.entries()),warnings:Array.from(mw.entries()),owners:$s,source:M||null,rootType:ph,rendererPackageName:g.rendererPackageName,rendererVersion:g.version,plugins:Eh}}var Co=null,Uc=!1,xg={};function Gc(w){return Co!==null&&Co.id===w}function J0(w){return Gc(w)&&!Uc}function j0(w){var b=xg;w.forEach(function(L){b[L]||(b[L]={}),b=b[L]})}function Hc(w,b){return function(M){switch(b){case"hooks":if(M.length===1||M[M.length-2]==="hookSource"&&M[M.length-1]==="fileName"||M[M.length-1]==="subHooks"||M[M.length-2]==="subHooks")return!0;break;default:break}var ee=w===null?xg:xg[w];if(!ee)return!1;for(var me=0;me"),"color: var(--dom-tag-name-color); font-weight: normal;"),F.props!==null&&console.log("Props:",F.props),F.state!==null&&console.log("State:",F.state),F.hooks!==null&&console.log("Hooks:",F.hooks);var M=ZI(v);M!==null&&console.log("Nodes:",M),F.source!==null&&console.log("Location:",F.source),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),L&&console.groupEnd()}function V0(v,F,L,M){var ee=Vs(F);if(ee!==null){var Ee=ee.stateNode;switch(v){case"context":switch(M=M.slice(1),ee.tag){case j:M.length===0||sa(Ee.context,M),Ee.forceUpdate();break;case Ct:break}break;case"hooks":typeof wn=="function"&&wn(ee,L,M);break;case"props":Ee===null?typeof ms=="function"&&ms(ee,M):(ee.pendingProps=Qr(Ee.props,M),Ee.forceUpdate());break;case"state":sa(Ee.state,M),Ee.forceUpdate();break}}}function q0(v,F,L,M,ee){var Ee=Vs(F);if(Ee!==null){var Ne=Ee.stateNode;switch(v){case"context":switch(M=M.slice(1),ee=ee.slice(1),Ee.tag){case j:M.length===0||Li(Ne.context,M,ee),Ne.forceUpdate();break;case Ct:break}break;case"hooks":typeof js=="function"&&js(Ee,L,M,ee);break;case"props":Ne===null?typeof Is=="function"&&Is(Ee,M,ee):(Ee.pendingProps=bA(Ne.props,M,ee),Ne.forceUpdate());break;case"state":Li(Ne.state,M,ee),Ne.forceUpdate();break}}}function z0(v,F,L,M,ee){var Ee=Vs(F);if(Ee!==null){var Ne=Ee.stateNode;switch(v){case"context":switch(M=M.slice(1),Ee.tag){case j:M.length===0?Ne.context=ee:Aa(Ne.context,M,ee),Ne.forceUpdate();break;case Ct:break}break;case"hooks":typeof sn=="function"&&sn(Ee,L,M,ee);break;case"props":Ee.tag===j?(Ee.pendingProps=fa(Ne.props,M,ee),Ne.forceUpdate()):typeof ri=="function"&&ri(Ee,M,ee);break;case"state":Ee.tag===j&&(Aa(Ne.state,M,ee),Ne.forceUpdate());break}}}var Bs=null,zl=null,$l=null,rE=null,nE=null,Di=!1,oE=0,Hc=!1,Wc=null;function $0(){var v=[];if(Wc===null)throw Error("getProfilingData() called before any profiling data was recorded");Wc.forEach(function(Dt,Et){var yt=[],Kt=[],Rn=zl!==null&&zl.get(Et)||"Unknown";rE?.forEach(function(Pr,lo){nE!=null&&nE.get(lo)===Et&&Kt.push([lo,Pr])}),Dt.forEach(function(Pr,lo){for(var xo=Pr.changeDescriptions,Bo=Pr.durations,eu=Pr.effectDuration,yi=Pr.maxActualDuration,oi=Pr.passiveEffectDuration,JA=Pr.priorityLevel,tu=Pr.commitTime,Jc=Pr.updaters,zs=[],$s=[],Qi=0;Qi1?Zl.set(L,M-1):Zl.delete(L),bg.delete(v)}function iE(v){for(var F=null,L=null,M=v.child,ee=0;ee<3&&M!==null;ee++){var Ee=S(M);if(Ee!==null&&(typeof M.type=="function"?F=Ee:L===null&&(L=Ee)),F!==null)break;M=M.child}return F||L||"Anonymous"}function ah(v){var F=v.key,L=S(v),M=v.index;switch(v.tag){case Lt:var ee=hi(v),Ee=bg.get(ee);if(Ee===void 0)throw new Error("Expected mounted root to have known pseudo key.");L=Ee;break;case pr:L=v.type;break;default:break}return{displayName:L,key:F,index:M}}function Av(v){var F=br.get(v);if(F==null)return null;for(var L=[];F!==null;)L.push(ah(F)),F=F.return;return L.reverse(),L}function av(){if(WA===null||qs===null)return null;for(var v=qs;v!==null&&mi(v);)v=v.return;return v===null?null:{id:hi(v),isFullMatch:Kc===WA.length-1}}var lv=function(F){if(F==null)return"Unknown";switch(F){case Bn:return"Immediate";case Xn:return"User-Blocking";case Je:return"Normal";case lt:return"Low";case It:return"Idle";case Nr:default:return"Unknown"}};function uv(v){Ht=v}function cv(v){return br.has(v)}return{cleanup:R0,clearErrorsAndWarnings:Sn,clearErrorsForFiberID:Ys,clearWarningsForFiberID:HA,getSerializedElementValueByPath:J0,deletePath:V0,findNativeNodesForFiberID:ZI,flushInitialOperations:F0,getBestMatchForTrackedPath:av,getDisplayNameForFiberID:N0,getFiberForNative:T0,getFiberIDForNative:O0,getInstanceAndStyle:U0,getOwnersList:P0,getPathForElement:Av,getProfilingData:$0,handleCommitFiberRoot:k0,handleCommitFiberUnmount:b0,handlePostCommitFiberRoot:x0,hasFiberWithId:cv,inspectElement:j0,logElementToConsole:Y0,patchConsoleForStrictMode:Gs,prepareViewAttributeSource:L0,prepareViewElementSource:M0,overrideError:ev,overrideSuspense:nv,overrideValueAtPath:z0,renamePath:q0,renderer:g,setTraceUpdatesEnabled:uv,setTrackedPath:Ah,startProfiling:ih,stopProfiling:X0,storeAsGlobal:K0,unpatchConsoleForStrictMode:kl,updateComponentFilters:Zn}}function lg(A){return fg(A)||cg(A)||Da(A)||ug()}function ug(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cg(A){if(typeof Symbol<"u"&&Symbol.iterator in Object(A))return Array.from(A)}function fg(A){if(Array.isArray(A))return MA(A)}function Rl(A,f){var g;if(typeof Symbol>"u"||A[Symbol.iterator]==null){if(Array.isArray(A)||(g=Da(A))||f&&A&&typeof A.length=="number"){g&&(A=g);var m=0,d=function(){};return{s:d,n:function(){return m>=A.length?{done:!0}:{done:!1,value:A[m++]}},e:function(T){throw T},f:d}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=!0,S=!1,x;return{s:function(){g=A[Symbol.iterator]()},n:function(){var T=g.next();return B=T.done,T},e:function(T){S=!0,x=T},f:function(){try{!B&&g.return!=null&&g.return()}finally{if(S)throw x}}}}function Da(A,f){if(A){if(typeof A=="string")return MA(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return MA(A,f)}}function MA(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);g=2&&Sc.test(A[0])&&A[1]==="color: ".concat(xl(f)||"")}function xl(A){switch(A){case"warn":return xr.browserTheme==="light"?"rgba(250, 180, 50, 0.75)":"rgba(250, 180, 50, 0.5)";case"error":return xr.browserTheme==="light"?"rgba(250, 123, 130, 0.75)":"rgba(250, 123, 130, 0.5)";default:return xr.browserTheme==="light"?"rgba(125, 125, 125, 0.75)":"rgba(125, 125, 125, 0.5)"}}var dg=new Map,zn=console,Qa={};for(var Hr in console)Qa[Hr]=console[Hr];var Nt=null,ln=!1;try{ln=global===void 0}catch{}function un(A){zn=A,Qa={};for(var f in zn)Qa[f]=console[f]}function hn(A,f){var g=A.currentDispatcherRef,m=A.getCurrentFiber,d=A.findFiberByHostInstance,B=A.version;if(typeof d=="function"&&g!=null&&typeof m=="function"){var S=Fo(B),x=S.ReactTypeOfWork;dg.set(A,{currentDispatcherRef:g,getCurrentFiber:m,workTagMap:x,onErrorOrWarning:f})}}var xr={appendComponentStack:!1,breakOnConsoleErrors:!1,showInlineWarningsAndErrors:!1,hideConsoleLogsInStrictMode:!1,browserTheme:"dark"};function Us(A){var f=A.appendComponentStack,g=A.breakOnConsoleErrors,m=A.showInlineWarningsAndErrors,d=A.hideConsoleLogsInStrictMode,B=A.browserTheme;if(xr.appendComponentStack=f,xr.breakOnConsoleErrors=g,xr.showInlineWarningsAndErrors=m,xr.hideConsoleLogsInStrictMode=d,xr.browserTheme=B,f||g||m){if(Nt!==null)return;var S={};Nt=function(){for(var w in S)try{zn[w]=S[w]}catch{}},Fl.forEach(function(x){try{var w=S[x]=zn[x].__REACT_DEVTOOLS_ORIGINAL_METHOD__?zn[x].__REACT_DEVTOOLS_ORIGINAL_METHOD__:zn[x],T=function(){for(var Y=!1,j=arguments.length,le=new Array(j),Ue=0;Ue0?le[le.length-1]:null,Ge=typeof st=="string"&&wc(st);Y=!Ge}var Ct=xr.showInlineWarningsAndErrors&&(x==="error"||x==="warn"),Lt=Rl(dg.values()),sr;try{for(Lt.s();!(sr=Lt.n()).done;){var Xe=sr.value,er=Xe.currentDispatcherRef,pr=Xe.getCurrentFiber,zt=Xe.onErrorOrWarning,Dr=Xe.workTagMap,Er=pr();if(Er!=null)try{if(Ct&&typeof zt=="function"&&zt(Er,x,le.slice()),Y){var gn=rg(Dr,Er,er);gn!==""&&(gg(le,x)&&(le[0]="".concat(le[0]," %s")),le.push(gn))}}catch(kt){setTimeout(function(){throw kt},0)}finally{break}}}catch(kt){Lt.e(kt)}finally{Lt.f()}if(xr.breakOnConsoleErrors)debugger;w.apply(void 0,le)};T.__REACT_DEVTOOLS_ORIGINAL_METHOD__=w,w.__REACT_DEVTOOLS_OVERRIDE_METHOD__=T,zn[x]=T}catch{}})}else cn()}function cn(){Nt!==null&&(Nt(),Nt=null)}var Ji=null;function Gs(){if(oc){var A=["error","group","groupCollapsed","info","log","trace","warn"];if(Ji!==null)return;var f={};Ji=function(){for(var m in f)try{zn[m]=f[m]}catch{}},A.forEach(function(g){try{var m=f[g]=zn[g].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__?zn[g].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__:zn[g],d=function(){if(!xr.hideConsoleLogsInStrictMode){for(var S=arguments.length,x=new Array(S),w=0;wA.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function $n(A){return $n=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},$n(A)}function fn(A,f,g){return f in A?Object.defineProperty(A,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[f]=g,A}var pg=100,Ul=[{version:0,minNpmVersion:'"<4.11.0"',maxNpmVersion:'"<4.11.0"'},{version:1,minNpmVersion:"4.13.0",maxNpmVersion:"4.21.0"},{version:2,minNpmVersion:"4.22.0",maxNpmVersion:null}],Gl=Ul[Ul.length-1],Wp=(function(A){wa(g,A);var f=Ml(g);function g(m){var d;return Ol(this,g),d=f.call(this),fn(Mr(d),"_isShutdown",!1),fn(Mr(d),"_messageQueue",[]),fn(Mr(d),"_timeoutID",null),fn(Mr(d),"_wallUnlisten",null),fn(Mr(d),"_flush",function(){if(d._timeoutID!==null&&(clearTimeout(d._timeoutID),d._timeoutID=null),d._messageQueue.length){for(var B=0;B1?B-1:0),x=1;x"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ra(A){return Ra=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},Ra(A)}function xt(A,f,g){return f in A?Object.defineProperty(A,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[f]=g,A}var ps=function(f){if(G){for(var g,m=arguments.length,d=new Array(m>1?m-1:0),B=1;BA.length)&&(f=A.length);for(var g=0,m=new Array(f);g0?"development":"production";var lt=Function.prototype.toString;if(Je.Mount&&Je.Mount._renderNewRootComponent){var It=lt.call(Je.Mount._renderNewRootComponent);return It.indexOf("function")!==0?"production":It.indexOf("storedMeasure")!==-1?"development":It.indexOf("should be a pure function")!==-1?It.indexOf("NODE_ENV")!==-1||It.indexOf("development")!==-1||It.indexOf("true")!==-1?"development":It.indexOf("nextElement")!==-1||It.indexOf("nextComponent")!==-1?"unminified":"development":It.indexOf("nextElement")!==-1||It.indexOf("nextComponent")!==-1?"unminified":"outdated"}}catch{}return"production"}function S(Je){try{var lt=Function.prototype.toString,It=lt.call(Je);It.indexOf("^_^")>-1&&(le=!0,setTimeout(function(){throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")}))}catch{}}function x(Je,lt){if(Je==null||Je.length===0||typeof Je[0]=="string"&&Je[0].match(/([^%]|^)(%c)/g)||lt===void 0)return Je;var It=/([^%]|^)((%%)*)(%([oOdisf]))/g;if(typeof Je[0]=="string"&&Je[0].match(It))return["%c".concat(Je[0]),lt].concat(Jl(Je.slice(1)));var Nr=Je.reduce(function(on,Kr,sn){switch(sn>0&&(on+=" "),Ei(Kr)){case"string":case"boolean":case"symbol":return on+="%s";case"number":var wn=Number.isInteger(Kr)?"%i":"%f";return on+=wn;default:return on+="%o"}},"%c");return[Nr,lt].concat(Jl(Je))}var w=null;function T(Je){var lt=Je.hideConsoleLogsInStrictMode,It=Je.browserTheme,Nr=["error","group","groupCollapsed","info","log","trace","warn"];if(w===null){var on={};w=function(){for(var sn in on)try{f[sn]=on[sn]}catch{}},Nr.forEach(function(Kr){try{var sn=on[Kr]=f[Kr].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__?f[Kr].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__:f[Kr],wn=function(){if(!lt){var ri;switch(Kr){case"warn":ri=It==="light"?"rgba(250, 180, 50, 0.75)":"rgba(250, 180, 50, 0.5)";break;case"error":ri=It==="light"?"rgba(250, 123, 130, 0.75)":"rgba(250, 123, 130, 0.5)";break;default:ri=It==="light"?"rgba(125, 125, 125, 0.75)":"rgba(125, 125, 125, 0.5)";break}if(ri){for(var ms=arguments.length,Is=new Array(ms),Vi=0;Vi1?lt[1]:null;return It}function gn(){return Dr}function kt(Je){var lt=Er(Je);lt!==null&&zt.push(lt)}function Cn(Je){if(zt.length>0){var lt=zt.pop(),It=Er(Je);It!==null&&Dr.push([lt,It])}}var Zr={},Wr=new Map,St={},mr=new Map,Bn=new Map,Xn={rendererInterfaces:Wr,listeners:St,backends:Bn,renderers:mr,emit:Ct,getFiberRoots:Lt,inject:j,on:st,off:Ge,sub:Ue,supportsFiber:!0,checkDCE:S,onCommitFiberUnmount:sr,onCommitFiberRoot:Xe,onPostCommitFiberRoot:er,setStrictMode:pr,getInternalModuleRanges:gn,registerInternalModuleStart:kt,registerInternalModuleStop:Cn};return Object.defineProperty(A,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!1,enumerable:!1,get:function(){return Xn}}),Xn}function Cg(A,f,g){var m=A[f];return A[f]=function(d){return g.call(this,m,arguments)},m}function Vp(A,f){var g={};for(var m in f)g[m]=Cg(A,m,f[m]);return g}function Io(A,f){for(var g in f)A[g]=f[g]}function ei(A){typeof A.forceUpdate=="function"?A.forceUpdate():A.updater!=null&&typeof A.updater.enqueueForceUpdate=="function"&&A.updater.enqueueForceUpdate(this,function(){},"forceUpdate")}function Bg(A,f){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(A);f&&(m=m.filter(function(d){return Object.getOwnPropertyDescriptor(A,d).enumerable})),g.push.apply(g,m)}return g}function ho(A){for(var f=1;f0?le[le.length-1]:0;Ge(Oe,Mt,Ht),le.push(Mt),S.set(Oe,Y(At._topLevelWrapper));try{var lr=ye.apply(this,we);return le.pop(),lr}catch(Zn){throw le=[],Zn}finally{if(le.length===0){var Dn=S.get(Oe);if(Dn===void 0)throw new Error("Expected to find root ID.");gn(Dn)}}},performUpdateIfNecessary:function(ye,we){var Oe=we[0];if(bo(Oe)===fr)return ye.apply(this,we);var At=Y(Oe);le.push(At);var Mt=Ws(Oe);try{var Ht=ye.apply(this,we),lr=Ws(Oe);return j(Mt,lr)||Ct(Oe,At,lr),le.pop(),Ht}catch(Zn){throw le=[],Zn}finally{if(le.length===0){var Dn=S.get(Oe);if(Dn===void 0)throw new Error("Expected to find root ID.");gn(Dn)}}},receiveComponent:function(ye,we){var Oe=we[0];if(bo(Oe)===fr)return ye.apply(this,we);var At=Y(Oe);le.push(At);var Mt=Ws(Oe);try{var Ht=ye.apply(this,we),lr=Ws(Oe);return j(Mt,lr)||Ct(Oe,At,lr),le.pop(),Ht}catch(Zn){throw le=[],Zn}finally{if(le.length===0){var Dn=S.get(Oe);if(Dn===void 0)throw new Error("Expected to find root ID.");gn(Dn)}}},unmountComponent:function(ye,we){var Oe=we[0];if(bo(Oe)===fr)return ye.apply(this,we);var At=Y(Oe);le.push(At);try{var Mt=ye.apply(this,we);return le.pop(),Lt(Oe,At),Mt}catch(lr){throw le=[],lr}finally{if(le.length===0){var Ht=S.get(Oe);if(Ht===void 0)throw new Error("Expected to find root ID.");gn(Ht)}}}}));function st(){Ue!==null&&(g.Component?Io(g.Component.Mixin,Ue):Io(g.Reconciler,Ue)),Ue=null}function Ge(Be,ye,we){var Oe=we===0;if(G&&console.log("%crecordMount()","color: green; font-weight: bold;",ye,Es(Be).displayName),Oe){var At=Be._currentElement!=null&&Be._currentElement._owner!=null;kt(oe),kt(ye),kt(il),kt(0),kt(0),kt(0),kt(At?1:0)}else{var Mt=bo(Be),Ht=Es(Be),lr=Ht.displayName,Dn=Ht.key,Zn=Be._currentElement!=null&&Be._currentElement._owner!=null?Y(Be._currentElement._owner):0,mi=Cn(lr),_n=Cn(Dn);kt(oe),kt(ye),kt(Mt),kt(we),kt(Zn),kt(mi),kt(_n)}}function Ct(Be,ye,we){kt(J),kt(ye);var Oe=we.map(Y);kt(Oe.length);for(var At=0;At0?2+ye:0)+er.length),Oe=0;if(we[Oe++]=f,we[Oe++]=Be,we[Oe++]=Dr,pr.forEach(function(Ht,lr){we[Oe++]=lr.length;for(var Dn=wA(lr),Zn=0;Zn0){we[Oe++]=$,we[Oe++]=ye;for(var At=0;At"),"color: var(--dom-tag-name-color); font-weight: normal;"),ye.props!==null&&console.log("Props:",ye.props),ye.state!==null&&console.log("State:",ye.state),ye.context!==null&&console.log("Context:",ye.context);var Oe=w(Be);Oe!==null&&console.log("Node:",Oe),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),we&&console.groupEnd()}function Kr(Be,ye){var we=Nr(Be);we!==null&&(window.$attribute=$o(we,ye))}function sn(Be){var ye=d.get(Be);if(ye==null){console.warn('Could not find instance with id "'.concat(Be,'"'));return}var we=ye._currentElement;if(we==null){console.warn('Could not find element with id "'.concat(Be,'"'));return}m.$type=we.type}function wn(Be,ye,we,Oe){var At=d.get(ye);if(At!=null){var Mt=At._instance;if(Mt!=null)switch(Be){case"context":sa(Mt.context,Oe),ei(Mt);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var Ht=At._currentElement;At._currentElement=ho(ho({},Ht),{},{props:Qr(Ht.props,Oe)}),ei(Mt);break;case"state":sa(Mt.state,Oe),ei(Mt);break}}}function js(Be,ye,we,Oe,At){var Mt=d.get(ye);if(Mt!=null){var Ht=Mt._instance;if(Ht!=null)switch(Be){case"context":Li(Ht.context,Oe,At),ei(Ht);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var lr=Mt._currentElement;Mt._currentElement=ho(ho({},lr),{},{props:bA(lr.props,Oe,At)}),ei(Ht);break;case"state":Li(Ht.state,Oe,At),ei(Ht);break}}}function ri(Be,ye,we,Oe,At){var Mt=d.get(ye);if(Mt!=null){var Ht=Mt._instance;if(Ht!=null)switch(Be){case"context":Aa(Ht.context,Oe,At),ei(Ht);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var lr=Mt._currentElement;Mt._currentElement=ho(ho({},lr),{},{props:fa(lr.props,Oe,At)}),ei(Ht);break;case"state":Aa(Ht.state,Oe,At),ei(Ht);break}}}var ms=function(){throw new Error("getProfilingData not supported by this renderer")},Is=function(){throw new Error("handleCommitFiberRoot not supported by this renderer")},Vi=function(){throw new Error("handleCommitFiberUnmount not supported by this renderer")},qi=function(){throw new Error("handlePostCommitFiberRoot not supported by this renderer")},GA=function(){throw new Error("overrideError not supported by this renderer")},hs=function(){throw new Error("overrideSuspense not supported by this renderer")},kc=function(){},Nc=function(){};function qe(){return null}function gt(Be){return null}function Gt(Be){}function $t(Be){}function en(Be){}function Tr(Be){return null}function Mn(){}function ao(Be){}function Sn(Be){}function ni(){}function Ys(){}function HA(Be){return d.has(Be)}return{clearErrorsAndWarnings:Mn,clearErrorsForFiberID:ao,clearWarningsForFiberID:Sn,cleanup:st,getSerializedElementValueByPath:lt,deletePath:wn,flushInitialOperations:Xe,getBestMatchForTrackedPath:qe,getDisplayNameForFiberID:P,getFiberForNative:T,getFiberIDForNative:x,getInstanceAndStyle:Bn,findNativeNodesForFiberID:function(ye){var we=w(ye);return we==null?null:[we]},getOwnersList:Tr,getPathForElement:gt,getProfilingData:ms,handleCommitFiberRoot:Is,handleCommitFiberUnmount:Vi,handlePostCommitFiberRoot:qi,hasFiberWithId:HA,inspectElement:It,logElementToConsole:on,overrideError:GA,overrideSuspense:hs,overrideValueAtPath:ri,renamePath:js,patchConsoleForStrictMode:ni,prepareViewAttributeSource:Kr,prepareViewElementSource:sn,renderer:g,setTraceUpdatesEnabled:$t,setTrackedPath:en,startProfiling:kc,stopProfiling:Nc,storeAsGlobal:Je,unpatchConsoleForStrictMode:Ys,updateComponentFilters:Gt}}function Dg(A){return!Uf(A)}function yg(A,f,g){if(A==null)return function(){};var m=[A.sub("renderer-attached",function(S){var x=S.id,w=S.renderer,T=S.rendererInterface;f.setRendererInterface(x,T),T.flushInitialOperations()}),A.sub("unsupported-renderer-version",function(S){f.onUnsupportedRenderer(S)}),A.sub("fastRefreshScheduled",f.onFastRefreshScheduled),A.sub("operations",f.onHookOperations),A.sub("traceUpdates",f.onTraceUpdates)],d=function(x,w){if(Dg(w.reconcilerVersion||w.version)){var T=A.rendererInterfaces.get(x);T==null&&(typeof w.findFiberByHostInstance=="function"?T=Hp(A,x,w,g):w.ComponentTree&&(T=qp(A,x,w,g)),T!=null&&A.rendererInterfaces.set(x,T)),T!=null?A.emit("renderer-attached",{id:x,renderer:w,rendererInterface:T}):A.emit("unsupported-renderer-version",x)}};A.renderers.forEach(function(S,x){d(x,S)}),m.push(A.sub("renderer",function(S){var x=S.id,w=S.renderer;d(x,w)})),A.emit("react-devtools",f),A.reactDevtoolsAgent=f;var B=function(){m.forEach(function(x){return x()}),A.rendererInterfaces.forEach(function(x){x.cleanup()}),A.reactDevtoolsAgent=null};return f.addListener("shutdown",B),m.push(function(){f.removeListener("shutdown",B)}),function(){m.forEach(function(S){return S()})}}function xc(A,f){var g=!1,m={bottom:0,left:0,right:0,top:0},d=f[A];if(d!=null){for(var B=0,S=Object.keys(m);B1?g-1:0),d=1;d=0&&er.splice(Bn,1)}},send:function(mr,Bn,Xn){zt.readyState===zt.OPEN?(G&&wt("wall.send()",mr,Bn),zt.send(JSON.stringify({event:mr,payload:Bn}))):(G&&wt("wall.send()","Shutting down bridge because of closed WebSocket connection"),Xe!==null&&Xe.shutdown(),sr())}}),Xe.addListener("updateComponentFilters",function(St){ot=St}),Ge!=null&&Xe!=null&&Xe.addListener("updateConsolePatchSettings",function(St){return ie(Ge,St)}),window.__REACT_DEVTOOLS_COMPONENT_FILTERS__==null&&Xe.send("overrideComponentFilters",ot);var kt=new Jp(Xe);if(kt.addListener("shutdown",function(){be.emit("shutdown")}),yg(be,kt,window),Y!=null||be.resolveRNStyle!=null)Qg(Xe,kt,Y||be.resolveRNStyle,d||be.nativeStyleEditorValidAttributes||null);else{var Cn,Zr,Wr=function(){Xe!==null&&Qg(Xe,kt,Cn,Zr)};be.hasOwnProperty("resolveRNStyle")||Object.defineProperty(be,"resolveRNStyle",{enumerable:!1,get:function(){return Cn},set:function(mr){Cn=mr,Wr()}}),be.hasOwnProperty("nativeStyleEditorValidAttributes")||Object.defineProperty(be,"nativeStyleEditorValidAttributes",{enumerable:!1,get:function(){return Zr},set:function(mr){Zr=mr,Wr()}})}};function Dr(){G&&wt("WebSocket.onclose"),Xe!==null&&Xe.emit("shutdown"),sr()}function Er(){G&&wt("WebSocket.onerror"),sr()}function gn(kt){var Cn;try{if(typeof kt.data=="string")Cn=JSON.parse(kt.data),G&&wt("WebSocket.onmessage",Cn);else throw Error()}catch{console.error("[React DevTools] Failed to parse JSON: "+kt.data);return}er.forEach(function(Zr){try{Zr(Cn)}catch(Wr){throw console.log("[React DevTools] Error calling listener",Cn),console.log("error:",Wr),Wr}})}}})(),i})())});var F_={};var jB,YB=cE(()=>{KB();jB=Me(JB(),1);jB.default.connectToDevTools()});var ZB=nr((Vk,k_)=>{k_.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}}});var tD=nr((qk,Cm)=>{"use strict";var eD=ZB();Cm.exports=eD;Cm.exports.default=eD});var vD=nr((iT,Nm)=>{"use strict";var QD=(e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e};Nm.exports=QD;Nm.exports.default=QD});var SD=nr((sT,bd)=>{"use strict";var pR=vD(),Fd=new WeakMap,wD=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,i=0,s=e.displayName||e.name||"",a=function(...u){if(Fd.set(a,++i),i===1)r=e.apply(this,u),e=null;else if(t.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return pR(a,e),Fd.set(a,i),a};bd.exports=wD;bd.exports.default=wD;bd.exports.callCount=e=>{if(!Fd.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Fd.get(e)}});var KD=nr((vT,WD)=>{"use strict";var vR=/[|\\{}()[\]^$+*?.-]/g;WD.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(vR,"\\$&")}});var VD=nr((wT,YD)=>{"use strict";var wR=KD(),SR=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",jD=[].concat(Jr("module").builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\((?:node:)?${e}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${e}(?:\\.js)?:\\d+:\\d+$)`));jD.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Om=class e{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=e.nodeInternals()),"cwd"in t||(t.cwd=SR),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,_R(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...jD]}clean(t,r=0){r=" ".repeat(r),Array.isArray(t)||(t=t.split(` +`,yt),{type:"error",errorType:"uncaught",id:b,responseID:w,message:yt.message,stack:yt.stack})}if(Co===null)return{id:b,responseID:w,type:"not-found"};Y0(Co);var Et=Ba({},Co);return Et.context=di(Et.context,Hc("context",null)),Et.hooks=di(Et.hooks,Hc("hooks","hooks")),Et.props=di(Et.props,Hc("props",null)),Et.state=di(Et.state,Hc("state",null)),{id:b,responseID:w,type:"full-data",value:Et}}function $0(w){var b=J0(w)?Co:ah(w);if(b===null){console.warn('Could not find Fiber with id "'.concat(w,'"'));return}var L=typeof console.groupCollapsed=="function";L&&console.groupCollapsed("[Click to expand] %c<".concat(b.displayName||"Component"," />"),"color: var(--dom-tag-name-color); font-weight: normal;"),b.props!==null&&console.log("Props:",b.props),b.state!==null&&console.log("State:",b.state),b.hooks!==null&&console.log("Hooks:",b.hooks);var M=nh(w);M!==null&&console.log("Nodes:",M),b.source!==null&&console.log("Location:",b.source),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),L&&console.groupEnd()}function X0(w,b,L,M){var ee=Vs(b);if(ee!==null){var me=ee.stateNode;switch(w){case"context":switch(M=M.slice(1),ee.tag){case j:M.length===0||Aa(me.context,M),me.forceUpdate();break;case Ct:break}break;case"hooks":typeof Sn=="function"&&Sn(ee,L,M);break;case"props":me===null?typeof ms=="function"&&ms(ee,M):(ee.pendingProps=Qr(me.props,M),me.forceUpdate());break;case"state":Aa(me.state,M),me.forceUpdate();break}}}function Z0(w,b,L,M,ee){var me=Vs(b);if(me!==null){var ke=me.stateNode;switch(w){case"context":switch(M=M.slice(1),ee=ee.slice(1),me.tag){case j:M.length===0||Li(ke.context,M,ee),ke.forceUpdate();break;case Ct:break}break;case"hooks":typeof js=="function"&&js(me,L,M,ee);break;case"props":ke===null?typeof Is=="function"&&Is(me,M,ee):(me.pendingProps=FA(ke.props,M,ee),ke.forceUpdate());break;case"state":Li(ke.state,M,ee),ke.forceUpdate();break}}}function ew(w,b,L,M,ee){var me=Vs(b);if(me!==null){var ke=me.stateNode;switch(w){case"context":switch(M=M.slice(1),me.tag){case j:M.length===0?ke.context=ee:aa(ke.context,M,ee),ke.forceUpdate();break;case Ct:break}break;case"hooks":typeof sn=="function"&&sn(me,L,M,ee);break;case"props":me.tag===j?(me.pendingProps=ga(ke.props,M,ee),ke.forceUpdate()):typeof ri=="function"&&ri(me,M,ee);break;case"state":me.tag===j&&(aa(ke.state,M,ee),ke.forceUpdate());break}}}var Bs=null,$l=null,Xl=null,oE=null,iE=null,Di=!1,sE=0,Wc=!1,Kc=null;function tw(){var w=[];if(Kc===null)throw Error("getProfilingData() called before any profiling data was recorded");Kc.forEach(function(Dt,Et){var yt=[],Kt=[],bn=$l!==null&&$l.get(Et)||"Unknown";oE?.forEach(function(Pr,lo){iE!=null&&iE.get(lo)===Et&&Kt.push([lo,Pr])}),Dt.forEach(function(Pr,lo){for(var xo=Pr.changeDescriptions,Bo=Pr.durations,tu=Pr.effectDuration,yi=Pr.maxActualDuration,oi=Pr.passiveEffectDuration,JA=Pr.priorityLevel,ru=Pr.commitTime,jc=Pr.updaters,zs=[],$s=[],Qi=0;Qi1?eu.set(L,M-1):eu.delete(L),kg.delete(w)}function AE(w){for(var b=null,L=null,M=w.child,ee=0;ee<3&&M!==null;ee++){var me=S(M);if(me!==null&&(typeof M.type=="function"?b=me:L===null&&(L=me)),b!==null)break;M=M.child}return b||L||"Anonymous"}function fh(w){var b=w.key,L=S(w),M=w.index;switch(w.tag){case Lt:var ee=hi(w),me=kg.get(ee);if(me===void 0)throw new Error("Expected mounted root to have known pseudo key.");L=me;break;case pr:L=w.type;break;default:break}return{displayName:L,key:b,index:M}}function cw(w){var b=Fr.get(w);if(b==null)return null;for(var L=[];b!==null;)L.push(fh(b)),b=b.return;return L.reverse(),L}function fw(){if(WA===null||qs===null)return null;for(var w=qs;w!==null&&mi(w);)w=w.return;return w===null?null:{id:hi(w),isFullMatch:Jc===WA.length-1}}var gw=function(b){if(b==null)return"Unknown";switch(b){case Bn:return"Immediate";case Xn:return"User-Blocking";case Ke:return"Normal";case ut:return"Low";case It:return"Idle";case Nr:default:return"Unknown"}};function dw(w){Ht=w}function pw(w){return Fr.has(w)}return{cleanup:k0,clearErrorsAndWarnings:_n,clearErrorsForFiberID:Ys,clearWarningsForFiberID:HA,getSerializedElementValueByPath:q0,deletePath:X0,findNativeNodesForFiberID:nh,flushInitialOperations:N0,getBestMatchForTrackedPath:fw,getDisplayNameForFiberID:M0,getFiberForNative:P0,getFiberIDForNative:U0,getInstanceAndStyle:K0,getOwnersList:W0,getPathForElement:cw,getProfilingData:tw,handleCommitFiberRoot:L0,handleCommitFiberUnmount:T0,handlePostCommitFiberRoot:O0,hasFiberWithId:pw,inspectElement:z0,logElementToConsole:$0,patchConsoleForStrictMode:Gs,prepareViewAttributeSource:G0,prepareViewElementSource:H0,overrideError:ow,overrideSuspense:Aw,overrideValueAtPath:ew,renamePath:Z0,renderer:g,setTraceUpdatesEnabled:dw,setTrackedPath:ch,startProfiling:lh,stopProfiling:rw,storeAsGlobal:V0,unpatchConsoleForStrictMode:Nl,updateComponentFilters:Zn}}function cg(A){return dg(A)||gg(A)||ya(A)||fg()}function fg(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gg(A){if(typeof Symbol<"u"&&Symbol.iterator in Object(A))return Array.from(A)}function dg(A){if(Array.isArray(A))return MA(A)}function bl(A,f){var g;if(typeof Symbol>"u"||A[Symbol.iterator]==null){if(Array.isArray(A)||(g=ya(A))||f&&A&&typeof A.length=="number"){g&&(A=g);var m=0,d=function(){};return{s:d,n:function(){return m>=A.length?{done:!0}:{done:!1,value:A[m++]}},e:function(T){throw T},f:d}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=!0,S=!1,x;return{s:function(){g=A[Symbol.iterator]()},n:function(){var T=g.next();return B=T.done,T},e:function(T){S=!0,x=T},f:function(){try{!B&&g.return!=null&&g.return()}finally{if(S)throw x}}}}function ya(A,f){if(A){if(typeof A=="string")return MA(A,f);var g=Object.prototype.toString.call(A).slice(8,-1);if(g==="Object"&&A.constructor&&(g=A.constructor.name),g==="Map"||g==="Set")return Array.from(A);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return MA(A,f)}}function MA(A,f){(f==null||f>A.length)&&(f=A.length);for(var g=0,m=new Array(f);g=2&&_c.test(A[0])&&A[1]==="color: ".concat(kl(f)||"")}function kl(A){switch(A){case"warn":return xr.browserTheme==="light"?"rgba(250, 180, 50, 0.75)":"rgba(250, 180, 50, 0.5)";case"error":return xr.browserTheme==="light"?"rgba(250, 123, 130, 0.75)":"rgba(250, 123, 130, 0.5)";default:return xr.browserTheme==="light"?"rgba(125, 125, 125, 0.75)":"rgba(125, 125, 125, 0.5)"}}var Eg=new Map,zn=console,wa={};for(var Hr in console)wa[Hr]=console[Hr];var Nt=null,ln=!1;try{ln=global===void 0}catch{}function un(A){zn=A,wa={};for(var f in zn)wa[f]=console[f]}function hn(A,f){var g=A.currentDispatcherRef,m=A.getCurrentFiber,d=A.findFiberByHostInstance,B=A.version;if(typeof d=="function"&&g!=null&&typeof m=="function"){var S=bo(B),x=S.ReactTypeOfWork;Eg.set(A,{currentDispatcherRef:g,getCurrentFiber:m,workTagMap:x,onErrorOrWarning:f})}}var xr={appendComponentStack:!1,breakOnConsoleErrors:!1,showInlineWarningsAndErrors:!1,hideConsoleLogsInStrictMode:!1,browserTheme:"dark"};function Us(A){var f=A.appendComponentStack,g=A.breakOnConsoleErrors,m=A.showInlineWarningsAndErrors,d=A.hideConsoleLogsInStrictMode,B=A.browserTheme;if(xr.appendComponentStack=f,xr.breakOnConsoleErrors=g,xr.showInlineWarningsAndErrors=m,xr.hideConsoleLogsInStrictMode=d,xr.browserTheme=B,f||g||m){if(Nt!==null)return;var S={};Nt=function(){for(var v in S)try{zn[v]=S[v]}catch{}},Fl.forEach(function(x){try{var v=S[x]=zn[x].__REACT_DEVTOOLS_ORIGINAL_METHOD__?zn[x].__REACT_DEVTOOLS_ORIGINAL_METHOD__:zn[x],T=function(){for(var Y=!1,j=arguments.length,ue=new Array(j),Me=0;Me0?ue[ue.length-1]:null,Pe=typeof st=="string"&&Sc(st);Y=!Pe}var Ct=xr.showInlineWarningsAndErrors&&(x==="error"||x==="warn"),Lt=bl(Eg.values()),sr;try{for(Lt.s();!(sr=Lt.n()).done;){var Xe=sr.value,er=Xe.currentDispatcherRef,pr=Xe.getCurrentFiber,zt=Xe.onErrorOrWarning,Dr=Xe.workTagMap,Er=pr();if(Er!=null)try{if(Ct&&typeof zt=="function"&&zt(Er,x,ue.slice()),Y){var gn=og(Dr,Er,er);gn!==""&&(pg(ue,x)&&(ue[0]="".concat(ue[0]," %s")),ue.push(gn))}}catch(kt){setTimeout(function(){throw kt},0)}finally{break}}}catch(kt){Lt.e(kt)}finally{Lt.f()}if(xr.breakOnConsoleErrors)debugger;v.apply(void 0,ue)};T.__REACT_DEVTOOLS_ORIGINAL_METHOD__=v,v.__REACT_DEVTOOLS_OVERRIDE_METHOD__=T,zn[x]=T}catch{}})}else cn()}function cn(){Nt!==null&&(Nt(),Nt=null)}var Ji=null;function Gs(){if(ic){var A=["error","group","groupCollapsed","info","log","trace","warn"];if(Ji!==null)return;var f={};Ji=function(){for(var m in f)try{zn[m]=f[m]}catch{}},A.forEach(function(g){try{var m=f[g]=zn[g].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__?zn[g].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__:zn[g],d=function(){if(!xr.hideConsoleLogsInStrictMode){for(var S=arguments.length,x=new Array(S),v=0;vA.length)&&(f=A.length);for(var g=0,m=new Array(f);g"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function $n(A){return $n=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},$n(A)}function fn(A,f,g){return f in A?Object.defineProperty(A,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[f]=g,A}var mg=100,Gl=[{version:0,minNpmVersion:'"<4.11.0"',maxNpmVersion:'"<4.11.0"'},{version:1,minNpmVersion:"4.13.0",maxNpmVersion:"4.21.0"},{version:2,minNpmVersion:"4.22.0",maxNpmVersion:null}],Hl=Gl[Gl.length-1],Jp=(function(A){Sa(g,A);var f=Pl(g);function g(m){var d;return Ll(this,g),d=f.call(this),fn(Mr(d),"_isShutdown",!1),fn(Mr(d),"_messageQueue",[]),fn(Mr(d),"_timeoutID",null),fn(Mr(d),"_wallUnlisten",null),fn(Mr(d),"_flush",function(){if(d._timeoutID!==null&&(clearTimeout(d._timeoutID),d._timeoutID=null),d._messageQueue.length){for(var B=0;B1?B-1:0),x=1;x"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ba(A){return ba=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},ba(A)}function xt(A,f,g){return f in A?Object.defineProperty(A,f,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[f]=g,A}var ps=function(f){if(G){for(var g,m=arguments.length,d=new Array(m>1?m-1:0),B=1;BA.length)&&(f=A.length);for(var g=0,m=new Array(f);g0?"development":"production";var ut=Function.prototype.toString;if(Ke.Mount&&Ke.Mount._renderNewRootComponent){var It=ut.call(Ke.Mount._renderNewRootComponent);return It.indexOf("function")!==0?"production":It.indexOf("storedMeasure")!==-1?"development":It.indexOf("should be a pure function")!==-1?It.indexOf("NODE_ENV")!==-1||It.indexOf("development")!==-1||It.indexOf("true")!==-1?"development":It.indexOf("nextElement")!==-1||It.indexOf("nextComponent")!==-1?"unminified":"development":It.indexOf("nextElement")!==-1||It.indexOf("nextComponent")!==-1?"unminified":"outdated"}}catch{}return"production"}function S(Ke){try{var ut=Function.prototype.toString,It=ut.call(Ke);It.indexOf("^_^")>-1&&(ue=!0,setTimeout(function(){throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")}))}catch{}}function x(Ke,ut){if(Ke==null||Ke.length===0||typeof Ke[0]=="string"&&Ke[0].match(/([^%]|^)(%c)/g)||ut===void 0)return Ke;var It=/([^%]|^)((%%)*)(%([oOdisf]))/g;if(typeof Ke[0]=="string"&&Ke[0].match(It))return["%c".concat(Ke[0]),ut].concat(jl(Ke.slice(1)));var Nr=Ke.reduce(function(on,Kr,sn){switch(sn>0&&(on+=" "),Ei(Kr)){case"string":case"boolean":case"symbol":return on+="%s";case"number":var Sn=Number.isInteger(Kr)?"%i":"%f";return on+=Sn;default:return on+="%o"}},"%c");return[Nr,ut].concat(jl(Ke))}var v=null;function T(Ke){var ut=Ke.hideConsoleLogsInStrictMode,It=Ke.browserTheme,Nr=["error","group","groupCollapsed","info","log","trace","warn"];if(v===null){var on={};v=function(){for(var sn in on)try{f[sn]=on[sn]}catch{}},Nr.forEach(function(Kr){try{var sn=on[Kr]=f[Kr].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__?f[Kr].__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__:f[Kr],Sn=function(){if(!ut){var ri;switch(Kr){case"warn":ri=It==="light"?"rgba(250, 180, 50, 0.75)":"rgba(250, 180, 50, 0.5)";break;case"error":ri=It==="light"?"rgba(250, 123, 130, 0.75)":"rgba(250, 123, 130, 0.5)";break;default:ri=It==="light"?"rgba(125, 125, 125, 0.75)":"rgba(125, 125, 125, 0.5)";break}if(ri){for(var ms=arguments.length,Is=new Array(ms),Vi=0;Vi1?ut[1]:null;return It}function gn(){return Dr}function kt(Ke){var ut=Er(Ke);ut!==null&&zt.push(ut)}function Cn(Ke){if(zt.length>0){var ut=zt.pop(),It=Er(Ke);It!==null&&Dr.push([ut,It])}}var Zr={},Wr=new Map,St={},mr=new Map,Bn=new Map,Xn={rendererInterfaces:Wr,listeners:St,backends:Bn,renderers:mr,emit:Ct,getFiberRoots:Lt,inject:j,on:st,off:Pe,sub:Me,supportsFiber:!0,checkDCE:S,onCommitFiberUnmount:sr,onCommitFiberRoot:Xe,onPostCommitFiberRoot:er,setStrictMode:pr,getInternalModuleRanges:gn,registerInternalModuleStart:kt,registerInternalModuleStop:Cn};return Object.defineProperty(A,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!1,enumerable:!1,get:function(){return Xn}}),Xn}function Dg(A,f,g){var m=A[f];return A[f]=function(d){return g.call(this,m,arguments)},m}function zp(A,f){var g={};for(var m in f)g[m]=Dg(A,m,f[m]);return g}function Io(A,f){for(var g in f)A[g]=f[g]}function ei(A){typeof A.forceUpdate=="function"?A.forceUpdate():A.updater!=null&&typeof A.updater.enqueueForceUpdate=="function"&&A.updater.enqueueForceUpdate(this,function(){},"forceUpdate")}function yg(A,f){var g=Object.keys(A);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(A);f&&(m=m.filter(function(d){return Object.getOwnPropertyDescriptor(A,d).enumerable})),g.push.apply(g,m)}return g}function ho(A){for(var f=1;f0?ue[ue.length-1]:0;Pe(Te,Mt,Ht),ue.push(Mt),S.set(Te,Y(At._topLevelWrapper));try{var lr=De.apply(this,Qe);return ue.pop(),lr}catch(Zn){throw ue=[],Zn}finally{if(ue.length===0){var Dn=S.get(Te);if(Dn===void 0)throw new Error("Expected to find root ID.");gn(Dn)}}},performUpdateIfNecessary:function(De,Qe){var Te=Qe[0];if(Fo(Te)===fr)return De.apply(this,Qe);var At=Y(Te);ue.push(At);var Mt=Ws(Te);try{var Ht=De.apply(this,Qe),lr=Ws(Te);return j(Mt,lr)||Ct(Te,At,lr),ue.pop(),Ht}catch(Zn){throw ue=[],Zn}finally{if(ue.length===0){var Dn=S.get(Te);if(Dn===void 0)throw new Error("Expected to find root ID.");gn(Dn)}}},receiveComponent:function(De,Qe){var Te=Qe[0];if(Fo(Te)===fr)return De.apply(this,Qe);var At=Y(Te);ue.push(At);var Mt=Ws(Te);try{var Ht=De.apply(this,Qe),lr=Ws(Te);return j(Mt,lr)||Ct(Te,At,lr),ue.pop(),Ht}catch(Zn){throw ue=[],Zn}finally{if(ue.length===0){var Dn=S.get(Te);if(Dn===void 0)throw new Error("Expected to find root ID.");gn(Dn)}}},unmountComponent:function(De,Qe){var Te=Qe[0];if(Fo(Te)===fr)return De.apply(this,Qe);var At=Y(Te);ue.push(At);try{var Mt=De.apply(this,Qe);return ue.pop(),Lt(Te,At),Mt}catch(lr){throw ue=[],lr}finally{if(ue.length===0){var Ht=S.get(Te);if(Ht===void 0)throw new Error("Expected to find root ID.");gn(Ht)}}}}));function st(){Me!==null&&(g.Component?Io(g.Component.Mixin,Me):Io(g.Reconciler,Me)),Me=null}function Pe(Ce,De,Qe){var Te=Qe===0;if(G&&console.log("%crecordMount()","color: green; font-weight: bold;",De,Es(Ce).displayName),Te){var At=Ce._currentElement!=null&&Ce._currentElement._owner!=null;kt(oe),kt(De),kt(sl),kt(0),kt(0),kt(0),kt(At?1:0)}else{var Mt=Fo(Ce),Ht=Es(Ce),lr=Ht.displayName,Dn=Ht.key,Zn=Ce._currentElement!=null&&Ce._currentElement._owner!=null?Y(Ce._currentElement._owner):0,mi=Cn(lr),Rn=Cn(Dn);kt(oe),kt(De),kt(Mt),kt(Qe),kt(Zn),kt(mi),kt(Rn)}}function Ct(Ce,De,Qe){kt(Z),kt(De);var Te=Qe.map(Y);kt(Te.length);for(var At=0;At0?2+De:0)+er.length),Te=0;if(Qe[Te++]=f,Qe[Te++]=Ce,Qe[Te++]=Dr,pr.forEach(function(Ht,lr){Qe[Te++]=lr.length;for(var Dn=vA(lr),Zn=0;Zn0){Qe[Te++]=$,Qe[Te++]=De;for(var At=0;At"),"color: var(--dom-tag-name-color); font-weight: normal;"),De.props!==null&&console.log("Props:",De.props),De.state!==null&&console.log("State:",De.state),De.context!==null&&console.log("Context:",De.context);var Te=v(Ce);Te!==null&&console.log("Node:",Te),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),Qe&&console.groupEnd()}function Kr(Ce,De){var Qe=Nr(Ce);Qe!==null&&(window.$attribute=$o(Qe,De))}function sn(Ce){var De=d.get(Ce);if(De==null){console.warn('Could not find instance with id "'.concat(Ce,'"'));return}var Qe=De._currentElement;if(Qe==null){console.warn('Could not find element with id "'.concat(Ce,'"'));return}m.$type=Qe.type}function Sn(Ce,De,Qe,Te){var At=d.get(De);if(At!=null){var Mt=At._instance;if(Mt!=null)switch(Ce){case"context":Aa(Mt.context,Te),ei(Mt);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var Ht=At._currentElement;At._currentElement=ho(ho({},Ht),{},{props:Qr(Ht.props,Te)}),ei(Mt);break;case"state":Aa(Mt.state,Te),ei(Mt);break}}}function js(Ce,De,Qe,Te,At){var Mt=d.get(De);if(Mt!=null){var Ht=Mt._instance;if(Ht!=null)switch(Ce){case"context":Li(Ht.context,Te,At),ei(Ht);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var lr=Mt._currentElement;Mt._currentElement=ho(ho({},lr),{},{props:FA(lr.props,Te,At)}),ei(Ht);break;case"state":Li(Ht.state,Te,At),ei(Ht);break}}}function ri(Ce,De,Qe,Te,At){var Mt=d.get(De);if(Mt!=null){var Ht=Mt._instance;if(Ht!=null)switch(Ce){case"context":aa(Ht.context,Te,At),ei(Ht);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var lr=Mt._currentElement;Mt._currentElement=ho(ho({},lr),{},{props:ga(lr.props,Te,At)}),ei(Ht);break;case"state":aa(Ht.state,Te,At),ei(Ht);break}}}var ms=function(){throw new Error("getProfilingData not supported by this renderer")},Is=function(){throw new Error("handleCommitFiberRoot not supported by this renderer")},Vi=function(){throw new Error("handleCommitFiberUnmount not supported by this renderer")},qi=function(){throw new Error("handlePostCommitFiberRoot not supported by this renderer")},GA=function(){throw new Error("overrideError not supported by this renderer")},hs=function(){throw new Error("overrideSuspense not supported by this renderer")},Nc=function(){},Tc=function(){};function qe(){return null}function dt(Ce){return null}function Gt(Ce){}function $t(Ce){}function en(Ce){}function Tr(Ce){return null}function Mn(){}function ao(Ce){}function _n(Ce){}function ni(){}function Ys(){}function HA(Ce){return d.has(Ce)}return{clearErrorsAndWarnings:Mn,clearErrorsForFiberID:ao,clearWarningsForFiberID:_n,cleanup:st,getSerializedElementValueByPath:ut,deletePath:Sn,flushInitialOperations:Xe,getBestMatchForTrackedPath:qe,getDisplayNameForFiberID:P,getFiberForNative:T,getFiberIDForNative:x,getInstanceAndStyle:Bn,findNativeNodesForFiberID:function(De){var Qe=v(De);return Qe==null?null:[Qe]},getOwnersList:Tr,getPathForElement:dt,getProfilingData:ms,handleCommitFiberRoot:Is,handleCommitFiberUnmount:Vi,handlePostCommitFiberRoot:qi,hasFiberWithId:HA,inspectElement:It,logElementToConsole:on,overrideError:GA,overrideSuspense:hs,overrideValueAtPath:ri,renamePath:js,patchConsoleForStrictMode:ni,prepareViewAttributeSource:Kr,prepareViewElementSource:sn,renderer:g,setTraceUpdatesEnabled:$t,setTrackedPath:en,startProfiling:Nc,stopProfiling:Tc,storeAsGlobal:Ke,unpatchConsoleForStrictMode:Ys,updateComponentFilters:Gt}}function Qg(A){return!Hf(A)}function wg(A,f,g){if(A==null)return function(){};var m=[A.sub("renderer-attached",function(S){var x=S.id,v=S.renderer,T=S.rendererInterface;f.setRendererInterface(x,T),T.flushInitialOperations()}),A.sub("unsupported-renderer-version",function(S){f.onUnsupportedRenderer(S)}),A.sub("fastRefreshScheduled",f.onFastRefreshScheduled),A.sub("operations",f.onHookOperations),A.sub("traceUpdates",f.onTraceUpdates)],d=function(x,v){if(Qg(v.reconcilerVersion||v.version)){var T=A.rendererInterfaces.get(x);T==null&&(typeof v.findFiberByHostInstance=="function"?T=Kp(A,x,v,g):v.ComponentTree&&(T=$p(A,x,v,g)),T!=null&&A.rendererInterfaces.set(x,T)),T!=null?A.emit("renderer-attached",{id:x,renderer:v,rendererInterface:T}):A.emit("unsupported-renderer-version",x)}};A.renderers.forEach(function(S,x){d(x,S)}),m.push(A.sub("renderer",function(S){var x=S.id,v=S.renderer;d(x,v)})),A.emit("react-devtools",f),A.reactDevtoolsAgent=f;var B=function(){m.forEach(function(x){return x()}),A.rendererInterfaces.forEach(function(x){x.cleanup()}),A.reactDevtoolsAgent=null};return f.addListener("shutdown",B),m.push(function(){f.removeListener("shutdown",B)}),function(){m.forEach(function(S){return S()})}}function kc(A,f){var g=!1,m={bottom:0,left:0,right:0,top:0},d=f[A];if(d!=null){for(var B=0,S=Object.keys(m);B1?g-1:0),d=1;d=0&&er.splice(Bn,1)}},send:function(mr,Bn,Xn){zt.readyState===zt.OPEN?(G&&vt("wall.send()",mr,Bn),zt.send(JSON.stringify({event:mr,payload:Bn}))):(G&&vt("wall.send()","Shutting down bridge because of closed WebSocket connection"),Xe!==null&&Xe.shutdown(),sr())}}),Xe.addListener("updateComponentFilters",function(St){nt=St}),Pe!=null&&Xe!=null&&Xe.addListener("updateConsolePatchSettings",function(St){return ae(Pe,St)}),window.__REACT_DEVTOOLS_COMPONENT_FILTERS__==null&&Xe.send("overrideComponentFilters",nt);var kt=new Yp(Xe);if(kt.addListener("shutdown",function(){be.emit("shutdown")}),wg(be,kt,window),Y!=null||be.resolveRNStyle!=null)vg(Xe,kt,Y||be.resolveRNStyle,d||be.nativeStyleEditorValidAttributes||null);else{var Cn,Zr,Wr=function(){Xe!==null&&vg(Xe,kt,Cn,Zr)};be.hasOwnProperty("resolveRNStyle")||Object.defineProperty(be,"resolveRNStyle",{enumerable:!1,get:function(){return Cn},set:function(mr){Cn=mr,Wr()}}),be.hasOwnProperty("nativeStyleEditorValidAttributes")||Object.defineProperty(be,"nativeStyleEditorValidAttributes",{enumerable:!1,get:function(){return Zr},set:function(mr){Zr=mr,Wr()}})}};function Dr(){G&&vt("WebSocket.onclose"),Xe!==null&&Xe.emit("shutdown"),sr()}function Er(){G&&vt("WebSocket.onerror"),sr()}function gn(kt){var Cn;try{if(typeof kt.data=="string")Cn=JSON.parse(kt.data),G&&vt("WebSocket.onmessage",Cn);else throw Error()}catch{console.error("[React DevTools] Failed to parse JSON: "+kt.data);return}er.forEach(function(Zr){try{Zr(Cn)}catch(Wr){throw console.log("[React DevTools] Error calling listener",Cn),console.log("error:",Wr),Wr}})}}})(),i})())});var N_={};var zB,$B=gE(()=>{VB();zB=Le(qB(),1);zB.default.connectToDevTools()});var nD=nr((rN,L_)=>{L_.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}}});var iD=nr((nN,Dm)=>{"use strict";var oD=nD();Dm.exports=oD;Dm.exports.default=oD});var RD=nr((gT,Om)=>{"use strict";var _D=(e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e};Om.exports=_D;Om.exports.default=_D});var FD=nr((dT,kd)=>{"use strict";var hR=RD(),xd=new WeakMap,bD=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,i=0,s=e.displayName||e.name||"",a=function(...u){if(xd.set(a,++i),i===1)r=e.apply(this,u),e=null;else if(t.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return hR(a,e),xd.set(a,i),a};kd.exports=bD;kd.exports.default=bD;kd.exports.callCount=e=>{if(!xd.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return xd.get(e)}});var VD=nr((kT,YD)=>{"use strict";var RR=/[|\\{}()[\]^$+*?.-]/g;YD.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(RR,"\\$&")}});var XD=nr((NT,$D)=>{"use strict";var bR=VD(),FR=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",zD=[].concat(Jr("module").builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\((?:node:)?${e}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${e}(?:\\.js)?:\\d+:\\d+$)`));zD.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Mm=class e{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=e.nodeInternals()),"cwd"in t||(t.cwd=FR),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,xR(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...zD]}clean(t,r=0){r=" ".repeat(r),Array.isArray(t)||(t=t.split(` `)),!/^\s*at /.test(t[0])&&/^\s*at /.test(t[1])&&(t=t.slice(1));let i=!1,s=null,a=[];return t.forEach(u=>{if(u=u.replace(/\\/g,"/"),this._internals.some(I=>I.test(u)))return;let E=/^\s*at /.test(u);i?u=u.trimEnd().replace(/^(\s+)at /,"$1"):(u=u.trim(),E&&(u=u.slice(3))),u=u.replace(`${this._cwd}/`,""),u&&(E?(s&&(a.push(s),s=null),a.push(u)):(i=!0,s=u))}),a.map(u=>`${r}${u} -`).join("")}captureString(t,r=this.captureString){typeof t=="function"&&(r=t,t=1/0);let{stackTraceLimit:i}=Error;t&&(Error.stackTraceLimit=t);let s={};Error.captureStackTrace(s,r);let{stack:a}=s;return Error.stackTraceLimit=i,this.clean(a)}capture(t,r=this.capture){typeof t=="function"&&(r=t,t=1/0);let{prepareStackTrace:i,stackTraceLimit:s}=Error;Error.prepareStackTrace=(E,I)=>this._wrapCallSite?I.map(this._wrapCallSite):I,t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,r);let{stack:u}=a;return Object.assign(Error,{prepareStackTrace:i,stackTraceLimit:s}),u}at(t=this.at){let[r]=this.capture(1,t);if(!r)return{};let i={line:r.getLineNumber(),column:r.getColumnNumber()};JD(i,r.getFileName(),this._cwd),r.isConstructor()&&Object.defineProperty(i,"constructor",{value:!0,configurable:!0}),r.isEval()&&(i.evalOrigin=r.getEvalOrigin()),r.isNative()&&(i.native=!0);let s;try{s=r.getTypeName()}catch{}s&&s!=="Object"&&s!=="[object Object]"&&(i.type=s);let a=r.getFunctionName();a&&(i.function=a);let u=r.getMethodName();return u&&a!==u&&(i.method=u),i}parseLine(t){let r=t&&t.match(RR);if(!r)return null;let i=r[1]==="new",s=r[2],a=r[3],u=r[4],E=Number(r[5]),I=Number(r[6]),C=r[7],y=r[8],D=r[9],R=r[10]==="native",O=r[11]===")",G,ne={};if(y&&(ne.line=Number(y)),D&&(ne.column=Number(D)),O&&C){let oe=0;for(let $=C.length-1;$>0;$--)if(C.charAt($)===")")oe++;else if(C.charAt($)==="("&&C.charAt($-1)===" "&&(oe--,oe===-1&&C.charAt($-1)===" ")){let J=C.slice(0,$-1);C=C.slice($+1),s+=` (${J}`;break}}if(s){let oe=s.match(FR);oe&&(s=oe[1],G=oe[2])}return JD(ne,C,this._cwd),i&&Object.defineProperty(ne,"constructor",{value:!0,configurable:!0}),a&&(ne.evalOrigin=a,ne.evalLine=E,ne.evalColumn=I,ne.evalFile=u&&u.replace(/\\/g,"/")),R&&(ne.native=!0),s&&(ne.function=s),G&&s!==G&&(ne.method=G),ne}};function JD(e,t,r){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${r}/`)&&(t=t.slice(r.length+1)),e.file=t)}function _R(e){if(e.length===0)return[];let t=e.map(r=>wR(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var RR=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),FR=/^(.*?) \[as (.*?)\]$/;YD.exports=Om});var Fy=nr(zd=>{"use strict";var SF=jt(),_F=Symbol.for("react.element"),RF=Symbol.for("react.fragment"),FF=Object.prototype.hasOwnProperty,bF=SF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xF={key:!0,ref:!0,__self:!0,__source:!0};function Ry(e,t,r){var i,s={},a=null,u=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(u=t.ref);for(i in t)FF.call(t,i)&&!xF.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:_F,type:e,key:a,ref:u,props:s,_owner:bF.current}}zd.Fragment=RF;zd.jsx=Ry;zd.jsxs=Ry});var Pt=nr((OL,by)=>{"use strict";by.exports=Fy()});var bn=Me(jt(),1);import{Stream as UR}from"node:stream";import Pd from"node:process";var ry=Me(jt(),1);import PR from"node:process";function wh(e,t,{signal:r,edges:i}={}){let s,a=null,u=i!=null&&i.includes("leading"),E=i==null||i.includes("trailing"),I=()=>{a!==null&&(e.apply(s,a),s=void 0,a=null)},C=()=>{E&&I(),O()},y=null,D=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,C()},t)},R=()=>{y!==null&&(clearTimeout(y),y=null)},O=()=>{R(),s=void 0,a=null},G=()=>{I()},ne=function(...oe){if(r?.aborted)return;s=this,a=oe;let $=y==null;D(),u&&$&&I()};return ne.schedule=D,ne.cancel=O,ne.flush=G,r?.addEventListener("abort",O,{once:!0}),ne}function Sh(e,t=0,r={}){typeof r!="object"&&(r={});let{leading:i=!1,trailing:s=!0,maxWait:a}=r,u=Array(2);i&&(u[0]="leading"),s&&(u[1]="trailing");let E,I=null,C=wh(function(...R){E=e.apply(this,R),I=null},t,{edges:u}),y=function(...R){return a!=null&&(I===null&&(I=Date.now()),Date.now()-I>=a)?(E=e.apply(this,R),I=Date.now(),C.cancel(),C.schedule(),E):(C.apply(this,R),E)},D=()=>(C.flush(),E);return y.cancel=C.cancel,y.flush=D,y}function Pg(e,t=0,r={}){let{leading:i=!0,trailing:s=!0}=r;return Sh(e,t,{leading:i,maxWait:t,trailing:s})}var ko={};Bv(ko,{ConEmu:()=>Th,beep:()=>gw,beginSynchronizedOutput:()=>xh,clearScreen:()=>sw,clearTerminal:()=>lw,clearViewport:()=>Aw,cursorBackward:()=>Jv,cursorDown:()=>Wv,cursorForward:()=>Kv,cursorGetPosition:()=>Vv,cursorHide:()=>$v,cursorLeft:()=>Fh,cursorMove:()=>Hv,cursorNextLine:()=>qv,cursorPrevLine:()=>zv,cursorRestorePosition:()=>Yv,cursorSavePosition:()=>jv,cursorShow:()=>Xv,cursorTo:()=>Gv,cursorUp:()=>Rh,endSynchronizedOutput:()=>kh,enterAlternativeScreen:()=>uw,eraseDown:()=>rw,eraseEndLine:()=>ew,eraseLine:()=>bh,eraseLines:()=>Zv,eraseScreen:()=>Ug,eraseStartLine:()=>tw,eraseUp:()=>nw,exitAlternativeScreen:()=>cw,iTerm:()=>Nh,image:()=>pw,link:()=>dw,scrollDown:()=>iw,scrollUp:()=>ow,setCwd:()=>Ew,synchronizedOutput:()=>fw});import ou from"node:process";import Mv from"node:os";var nu=globalThis.window?.document!==void 0,T1=globalThis.process?.versions?.node!==void 0,O1=globalThis.process?.versions?.bun!==void 0,L1=globalThis.Deno?.version?.deno!==void 0,M1=globalThis.process?.versions?.electron!==void 0,P1=globalThis.navigator?.userAgent?.includes("jsdom")===!0,U1=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,G1=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,H1=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,W1=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,Yc=globalThis.navigator?.userAgentData?.platform,K1=Yc==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",J1=Yc==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",j1=Yc==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",Y1=Yc==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),V1=Yc==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var tr="\x1B[",iu="\x1B]",ka="\x07",Vc=";",_h=!nu&&ou.env.TERM_PROGRAM==="Apple_Terminal",Pv=!nu&&ou.platform==="win32",Uv=!nu&&(ou.env.TERM?.startsWith("screen")||ou.env.TERM?.startsWith("tmux")||ou.env.TMUX!==void 0),mE=nu?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:ou.cwd,su=e=>Uv?"\x1BPtmux;"+e.replaceAll("\x1B","\x1B\x1B")+"\x1B\\":e,Gv=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?tr+(e+1)+"G":tr+(t+1)+Vc+(e+1)+"H"},Hv=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=tr+-e+"D":e>0&&(r+=tr+e+"C"),t<0?r+=tr+-t+"A":t>0&&(r+=tr+t+"B"),r},Rh=(e=1)=>tr+e+"A",Wv=(e=1)=>tr+e+"B",Kv=(e=1)=>tr+e+"C",Jv=(e=1)=>tr+e+"D",Fh=tr+"G",jv=_h?"\x1B7":tr+"s",Yv=_h?"\x1B8":tr+"u",Vv=tr+"6n",qv=tr+"E",zv=tr+"F",$v=tr+"?25l",Xv=tr+"?25h",Zv=e=>{let t="";for(let r=0;r{if(nu||!Pv)return!1;let e=Mv.release().split("."),t=Number(e[0]),r=Number(e[2]??0);return t<10||t===10&&r<10586},lw=aw()?`${Ug}${tr}0f`:`${Ug}${tr}3J${tr}H`,uw=tr+"?1049h",cw=tr+"?1049l",xh=tr+"?2026h",kh=tr+"?2026l",fw=e=>xh+e+kh,gw=ka,dw=(e,t)=>{let r=su(`${iu}8${Vc}${Vc}${t}${ka}`),i=su(`${iu}8${Vc}${Vc}${ka}`);return r+e+i},pw=(e,t={})=>{let r=`${iu}1337;File=inline=1`;t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0");let i=Buffer.from(e);return su(r+`;size=${i.byteLength}:`+i.toString("base64")+ka)},Nh={setCwd:(e=mE())=>su(`${iu}50;CurrentDir=${e}${ka}`),annotation(e,t={}){let r=`${iu}1337;`,i=t.x!==void 0,s=t.y!==void 0;if((i||s)&&!(i&&s&&t.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(i?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,su(r+ka)}},Th={setCwd:(e=mE())=>su(`${iu}9;9;${e}${ka}`)},Ew=(e=mE())=>Nh.setCwd(e)+Th.setCwd(e);import{env as qc}from"node:process";var mw=qc.CI!=="0"&&qc.CI!=="false"&&("CI"in qc||"CONTINUOUS_INTEGRATION"in qc||Object.keys(qc).some(e=>e.startsWith("CI_"))),Na=mw;var Iw=e=>{let t=new Set;do for(let r of Reflect.ownKeys(e))t.add([e,r]);while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t};function IE(e,{include:t,exclude:r}={}){let i=s=>{let a=u=>typeof u=="string"?s===u:u.test(s);return t?t.some(a):r?!r.some(a):!0};for(let[s,a]of Iw(e.constructor.prototype)){if(a==="constructor"||!i(a))continue;let u=Reflect.getOwnPropertyDescriptor(s,a);u&&typeof u.value=="function"&&(e[a]=e[a].bind(e))}return e}var ny=Me(BE(),1);import{PassThrough as Gh}from"node:stream";var Hh=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],DE={},hw=e=>{let t=new Gh,r=new Gh;t.write=s=>{e("stdout",s)},r.write=s=>{e("stderr",s)};let i=new console.Console(t,r);for(let s of Hh)DE[s]=console[s],console[s]=i[s];return()=>{for(let s of Hh)console[s]=DE[s];DE={}}},Wh=hw;var Cw=(()=>{var e=import.meta.url;return(function(t){t=t||{};var r;r||(r=typeof t<"u"?t:{});var i,s;r.ready=new Promise(function(Q,_){i=Q,s=_});var a=Object.assign({},r),u="";typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),e&&(u=e),u.indexOf("blob:")!==0?u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):u="";var E=r.print||console.log.bind(console),I=r.printErr||console.warn.bind(console);Object.assign(r,a),a=null;var C;r.wasmBinary&&(C=r.wasmBinary);var y=r.noExitRuntime||!0;typeof WebAssembly!="object"&&ae("no native wasm support detected");var D,R=!1;function O(Q,_,U){U=_+U;for(var H="";!(_>=U);){var re=Q[_++];if(!re)break;if(re&128){var de=Q[_++]&63;if((re&224)==192)H+=String.fromCharCode((re&31)<<6|de);else{var Re=Q[_++]&63;re=(re&240)==224?(re&15)<<12|de<<6|Re:(re&7)<<18|de<<12|Re<<6|Q[_++]&63,65536>re?H+=String.fromCharCode(re):(re-=65536,H+=String.fromCharCode(55296|re>>10,56320|re&1023))}}else H+=String.fromCharCode(re)}return H}var G,ne,oe,$,J,X,Z,ge,he;function ue(){var Q=D.buffer;G=Q,r.HEAP8=ne=new Int8Array(Q),r.HEAP16=$=new Int16Array(Q),r.HEAP32=X=new Int32Array(Q),r.HEAPU8=oe=new Uint8Array(Q),r.HEAPU16=J=new Uint16Array(Q),r.HEAPU32=Z=new Uint32Array(Q),r.HEAPF32=ge=new Float32Array(Q),r.HEAPF64=he=new Float64Array(Q)}var Le,pe=[],ct=[],De=[];function ve(){var Q=r.preRun.shift();pe.unshift(Q)}var se=0,N=null,W=null;function ae(Q){throw r.onAbort&&r.onAbort(Q),Q="Aborted("+Q+")",I(Q),R=!0,Q=new WebAssembly.RuntimeError(Q+". Build with -sASSERTIONS for more info."),s(Q),Q}function fe(Q){return Q.startsWith("data:application/octet-stream;base64,")}var Ie;if(Ie="data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9/f39/f319AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfGAEf39/fABgA39/fQBg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EQANAIAAgBUGAAhAmIANBgAJrIgNB/wFLDQALCyAAIAUgAxAmCyAFQYACaiQAC/ICAgJ/AX4CQCACRQ0AIAAgAToAACAAIAJqIgNBAWsgAToAACACQQNJDQAgACABOgACIAAgAToAASADQQNrIAE6AAAgA0ECayABOgAAIAJBB0kNACAAIAE6AAMgA0EEayABOgAAIAJBCUkNACAAQQAgAGtBA3EiBGoiAyABQf8BcUGBgoQIbCIBNgIAIAMgAiAEa0F8cSIEaiICQQRrIAE2AgAgBEEJSQ0AIAMgATYCCCADIAE2AgQgAkEIayABNgIAIAJBDGsgATYCACAEQRlJDQAgAyABNgIYIAMgATYCFCADIAE2AhAgAyABNgIMIAJBEGsgATYCACACQRRrIAE2AgAgAkEYayABNgIAIAJBHGsgATYCACAEIANBBHFBGHIiBGsiAkEgSQ0AIAGtQoGAgIAQfiEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkEgayICQR9LDQALCyAAC4AEAQN/IAJBgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAA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IQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////////8HWARAA0AgBEEBayEEIAFCgICAgICAgARUIQUgAUIBhiEBIAUNAAsLIAJCgICAgICAgICAf4MgAU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QsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAuQDIgANAAsLIANBEGokAAtdAQR/IAAoAgAhAgNAIAIsA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CAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNAiAMKAIsIQlBBiADIANBAEgbDAELIAwgBkEdayIJNgIsIAFEAAAAAAAAsEGiIQFBBiADIANBAEgbCyELIAxBMGpBoAJBACAJ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tcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAoAhQLGQAgAUH/AXEEQBACAAsgACgCACgCEEEBcQsYACAAKAIAIgAgAC0ACEH+AXEgAXI6AAgLJgAgASAAKAIAIgAoAhRHBEAgACABNgIUIAAgACgCDEEBajYCDAsLkgEBAn8jAEEQayICJAAgACgCACEAIAFDAAAAAGAEQCABIAAqAhhc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wAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT",!fe(Ie)){var et=Ie;Ie=r.locateFile?r.locateFile(et,u):u+et}function ke(){var Q=Ie;try{if(Q==Ie&&C)return new Uint8Array(C);if(fe(Q))try{var _=CA(Q.slice(37)),U=new Uint8Array(_.length);for(Q=0;Q<_.length;++Q)U[Q]=_.charCodeAt(Q);var H=U}catch{throw Error("Converting base64 string to bytes failed.")}else H=void 0;var re=H;if(re)return re;throw"both async and sync fetching of the wasm failed"}catch(de){ae(de)}}function ft(){return C||typeof fetch!="function"?Promise.resolve().then(function(){return ke()}):fetch(Ie,{credentials:"same-origin"}).then(function(Q){if(!Q.ok)throw"failed to load wasm binary file at '"+Ie+"'";return Q.arrayBuffer()}).catch(function(){return ke()})}function pt(Q){for(;0=_?"_"+Q:Q}function Ze(Q,_){return Q=Pe(Q),function(){return _.apply(this,arguments)}}var V=[{},{value:void 0},{value:null},{value:!0},{value:!1}],ce=[];function Ce(Q){var _=Error,U=Ze(Q,function(H){this.name=Q,this.message=H,H=Error(H).stack,H!==void 0&&(this.stack=this.toString()+` -`+H.replace(/^Error(:[^\n]*)?\n/,""))});return U.prototype=Object.create(_.prototype),U.prototype.constructor=U,U.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},U}var tt=void 0;function Ye(Q){throw new tt(Q)}var Qt=Q=>(Q||Ye("Cannot use deleted val. handle = "+Q),V[Q].value),ut=Q=>{switch(Q){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var _=ce.length?ce.pop():V.length;return V[_]={ga:1,value:Q},_}},mt=void 0,vt=void 0;function je(Q){for(var _="";oe[Q];)_+=vt[oe[Q++]];return _}var Br=[];function Ar(){for(;Br.length;){var Q=Br.pop();Q.M.$=!1,Q.delete()}}var yr=void 0,Ur={};function K(Q,_){for(_===void 0&&Ye("ptr should not be undefined");Q.R;)_=Q.ba(_),Q=Q.R;return _}var Ae={};function rt(Q){Q=Ko(Q);var _=je(Q);return Wt(Q),_}function dt(Q,_){var U=Ae[Q];return U===void 0&&Ye(_+" has unknown type "+rt(Q)),U}function Ft(){}var _t=!1;function Xt(Q){--Q.count.value,Q.count.value===0&&(Q.T?Q.U.W(Q.T):Q.P.N.W(Q.O))}function or(Q,_,U){return _===U?Q:U.R===void 0?null:(Q=or(Q,_,U.R),Q===null?null:U.na(Q))}var ir={};function tn(Q,_){return _=K(Q,_),Ur[_]}var Ss=void 0;function Uo(Q){throw new Ss(Q)}function Wn(Q,_){return _.P&&_.O||Uo("makeClassHandle requires ptr and ptrType"),!!_.U!=!!_.T&&Uo("Both smartPtrType and smartPtr must be specified"),_.count={value:1},xn(Object.create(Q,{M:{value:_}}))}function xn(Q){return typeof FinalizationRegistry>"u"?(xn=_=>_,Q):(_t=new FinalizationRegistry(_=>{Xt(_.M)}),xn=_=>{var U=_.M;return U.T&&_t.register(_,{M:U},_),_},Ft=_=>{_t.unregister(_)},xn(Q))}var Ai={};function ai(Q){for(;Q.length;){var _=Q.pop();Q.pop()(_)}}function Go(Q){return this.fromWireType(X[Q>>2])}var kn={},li={};function Xr(Q,_,U){function H(Fe){Fe=U(Fe),Fe.length!==Q.length&&Uo("Mismatched type converter count");for(var We=0;We{Ae.hasOwnProperty(Fe)?re[We]=Ae[Fe]:(de.push(Fe),kn.hasOwnProperty(Fe)||(kn[Fe]=[]),kn[Fe].push(()=>{re[We]=Ae[Fe],++Re,Re===de.length&&H(re)}))}),de.length===0&&H(re)}function As(Q){switch(Q){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+Q)}}function ro(Q,_,U={}){if(!("argPackAdvance"in _))throw new TypeError("registerType registeredInstance requires argPackAdvance");var H=_.name;if(Q||Ye('type "'+H+'" must have a positive integer typeid pointer'),Ae.hasOwnProperty(Q)){if(U.ua)return;Ye("Cannot register type '"+H+"' twice")}Ae[Q]=_,delete li[Q],kn.hasOwnProperty(Q)&&(_=kn[Q],delete kn[Q],_.forEach(re=>re()))}function as(Q){Ye(Q.M.P.N.name+" instance already deleted")}function po(){}function _s(Q,_,U){if(Q[_].S===void 0){var H=Q[_];Q[_]=function(){return Q[_].S.hasOwnProperty(arguments.length)||Ye("Function '"+U+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+Q[_].S+")!"),Q[_].S[arguments.length].apply(this,arguments)},Q[_].S=[],Q[_].S[H.Z]=H}}function ui(Q,_){r.hasOwnProperty(Q)?(Ye("Cannot register public name '"+Q+"' twice"),_s(r,Q,Q),r.hasOwnProperty(void 0)&&Ye("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),r[Q].S[void 0]=_):r[Q]=_}function Fi(Q,_,U,H,re,de,Re,Fe){this.name=Q,this.constructor=_,this.X=U,this.W=H,this.R=re,this.pa=de,this.ba=Re,this.na=Fe,this.ja=[]}function Qo(Q,_,U){for(;_!==U;)_.ba||Ye("Expected null or instance of "+U.name+", got an instance of "+_.name),Q=_.ba(Q),_=_.R;return Q}function EA(Q,_){return _===null?(this.ea&&Ye("null is not a valid "+this.name),0):(_.M||Ye('Cannot pass "'+dr(_)+'" as a '+this.name),_.M.O||Ye("Cannot pass deleted object as a pointer of type "+this.name),Qo(_.M.O,_.M.P.N,this.N))}function ls(Q,_){if(_===null){if(this.ea&&Ye("null is not a valid "+this.name),this.da){var U=this.fa();return Q!==null&&Q.push(this.W,U),U}return 0}if(_.M||Ye('Cannot pass "'+dr(_)+'" as a '+this.name),_.M.O||Ye("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&_.M.P.ca&&Ye("Cannot convert argument of type "+(_.M.U?_.M.U.name:_.M.P.name)+" to parameter type "+this.name),U=Qo(_.M.O,_.M.P.N,this.N),this.da)switch(_.M.T===void 0&&Ye("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:_.M.U===this?U=_.M.T:Ye("Cannot convert argument of type "+(_.M.U?_.M.U.name:_.M.P.name)+" to parameter type "+this.name);break;case 1:U=_.M.T;break;case 2:if(_.M.U===this)U=_.M.T;else{var H=_.clone();U=this.xa(U,ut(function(){H.delete()})),Q!==null&&Q.push(this.W,U)}break;default:Ye("Unsupporting sharing policy")}return U}function Ho(Q,_){return _===null?(this.ea&&Ye("null is not a valid "+this.name),0):(_.M||Ye('Cannot pass "'+dr(_)+'" as a '+this.name),_.M.O||Ye("Cannot pass deleted object as a pointer of type "+this.name),_.M.P.ca&&Ye("Cannot convert argument of type "+_.M.P.name+" to parameter type "+this.name),Qo(_.M.O,_.M.P.N,this.N))}function Nn(Q,_,U,H){this.name=Q,this.N=_,this.ea=U,this.ca=H,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,_.R!==void 0?this.toWireType=ls:(this.toWireType=H?EA:Ho,this.V=null)}function vo(Q,_){r.hasOwnProperty(Q)||Uo("Replacing nonexistant public symbol"),r[Q]=_,r[Q].Z=void 0}function Rs(Q,_){var U=[];return function(){if(U.length=0,Object.assign(U,arguments),Q.includes("j")){var H=r["dynCall_"+Q];H=U&&U.length?H.apply(null,[_].concat(U)):H.call(null,_)}else H=Le.get(_).apply(null,U);return H}}function wr(Q,_){Q=je(Q);var U=Q.includes("j")?Rs(Q,_):Le.get(_);return typeof U!="function"&&Ye("unknown function pointer with signature "+Q+": "+_),U}var us=void 0;function Se(Q,_){function U(de){re[de]||Ae[de]||(li[de]?li[de].forEach(U):(H.push(de),re[de]=!0))}var H=[],re={};throw _.forEach(U),new us(Q+": "+H.map(rt).join([", "]))}function Te(Q,_,U,H,re){var de=_.length;2>de&&Ye("argTypes array size mismatch! Must at least get return value and 'this' types!");var Re=_[1]!==null&&U!==null,Fe=!1;for(U=1;U<_.length;++U)if(_[U]!==null&&_[U].V===void 0){Fe=!0;break}var We=_[0].name!=="void",xe=de-2,$e=Array(xe),Bt=[],Vt=[];return function(){if(arguments.length!==xe&&Ye("function "+Q+" called with "+arguments.length+" arguments, expected "+xe+" args!"),Vt.length=0,Bt.length=Re?2:1,Bt[0]=re,Re){var _r=_[1].toWireType(Vt,this);Bt[1]=_r}for(var qt=0;qt>2]);return U}function Ut(Q){4>2])};case 3:return function(U){return this.fromWireType(he[U>>3])};default:throw new TypeError("Unknown float type: "+Q)}}function Zt(Q,_,U){switch(_){case 0:return U?function(H){return ne[H]}:function(H){return oe[H]};case 1:return U?function(H){return $[H>>1]}:function(H){return J[H>>1]};case 2:return U?function(H){return X[H>>2]}:function(H){return Z[H>>2]};default:throw new TypeError("Unknown integer type: "+Q)}}function cr(Q,_){for(var U="",H=0;!(H>=_/2);++H){var re=$[Q+2*H>>1];if(re==0)break;U+=String.fromCharCode(re)}return U}function Yt(Q,_,U){if(U===void 0&&(U=2147483647),2>U)return 0;U-=2;var H=_;U=U<2*Q.length?U/2:Q.length;for(var re=0;re>1]=Q.charCodeAt(re),_+=2;return $[_>>1]=0,_-H}function rn(Q){return 2*Q.length}function Pu(Q,_){for(var U=0,H="";!(U>=_/4);){var re=X[Q+4*U>>2];if(re==0)break;++U,65536<=re?(re-=65536,H+=String.fromCharCode(55296|re>>10,56320|re&1023)):H+=String.fromCharCode(re)}return H}function ea(Q,_,U){if(U===void 0&&(U=2147483647),4>U)return 0;var H=_;U=H+U-4;for(var re=0;re=de){var Re=Q.charCodeAt(++re);de=65536+((de&1023)<<10)|Re&1023}if(X[_>>2]=de,_+=4,_+4>U)break}return X[_>>2]=0,_-H}function bf(Q){for(var _=0,U=0;U=H&&++U,_+=4}return _}var Uu={};function Gu(Q){var _=Uu[Q];return _===void 0?je(Q):_}var Fs=[];function mA(Q){var _=Fs.length;return Fs.push(Q),_}function IA(Q,_){for(var U=Array(Q),H=0;H>2],"parameter "+H);return U}var bi=[],ta=[null,[],[]];tt=r.BindingError=Ce("BindingError"),r.count_emval_handles=function(){for(var Q=0,_=5;_Wo;++Wo)hA[Wo]=String.fromCharCode(Wo);vt=hA,r.getInheritedInstanceCount=function(){return Object.keys(Ur).length},r.getLiveInheritedInstances=function(){var Q=[],_;for(_ in Ur)Ur.hasOwnProperty(_)&&Q.push(Ur[_]);return Q},r.flushPendingDeletes=Ar,r.setDelayFunction=function(Q){yr=Q,Br.length&&yr&&yr(Ar)},Ss=r.InternalError=Ce("InternalError"),po.prototype.isAliasOf=function(Q){if(!(this instanceof po&&Q instanceof po))return!1;var _=this.M.P.N,U=this.M.O,H=Q.M.P.N;for(Q=Q.M.O;_.R;)U=_.ba(U),_=_.R;for(;H.R;)Q=H.ba(Q),H=H.R;return _===H&&U===Q},po.prototype.clone=function(){if(this.M.O||as(this),this.M.aa)return this.M.count.value+=1,this;var Q=xn,_=Object,U=_.create,H=Object.getPrototypeOf(this),re=this.M;return Q=Q(U.call(_,H,{M:{value:{count:re.count,$:re.$,aa:re.aa,O:re.O,P:re.P,T:re.T,U:re.U}}})),Q.M.count.value+=1,Q.M.$=!1,Q},po.prototype.delete=function(){this.M.O||as(this),this.M.$&&!this.M.aa&&Ye("Object already scheduled for deletion"),Ft(this),Xt(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},po.prototype.isDeleted=function(){return!this.M.O},po.prototype.deleteLater=function(){return this.M.O||as(this),this.M.$&&!this.M.aa&&Ye("Object already scheduled for deletion"),Br.push(this),Br.length===1&&yr&&yr(Ar),this.M.$=!0,this},Nn.prototype.qa=function(Q){return this.ka&&(Q=this.ka(Q)),Q},Nn.prototype.ha=function(Q){this.W&&this.W(Q)},Nn.prototype.argPackAdvance=8,Nn.prototype.readValueFromPointer=Go,Nn.prototype.deleteObject=function(Q){Q!==null&&Q.delete()},Nn.prototype.fromWireType=function(Q){function _(){return this.da?Wn(this.N.X,{P:this.wa,O:U,U:this,T:Q}):Wn(this.N.X,{P:this,O:Q})}var U=this.qa(Q);if(!U)return this.ha(Q),null;var H=tn(this.N,U);if(H!==void 0)return H.M.count.value===0?(H.M.O=U,H.M.T=Q,H.clone()):(H=H.clone(),this.ha(Q),H);if(H=this.N.pa(U),H=ir[H],!H)return _.call(this);H=this.ca?H.la:H.pointerType;var re=or(U,this.N,H.N);return re===null?_.call(this):this.da?Wn(H.N.X,{P:H,O:re,U:this,T:Q}):Wn(H.N.X,{P:H,O:re})},us=r.UnboundTypeError=Ce("UnboundTypeError");var CA=typeof atob=="function"?atob:function(Q){var _="",U=0;Q=Q.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++)),re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++)),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++)),Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++));H=H<<2|re>>4,re=(re&15)<<4|de>>2;var Fe=(de&3)<<6|Re;_+=String.fromCharCode(H),de!==64&&(_+=String.fromCharCode(re)),Re!==64&&(_+=String.fromCharCode(Fe))}while(URe.ta).concat(re.map(Re=>Re.za));Xr([Q],de,Re=>{var Fe={};return re.forEach((We,xe)=>{var $e=Re[xe],Bt=We.ra,Vt=We.sa,_r=Re[xe+re.length],qt=We.ya,mn=We.Aa;Fe[We.oa]={read:Kn=>$e.fromWireType(Bt(Vt,Kn)),write:(Kn,BA)=>{var Jo=[];qt(mn,Kn,_r.toWireType(Jo,BA)),ai(Jo)}}}),[{name:_.name,fromWireType:function(We){var xe={},$e;for($e in Fe)xe[$e]=Fe[$e].read(We);return H(We),xe},toWireType:function(We,xe){for(var $e in Fe)if(!($e in xe))throw new TypeError('Missing field: "'+$e+'"');var Bt=U();for($e in Fe)Fe[$e].write(Bt,xe[$e]);return We!==null&&We.push(H,Bt),Bt},argPackAdvance:8,readValueFromPointer:Go,V:H}]})},v:function(){},B:function(Q,_,U,H,re){var de=As(U);_=je(_),ro(Q,{name:_,fromWireType:function(Re){return!!Re},toWireType:function(Re,Fe){return Fe?H:re},argPackAdvance:8,readValueFromPointer:function(Re){if(U===1)var Fe=ne;else if(U===2)Fe=$;else if(U===4)Fe=X;else throw new TypeError("Unknown boolean type size: "+_);return this.fromWireType(Fe[Re>>de])},V:null})},f:function(Q,_,U,H,re,de,Re,Fe,We,xe,$e,Bt,Vt){$e=je($e),de=wr(re,de),Fe&&(Fe=wr(Re,Fe)),xe&&(xe=wr(We,xe)),Vt=wr(Bt,Vt);var _r=Pe($e);ui(_r,function(){Se("Cannot construct "+$e+" due to unbound types",[H])}),Xr([Q,_,U],H?[H]:[],function(qt){if(qt=qt[0],H)var mn=qt.N,Kn=mn.X;else Kn=po.prototype;qt=Ze(_r,function(){if(Object.getPrototypeOf(this)!==BA)throw new tt("Use 'new' to construct "+$e);if(Jo.Y===void 0)throw new tt($e+" has no accessible constructor");var nl=Jo.Y[arguments.length];if(nl===void 0)throw new tt("Tried to invoke ctor of "+$e+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(Jo.Y).toString()+") parameters instead!");return nl.apply(this,arguments)});var BA=Object.create(Kn,{constructor:{value:qt}});qt.prototype=BA;var Jo=new Fi($e,qt,BA,Vt,mn,de,Fe,xe);mn=new Nn($e,Jo,!0,!1),Kn=new Nn($e+"*",Jo,!1,!1);var ra=new Nn($e+" const*",Jo,!1,!0);return ir[Q]={pointerType:Kn,la:ra},vo(_r,qt),[mn,Kn,ra]})},d:function(Q,_,U,H,re,de,Re){var Fe=ze(U,H);_=je(_),de=wr(re,de),Xr([],[Q],function(We){function xe(){Se("Cannot call "+$e+" due to unbound types",Fe)}We=We[0];var $e=We.name+"."+_;_.startsWith("@@")&&(_=Symbol[_.substring(2)]);var Bt=We.N.constructor;return Bt[_]===void 0?(xe.Z=U-1,Bt[_]=xe):(_s(Bt,_,$e),Bt[_].S[U-1]=xe),Xr([],Fe,function(Vt){return Vt=Te($e,[Vt[0],null].concat(Vt.slice(1)),null,de,Re),Bt[_].S===void 0?(Vt.Z=U-1,Bt[_]=Vt):Bt[_].S[U-1]=Vt,[]}),[]})},p:function(Q,_,U,H,re,de){0<_||ae();var Re=ze(_,U);re=wr(H,re),Xr([],[Q],function(Fe){Fe=Fe[0];var We="constructor "+Fe.name;if(Fe.N.Y===void 0&&(Fe.N.Y=[]),Fe.N.Y[_-1]!==void 0)throw new tt("Cannot register multiple constructors with identical number of parameters ("+(_-1)+") for class '"+Fe.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return Fe.N.Y[_-1]=()=>{Se("Cannot construct "+Fe.name+" due to unbound types",Re)},Xr([],Re,function(xe){return xe.splice(1,0,null),Fe.N.Y[_-1]=Te(We,xe,null,re,de),[]}),[]})},a:function(Q,_,U,H,re,de,Re,Fe){var We=ze(U,H);_=je(_),de=wr(re,de),Xr([],[Q],function(xe){function $e(){Se("Cannot call "+Bt+" due to unbound types",We)}xe=xe[0];var Bt=xe.name+"."+_;_.startsWith("@@")&&(_=Symbol[_.substring(2)]),Fe&&xe.N.ja.push(_);var Vt=xe.N.X,_r=Vt[_];return _r===void 0||_r.S===void 0&&_r.className!==xe.name&&_r.Z===U-2?($e.Z=U-2,$e.className=xe.name,Vt[_]=$e):(_s(Vt,_,Bt),Vt[_].S[U-2]=$e),Xr([],We,function(qt){return qt=Te(Bt,qt,xe,de,Re),Vt[_].S===void 0?(qt.Z=U-2,Vt[_]=qt):Vt[_].S[U-2]=qt,[]}),[]})},A:function(Q,_){_=je(_),ro(Q,{name:_,fromWireType:function(U){var H=Qt(U);return Ut(U),H},toWireType:function(U,H){return ut(H)},argPackAdvance:8,readValueFromPointer:Go,V:null})},n:function(Q,_,U){U=As(U),_=je(_),ro(Q,{name:_,fromWireType:function(H){return H},toWireType:function(H,re){return re},argPackAdvance:8,readValueFromPointer:at(_,U),V:null})},e:function(Q,_,U,H,re){_=je(_),re===-1&&(re=4294967295),re=As(U);var de=Fe=>Fe;if(H===0){var Re=32-8*U;de=Fe=>Fe<>>Re}U=_.includes("unsigned")?function(Fe,We){return We>>>0}:function(Fe,We){return We},ro(Q,{name:_,fromWireType:de,toWireType:U,argPackAdvance:8,readValueFromPointer:Zt(_,re,H!==0),V:null})},b:function(Q,_,U){function H(de){de>>=2;var Re=Z;return new re(G,Re[de+1],Re[de])}var re=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][_];U=je(U),ro(Q,{name:U,fromWireType:H,argPackAdvance:8,readValueFromPointer:H},{ua:!0})},o:function(Q,_){_=je(_);var U=_==="std::string";ro(Q,{name:_,fromWireType:function(H){var re=Z[H>>2],de=H+4;if(U)for(var Re=de,Fe=0;Fe<=re;++Fe){var We=de+Fe;if(Fe==re||oe[We]==0){if(Re=Re?O(oe,Re,We-Re):"",xe===void 0)var xe=Re;else xe+="\0",xe+=Re;Re=We+1}}else{for(xe=Array(re),Fe=0;Fe=We?Fe++:2047>=We?Fe+=2:55296<=We&&57343>=We?(Fe+=4,++de):Fe+=3}de=Fe}else de=re.length;if(Fe=ar(4+de+1),We=Fe+4,Z[Fe>>2]=de,U&&Re){if(Re=We,We=de+1,de=oe,0=$e){var Bt=re.charCodeAt(++xe);$e=65536+(($e&1023)<<10)|Bt&1023}if(127>=$e){if(Re>=We)break;de[Re++]=$e}else{if(2047>=$e){if(Re+1>=We)break;de[Re++]=192|$e>>6}else{if(65535>=$e){if(Re+2>=We)break;de[Re++]=224|$e>>12}else{if(Re+3>=We)break;de[Re++]=240|$e>>18,de[Re++]=128|$e>>12&63}de[Re++]=128|$e>>6&63}de[Re++]=128|$e&63}}de[Re]=0}}else if(Re)for(Re=0;ReJ,Fe=1;else _===4&&(H=Pu,re=ea,de=bf,Re=()=>Z,Fe=2);ro(Q,{name:U,fromWireType:function(We){for(var xe=Z[We>>2],$e=Re(),Bt,Vt=We+4,_r=0;_r<=xe;++_r){var qt=We+4+_r*_;(_r==xe||$e[qt>>Fe]==0)&&(Vt=H(Vt,qt-Vt),Bt===void 0?Bt=Vt:(Bt+="\0",Bt+=Vt),Vt=qt+_)}return Wt(We),Bt},toWireType:function(We,xe){typeof xe!="string"&&Ye("Cannot pass non-string to C++ string type "+U);var $e=de(xe),Bt=ar(4+$e+_);return Z[Bt>>2]=$e>>Fe,re(xe,Bt+4,$e+_),We!==null&&We.push(Wt,Bt),Bt},argPackAdvance:8,readValueFromPointer:Go,V:function(We){Wt(We)}})},k:function(Q,_,U,H,re,de){Ai[Q]={name:je(_),fa:wr(U,H),W:wr(re,de),ia:[]}},h:function(Q,_,U,H,re,de,Re,Fe,We,xe){Ai[Q].ia.push({oa:je(_),ta:U,ra:wr(H,re),sa:de,za:Re,ya:wr(Fe,We),Aa:xe})},C:function(Q,_){_=je(_),ro(Q,{va:!0,name:_,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(Q,_,U,H,re){Q=Fs[Q],_=Qt(_),U=Gu(U);var de=[];return Z[H>>2]=ut(de),Q(_,U,de,re)},t:function(Q,_,U,H){Q=Fs[Q],_=Qt(_),U=Gu(U),Q(_,U,null,H)},g:Ut,m:function(Q,_){var U=IA(Q,_),H=U[0];_=H.name+"_$"+U.slice(1).map(function(Re){return Re.name}).join("_")+"$";var re=bi[_];if(re!==void 0)return re;var de=Array(Q-1);return re=mA((Re,Fe,We,xe)=>{for(var $e=0,Bt=0;Bt>>=0,2147483648=U;U*=2){var H=_*(1+.2/U);H=Math.min(H,Q+100663296);var re=Math;H=Math.max(Q,H),re=re.min.call(re,2147483648,H+(65536-H%65536)%65536);e:{try{D.grow(re-G.byteLength+65535>>>16),ue();var de=1;break e}catch{}de=void 0}if(de)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(Q,_,U,H){for(var re=0,de=0;de>2],Fe=Z[_+4>>2];_+=8;for(var We=0;We>2]=re,0}};(function(){function Q(re){r.asm=re.exports,D=r.asm.E,ue(),Le=r.asm.J,ct.unshift(r.asm.F),se--,r.monitorRunDependencies&&r.monitorRunDependencies(se),se==0&&(N!==null&&(clearInterval(N),N=null),W&&(re=W,W=null,re()))}function _(re){Q(re.instance)}function U(re){return ft().then(function(de){return WebAssembly.instantiate(de,H)}).then(function(de){return de}).then(re,function(de){I("failed to asynchronously prepare wasm: "+de),ae(de)})}var H={a:xi};if(se++,r.monitorRunDependencies&&r.monitorRunDependencies(se),r.instantiateWasm)try{return r.instantiateWasm(H,Q)}catch(re){I("Module.instantiateWasm callback failed with error: "+re),s(re)}return(function(){return C||typeof WebAssembly.instantiateStreaming!="function"||fe(Ie)||typeof fetch!="function"?U(_):fetch(Ie,{credentials:"same-origin"}).then(function(re){return WebAssembly.instantiateStreaming(re,H).then(_,function(de){return I("wasm streaming compile failed: "+de),I("falling back to ArrayBuffer instantiation"),U(_)})})})().catch(s),{}})(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.F).apply(null,arguments)};var Ko=r.___getTypeName=function(){return(Ko=r.___getTypeName=r.asm.G).apply(null,arguments)};r.__embind_initialize_bindings=function(){return(r.__embind_initialize_bindings=r.asm.H).apply(null,arguments)};var ar=r._malloc=function(){return(ar=r._malloc=r.asm.I).apply(null,arguments)},Wt=r._free=function(){return(Wt=r._free=r.asm.K).apply(null,arguments)};r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.L).apply(null,arguments)};var Sr;W=function Q(){Sr||Gr(),Sr||(W=Q)};function Gr(){function Q(){if(!Sr&&(Sr=!0,r.calledRun=!0,!R)){if(pt(ct),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var _=r.postRun.shift();De.unshift(_)}pt(De)}}if(!(01?E-1:0),C=1;Ca?e.Node.createWithConfig(a):e.Node.createDefault()),t(e.Node.prototype,"free",function(){e.Node.destroy(this)}),t(e.Node.prototype,"freeRecursive",function(){for(let s=0,a=this.getChildCount();s1&&arguments[1]!==void 0?arguments[1]:NaN,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:$c.LTR;return s.call(this,a,u,E)}),{Config:e.Config,Node:e.Node,...Vh}}var yw=RE(await Kh()),it=yw;var zB=Me(uC(),1),$B=Me(gC(),1);import b_ from"node:process";function PE({onlyFirst:e=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,e?void 0:"g")}var vw=PE();function tf(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(vw,"")}var dC=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],pC=12288,EC=65510,mC=[12288,12288,65281,65376,65504,65510];var IC=4352,hC=262141,UE=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var $g=(e,t)=>{let r=0,i=Math.floor(e.length/2)-1;for(;r<=i;){let s=Math.floor((r+i)/2),a=s*2;if(te[a+1])r=s+1;else return!0}return!1};var CC=19968,[_w,Rw]=Fw(UE);function Fw(e){let t=e[0],r=e[1];for(let i=0;i=s&&CC<=a)return[s,a];a-s>r-t&&(t=s,r=a)}return[t,r]}var BC=e=>e<161||e>1114109?!1:$g(dC,e),rf=e=>eEC?!1:$g(mC,e);var nf=e=>e>=_w&&e<=Rw?!0:ehC?!1:$g(UE,e);function bw(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function DC(e,{ambiguousAsWide:t=!1}={}){return bw(e),rf(e)||nf(e)||t&&BC(e)?2:1}var vC=Me(QC(),1),xw=new Intl.Segmenter,kw=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function dn(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=t;if(i||(e=tf(e)),e.length===0)return 0;let s=0,a={ambiguousAsWide:!r};for(let{segment:u}of xw.segment(e)){let E=u.codePointAt(0);if(!(E<=31||E>=127&&E<=159)&&!(E>=8203&&E<=8207||E===65279)&&!(E>=768&&E<=879||E>=6832&&E<=6911||E>=7616&&E<=7679||E>=8400&&E<=8447||E>=65056&&E<=65071)&&!(E>=55296&&E<=57343)&&!(E>=65024&&E<=65039)&&!kw.test(u)){if((0,vC.default)().test(u)){s+=2;continue}s+=DC(E,a)}}return s}function Pa(e){let t=0;for(let r of e.split(` -`))t=Math.max(t,dn(r));return t}var wC={},Nw=e=>{if(e.length===0)return{width:0,height:0};let t=wC[e];if(t)return t;let r=Pa(e),i=e.split(` -`).length;return wC[e]={width:r,height:i},{width:r,height:i}},GE=Nw;var SC=(e=0)=>t=>`\x1B[${t+e}m`,_C=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,RC=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,Yr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},qx=Object.keys(Yr.modifier),Tw=Object.keys(Yr.color),Ow=Object.keys(Yr.bgColor),zx=[...Tw,...Ow];function Lw(){let e=new Map;for(let[t,r]of Object.entries(Yr)){for(let[i,s]of Object.entries(r))Yr[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=Yr[i],e.set(s[0],s[1]);Object.defineProperty(Yr,t,{value:r,enumerable:!1})}return Object.defineProperty(Yr,"codes",{value:e,enumerable:!1}),Yr.color.close="\x1B[39m",Yr.bgColor.close="\x1B[49m",Yr.color.ansi=SC(),Yr.color.ansi256=_C(),Yr.color.ansi16m=RC(),Yr.bgColor.ansi=SC(10),Yr.bgColor.ansi256=_C(10),Yr.bgColor.ansi16m=RC(10),Object.defineProperties(Yr,{rgbToAnsi256:{value(t,r,i){return t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(a=>a+a).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>Yr.rgbToAnsi256(...Yr.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,s;if(t>=232)r=((t-232)*10+8)/255,i=r,s=r;else{t-=16;let E=t%36;r=Math.floor(t/36)/5,i=Math.floor(E/6)/5,s=E%6/5}let a=Math.max(r,i,s)*2;if(a===0)return 30;let u=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return a===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>Yr.ansi256ToAnsi(Yr.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>Yr.ansi256ToAnsi(Yr.hexToAnsi256(t)),enumerable:!1}}),Yr}var Mw=Lw(),Vr=Mw;var Zg=new Set(["\x1B","\x9B"]),Pw=39,WE="\x07",xC="[",Uw="]",kC="m",Xg=`${Uw}8;;`,FC=e=>`${Zg.values().next().value}${xC}${e}${kC}`,bC=e=>`${Zg.values().next().value}${Xg}${e}${WE}`,Gw=e=>e.split(" ").map(t=>dn(t)),HE=(e,t,r)=>{let i=[...t],s=!1,a=!1,u=dn(tf(e.at(-1)));for(let[E,I]of i.entries()){let C=dn(I);if(u+C<=r?e[e.length-1]+=I:(e.push(I),u=0),Zg.has(I)&&(s=!0,a=i.slice(E+1,E+1+Xg.length).join("")===Xg),s){a?I===WE&&(s=!1,a=!1):I===kC&&(s=!1);continue}u+=C,u===r&&E0&&e.length>1&&(e[e.length-2]+=e.pop())},Hw=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(dn(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Ww=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",s,a,u=Gw(e),E=[""];for(let[D,R]of e.split(" ").entries()){r.trim!==!1&&(E[E.length-1]=E.at(-1).trimStart());let O=dn(E.at(-1));if(D!==0&&(O>=t&&(r.wordWrap===!1||r.trim===!1)&&(E.push(""),O=0),(O>0||r.trim===!1)&&(E[E.length-1]+=" ",O++)),r.hard&&u[D]>t){let G=t-O,ne=1+Math.floor((u[D]-G-1)/t);Math.floor((u[D]-1)/t)t&&O>0&&u[D]>0){if(r.wordWrap===!1&&Ot&&r.wordWrap===!1){HE(E,R,t);continue}E[E.length-1]+=R}r.trim!==!1&&(E=E.map(D=>Hw(D)));let I=E.join(` -`),C=[...I],y=0;for(let[D,R]of C.entries()){if(i+=R,Zg.has(R)){let{groups:G}=new RegExp(`(?:\\${xC}(?\\d+)m|\\${Xg}(?.*)${WE})`).exec(I.slice(y))||{groups:{}};if(G.code!==void 0){let ne=Number.parseFloat(G.code);s=ne===Pw?void 0:ne}else G.uri!==void 0&&(a=G.uri.length===0?void 0:G.uri)}let O=Vr.codes.get(Number(s));C[D+1]===` -`?(a&&(i+=bC("")),s&&O&&(i+=FC(O))):R===` -`&&(s&&O&&(i+=FC(s)),a&&(i+=bC(a))),y+=R.length}return i};function KE(e,t,r){return String(e).normalize().replaceAll(`\r +`).join("")}captureString(t,r=this.captureString){typeof t=="function"&&(r=t,t=1/0);let{stackTraceLimit:i}=Error;t&&(Error.stackTraceLimit=t);let s={};Error.captureStackTrace(s,r);let{stack:a}=s;return Error.stackTraceLimit=i,this.clean(a)}capture(t,r=this.capture){typeof t=="function"&&(r=t,t=1/0);let{prepareStackTrace:i,stackTraceLimit:s}=Error;Error.prepareStackTrace=(E,I)=>this._wrapCallSite?I.map(this._wrapCallSite):I,t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,r);let{stack:u}=a;return Object.assign(Error,{prepareStackTrace:i,stackTraceLimit:s}),u}at(t=this.at){let[r]=this.capture(1,t);if(!r)return{};let i={line:r.getLineNumber(),column:r.getColumnNumber()};qD(i,r.getFileName(),this._cwd),r.isConstructor()&&Object.defineProperty(i,"constructor",{value:!0,configurable:!0}),r.isEval()&&(i.evalOrigin=r.getEvalOrigin()),r.isNative()&&(i.native=!0);let s;try{s=r.getTypeName()}catch{}s&&s!=="Object"&&s!=="[object Object]"&&(i.type=s);let a=r.getFunctionName();a&&(i.function=a);let u=r.getMethodName();return u&&a!==u&&(i.method=u),i}parseLine(t){let r=t&&t.match(kR);if(!r)return null;let i=r[1]==="new",s=r[2],a=r[3],u=r[4],E=Number(r[5]),I=Number(r[6]),h=r[7],y=r[8],D=r[9],R=r[10]==="native",O=r[11]===")",G,ne={};if(y&&(ne.line=Number(y)),D&&(ne.column=Number(D)),O&&h){let oe=0;for(let $=h.length-1;$>0;$--)if(h.charAt($)===")")oe++;else if(h.charAt($)==="("&&h.charAt($-1)===" "&&(oe--,oe===-1&&h.charAt($-1)===" ")){let Z=h.slice(0,$-1);h=h.slice($+1),s+=` (${Z}`;break}}if(s){let oe=s.match(NR);oe&&(s=oe[1],G=oe[2])}return qD(ne,h,this._cwd),i&&Object.defineProperty(ne,"constructor",{value:!0,configurable:!0}),a&&(ne.evalOrigin=a,ne.evalLine=E,ne.evalColumn=I,ne.evalFile=u&&u.replace(/\\/g,"/")),R&&(ne.native=!0),s&&(ne.function=s),G&&s!==G&&(ne.method=G),ne}};function qD(e,t,r){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${r}/`)&&(t=t.slice(r.length+1)),e.file=t)}function xR(e){if(e.length===0)return[];let t=e.map(r=>bR(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var kR=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),NR=/^(.*?) \[as (.*?)\]$/;$D.exports=Mm});var Ny=nr(Xd=>{"use strict";var Fb=jt(),xb=Symbol.for("react.element"),kb=Symbol.for("react.fragment"),Nb=Object.prototype.hasOwnProperty,Tb=Fb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ob={key:!0,ref:!0,__self:!0,__source:!0};function ky(e,t,r){var i,s={},a=null,u=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(u=t.ref);for(i in t)Nb.call(t,i)&&!Ob.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:xb,type:e,key:a,ref:u,props:s,_owner:Tb.current}}Xd.Fragment=kb;Xd.jsx=ky;Xd.jsxs=ky});var Pt=nr((KL,Ty)=>{"use strict";Ty.exports=Ny()});var wn=Le(jt(),1);import{Stream as KR}from"node:stream";import Gd from"node:process";var sy=Le(jt(),1);import WR from"node:process";function bh(e,t,{signal:r,edges:i}={}){let s,a=null,u=i!=null&&i.includes("leading"),E=i==null||i.includes("trailing"),I=()=>{a!==null&&(e.apply(s,a),s=void 0,a=null)},h=()=>{E&&I(),O()},y=null,D=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,h()},t)},R=()=>{y!==null&&(clearTimeout(y),y=null)},O=()=>{R(),s=void 0,a=null},G=()=>{I()},ne=function(...oe){if(r?.aborted)return;s=this,a=oe;let $=y==null;D(),u&&$&&I()};return ne.schedule=D,ne.cancel=O,ne.flush=G,r?.addEventListener("abort",O,{once:!0}),ne}function Fh(e,t=0,r={}){typeof r!="object"&&(r={});let{leading:i=!1,trailing:s=!0,maxWait:a}=r,u=Array(2);i&&(u[0]="leading"),s&&(u[1]="trailing");let E,I=null,h=bh(function(...R){E=e.apply(this,R),I=null},t,{edges:u}),y=function(...R){return a!=null&&(I===null&&(I=Date.now()),Date.now()-I>=a)?(E=e.apply(this,R),I=Date.now(),h.cancel(),h.schedule(),E):(h.apply(this,R),E)},D=()=>(h.flush(),E);return y.cancel=h.cancel,y.flush=D,y}function Gg(e,t=0,r={}){let{leading:i=!0,trailing:s=!0}=r;return Fh(e,t,{leading:i,maxWait:t,trailing:s})}var ko={};ww(ko,{ConEmu:()=>Ph,beep:()=>mv,beginSynchronizedOutput:()=>Oh,clearScreen:()=>uv,clearTerminal:()=>gv,clearViewport:()=>cv,cursorBackward:()=>qw,cursorDown:()=>Yw,cursorForward:()=>Vw,cursorGetPosition:()=>Xw,cursorHide:()=>tv,cursorLeft:()=>Nh,cursorMove:()=>jw,cursorNextLine:()=>Zw,cursorPrevLine:()=>ev,cursorRestorePosition:()=>$w,cursorSavePosition:()=>zw,cursorShow:()=>rv,cursorTo:()=>Jw,cursorUp:()=>kh,endSynchronizedOutput:()=>Lh,enterAlternativeScreen:()=>dv,eraseDown:()=>sv,eraseEndLine:()=>ov,eraseLine:()=>Th,eraseLines:()=>nv,eraseScreen:()=>Hg,eraseStartLine:()=>iv,eraseUp:()=>Av,exitAlternativeScreen:()=>pv,iTerm:()=>Mh,image:()=>hv,link:()=>Iv,scrollDown:()=>lv,scrollUp:()=>av,setCwd:()=>Cv,synchronizedOutput:()=>Ev});import iu from"node:process";import Hw from"node:os";var ou=globalThis.window?.document!==void 0,W1=globalThis.process?.versions?.node!==void 0,K1=globalThis.process?.versions?.bun!==void 0,J1=globalThis.Deno?.version?.deno!==void 0,j1=globalThis.process?.versions?.electron!==void 0,Y1=globalThis.navigator?.userAgent?.includes("jsdom")===!0,V1=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,q1=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,z1=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,$1=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,Vc=globalThis.navigator?.userAgentData?.platform,X1=Vc==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",Z1=Vc==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",ex=Vc==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",tx=Vc==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),rx=Vc==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var tr="\x1B[",su="\x1B]",Na="\x07",qc=";",xh=!ou&&iu.env.TERM_PROGRAM==="Apple_Terminal",Ww=!ou&&iu.platform==="win32",Kw=!ou&&(iu.env.TERM?.startsWith("screen")||iu.env.TERM?.startsWith("tmux")||iu.env.TMUX!==void 0),hE=ou?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:iu.cwd,Au=e=>Kw?"\x1BPtmux;"+e.replaceAll("\x1B","\x1B\x1B")+"\x1B\\":e,Jw=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?tr+(e+1)+"G":tr+(t+1)+qc+(e+1)+"H"},jw=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=tr+-e+"D":e>0&&(r+=tr+e+"C"),t<0?r+=tr+-t+"A":t>0&&(r+=tr+t+"B"),r},kh=(e=1)=>tr+e+"A",Yw=(e=1)=>tr+e+"B",Vw=(e=1)=>tr+e+"C",qw=(e=1)=>tr+e+"D",Nh=tr+"G",zw=xh?"\x1B7":tr+"s",$w=xh?"\x1B8":tr+"u",Xw=tr+"6n",Zw=tr+"E",ev=tr+"F",tv=tr+"?25l",rv=tr+"?25h",nv=e=>{let t="";for(let r=0;r{if(ou||!Ww)return!1;let e=Hw.release().split("."),t=Number(e[0]),r=Number(e[2]??0);return t<10||t===10&&r<10586},gv=fv()?`${Hg}${tr}0f`:`${Hg}${tr}3J${tr}H`,dv=tr+"?1049h",pv=tr+"?1049l",Oh=tr+"?2026h",Lh=tr+"?2026l",Ev=e=>Oh+e+Lh,mv=Na,Iv=(e,t)=>{let r=Au(`${su}8${qc}${qc}${t}${Na}`),i=Au(`${su}8${qc}${qc}${Na}`);return r+e+i},hv=(e,t={})=>{let r=`${su}1337;File=inline=1`;t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0");let i=Buffer.from(e);return Au(r+`;size=${i.byteLength}:`+i.toString("base64")+Na)},Mh={setCwd:(e=hE())=>Au(`${su}50;CurrentDir=${e}${Na}`),annotation(e,t={}){let r=`${su}1337;`,i=t.x!==void 0,s=t.y!==void 0;if((i||s)&&!(i&&s&&t.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replaceAll("|",""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(i?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,Au(r+Na)}},Ph={setCwd:(e=hE())=>Au(`${su}9;9;${e}${Na}`)},Cv=(e=hE())=>Mh.setCwd(e)+Ph.setCwd(e);import{env as zc}from"node:process";var Bv=zc.CI!=="0"&&zc.CI!=="false"&&("CI"in zc||"CONTINUOUS_INTEGRATION"in zc||Object.keys(zc).some(e=>e.startsWith("CI_"))),Ta=Bv;var Dv=e=>{let t=new Set;do for(let r of Reflect.ownKeys(e))t.add([e,r]);while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t};function CE(e,{include:t,exclude:r}={}){let i=s=>{let a=u=>typeof u=="string"?s===u:u.test(s);return t?t.some(a):r?!r.some(a):!0};for(let[s,a]of Dv(e.constructor.prototype)){if(a==="constructor"||!i(a))continue;let u=Reflect.getOwnPropertyDescriptor(s,a);u&&typeof u.value=="function"&&(e[a]=e[a].bind(e))}return e}var Ay=Le(yE(),1);import{PassThrough as Jh}from"node:stream";var jh=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],QE={},yv=e=>{let t=new Jh,r=new Jh;t.write=s=>{e("stdout",s)},r.write=s=>{e("stderr",s)};let i=new console.Console(t,r);for(let s of jh)QE[s]=console[s],console[s]=i[s];return()=>{for(let s of jh)console[s]=QE[s];QE={}}},Yh=yv;var Qv=(()=>{var e=import.meta.url;return(function(t){t=t||{};var r;r||(r=typeof t<"u"?t:{});var i,s;r.ready=new Promise(function(Q,_){i=Q,s=_});var a=Object.assign({},r),u="";typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),e&&(u=e),u.indexOf("blob:")!==0?u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):u="";var E=r.print||console.log.bind(console),I=r.printErr||console.warn.bind(console);Object.assign(r,a),a=null;var h;r.wasmBinary&&(h=r.wasmBinary);var y=r.noExitRuntime||!0;typeof WebAssembly!="object"&&se("no native wasm support detected");var D,R=!1;function O(Q,_,U){U=_+U;for(var W="";!(_>=U);){var re=Q[_++];if(!re)break;if(re&128){var pe=Q[_++]&63;if((re&224)==192)W+=String.fromCharCode((re&31)<<6|pe);else{var _e=Q[_++]&63;re=(re&240)==224?(re&15)<<12|pe<<6|_e:(re&7)<<18|pe<<12|_e<<6|Q[_++]&63,65536>re?W+=String.fromCharCode(re):(re-=65536,W+=String.fromCharCode(55296|re>>10,56320|re&1023))}}else W+=String.fromCharCode(re)}return W}var G,ne,oe,$,Z,q,X,fe,Be;function Ae(){var Q=D.buffer;G=Q,r.HEAP8=ne=new Int8Array(Q),r.HEAP16=$=new Int16Array(Q),r.HEAP32=q=new Int32Array(Q),r.HEAPU8=oe=new Uint8Array(Q),r.HEAPU16=Z=new Uint16Array(Q),r.HEAPU32=X=new Uint32Array(Q),r.HEAPF32=fe=new Float32Array(Q),r.HEAPF64=Be=new Float64Array(Q)}var xe,de=[],ft=[],Ye=[];function we(){var Q=r.preRun.shift();de.unshift(Q)}var ie=0,k=null,H=null;function se(Q){throw r.onAbort&&r.onAbort(Q),Q="Aborted("+Q+")",I(Q),R=!0,Q=new WebAssembly.RuntimeError(Q+". Build with -sASSERTIONS for more info."),s(Q),Q}function ge(Q){return Q.startsWith("data:application/octet-stream;base64,")}var Ee;if(Ee="data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f38AYAJ+fwF/YAN/fX0BfWABfAF8YAN/fHwAYAR/f319AGAHf39/fX19fQF9YA1/fX99f31/fX19fX1/AX9gC39/f39/f399fX19AX9gCH9/f39/f319AGAEf39+fgBgB39/f39/f38Bf2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3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jAEEQayIDJAAgA0EIaiAAIAFBAnRB7CVqKAIAIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC1QAAkACQAJAAkACQCACDgQEAAECAwsgACABIAFBwgBqEEMPCyAAIAEgAUHCAGogAxBEDwsgACABIAFBwgBqEEIPCxAkAAsgACABIAFBwgBqIAMQRQsvACAAIAJFQQF0IgIgASADEGAgACACIAEQS5IgACACIAEgAxB/IAAgAiABEFKSkgvOAQIDfwJ9IwBBEGsiAyQAQQEhBCADQQhqIABB/ABqIgUgACABQQF0akH2AGoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIA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CQEGsOy0AAEEBcQRAQag7KAIAIQIMAQtBAUGAJxAMIQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgAUIBhiEBIARBAWsiBEH/B0oNAAtB/wchBAsCQCABQoCAgICAgIAIfSIDQgBTDQAgAyIBQgBSDQAgAEQAAAAAAAAAAKIPCyABQv////////8HWARAA0AgBEEBayEEIAFCgICAgICAgAR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ACKgKUA5MhB0EAIQMLIAIgA0ECdGogByAGkzgCnAMMAQsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcIQQLIAItAAQhAiAERQ0AIAMtAAwgAkH/AXFGDQELIAUgASAGIAIQOQNAIAAtAAAiAUEEcQ0BIAAgAUEEcjoAACAAKAIQIgEEQCAAIAERAAALIABBgICA/gc2ApwBIAAoAu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CAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAVBIHIiDkHhAEYNAiAMKAIsIQlBBiADIANBAEgbDAELIAwgBkEdayIJNgIsIAFEAAAA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C8AABAfQQEhAyACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAoAhQLGQAgAUH/AXEEQBACAAsgACgCACgCEEEBcQsYACAAKAIAIgAgAC0ACEH+AXEgAXI6AAgLJgAgASAAKAIAIgAoAhRHBEAgACABNgIUIAAgACgCDEEBajYCDAsLkgEBAn8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BByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT",!ge(Ee)){var Ze=Ee;Ee=r.locateFile?r.locateFile(Ze,u):u+Ze}function Oe(){var Q=Ee;try{if(Q==Ee&&h)return new Uint8Array(h);if(ge(Q))try{var _=CA(Q.slice(37)),U=new Uint8Array(_.length);for(Q=0;Q<_.length;++Q)U[Q]=_.charCodeAt(Q);var W=U}catch{throw Error("Converting base64 string to bytes failed.")}else W=void 0;var re=W;if(re)return re;throw"both async and sync fetching of the wasm failed"}catch(pe){se(pe)}}function gt(){return h||typeof fetch!="function"?Promise.resolve().then(function(){return Oe()}):fetch(Ee,{credentials:"same-origin"}).then(function(Q){if(!Q.ok)throw"failed to load wasm binary file at '"+Ee+"'";return Q.arrayBuffer()}).catch(function(){return Oe()})}function at(Q){for(;0=_?"_"+Q:Q}function it(Q,_){return Q=Ge(Q),function(){return _.apply(this,arguments)}}var J=[{},{value:void 0},{value:null},{value:!0},{value:!1}],ce=[];function he(Q){var _=Error,U=it(Q,function(W){this.name=Q,this.message=W,W=Error(W).stack,W!==void 0&&(this.stack=this.toString()+` +`+W.replace(/^Error(:[^\n]*)?\n/,""))});return U.prototype=Object.create(_.prototype),U.prototype.constructor=U,U.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},U}var et=void 0;function je(Q){throw new et(Q)}var Qt=Q=>(Q||je("Cannot use deleted val. handle = "+Q),J[Q].value),ct=Q=>{switch(Q){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var _=ce.length?ce.pop():J.length;return J[_]={ga:1,value:Q},_}},mt=void 0,wt=void 0;function Je(Q){for(var _="";oe[Q];)_+=wt[oe[Q++]];return _}var Br=[];function Ar(){for(;Br.length;){var Q=Br.pop();Q.M.$=!1,Q.delete()}}var yr=void 0,Ur={};function K(Q,_){for(_===void 0&&je("ptr should not be undefined");Q.R;)_=Q.ba(_),Q=Q.R;return _}var le={};function tt(Q){Q=Ko(Q);var _=Je(Q);return Wt(Q),_}function pt(Q,_){var U=le[Q];return U===void 0&&je(_+" has unknown type "+tt(Q)),U}function bt(){}var _t=!1;function Xt(Q){--Q.count.value,Q.count.value===0&&(Q.T?Q.U.W(Q.T):Q.P.N.W(Q.O))}function or(Q,_,U){return _===U?Q:U.R===void 0?null:(Q=or(Q,_,U.R),Q===null?null:U.na(Q))}var ir={};function tn(Q,_){return _=K(Q,_),Ur[_]}var Ss=void 0;function Uo(Q){throw new Ss(Q)}function Wn(Q,_){return _.P&&_.O||Uo("makeClassHandle requires ptr and ptrType"),!!_.U!=!!_.T&&Uo("Both smartPtrType and smartPtr must be specified"),_.count={value:1},xn(Object.create(Q,{M:{value:_}}))}function xn(Q){return typeof FinalizationRegistry>"u"?(xn=_=>_,Q):(_t=new FinalizationRegistry(_=>{Xt(_.M)}),xn=_=>{var U=_.M;return U.T&&_t.register(_,{M:U},_),_},bt=_=>{_t.unregister(_)},xn(Q))}var Ai={};function ai(Q){for(;Q.length;){var _=Q.pop();Q.pop()(_)}}function Go(Q){return this.fromWireType(q[Q>>2])}var kn={},li={};function Xr(Q,_,U){function W(Re){Re=U(Re),Re.length!==Q.length&&Uo("Mismatched type converter count");for(var He=0;He{le.hasOwnProperty(Re)?re[He]=le[Re]:(pe.push(Re),kn.hasOwnProperty(Re)||(kn[Re]=[]),kn[Re].push(()=>{re[He]=le[Re],++_e,_e===pe.length&&W(re)}))}),pe.length===0&&W(re)}function As(Q){switch(Q){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+Q)}}function ro(Q,_,U={}){if(!("argPackAdvance"in _))throw new TypeError("registerType registeredInstance requires argPackAdvance");var W=_.name;if(Q||je('type "'+W+'" must have a positive integer typeid pointer'),le.hasOwnProperty(Q)){if(U.ua)return;je("Cannot register type '"+W+"' twice")}le[Q]=_,delete li[Q],kn.hasOwnProperty(Q)&&(_=kn[Q],delete kn[Q],_.forEach(re=>re()))}function as(Q){je(Q.M.P.N.name+" instance already deleted")}function po(){}function _s(Q,_,U){if(Q[_].S===void 0){var W=Q[_];Q[_]=function(){return Q[_].S.hasOwnProperty(arguments.length)||je("Function '"+U+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+Q[_].S+")!"),Q[_].S[arguments.length].apply(this,arguments)},Q[_].S=[],Q[_].S[W.Z]=W}}function ui(Q,_){r.hasOwnProperty(Q)?(je("Cannot register public name '"+Q+"' twice"),_s(r,Q,Q),r.hasOwnProperty(void 0)&&je("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),r[Q].S[void 0]=_):r[Q]=_}function bi(Q,_,U,W,re,pe,_e,Re){this.name=Q,this.constructor=_,this.X=U,this.W=W,this.R=re,this.pa=pe,this.ba=_e,this.na=Re,this.ja=[]}function Qo(Q,_,U){for(;_!==U;)_.ba||je("Expected null or instance of "+U.name+", got an instance of "+_.name),Q=_.ba(Q),_=_.R;return Q}function EA(Q,_){return _===null?(this.ea&&je("null is not a valid "+this.name),0):(_.M||je('Cannot pass "'+dr(_)+'" as a '+this.name),_.M.O||je("Cannot pass deleted object as a pointer of type "+this.name),Qo(_.M.O,_.M.P.N,this.N))}function ls(Q,_){if(_===null){if(this.ea&&je("null is not a valid "+this.name),this.da){var U=this.fa();return Q!==null&&Q.push(this.W,U),U}return 0}if(_.M||je('Cannot pass "'+dr(_)+'" as a '+this.name),_.M.O||je("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&_.M.P.ca&&je("Cannot convert argument of type "+(_.M.U?_.M.U.name:_.M.P.name)+" to parameter type "+this.name),U=Qo(_.M.O,_.M.P.N,this.N),this.da)switch(_.M.T===void 0&&je("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:_.M.U===this?U=_.M.T:je("Cannot convert argument of type "+(_.M.U?_.M.U.name:_.M.P.name)+" to parameter type "+this.name);break;case 1:U=_.M.T;break;case 2:if(_.M.U===this)U=_.M.T;else{var W=_.clone();U=this.xa(U,ct(function(){W.delete()})),Q!==null&&Q.push(this.W,U)}break;default:je("Unsupporting sharing policy")}return U}function Ho(Q,_){return _===null?(this.ea&&je("null is not a valid "+this.name),0):(_.M||je('Cannot pass "'+dr(_)+'" as a '+this.name),_.M.O||je("Cannot pass deleted object as a pointer of type "+this.name),_.M.P.ca&&je("Cannot convert argument of type "+_.M.P.name+" to parameter type "+this.name),Qo(_.M.O,_.M.P.N,this.N))}function Nn(Q,_,U,W){this.name=Q,this.N=_,this.ea=U,this.ca=W,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,_.R!==void 0?this.toWireType=ls:(this.toWireType=W?EA:Ho,this.V=null)}function wo(Q,_){r.hasOwnProperty(Q)||Uo("Replacing nonexistant public symbol"),r[Q]=_,r[Q].Z=void 0}function Rs(Q,_){var U=[];return function(){if(U.length=0,Object.assign(U,arguments),Q.includes("j")){var W=r["dynCall_"+Q];W=U&&U.length?W.apply(null,[_].concat(U)):W.call(null,_)}else W=xe.get(_).apply(null,U);return W}}function vr(Q,_){Q=Je(Q);var U=Q.includes("j")?Rs(Q,_):xe.get(_);return typeof U!="function"&&je("unknown function pointer with signature "+Q+": "+_),U}var us=void 0;function ve(Q,_){function U(pe){re[pe]||le[pe]||(li[pe]?li[pe].forEach(U):(W.push(pe),re[pe]=!0))}var W=[],re={};throw _.forEach(U),new us(Q+": "+W.map(tt).join([", "]))}function Ne(Q,_,U,W,re){var pe=_.length;2>pe&&je("argTypes array size mismatch! Must at least get return value and 'this' types!");var _e=_[1]!==null&&U!==null,Re=!1;for(U=1;U<_.length;++U)if(_[U]!==null&&_[U].V===void 0){Re=!0;break}var He=_[0].name!=="void",Fe=pe-2,$e=Array(Fe),Bt=[],Vt=[];return function(){if(arguments.length!==Fe&&je("function "+Q+" called with "+arguments.length+" arguments, expected "+Fe+" args!"),Vt.length=0,Bt.length=_e?2:1,Bt[0]=re,_e){var _r=_[1].toWireType(Vt,this);Bt[1]=_r}for(var qt=0;qt>2]);return U}function Ut(Q){4>2])};case 3:return function(U){return this.fromWireType(Be[U>>3])};default:throw new TypeError("Unknown float type: "+Q)}}function Zt(Q,_,U){switch(_){case 0:return U?function(W){return ne[W]}:function(W){return oe[W]};case 1:return U?function(W){return $[W>>1]}:function(W){return Z[W>>1]};case 2:return U?function(W){return q[W>>2]}:function(W){return X[W>>2]};default:throw new TypeError("Unknown integer type: "+Q)}}function cr(Q,_){for(var U="",W=0;!(W>=_/2);++W){var re=$[Q+2*W>>1];if(re==0)break;U+=String.fromCharCode(re)}return U}function Yt(Q,_,U){if(U===void 0&&(U=2147483647),2>U)return 0;U-=2;var W=_;U=U<2*Q.length?U/2:Q.length;for(var re=0;re>1]=Q.charCodeAt(re),_+=2;return $[_>>1]=0,_-W}function rn(Q){return 2*Q.length}function Uu(Q,_){for(var U=0,W="";!(U>=_/4);){var re=q[Q+4*U>>2];if(re==0)break;++U,65536<=re?(re-=65536,W+=String.fromCharCode(55296|re>>10,56320|re&1023)):W+=String.fromCharCode(re)}return W}function ta(Q,_,U){if(U===void 0&&(U=2147483647),4>U)return 0;var W=_;U=W+U-4;for(var re=0;re=pe){var _e=Q.charCodeAt(++re);pe=65536+((pe&1023)<<10)|_e&1023}if(q[_>>2]=pe,_+=4,_+4>U)break}return q[_>>2]=0,_-W}function kf(Q){for(var _=0,U=0;U=W&&++U,_+=4}return _}var Gu={};function Hu(Q){var _=Gu[Q];return _===void 0?Je(Q):_}var bs=[];function mA(Q){var _=bs.length;return bs.push(Q),_}function IA(Q,_){for(var U=Array(Q),W=0;W>2],"parameter "+W);return U}var Fi=[],ra=[null,[],[]];et=r.BindingError=he("BindingError"),r.count_emval_handles=function(){for(var Q=0,_=5;_Wo;++Wo)hA[Wo]=String.fromCharCode(Wo);wt=hA,r.getInheritedInstanceCount=function(){return Object.keys(Ur).length},r.getLiveInheritedInstances=function(){var Q=[],_;for(_ in Ur)Ur.hasOwnProperty(_)&&Q.push(Ur[_]);return Q},r.flushPendingDeletes=Ar,r.setDelayFunction=function(Q){yr=Q,Br.length&&yr&&yr(Ar)},Ss=r.InternalError=he("InternalError"),po.prototype.isAliasOf=function(Q){if(!(this instanceof po&&Q instanceof po))return!1;var _=this.M.P.N,U=this.M.O,W=Q.M.P.N;for(Q=Q.M.O;_.R;)U=_.ba(U),_=_.R;for(;W.R;)Q=W.ba(Q),W=W.R;return _===W&&U===Q},po.prototype.clone=function(){if(this.M.O||as(this),this.M.aa)return this.M.count.value+=1,this;var Q=xn,_=Object,U=_.create,W=Object.getPrototypeOf(this),re=this.M;return Q=Q(U.call(_,W,{M:{value:{count:re.count,$:re.$,aa:re.aa,O:re.O,P:re.P,T:re.T,U:re.U}}})),Q.M.count.value+=1,Q.M.$=!1,Q},po.prototype.delete=function(){this.M.O||as(this),this.M.$&&!this.M.aa&&je("Object already scheduled for deletion"),bt(this),Xt(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},po.prototype.isDeleted=function(){return!this.M.O},po.prototype.deleteLater=function(){return this.M.O||as(this),this.M.$&&!this.M.aa&&je("Object already scheduled for deletion"),Br.push(this),Br.length===1&&yr&&yr(Ar),this.M.$=!0,this},Nn.prototype.qa=function(Q){return this.ka&&(Q=this.ka(Q)),Q},Nn.prototype.ha=function(Q){this.W&&this.W(Q)},Nn.prototype.argPackAdvance=8,Nn.prototype.readValueFromPointer=Go,Nn.prototype.deleteObject=function(Q){Q!==null&&Q.delete()},Nn.prototype.fromWireType=function(Q){function _(){return this.da?Wn(this.N.X,{P:this.wa,O:U,U:this,T:Q}):Wn(this.N.X,{P:this,O:Q})}var U=this.qa(Q);if(!U)return this.ha(Q),null;var W=tn(this.N,U);if(W!==void 0)return W.M.count.value===0?(W.M.O=U,W.M.T=Q,W.clone()):(W=W.clone(),this.ha(Q),W);if(W=this.N.pa(U),W=ir[W],!W)return _.call(this);W=this.ca?W.la:W.pointerType;var re=or(U,this.N,W.N);return re===null?_.call(this):this.da?Wn(W.N.X,{P:W,O:re,U:this,T:Q}):Wn(W.N.X,{P:W,O:re})},us=r.UnboundTypeError=he("UnboundTypeError");var CA=typeof atob=="function"?atob:function(Q){var _="",U=0;Q=Q.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++)),re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++)),pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++)),_e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Q.charAt(U++));W=W<<2|re>>4,re=(re&15)<<4|pe>>2;var Re=(pe&3)<<6|_e;_+=String.fromCharCode(W),pe!==64&&(_+=String.fromCharCode(re)),_e!==64&&(_+=String.fromCharCode(Re))}while(U_e.ta).concat(re.map(_e=>_e.za));Xr([Q],pe,_e=>{var Re={};return re.forEach((He,Fe)=>{var $e=_e[Fe],Bt=He.ra,Vt=He.sa,_r=_e[Fe+re.length],qt=He.ya,mn=He.Aa;Re[He.oa]={read:Kn=>$e.fromWireType(Bt(Vt,Kn)),write:(Kn,BA)=>{var Jo=[];qt(mn,Kn,_r.toWireType(Jo,BA)),ai(Jo)}}}),[{name:_.name,fromWireType:function(He){var Fe={},$e;for($e in Re)Fe[$e]=Re[$e].read(He);return W(He),Fe},toWireType:function(He,Fe){for(var $e in Re)if(!($e in Fe))throw new TypeError('Missing field: "'+$e+'"');var Bt=U();for($e in Re)Re[$e].write(Bt,Fe[$e]);return He!==null&&He.push(W,Bt),Bt},argPackAdvance:8,readValueFromPointer:Go,V:W}]})},v:function(){},B:function(Q,_,U,W,re){var pe=As(U);_=Je(_),ro(Q,{name:_,fromWireType:function(_e){return!!_e},toWireType:function(_e,Re){return Re?W:re},argPackAdvance:8,readValueFromPointer:function(_e){if(U===1)var Re=ne;else if(U===2)Re=$;else if(U===4)Re=q;else throw new TypeError("Unknown boolean type size: "+_);return this.fromWireType(Re[_e>>pe])},V:null})},f:function(Q,_,U,W,re,pe,_e,Re,He,Fe,$e,Bt,Vt){$e=Je($e),pe=vr(re,pe),Re&&(Re=vr(_e,Re)),Fe&&(Fe=vr(He,Fe)),Vt=vr(Bt,Vt);var _r=Ge($e);ui(_r,function(){ve("Cannot construct "+$e+" due to unbound types",[W])}),Xr([Q,_,U],W?[W]:[],function(qt){if(qt=qt[0],W)var mn=qt.N,Kn=mn.X;else Kn=po.prototype;qt=it(_r,function(){if(Object.getPrototypeOf(this)!==BA)throw new et("Use 'new' to construct "+$e);if(Jo.Y===void 0)throw new et($e+" has no accessible constructor");var ol=Jo.Y[arguments.length];if(ol===void 0)throw new et("Tried to invoke ctor of "+$e+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(Jo.Y).toString()+") parameters instead!");return ol.apply(this,arguments)});var BA=Object.create(Kn,{constructor:{value:qt}});qt.prototype=BA;var Jo=new bi($e,qt,BA,Vt,mn,pe,Re,Fe);mn=new Nn($e,Jo,!0,!1),Kn=new Nn($e+"*",Jo,!1,!1);var na=new Nn($e+" const*",Jo,!1,!0);return ir[Q]={pointerType:Kn,la:na},wo(_r,qt),[mn,Kn,na]})},d:function(Q,_,U,W,re,pe,_e){var Re=ze(U,W);_=Je(_),pe=vr(re,pe),Xr([],[Q],function(He){function Fe(){ve("Cannot call "+$e+" due to unbound types",Re)}He=He[0];var $e=He.name+"."+_;_.startsWith("@@")&&(_=Symbol[_.substring(2)]);var Bt=He.N.constructor;return Bt[_]===void 0?(Fe.Z=U-1,Bt[_]=Fe):(_s(Bt,_,$e),Bt[_].S[U-1]=Fe),Xr([],Re,function(Vt){return Vt=Ne($e,[Vt[0],null].concat(Vt.slice(1)),null,pe,_e),Bt[_].S===void 0?(Vt.Z=U-1,Bt[_]=Vt):Bt[_].S[U-1]=Vt,[]}),[]})},p:function(Q,_,U,W,re,pe){0<_||se();var _e=ze(_,U);re=vr(W,re),Xr([],[Q],function(Re){Re=Re[0];var He="constructor "+Re.name;if(Re.N.Y===void 0&&(Re.N.Y=[]),Re.N.Y[_-1]!==void 0)throw new et("Cannot register multiple constructors with identical number of parameters ("+(_-1)+") for class '"+Re.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return Re.N.Y[_-1]=()=>{ve("Cannot construct "+Re.name+" due to unbound types",_e)},Xr([],_e,function(Fe){return Fe.splice(1,0,null),Re.N.Y[_-1]=Ne(He,Fe,null,re,pe),[]}),[]})},a:function(Q,_,U,W,re,pe,_e,Re){var He=ze(U,W);_=Je(_),pe=vr(re,pe),Xr([],[Q],function(Fe){function $e(){ve("Cannot call "+Bt+" due to unbound types",He)}Fe=Fe[0];var Bt=Fe.name+"."+_;_.startsWith("@@")&&(_=Symbol[_.substring(2)]),Re&&Fe.N.ja.push(_);var Vt=Fe.N.X,_r=Vt[_];return _r===void 0||_r.S===void 0&&_r.className!==Fe.name&&_r.Z===U-2?($e.Z=U-2,$e.className=Fe.name,Vt[_]=$e):(_s(Vt,_,Bt),Vt[_].S[U-2]=$e),Xr([],He,function(qt){return qt=Ne(Bt,qt,Fe,pe,_e),Vt[_].S===void 0?(qt.Z=U-2,Vt[_]=qt):Vt[_].S[U-2]=qt,[]}),[]})},A:function(Q,_){_=Je(_),ro(Q,{name:_,fromWireType:function(U){var W=Qt(U);return Ut(U),W},toWireType:function(U,W){return ct(W)},argPackAdvance:8,readValueFromPointer:Go,V:null})},n:function(Q,_,U){U=As(U),_=Je(_),ro(Q,{name:_,fromWireType:function(W){return W},toWireType:function(W,re){return re},argPackAdvance:8,readValueFromPointer:lt(_,U),V:null})},e:function(Q,_,U,W,re){_=Je(_),re===-1&&(re=4294967295),re=As(U);var pe=Re=>Re;if(W===0){var _e=32-8*U;pe=Re=>Re<<_e>>>_e}U=_.includes("unsigned")?function(Re,He){return He>>>0}:function(Re,He){return He},ro(Q,{name:_,fromWireType:pe,toWireType:U,argPackAdvance:8,readValueFromPointer:Zt(_,re,W!==0),V:null})},b:function(Q,_,U){function W(pe){pe>>=2;var _e=X;return new re(G,_e[pe+1],_e[pe])}var re=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][_];U=Je(U),ro(Q,{name:U,fromWireType:W,argPackAdvance:8,readValueFromPointer:W},{ua:!0})},o:function(Q,_){_=Je(_);var U=_==="std::string";ro(Q,{name:_,fromWireType:function(W){var re=X[W>>2],pe=W+4;if(U)for(var _e=pe,Re=0;Re<=re;++Re){var He=pe+Re;if(Re==re||oe[He]==0){if(_e=_e?O(oe,_e,He-_e):"",Fe===void 0)var Fe=_e;else Fe+="\0",Fe+=_e;_e=He+1}}else{for(Fe=Array(re),Re=0;Re=He?Re++:2047>=He?Re+=2:55296<=He&&57343>=He?(Re+=4,++pe):Re+=3}pe=Re}else pe=re.length;if(Re=ar(4+pe+1),He=Re+4,X[Re>>2]=pe,U&&_e){if(_e=He,He=pe+1,pe=oe,0=$e){var Bt=re.charCodeAt(++Fe);$e=65536+(($e&1023)<<10)|Bt&1023}if(127>=$e){if(_e>=He)break;pe[_e++]=$e}else{if(2047>=$e){if(_e+1>=He)break;pe[_e++]=192|$e>>6}else{if(65535>=$e){if(_e+2>=He)break;pe[_e++]=224|$e>>12}else{if(_e+3>=He)break;pe[_e++]=240|$e>>18,pe[_e++]=128|$e>>12&63}pe[_e++]=128|$e>>6&63}pe[_e++]=128|$e&63}}pe[_e]=0}}else if(_e)for(_e=0;_eZ,Re=1;else _===4&&(W=Uu,re=ta,pe=kf,_e=()=>X,Re=2);ro(Q,{name:U,fromWireType:function(He){for(var Fe=X[He>>2],$e=_e(),Bt,Vt=He+4,_r=0;_r<=Fe;++_r){var qt=He+4+_r*_;(_r==Fe||$e[qt>>Re]==0)&&(Vt=W(Vt,qt-Vt),Bt===void 0?Bt=Vt:(Bt+="\0",Bt+=Vt),Vt=qt+_)}return Wt(He),Bt},toWireType:function(He,Fe){typeof Fe!="string"&&je("Cannot pass non-string to C++ string type "+U);var $e=pe(Fe),Bt=ar(4+$e+_);return X[Bt>>2]=$e>>Re,re(Fe,Bt+4,$e+_),He!==null&&He.push(Wt,Bt),Bt},argPackAdvance:8,readValueFromPointer:Go,V:function(He){Wt(He)}})},k:function(Q,_,U,W,re,pe){Ai[Q]={name:Je(_),fa:vr(U,W),W:vr(re,pe),ia:[]}},h:function(Q,_,U,W,re,pe,_e,Re,He,Fe){Ai[Q].ia.push({oa:Je(_),ta:U,ra:vr(W,re),sa:pe,za:_e,ya:vr(Re,He),Aa:Fe})},C:function(Q,_){_=Je(_),ro(Q,{va:!0,name:_,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(Q,_,U,W,re){Q=bs[Q],_=Qt(_),U=Hu(U);var pe=[];return X[W>>2]=ct(pe),Q(_,U,pe,re)},t:function(Q,_,U,W){Q=bs[Q],_=Qt(_),U=Hu(U),Q(_,U,null,W)},g:Ut,m:function(Q,_){var U=IA(Q,_),W=U[0];_=W.name+"_$"+U.slice(1).map(function(_e){return _e.name}).join("_")+"$";var re=Fi[_];if(re!==void 0)return re;var pe=Array(Q-1);return re=mA((_e,Re,He,Fe)=>{for(var $e=0,Bt=0;Bt>>=0,2147483648=U;U*=2){var W=_*(1+.2/U);W=Math.min(W,Q+100663296);var re=Math;W=Math.max(Q,W),re=re.min.call(re,2147483648,W+(65536-W%65536)%65536);e:{try{D.grow(re-G.byteLength+65535>>>16),Ae();var pe=1;break e}catch{}pe=void 0}if(pe)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(Q,_,U,W){for(var re=0,pe=0;pe>2],Re=X[_+4>>2];_+=8;for(var He=0;He>2]=re,0}};(function(){function Q(re){r.asm=re.exports,D=r.asm.E,Ae(),xe=r.asm.J,ft.unshift(r.asm.F),ie--,r.monitorRunDependencies&&r.monitorRunDependencies(ie),ie==0&&(k!==null&&(clearInterval(k),k=null),H&&(re=H,H=null,re()))}function _(re){Q(re.instance)}function U(re){return gt().then(function(pe){return WebAssembly.instantiate(pe,W)}).then(function(pe){return pe}).then(re,function(pe){I("failed to asynchronously prepare wasm: "+pe),se(pe)})}var W={a:xi};if(ie++,r.monitorRunDependencies&&r.monitorRunDependencies(ie),r.instantiateWasm)try{return r.instantiateWasm(W,Q)}catch(re){I("Module.instantiateWasm callback failed with error: "+re),s(re)}return(function(){return h||typeof WebAssembly.instantiateStreaming!="function"||ge(Ee)||typeof fetch!="function"?U(_):fetch(Ee,{credentials:"same-origin"}).then(function(re){return WebAssembly.instantiateStreaming(re,W).then(_,function(pe){return I("wasm streaming compile failed: "+pe),I("falling back to ArrayBuffer instantiation"),U(_)})})})().catch(s),{}})(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.F).apply(null,arguments)};var Ko=r.___getTypeName=function(){return(Ko=r.___getTypeName=r.asm.G).apply(null,arguments)};r.__embind_initialize_bindings=function(){return(r.__embind_initialize_bindings=r.asm.H).apply(null,arguments)};var ar=r._malloc=function(){return(ar=r._malloc=r.asm.I).apply(null,arguments)},Wt=r._free=function(){return(Wt=r._free=r.asm.K).apply(null,arguments)};r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.L).apply(null,arguments)};var Sr;H=function Q(){Sr||Gr(),Sr||(H=Q)};function Gr(){function Q(){if(!Sr&&(Sr=!0,r.calledRun=!0,!R)){if(at(ft),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var _=r.postRun.shift();Ye.unshift(_)}at(Ye)}}if(!(01?E-1:0),h=1;ha?e.Node.createWithConfig(a):e.Node.createDefault()),t(e.Node.prototype,"free",function(){e.Node.destroy(this)}),t(e.Node.prototype,"freeRecursive",function(){for(let s=0,a=this.getChildCount();s1&&arguments[1]!==void 0?arguments[1]:NaN,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Xc.LTR;return s.call(this,a,u,E)}),{Config:e.Config,Node:e.Node,...Xh}}var Sv=FE(await Vh()),ot=Sv;var eD=Le(dC(),1),tD=Le(mC(),1);import T_ from"node:process";function GE({onlyFirst:e=!1}={}){let s="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(s,e?void 0:"g")}var Rv=GE();function rf(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(Rv,"")}var IC=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],hC=12288,CC=65510,BC=[12288,12288,65281,65376,65504,65510];var DC=4352,yC=262141,HE=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Zg=(e,t)=>{let r=0,i=Math.floor(e.length/2)-1;for(;r<=i;){let s=Math.floor((r+i)/2),a=s*2;if(te[a+1])r=s+1;else return!0}return!1};var QC=19968,[xv,kv]=Nv(HE);function Nv(e){let t=e[0],r=e[1];for(let i=0;i=s&&QC<=a)return[s,a];a-s>r-t&&(t=s,r=a)}return[t,r]}var wC=e=>e<161||e>1114109?!1:Zg(IC,e),nf=e=>eCC?!1:Zg(BC,e);var of=e=>e>=xv&&e<=kv?!0:eyC?!1:Zg(HE,e);function Tv(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function vC(e,{ambiguousAsWide:t=!1}={}){return Tv(e),nf(e)||of(e)||t&&wC(e)?2:1}var RC=Le(_C(),1),Ov=new Intl.Segmenter,Lv=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function dn(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=t;if(i||(e=rf(e)),e.length===0)return 0;let s=0,a={ambiguousAsWide:!r};for(let{segment:u}of Ov.segment(e)){let E=u.codePointAt(0);if(!(E<=31||E>=127&&E<=159)&&!(E>=8203&&E<=8207||E===65279)&&!(E>=768&&E<=879||E>=6832&&E<=6911||E>=7616&&E<=7679||E>=8400&&E<=8447||E>=65056&&E<=65071)&&!(E>=55296&&E<=57343)&&!(E>=65024&&E<=65039)&&!Lv.test(u)){if((0,RC.default)().test(u)){s+=2;continue}s+=vC(E,a)}}return s}function Ua(e){let t=0;for(let r of e.split(` +`))t=Math.max(t,dn(r));return t}var bC={},Mv=e=>{if(e.length===0)return{width:0,height:0};let t=bC[e];if(t)return t;let r=Ua(e),i=e.split(` +`).length;return bC[e]={width:r,height:i},{width:r,height:i}},WE=Mv;var FC=(e=0)=>t=>`\x1B[${t+e}m`,xC=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,kC=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,Yr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},nk=Object.keys(Yr.modifier),Pv=Object.keys(Yr.color),Uv=Object.keys(Yr.bgColor),ok=[...Pv,...Uv];function Gv(){let e=new Map;for(let[t,r]of Object.entries(Yr)){for(let[i,s]of Object.entries(r))Yr[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=Yr[i],e.set(s[0],s[1]);Object.defineProperty(Yr,t,{value:r,enumerable:!1})}return Object.defineProperty(Yr,"codes",{value:e,enumerable:!1}),Yr.color.close="\x1B[39m",Yr.bgColor.close="\x1B[49m",Yr.color.ansi=FC(),Yr.color.ansi256=xC(),Yr.color.ansi16m=kC(),Yr.bgColor.ansi=FC(10),Yr.bgColor.ansi256=xC(10),Yr.bgColor.ansi16m=kC(10),Object.defineProperties(Yr,{rgbToAnsi256:{value(t,r,i){return t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(a=>a+a).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>Yr.rgbToAnsi256(...Yr.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,s;if(t>=232)r=((t-232)*10+8)/255,i=r,s=r;else{t-=16;let E=t%36;r=Math.floor(t/36)/5,i=Math.floor(E/6)/5,s=E%6/5}let a=Math.max(r,i,s)*2;if(a===0)return 30;let u=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return a===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>Yr.ansi256ToAnsi(Yr.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>Yr.ansi256ToAnsi(Yr.hexToAnsi256(t)),enumerable:!1}}),Yr}var Hv=Gv(),Vr=Hv;var td=new Set(["\x1B","\x9B"]),Wv=39,JE="\x07",OC="[",Kv="]",LC="m",ed=`${Kv}8;;`,NC=e=>`${td.values().next().value}${OC}${e}${LC}`,TC=e=>`${td.values().next().value}${ed}${e}${JE}`,Jv=e=>e.split(" ").map(t=>dn(t)),KE=(e,t,r)=>{let i=[...t],s=!1,a=!1,u=dn(rf(e.at(-1)));for(let[E,I]of i.entries()){let h=dn(I);if(u+h<=r?e[e.length-1]+=I:(e.push(I),u=0),td.has(I)&&(s=!0,a=i.slice(E+1,E+1+ed.length).join("")===ed),s){a?I===JE&&(s=!1,a=!1):I===LC&&(s=!1);continue}u+=h,u===r&&E0&&e.length>1&&(e[e.length-2]+=e.pop())},jv=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(dn(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Yv=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",s,a,u=Jv(e),E=[""];for(let[D,R]of e.split(" ").entries()){r.trim!==!1&&(E[E.length-1]=E.at(-1).trimStart());let O=dn(E.at(-1));if(D!==0&&(O>=t&&(r.wordWrap===!1||r.trim===!1)&&(E.push(""),O=0),(O>0||r.trim===!1)&&(E[E.length-1]+=" ",O++)),r.hard&&u[D]>t){let G=t-O,ne=1+Math.floor((u[D]-G-1)/t);Math.floor((u[D]-1)/t)t&&O>0&&u[D]>0){if(r.wordWrap===!1&&Ot&&r.wordWrap===!1){KE(E,R,t);continue}E[E.length-1]+=R}r.trim!==!1&&(E=E.map(D=>jv(D)));let I=E.join(` +`),h=[...I],y=0;for(let[D,R]of h.entries()){if(i+=R,td.has(R)){let{groups:G}=new RegExp(`(?:\\${OC}(?\\d+)m|\\${ed}(?.*)${JE})`).exec(I.slice(y))||{groups:{}};if(G.code!==void 0){let ne=Number.parseFloat(G.code);s=ne===Wv?void 0:ne}else G.uri!==void 0&&(a=G.uri.length===0?void 0:G.uri)}let O=Vr.codes.get(Number(s));h[D+1]===` +`?(a&&(i+=TC("")),s&&O&&(i+=NC(O))):R===` +`&&(s&&O&&(i+=NC(s)),a&&(i+=TC(a))),y+=R.length}return i};function jE(e,t,r){return String(e).normalize().replaceAll(`\r `,` `).split(` -`).map(i=>Ww(i,t,r)).join(` -`)}function of(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var Kw=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,TC=["\x1B","\x9B"],ed=e=>`${TC[0]}[${e}m`,NC=(e,t,r)=>{let i=[];e=[...e];for(let s of e){let a=s;s.includes(";")&&(s=s.split(";")[0][0]+"0");let u=Vr.codes.get(Number.parseInt(s,10));if(u){let E=e.indexOf(u.toString());E===-1?i.push(ed(t?u:a)):e.splice(E,1)}else if(t){i.push(ed(0));break}else i.push(ed(a))}if(t&&(i=i.filter((s,a)=>i.indexOf(s)===a),r!==void 0)){let s=ed(Vr.codes.get(Number.parseInt(r,10)));i=i.reduce((a,u)=>u===s?[u,...a]:[...a,u],[])}return i.join("")};function ys(e,t,r){let i=[...e],s=[],a=typeof r=="number"?r:i.length,u=!1,E,I=0,C="";for(let[y,D]of i.entries()){let R=!1;if(TC.includes(D)){let O=/\d[^m]*/.exec(e.slice(y,y+18));E=O&&O.length>0?O[0]:void 0,It&&I<=a)C+=D;else if(I===t&&!u&&E!==void 0)C=NC(s);else if(I>=a){C+=NC(s,!0,E);break}}return C}function td(e,t,r){if(e.charAt(t)===" ")return t;let i=r?1:-1;for(let s=0;s<=3;s++){let a=t+s*i;if(e.charAt(a)===" ")return a}return t}function JE(e,t,r={}){let{position:i="end",space:s=!1,preferTruncationOnSpace:a=!1}=r,{truncationCharacter:u="\u2026"}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return u;let E=dn(e);if(E<=t)return e;if(i==="start"){if(a){let I=td(e,E-t+1,!0);return u+ys(e,I,E).trim()}return s===!0&&(u+=" "),u+ys(e,E-t+dn(u),E)}if(i==="middle"){s===!0&&(u=` ${u} `);let I=Math.floor(t/2);if(a){let C=td(e,I),y=td(e,E-(t-I)+1,!0);return ys(e,0,C)+u+ys(e,y,E).trim()}return ys(e,0,I)+u+ys(e,E-(t-I)+dn(u),E)}if(i==="end"){if(a){let I=td(e,t-1);return ys(e,0,I)+u}return s===!0&&(u=` ${u}`),ys(e,0,t-dn(u))+u}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}var OC={},Jw=(e,t,r)=>{let i=e+String(t)+String(r),s=OC[i];if(s)return s;let a=e;if(r==="wrap"&&(a=KE(e,t,{trim:!1,hard:!0})),r.startsWith("truncate")){let u="end";r==="truncate-middle"&&(u="middle"),r==="truncate-start"&&(u="start"),a=JE(e,t,{position:u})}return OC[i]=a,a},rd=Jw;var LC=e=>{let t="";for(let r=0;r0&&typeof i.internal_transform=="function"&&(s=i.internal_transform(s,r))),t+=s}return t},nd=LC;var od=e=>{let t={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:e==="ink-virtual-text"?void 0:it.Node.create()};return e==="ink-text"&&t.yogaNode?.setMeasureFunc(jw.bind(null,t)),t},id=(e,t)=>{t.parentNode&&sf(t.parentNode,t),t.parentNode=e,e.childNodes.push(t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,e.yogaNode.getChildCount()),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&sd(e)},jE=(e,t,r)=>{t.parentNode&&sf(t.parentNode,t),t.parentNode=e;let i=e.childNodes.indexOf(r);if(i>=0){e.childNodes.splice(i,0,t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,i);return}e.childNodes.push(t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,e.yogaNode.getChildCount()),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&sd(e)},sf=(e,t)=>{t.yogaNode&&t.parentNode?.yogaNode?.removeChild(t.yogaNode),t.parentNode=void 0;let r=e.childNodes.indexOf(t);r>=0&&e.childNodes.splice(r,1),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&sd(e)},YE=(e,t,r)=>{e.attributes[t]=r},VE=(e,t)=>{e.style=t},MC=e=>{let t={nodeName:"#text",nodeValue:e,yogaNode:void 0,parentNode:void 0,style:{}};return Af(t,e),t},jw=function(e,t){let r=e.nodeName==="#text"?e.nodeValue:nd(e),i=GE(r);if(i.width<=t||i.width>=1&&t>0&&t<1)return i;let s=e.style?.textWrap??"wrap",a=rd(r,t,s);return GE(a)},PC=e=>{if(e?.parentNode)return e.yogaNode??PC(e.parentNode)},sd=e=>{PC(e)?.markDirty()},Af=(e,t)=>{typeof t!="string"&&(t=String(t)),e.nodeValue=t,sd(e)};var Vw=(e,t)=>{"position"in t&&e.setPositionType(t.position==="absolute"?it.POSITION_TYPE_ABSOLUTE:it.POSITION_TYPE_RELATIVE)},qw=(e,t)=>{"margin"in t&&e.setMargin(it.EDGE_ALL,t.margin??0),"marginX"in t&&e.setMargin(it.EDGE_HORIZONTAL,t.marginX??0),"marginY"in t&&e.setMargin(it.EDGE_VERTICAL,t.marginY??0),"marginLeft"in t&&e.setMargin(it.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(it.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(it.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(it.EDGE_BOTTOM,t.marginBottom||0)},zw=(e,t)=>{"padding"in t&&e.setPadding(it.EDGE_ALL,t.padding??0),"paddingX"in t&&e.setPadding(it.EDGE_HORIZONTAL,t.paddingX??0),"paddingY"in t&&e.setPadding(it.EDGE_VERTICAL,t.paddingY??0),"paddingLeft"in t&&e.setPadding(it.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(it.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(it.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(it.EDGE_BOTTOM,t.paddingBottom||0)},$w=(e,t)=>{"flexGrow"in t&&e.setFlexGrow(t.flexGrow??0),"flexShrink"in t&&e.setFlexShrink(typeof t.flexShrink=="number"?t.flexShrink:1),"flexWrap"in t&&(t.flexWrap==="nowrap"&&e.setFlexWrap(it.WRAP_NO_WRAP),t.flexWrap==="wrap"&&e.setFlexWrap(it.WRAP_WRAP),t.flexWrap==="wrap-reverse"&&e.setFlexWrap(it.WRAP_WRAP_REVERSE)),"flexDirection"in t&&(t.flexDirection==="row"&&e.setFlexDirection(it.FLEX_DIRECTION_ROW),t.flexDirection==="row-reverse"&&e.setFlexDirection(it.FLEX_DIRECTION_ROW_REVERSE),t.flexDirection==="column"&&e.setFlexDirection(it.FLEX_DIRECTION_COLUMN),t.flexDirection==="column-reverse"&&e.setFlexDirection(it.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&(typeof t.flexBasis=="number"?e.setFlexBasis(t.flexBasis):typeof t.flexBasis=="string"?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(Number.NaN)),"alignItems"in t&&((t.alignItems==="stretch"||!t.alignItems)&&e.setAlignItems(it.ALIGN_STRETCH),t.alignItems==="flex-start"&&e.setAlignItems(it.ALIGN_FLEX_START),t.alignItems==="center"&&e.setAlignItems(it.ALIGN_CENTER),t.alignItems==="flex-end"&&e.setAlignItems(it.ALIGN_FLEX_END)),"alignSelf"in t&&((t.alignSelf==="auto"||!t.alignSelf)&&e.setAlignSelf(it.ALIGN_AUTO),t.alignSelf==="flex-start"&&e.setAlignSelf(it.ALIGN_FLEX_START),t.alignSelf==="center"&&e.setAlignSelf(it.ALIGN_CENTER),t.alignSelf==="flex-end"&&e.setAlignSelf(it.ALIGN_FLEX_END)),"justifyContent"in t&&((t.justifyContent==="flex-start"||!t.justifyContent)&&e.setJustifyContent(it.JUSTIFY_FLEX_START),t.justifyContent==="center"&&e.setJustifyContent(it.JUSTIFY_CENTER),t.justifyContent==="flex-end"&&e.setJustifyContent(it.JUSTIFY_FLEX_END),t.justifyContent==="space-between"&&e.setJustifyContent(it.JUSTIFY_SPACE_BETWEEN),t.justifyContent==="space-around"&&e.setJustifyContent(it.JUSTIFY_SPACE_AROUND),t.justifyContent==="space-evenly"&&e.setJustifyContent(it.JUSTIFY_SPACE_EVENLY))},Xw=(e,t)=>{"width"in t&&(typeof t.width=="number"?e.setWidth(t.width):typeof t.width=="string"?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&(typeof t.height=="number"?e.setHeight(t.height):typeof t.height=="string"?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&(typeof t.minWidth=="string"?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth(t.minWidth??0)),"minHeight"in t&&(typeof t.minHeight=="string"?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight(t.minHeight??0))},Zw=(e,t)=>{"display"in t&&e.setDisplay(t.display==="flex"?it.DISPLAY_FLEX:it.DISPLAY_NONE)},eS=(e,t)=>{if("borderStyle"in t){let r=t.borderStyle?1:0;t.borderTop!==!1&&e.setBorder(it.EDGE_TOP,r),t.borderBottom!==!1&&e.setBorder(it.EDGE_BOTTOM,r),t.borderLeft!==!1&&e.setBorder(it.EDGE_LEFT,r),t.borderRight!==!1&&e.setBorder(it.EDGE_RIGHT,r)}},tS=(e,t)=>{"gap"in t&&e.setGap(it.GUTTER_ALL,t.gap??0),"columnGap"in t&&e.setGap(it.GUTTER_COLUMN,t.columnGap??0),"rowGap"in t&&e.setGap(it.GUTTER_ROW,t.rowGap??0)},rS=(e,t={})=>{Vw(e,t),qw(e,t),zw(e,t),$w(e,t),Xw(e,t),Zw(e,t),eS(e,t),tS(e,t)},qE=rS;if(b_.env.DEV==="true")try{await Promise.resolve().then(()=>(YB(),F_))}catch(e){if(e.code==="ERR_MODULE_NOT_FOUND")console.warn(` +`).map(i=>Yv(i,t,r)).join(` +`)}function sf(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var Vv=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,PC=["\x1B","\x9B"],rd=e=>`${PC[0]}[${e}m`,MC=(e,t,r)=>{let i=[];e=[...e];for(let s of e){let a=s;s.includes(";")&&(s=s.split(";")[0][0]+"0");let u=Vr.codes.get(Number.parseInt(s,10));if(u){let E=e.indexOf(u.toString());E===-1?i.push(rd(t?u:a)):e.splice(E,1)}else if(t){i.push(rd(0));break}else i.push(rd(a))}if(t&&(i=i.filter((s,a)=>i.indexOf(s)===a),r!==void 0)){let s=rd(Vr.codes.get(Number.parseInt(r,10)));i=i.reduce((a,u)=>u===s?[u,...a]:[...a,u],[])}return i.join("")};function ys(e,t,r){let i=[...e],s=[],a=typeof r=="number"?r:i.length,u=!1,E,I=0,h="";for(let[y,D]of i.entries()){let R=!1;if(PC.includes(D)){let O=/\d[^m]*/.exec(e.slice(y,y+18));E=O&&O.length>0?O[0]:void 0,It&&I<=a)h+=D;else if(I===t&&!u&&E!==void 0)h=MC(s);else if(I>=a){h+=MC(s,!0,E);break}}return h}function nd(e,t,r){if(e.charAt(t)===" ")return t;let i=r?1:-1;for(let s=0;s<=3;s++){let a=t+s*i;if(e.charAt(a)===" ")return a}return t}function YE(e,t,r={}){let{position:i="end",space:s=!1,preferTruncationOnSpace:a=!1}=r,{truncationCharacter:u="\u2026"}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return u;let E=dn(e);if(E<=t)return e;if(i==="start"){if(a){let I=nd(e,E-t+1,!0);return u+ys(e,I,E).trim()}return s===!0&&(u+=" "),u+ys(e,E-t+dn(u),E)}if(i==="middle"){s===!0&&(u=` ${u} `);let I=Math.floor(t/2);if(a){let h=nd(e,I),y=nd(e,E-(t-I)+1,!0);return ys(e,0,h)+u+ys(e,y,E).trim()}return ys(e,0,I)+u+ys(e,E-(t-I)+dn(u),E)}if(i==="end"){if(a){let I=nd(e,t-1);return ys(e,0,I)+u}return s===!0&&(u=` ${u}`),ys(e,0,t-dn(u))+u}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}var UC={},qv=(e,t,r)=>{let i=e+String(t)+String(r),s=UC[i];if(s)return s;let a=e;if(r==="wrap"&&(a=jE(e,t,{trim:!1,hard:!0})),r.startsWith("truncate")){let u="end";r==="truncate-middle"&&(u="middle"),r==="truncate-start"&&(u="start"),a=YE(e,t,{position:u})}return UC[i]=a,a},od=qv;var GC=e=>{let t="";for(let r=0;r0&&typeof i.internal_transform=="function"&&(s=i.internal_transform(s,r))),t+=s}return t},id=GC;var sd=e=>{let t={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:e==="ink-virtual-text"?void 0:ot.Node.create()};return e==="ink-text"&&t.yogaNode?.setMeasureFunc(zv.bind(null,t)),t},Ad=(e,t)=>{t.parentNode&&Af(t.parentNode,t),t.parentNode=e,e.childNodes.push(t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,e.yogaNode.getChildCount()),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&ad(e)},VE=(e,t,r)=>{t.parentNode&&Af(t.parentNode,t),t.parentNode=e;let i=e.childNodes.indexOf(r);if(i>=0){e.childNodes.splice(i,0,t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,i);return}e.childNodes.push(t),t.yogaNode&&e.yogaNode?.insertChild(t.yogaNode,e.yogaNode.getChildCount()),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&ad(e)},Af=(e,t)=>{t.yogaNode&&t.parentNode?.yogaNode?.removeChild(t.yogaNode),t.parentNode=void 0;let r=e.childNodes.indexOf(t);r>=0&&e.childNodes.splice(r,1),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&ad(e)},qE=(e,t,r)=>{e.attributes[t]=r},zE=(e,t)=>{e.style=t},HC=e=>{let t={nodeName:"#text",nodeValue:e,yogaNode:void 0,parentNode:void 0,style:{}};return af(t,e),t},zv=function(e,t){let r=e.nodeName==="#text"?e.nodeValue:id(e),i=WE(r);if(i.width<=t||i.width>=1&&t>0&&t<1)return i;let s=e.style?.textWrap??"wrap",a=od(r,t,s);return WE(a)},WC=e=>{if(e?.parentNode)return e.yogaNode??WC(e.parentNode)},ad=e=>{WC(e)?.markDirty()},af=(e,t)=>{typeof t!="string"&&(t=String(t)),e.nodeValue=t,ad(e)};var Xv=(e,t)=>{"position"in t&&e.setPositionType(t.position==="absolute"?ot.POSITION_TYPE_ABSOLUTE:ot.POSITION_TYPE_RELATIVE)},Zv=(e,t)=>{"margin"in t&&e.setMargin(ot.EDGE_ALL,t.margin??0),"marginX"in t&&e.setMargin(ot.EDGE_HORIZONTAL,t.marginX??0),"marginY"in t&&e.setMargin(ot.EDGE_VERTICAL,t.marginY??0),"marginLeft"in t&&e.setMargin(ot.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(ot.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(ot.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(ot.EDGE_BOTTOM,t.marginBottom||0)},eS=(e,t)=>{"padding"in t&&e.setPadding(ot.EDGE_ALL,t.padding??0),"paddingX"in t&&e.setPadding(ot.EDGE_HORIZONTAL,t.paddingX??0),"paddingY"in t&&e.setPadding(ot.EDGE_VERTICAL,t.paddingY??0),"paddingLeft"in t&&e.setPadding(ot.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(ot.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(ot.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(ot.EDGE_BOTTOM,t.paddingBottom||0)},tS=(e,t)=>{"flexGrow"in t&&e.setFlexGrow(t.flexGrow??0),"flexShrink"in t&&e.setFlexShrink(typeof t.flexShrink=="number"?t.flexShrink:1),"flexWrap"in t&&(t.flexWrap==="nowrap"&&e.setFlexWrap(ot.WRAP_NO_WRAP),t.flexWrap==="wrap"&&e.setFlexWrap(ot.WRAP_WRAP),t.flexWrap==="wrap-reverse"&&e.setFlexWrap(ot.WRAP_WRAP_REVERSE)),"flexDirection"in t&&(t.flexDirection==="row"&&e.setFlexDirection(ot.FLEX_DIRECTION_ROW),t.flexDirection==="row-reverse"&&e.setFlexDirection(ot.FLEX_DIRECTION_ROW_REVERSE),t.flexDirection==="column"&&e.setFlexDirection(ot.FLEX_DIRECTION_COLUMN),t.flexDirection==="column-reverse"&&e.setFlexDirection(ot.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&(typeof t.flexBasis=="number"?e.setFlexBasis(t.flexBasis):typeof t.flexBasis=="string"?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(Number.NaN)),"alignItems"in t&&((t.alignItems==="stretch"||!t.alignItems)&&e.setAlignItems(ot.ALIGN_STRETCH),t.alignItems==="flex-start"&&e.setAlignItems(ot.ALIGN_FLEX_START),t.alignItems==="center"&&e.setAlignItems(ot.ALIGN_CENTER),t.alignItems==="flex-end"&&e.setAlignItems(ot.ALIGN_FLEX_END)),"alignSelf"in t&&((t.alignSelf==="auto"||!t.alignSelf)&&e.setAlignSelf(ot.ALIGN_AUTO),t.alignSelf==="flex-start"&&e.setAlignSelf(ot.ALIGN_FLEX_START),t.alignSelf==="center"&&e.setAlignSelf(ot.ALIGN_CENTER),t.alignSelf==="flex-end"&&e.setAlignSelf(ot.ALIGN_FLEX_END)),"justifyContent"in t&&((t.justifyContent==="flex-start"||!t.justifyContent)&&e.setJustifyContent(ot.JUSTIFY_FLEX_START),t.justifyContent==="center"&&e.setJustifyContent(ot.JUSTIFY_CENTER),t.justifyContent==="flex-end"&&e.setJustifyContent(ot.JUSTIFY_FLEX_END),t.justifyContent==="space-between"&&e.setJustifyContent(ot.JUSTIFY_SPACE_BETWEEN),t.justifyContent==="space-around"&&e.setJustifyContent(ot.JUSTIFY_SPACE_AROUND),t.justifyContent==="space-evenly"&&e.setJustifyContent(ot.JUSTIFY_SPACE_EVENLY))},rS=(e,t)=>{"width"in t&&(typeof t.width=="number"?e.setWidth(t.width):typeof t.width=="string"?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&(typeof t.height=="number"?e.setHeight(t.height):typeof t.height=="string"?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&(typeof t.minWidth=="string"?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth(t.minWidth??0)),"minHeight"in t&&(typeof t.minHeight=="string"?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight(t.minHeight??0))},nS=(e,t)=>{"display"in t&&e.setDisplay(t.display==="flex"?ot.DISPLAY_FLEX:ot.DISPLAY_NONE)},oS=(e,t)=>{if("borderStyle"in t){let r=t.borderStyle?1:0;t.borderTop!==!1&&e.setBorder(ot.EDGE_TOP,r),t.borderBottom!==!1&&e.setBorder(ot.EDGE_BOTTOM,r),t.borderLeft!==!1&&e.setBorder(ot.EDGE_LEFT,r),t.borderRight!==!1&&e.setBorder(ot.EDGE_RIGHT,r)}},iS=(e,t)=>{"gap"in t&&e.setGap(ot.GUTTER_ALL,t.gap??0),"columnGap"in t&&e.setGap(ot.GUTTER_COLUMN,t.columnGap??0),"rowGap"in t&&e.setGap(ot.GUTTER_ROW,t.rowGap??0)},sS=(e,t={})=>{Xv(e,t),Zv(e,t),eS(e,t),tS(e,t),rS(e,t),nS(e,t),oS(e,t),iS(e,t)},$E=sS;if(T_.env.DEV==="true")try{await Promise.resolve().then(()=>($B(),N_))}catch(e){if(e.code==="ERR_MODULE_NOT_FOUND")console.warn(` The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`, but this failed as it was not installed. Debugging with React Devtools requires it. @@ -102,58 +102,58 @@ To install use this command: $ npm install --save-dev react-devtools-core `.trim()+` -`);else throw e}var VB=(e,t)=>{if(e===t)return;if(!e)return t;let r={},i=!1;for(let s of Object.keys(e))(!t||!Object.hasOwn(t,s))&&(r[s]=void 0,i=!0);if(t)for(let s of Object.keys(t))t[s]!==e[s]&&(r[s]=t[s],i=!0);return i?r:void 0},qB=e=>{e?.unsetMeasureFunc(),e?.freeRecursive()},Ja=(0,zB.default)({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(e){if(typeof e.onComputeLayout=="function"&&e.onComputeLayout(),e.isStaticDirty){e.isStaticDirty=!1,typeof e.onImmediateRender=="function"&&e.onImmediateRender();return}typeof e.onRender=="function"&&e.onRender()},getChildHostContext(e,t){let r=e.isInsideText,i=t==="ink-text"||t==="ink-virtual-text";return r===i?e:{isInsideText:i}},shouldSetTextContent:()=>!1,createInstance(e,t,r,i){if(i.isInsideText&&e==="ink-box")throw new Error(" can\u2019t be nested inside component");let s=e==="ink-text"&&i.isInsideText?"ink-virtual-text":e,a=od(s);for(let[u,E]of Object.entries(t))if(u!=="children"){if(u==="style"){VE(a,E),a.yogaNode&&qE(a.yogaNode,E);continue}if(u==="internal_transform"){a.internal_transform=E;continue}if(u==="internal_static"){a.internal_static=!0;continue}YE(a,u,E)}return a},createTextInstance(e,t,r){if(!r.isInsideText)throw new Error(`Text string "${e}" must be rendered inside component`);return MC(e)},resetTextContent(){},hideTextInstance(e){Af(e,"")},unhideTextInstance(e,t){Af(e,t)},getPublicInstance:e=>e,hideInstance(e){e.yogaNode?.setDisplay(it.DISPLAY_NONE)},unhideInstance(e){e.yogaNode?.setDisplay(it.DISPLAY_FLEX)},appendInitialChild:id,appendChild:id,insertBefore:jE,finalizeInitialChildren(e,t,r,i){return e.internal_static&&(i.isStaticDirty=!0,i.staticNode=e),!1},isPrimaryRenderer:!0,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,getCurrentEventPriority:()=>$B.DefaultEventPriority,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:id,insertInContainerBefore:jE,removeChildFromContainer(e,t){sf(e,t),qB(t.yogaNode)},prepareUpdate(e,t,r,i,s){e.internal_static&&(s.isStaticDirty=!0);let a=VB(r,i),u=VB(r.style,i.style);return!a&&!u?null:{props:a,style:u}},commitUpdate(e,{props:t,style:r}){if(t)for(let[i,s]of Object.entries(t)){if(i==="style"){VE(e,s);continue}if(i==="internal_transform"){e.internal_transform=s;continue}if(i==="internal_static"){e.internal_static=!0;continue}YE(e,i,s)}r&&e.yogaNode&&qE(e.yogaNode,r)},commitTextUpdate(e,t,r){Af(e,r)},removeChild(e,t){sf(e,t),qB(t.yogaNode)}});function hm(e,t=1,r={}){let{indent:i=" ",includeEmptyLines:s=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof i!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof i}\``);if(t===0)return e;let a=s?/^/gm:/^(?!\s*$)/gm;return e.replace(a,i.repeat(t))}var x_=e=>e.getComputedWidth()-e.getComputedPadding(it.EDGE_LEFT)-e.getComputedPadding(it.EDGE_RIGHT)-e.getComputedBorder(it.EDGE_LEFT)-e.getComputedBorder(it.EDGE_RIGHT),XB=x_;var gD=Me(tD(),1);var rD=(e=0)=>t=>`\x1B[${t+e}m`,nD=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,oD=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,zr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},zk=Object.keys(zr.modifier),N_=Object.keys(zr.color),T_=Object.keys(zr.bgColor),$k=[...N_,...T_];function O_(){let e=new Map;for(let[t,r]of Object.entries(zr)){for(let[i,s]of Object.entries(r))zr[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=zr[i],e.set(s[0],s[1]);Object.defineProperty(zr,t,{value:r,enumerable:!1})}return Object.defineProperty(zr,"codes",{value:e,enumerable:!1}),zr.color.close="\x1B[39m",zr.bgColor.close="\x1B[49m",zr.color.ansi=rD(),zr.color.ansi256=nD(),zr.color.ansi16m=oD(),zr.bgColor.ansi=rD(10),zr.bgColor.ansi256=nD(10),zr.bgColor.ansi16m=oD(10),Object.defineProperties(zr,{rgbToAnsi256:{value(t,r,i){return t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(a=>a+a).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>zr.rgbToAnsi256(...zr.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,s;if(t>=232)r=((t-232)*10+8)/255,i=r,s=r;else{t-=16;let E=t%36;r=Math.floor(t/36)/5,i=Math.floor(E/6)/5,s=E%6/5}let a=Math.max(r,i,s)*2;if(a===0)return 30;let u=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return a===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>zr.ansi256ToAnsi(zr.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>zr.ansi256ToAnsi(zr.hexToAnsi256(t)),enumerable:!1}}),zr}var L_=O_(),ts=L_;import Bm from"node:process";import M_ from"node:os";import iD from"node:tty";function _i(e,t=globalThis.Deno?globalThis.Deno.args:Bm.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),s=t.indexOf("--");return i!==-1&&(s===-1||i=2,has16m:e>=3}}function G_(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let i=P_();i!==void 0&&(Qd=i);let s=r?Qd:i;if(s===0)return 0;if(r){if(_i("color=16m")||_i("color=full")||_i("color=truecolor"))return 3;if(_i("color=256"))return 2}if("TF_BUILD"in $r&&"AGENT_NAME"in $r)return 1;if(e&&!t&&s===void 0)return 0;let a=s||0;if($r.TERM==="dumb")return a;if(Bm.platform==="win32"){let u=M_.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in $r)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(u=>u in $r)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in $r)||$r.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in $r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($r.TEAMCITY_VERSION)?1:0;if($r.COLORTERM==="truecolor"||$r.TERM==="xterm-kitty"||$r.TERM==="xterm-ghostty"||$r.TERM==="wezterm")return 3;if("TERM_PROGRAM"in $r){let u=Number.parseInt(($r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($r.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($r.TERM)||"COLORTERM"in $r?1:a}function sD(e,t={}){let r=G_(e,{streamIsTTY:e&&e.isTTY,...t});return U_(r)}var H_={stdout:sD({isTTY:iD.isatty(1)}),stderr:sD({isTTY:iD.isatty(2)})},AD=H_;function aD(e,t,r){let i=e.indexOf(t);if(i===-1)return e;let s=t.length,a=0,u="";do u+=e.slice(a,i)+t+r,a=i+s,i=e.indexOf(t,a);while(i!==-1);return u+=e.slice(a),u}function lD(e,t,r,i){let s=0,a="";do{let u=e[i-1]==="\r";a+=e.slice(s,u?i-1:i)+t+(u?`\r +`);else throw e}var XB=(e,t)=>{if(e===t)return;if(!e)return t;let r={},i=!1;for(let s of Object.keys(e))(!t||!Object.hasOwn(t,s))&&(r[s]=void 0,i=!0);if(t)for(let s of Object.keys(t))t[s]!==e[s]&&(r[s]=t[s],i=!0);return i?r:void 0},ZB=e=>{e?.unsetMeasureFunc(),e?.freeRecursive()},ja=(0,eD.default)({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(e){if(typeof e.onComputeLayout=="function"&&e.onComputeLayout(),e.isStaticDirty){e.isStaticDirty=!1,typeof e.onImmediateRender=="function"&&e.onImmediateRender();return}typeof e.onRender=="function"&&e.onRender()},getChildHostContext(e,t){let r=e.isInsideText,i=t==="ink-text"||t==="ink-virtual-text";return r===i?e:{isInsideText:i}},shouldSetTextContent:()=>!1,createInstance(e,t,r,i){if(i.isInsideText&&e==="ink-box")throw new Error(" can\u2019t be nested inside component");let s=e==="ink-text"&&i.isInsideText?"ink-virtual-text":e,a=sd(s);for(let[u,E]of Object.entries(t))if(u!=="children"){if(u==="style"){zE(a,E),a.yogaNode&&$E(a.yogaNode,E);continue}if(u==="internal_transform"){a.internal_transform=E;continue}if(u==="internal_static"){a.internal_static=!0;continue}qE(a,u,E)}return a},createTextInstance(e,t,r){if(!r.isInsideText)throw new Error(`Text string "${e}" must be rendered inside component`);return HC(e)},resetTextContent(){},hideTextInstance(e){af(e,"")},unhideTextInstance(e,t){af(e,t)},getPublicInstance:e=>e,hideInstance(e){e.yogaNode?.setDisplay(ot.DISPLAY_NONE)},unhideInstance(e){e.yogaNode?.setDisplay(ot.DISPLAY_FLEX)},appendInitialChild:Ad,appendChild:Ad,insertBefore:VE,finalizeInitialChildren(e,t,r,i){return e.internal_static&&(i.isStaticDirty=!0,i.staticNode=e),!1},isPrimaryRenderer:!0,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,getCurrentEventPriority:()=>tD.DefaultEventPriority,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},getInstanceFromNode:()=>null,prepareScopeUpdate(){},getInstanceFromScope:()=>null,appendChildToContainer:Ad,insertInContainerBefore:VE,removeChildFromContainer(e,t){Af(e,t),ZB(t.yogaNode)},prepareUpdate(e,t,r,i,s){e.internal_static&&(s.isStaticDirty=!0);let a=XB(r,i),u=XB(r.style,i.style);return!a&&!u?null:{props:a,style:u}},commitUpdate(e,{props:t,style:r}){if(t)for(let[i,s]of Object.entries(t)){if(i==="style"){zE(e,s);continue}if(i==="internal_transform"){e.internal_transform=s;continue}if(i==="internal_static"){e.internal_static=!0;continue}qE(e,i,s)}r&&e.yogaNode&&$E(e.yogaNode,r)},commitTextUpdate(e,t,r){af(e,r)},removeChild(e,t){Af(e,t),ZB(t.yogaNode)}});function Bm(e,t=1,r={}){let{indent:i=" ",includeEmptyLines:s=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof i!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof i}\``);if(t===0)return e;let a=s?/^/gm:/^(?!\s*$)/gm;return e.replace(a,i.repeat(t))}var O_=e=>e.getComputedWidth()-e.getComputedPadding(ot.EDGE_LEFT)-e.getComputedPadding(ot.EDGE_RIGHT)-e.getComputedBorder(ot.EDGE_LEFT)-e.getComputedBorder(ot.EDGE_RIGHT),rD=O_;var mD=Le(iD(),1);var sD=(e=0)=>t=>`\x1B[${t+e}m`,AD=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,aD=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,zr={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},oN=Object.keys(zr.modifier),M_=Object.keys(zr.color),P_=Object.keys(zr.bgColor),iN=[...M_,...P_];function U_(){let e=new Map;for(let[t,r]of Object.entries(zr)){for(let[i,s]of Object.entries(r))zr[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=zr[i],e.set(s[0],s[1]);Object.defineProperty(zr,t,{value:r,enumerable:!1})}return Object.defineProperty(zr,"codes",{value:e,enumerable:!1}),zr.color.close="\x1B[39m",zr.bgColor.close="\x1B[49m",zr.color.ansi=sD(),zr.color.ansi256=AD(),zr.color.ansi16m=aD(),zr.bgColor.ansi=sD(10),zr.bgColor.ansi256=AD(10),zr.bgColor.ansi16m=aD(10),Object.defineProperties(zr,{rgbToAnsi256:{value(t,r,i){return t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(a=>a+a).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>zr.rgbToAnsi256(...zr.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,s;if(t>=232)r=((t-232)*10+8)/255,i=r,s=r;else{t-=16;let E=t%36;r=Math.floor(t/36)/5,i=Math.floor(E/6)/5,s=E%6/5}let a=Math.max(r,i,s)*2;if(a===0)return 30;let u=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return a===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>zr.ansi256ToAnsi(zr.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>zr.ansi256ToAnsi(zr.hexToAnsi256(t)),enumerable:!1}}),zr}var G_=U_(),ts=G_;import ym from"node:process";import H_ from"node:os";import lD from"node:tty";function _i(e,t=globalThis.Deno?globalThis.Deno.args:ym.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),s=t.indexOf("--");return i!==-1&&(s===-1||i=2,has16m:e>=3}}function J_(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let i=W_();i!==void 0&&(vd=i);let s=r?vd:i;if(s===0)return 0;if(r){if(_i("color=16m")||_i("color=full")||_i("color=truecolor"))return 3;if(_i("color=256"))return 2}if("TF_BUILD"in $r&&"AGENT_NAME"in $r)return 1;if(e&&!t&&s===void 0)return 0;let a=s||0;if($r.TERM==="dumb")return a;if(ym.platform==="win32"){let u=H_.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in $r)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(u=>u in $r)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in $r)||$r.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in $r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($r.TEAMCITY_VERSION)?1:0;if($r.COLORTERM==="truecolor"||$r.TERM==="xterm-kitty"||$r.TERM==="xterm-ghostty"||$r.TERM==="wezterm")return 3;if("TERM_PROGRAM"in $r){let u=Number.parseInt(($r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($r.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test($r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($r.TERM)||"COLORTERM"in $r?1:a}function uD(e,t={}){let r=J_(e,{streamIsTTY:e&&e.isTTY,...t});return K_(r)}var j_={stdout:uD({isTTY:lD.isatty(1)}),stderr:uD({isTTY:lD.isatty(2)})},cD=j_;function fD(e,t,r){let i=e.indexOf(t);if(i===-1)return e;let s=t.length,a=0,u="";do u+=e.slice(a,i)+t+r,a=i+s,i=e.indexOf(t,a);while(i!==-1);return u+=e.slice(a),u}function gD(e,t,r,i){let s=0,a="";do{let u=e[i-1]==="\r";a+=e.slice(s,u?i-1:i)+t+(u?`\r `:` `)+r,s=i+1,i=e.indexOf(` -`,s)}while(i!==-1);return a+=e.slice(s),a}var{stdout:uD,stderr:cD}=AD,Dm=Symbol("GENERATOR"),Bu=Symbol("STYLER"),pf=Symbol("IS_EMPTY"),fD=["ansi","ansi","ansi256","ansi16m"],Du=Object.create(null),W_=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=uD?uD.level:0;e.level=t.level===void 0?r:t.level};var K_=e=>{let t=(...r)=>r.join(" ");return W_(t,e),Object.setPrototypeOf(t,Ef.prototype),t};function Ef(e){return K_(e)}Object.setPrototypeOf(Ef.prototype,Function.prototype);for(let[e,t]of Object.entries(ts))Du[e]={get(){let r=vd(this,Qm(t.open,t.close,this[Bu]),this[pf]);return Object.defineProperty(this,e,{value:r}),r}};Du.visible={get(){let e=vd(this,this[Bu],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var ym=(e,t,r,...i)=>e==="rgb"?t==="ansi16m"?ts[r].ansi16m(...i):t==="ansi256"?ts[r].ansi256(ts.rgbToAnsi256(...i)):ts[r].ansi(ts.rgbToAnsi(...i)):e==="hex"?ym("rgb",t,r,...ts.hexToRgb(...i)):ts[r][e](...i),J_=["rgb","hex","ansi256"];for(let e of J_){Du[e]={get(){let{level:r}=this;return function(...i){let s=Qm(ym(e,fD[r],"color",...i),ts.color.close,this[Bu]);return vd(this,s,this[pf])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Du[t]={get(){let{level:r}=this;return function(...i){let s=Qm(ym(e,fD[r],"bgColor",...i),ts.bgColor.close,this[Bu]);return vd(this,s,this[pf])}}}}var j_=Object.defineProperties(()=>{},{...Du,level:{enumerable:!0,get(){return this[Dm].level},set(e){this[Dm].level=e}}}),Qm=(e,t,r)=>{let i,s;return r===void 0?(i=e,s=t):(i=r.openAll+e,s=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:s,parent:r}},vd=(e,t,r)=>{let i=(...s)=>Y_(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,j_),i[Dm]=e,i[Bu]=t,i[pf]=r,i},Y_=(e,t)=>{if(e.level<=0||!t)return e[pf]?"":t;let r=e[Bu];if(r===void 0)return t;let{openAll:i,closeAll:s}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=aD(t,r.close,r.open),r=r.parent;let a=t.indexOf(` -`);return a!==-1&&(t=lD(t,s,i,a)),i+t+s};Object.defineProperties(Ef.prototype,Du);var V_=Ef(),AN=Ef({level:cD?cD.level:0});var An=V_;var q_=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,z_=/^ansi256\(\s?(\d+)\s?\)$/,$_=e=>e in An,X_=(e,t,r)=>{if(!t)return e;if($_(t)){if(r==="foreground")return An[t](e);let i=`bg${t[0].toUpperCase()+t.slice(1)}`;return An[i](e)}if(t.startsWith("#"))return r==="foreground"?An.hex(t)(e):An.bgHex(t)(e);if(t.startsWith("ansi256")){let i=z_.exec(t);if(!i)return e;let s=Number(i[1]);return r==="foreground"?An.ansi256(s)(e):An.bgAnsi256(s)(e)}if(t.startsWith("rgb")){let i=q_.exec(t);if(!i)return e;let s=Number(i[1]),a=Number(i[2]),u=Number(i[3]);return r==="foreground"?An.rgb(s,a,u)(e):An.bgRgb(s,a,u)(e)}return e},qA=X_;var Z_=(e,t,r,i)=>{if(r.style.borderStyle){let s=r.yogaNode.getComputedWidth(),a=r.yogaNode.getComputedHeight(),u=typeof r.style.borderStyle=="string"?gD.default[r.style.borderStyle]:r.style.borderStyle,E=r.style.borderTopColor??r.style.borderColor,I=r.style.borderBottomColor??r.style.borderColor,C=r.style.borderLeftColor??r.style.borderColor,y=r.style.borderRightColor??r.style.borderColor,D=r.style.borderTopDimColor??r.style.borderDimColor,R=r.style.borderBottomDimColor??r.style.borderDimColor,O=r.style.borderLeftDimColor??r.style.borderDimColor,G=r.style.borderRightDimColor??r.style.borderDimColor,ne=r.style.borderTop!==!1,oe=r.style.borderBottom!==!1,$=r.style.borderLeft!==!1,J=r.style.borderRight!==!1,X=s-($?1:0)-(J?1:0),Z=ne?qA(($?u.topLeft:"")+u.top.repeat(X)+(J?u.topRight:""),E,"foreground"):void 0;ne&&D&&(Z=An.dim(Z));let ge=a;ne&&(ge-=1),oe&&(ge-=1);let he=(qA(u.left,C,"foreground")+` -`).repeat(ge);O&&(he=An.dim(he));let ue=(qA(u.right,y,"foreground")+` -`).repeat(ge);G&&(ue=An.dim(ue));let Le=oe?qA(($?u.bottomLeft:"")+u.bottom.repeat(X)+(J?u.bottomRight:""),I,"foreground"):void 0;oe&&R&&(Le=An.dim(Le));let pe=ne?1:0;Z&&i.write(e,t,Z,{transformers:[]}),$&&i.write(e,t+pe,he,{transformers:[]}),J&&i.write(e+s-1,t+pe,ue,{transformers:[]}),Le&&i.write(e,t+a-1,Le,{transformers:[]})}},dD=Z_;var eR=(e,t)=>{let r=e.childNodes[0]?.yogaNode;if(r){let i=r.getComputedLeft(),s=r.getComputedTop();t=` -`.repeat(s)+hm(t,i)}return t},pD=(e,t,r)=>{let{offsetX:i=0,offsetY:s=0,transformers:a=[],skipStaticElements:u}=r;if(u&&e.internal_static)return;let{yogaNode:E}=e;if(E){if(E.getDisplay()===it.DISPLAY_NONE)return;let I=i+E.getComputedLeft(),C=s+E.getComputedTop(),y=a;if(typeof e.internal_transform=="function"&&(y=[e.internal_transform,...a]),e.nodeName==="ink-text"){let R=nd(e);if(R.length>0){let O=Pa(R),G=XB(E);if(O>G){let ne=e.style.textWrap??"wrap";R=rd(R,G,ne)}R=eR(e,R),t.write(I,C,R,{transformers:y})}return}let D=!1;if(e.nodeName==="ink-box"){dD(I,C,e,t);let R=e.style.overflowX==="hidden"||e.style.overflow==="hidden",O=e.style.overflowY==="hidden"||e.style.overflow==="hidden";if(R||O){let G=R?I+E.getComputedBorder(it.EDGE_LEFT):void 0,ne=R?I+E.getComputedWidth()-E.getComputedBorder(it.EDGE_RIGHT):void 0,oe=O?C+E.getComputedBorder(it.EDGE_TOP):void 0,$=O?C+E.getComputedHeight()-E.getComputedBorder(it.EDGE_BOTTOM):void 0;t.clip({x1:G,x2:ne,y1:oe,y2:$}),D=!0}}if(e.nodeName==="ink-root"||e.nodeName==="ink-box"){for(let R of e.childNodes)pD(R,t,{offsetX:I,offsetY:C,transformers:y,skipStaticElements:u});D&&t.unclip()}}},vm=pD;function wm(e){return Number.isInteger(e)?rf(e)||nf(e):!1}var tR=new Set([27,155]),rR="0".codePointAt(0),nR="9".codePointAt(0),oR=19,_m=new Set,Sm=new Map;for(let[e,t]of Vr.codes)_m.add(Vr.color.ansi(t)),Sm.set(Vr.color.ansi(e),Vr.color.ansi(t));function iR(e){if(_m.has(e))return e;if(Sm.has(e))return Sm.get(e);e=e.slice(2),e.includes(";")&&(e=e[0]+"0");let t=Vr.codes.get(Number.parseInt(e,10));return t?Vr.color.ansi(t):Vr.reset.open}function sR(e){for(let t=0;t=rR&&r<=nR)return t}return-1}function AR(e,t){e=e.slice(t,t+oR);let r=sR(e);if(r!==-1){let i=e.indexOf("m",r);return i===-1&&(i=e.length),e.slice(0,i+1)}}function aR(e,t=Number.POSITIVE_INFINITY){let r=[],i=0,s=0;for(;i=t)break}return r}function ED(e){let t=[];for(let r of e)r.code===Vr.reset.open?t=[]:_m.has(r.code)?t=t.filter(i=>i.endCode!==r.code):(t=t.filter(i=>i.endCode!==r.endCode),t.push(r));return t}function lR(e){return ED(e).map(({endCode:i})=>i).reverse().join("")}function Rm(e,t,r){let i=aR(e,r),s=[],a=0,u="",E=!1;for(let I of i){if(r!==void 0&&a>=r)break;I.type==="ansi"?(s.push(I),E&&(u+=I.code)):(!E&&a>=t&&(E=!0,s=ED(s),u=s.map(({code:C})=>C).join("")),E&&(u+=I.value),a+=I.isFullWidth?2:I.value.length)}return u+=lR(s),u}var mD=new Set([27,155]),wd=new Set,Fm=new Map;for(let[e,t]of Vr.codes)wd.add(Vr.color.ansi(t)),Fm.set(Vr.color.ansi(e),Vr.color.ansi(t));var Sd="\x1B]8;;",bm=Sd.split("").map(e=>e.charCodeAt(0)),ID="\x07",_N=ID.charCodeAt(0),uR=`\x1B]8;;${ID}`;function hD(e){if(wd.has(e))return e;if(Fm.has(e))return Fm.get(e);if(e.startsWith(Sd))return uR;e=e.slice(2),e.includes(";")&&(e=e[0]+"0");let t=Vr.codes.get(parseInt(e,10));return t?Vr.color.ansi(t):Vr.reset.open}function mf(e){return e.map(t=>t.code).join("")}function xm(e){return _d([],e)}function _d(e,t){let r=[...e];for(let i of t)i.code===Vr.reset.open?r=[]:wd.has(i.code)?r=r.filter(s=>s.endCode!==i.code):(r=r.filter(s=>s.endCode!==i.endCode),r.push(i));return r}function km(e){return xm(e).reverse().map(t=>({...t,code:t.endCode}))}function Rd(e,t){let r=new Set(t.map(s=>s.endCode)),i=new Set(e.map(s=>s.code));return[...km(e.filter(s=>!r.has(s.endCode))),...t.filter(s=>!i.has(s.code))]}function CD(e){let t=[],r=[];for(let i of e)i.type==="ansi"?t=_d(t,[i]):i.type==="char"&&r.push({...i,styles:[...t]});return r}function BD(e){let t="";for(let r=0;r=48&&r<=57)return t}return-1}function fR(e,t){e=e.slice(t);for(let i=1;i=t)break}return r}var yu=class{width;height;operations=[];constructor(t){let{width:r,height:i}=t;this.width=r,this.height=i}write(t,r,i,s){let{transformers:a}=s;i&&this.operations.push({type:"write",x:t,y:r,text:i,transformers:a})}clip(t){this.operations.push({type:"clip",clip:t})}unclip(){this.operations.push({type:"unclip"})}get(){let t=[];for(let s=0;sy.x2)continue}if(O){let G=C.length;if(I+Gy.y2)continue}if(R&&(C=C.map(G=>{let ne=Ey.x2?y.x2-E:oe;return Rm(G,ne,$)}),Ey.y2?y.y2-I:ne;C=C.slice(G,oe),I1;J&&(G[oe+1]={type:"char",value:"",fullWidth:!1,styles:$.styles}),oe+=J?2:1}D++}}return{output:t.map(s=>{let a=s.filter(u=>u!==void 0);return BD(a).trimEnd()}).join(` -`),height:t.length}}};var dR=e=>{if(e.yogaNode){let t=new yu({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});vm(e,t,{skipStaticElements:!0});let r;e.staticNode?.yogaNode&&(r=new yu({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),vm(e.staticNode,r,{skipStaticElements:!1}));let{output:i,height:s}=t.get();return{output:i,outputHeight:s,staticOutput:r?`${r.get().output} -`:""}}return{output:"",outputHeight:0,staticOutput:""}},yD=dR;import bD from"node:process";var _D=Me(SD(),1),RD=Me(BE(),1);import ER from"node:process";var mR=(0,_D.default)(()=>{(0,RD.default)(()=>{ER.stderr.write("\x1B[?25h")},{alwaysLast:!0})}),FD=mR;var xd=!1,Qu={};Qu.show=(e=bD.stderr)=>{e.isTTY&&(xd=!1,e.write("\x1B[?25h"))};Qu.hide=(e=bD.stderr)=>{e.isTTY&&(FD(),xd=!0,e.write("\x1B[?25l"))};Qu.toggle=(e,t)=>{e!==void 0&&(xd=e),xd?Qu.show(t):Qu.hide(t)};var vu=Qu;var IR=(e,{showCursor:t=!1}={})=>{let r=0,i="",s=!1,a=u=>{!t&&!s&&(vu.hide(),s=!0);let E=u+` +`,s)}while(i!==-1);return a+=e.slice(s),a}var{stdout:dD,stderr:pD}=cD,Qm=Symbol("GENERATOR"),Du=Symbol("STYLER"),Ef=Symbol("IS_EMPTY"),ED=["ansi","ansi","ansi256","ansi16m"],yu=Object.create(null),Y_=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=dD?dD.level:0;e.level=t.level===void 0?r:t.level};var V_=e=>{let t=(...r)=>r.join(" ");return Y_(t,e),Object.setPrototypeOf(t,mf.prototype),t};function mf(e){return V_(e)}Object.setPrototypeOf(mf.prototype,Function.prototype);for(let[e,t]of Object.entries(ts))yu[e]={get(){let r=Sd(this,vm(t.open,t.close,this[Du]),this[Ef]);return Object.defineProperty(this,e,{value:r}),r}};yu.visible={get(){let e=Sd(this,this[Du],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var wm=(e,t,r,...i)=>e==="rgb"?t==="ansi16m"?ts[r].ansi16m(...i):t==="ansi256"?ts[r].ansi256(ts.rgbToAnsi256(...i)):ts[r].ansi(ts.rgbToAnsi(...i)):e==="hex"?wm("rgb",t,r,...ts.hexToRgb(...i)):ts[r][e](...i),q_=["rgb","hex","ansi256"];for(let e of q_){yu[e]={get(){let{level:r}=this;return function(...i){let s=vm(wm(e,ED[r],"color",...i),ts.color.close,this[Du]);return Sd(this,s,this[Ef])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);yu[t]={get(){let{level:r}=this;return function(...i){let s=vm(wm(e,ED[r],"bgColor",...i),ts.bgColor.close,this[Du]);return Sd(this,s,this[Ef])}}}}var z_=Object.defineProperties(()=>{},{...yu,level:{enumerable:!0,get(){return this[Qm].level},set(e){this[Qm].level=e}}}),vm=(e,t,r)=>{let i,s;return r===void 0?(i=e,s=t):(i=r.openAll+e,s=t+r.closeAll),{open:e,close:t,openAll:i,closeAll:s,parent:r}},Sd=(e,t,r)=>{let i=(...s)=>$_(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,z_),i[Qm]=e,i[Du]=t,i[Ef]=r,i},$_=(e,t)=>{if(e.level<=0||!t)return e[Ef]?"":t;let r=e[Du];if(r===void 0)return t;let{openAll:i,closeAll:s}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=fD(t,r.close,r.open),r=r.parent;let a=t.indexOf(` +`);return a!==-1&&(t=gD(t,s,i,a)),i+t+s};Object.defineProperties(mf.prototype,yu);var X_=mf(),pN=mf({level:pD?pD.level:0});var An=X_;var Z_=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,eR=/^ansi256\(\s?(\d+)\s?\)$/,tR=e=>e in An,rR=(e,t,r)=>{if(!t)return e;if(tR(t)){if(r==="foreground")return An[t](e);let i=`bg${t[0].toUpperCase()+t.slice(1)}`;return An[i](e)}if(t.startsWith("#"))return r==="foreground"?An.hex(t)(e):An.bgHex(t)(e);if(t.startsWith("ansi256")){let i=eR.exec(t);if(!i)return e;let s=Number(i[1]);return r==="foreground"?An.ansi256(s)(e):An.bgAnsi256(s)(e)}if(t.startsWith("rgb")){let i=Z_.exec(t);if(!i)return e;let s=Number(i[1]),a=Number(i[2]),u=Number(i[3]);return r==="foreground"?An.rgb(s,a,u)(e):An.bgRgb(s,a,u)(e)}return e},qA=rR;var nR=(e,t,r,i)=>{if(r.style.borderStyle){let s=r.yogaNode.getComputedWidth(),a=r.yogaNode.getComputedHeight(),u=typeof r.style.borderStyle=="string"?mD.default[r.style.borderStyle]:r.style.borderStyle,E=r.style.borderTopColor??r.style.borderColor,I=r.style.borderBottomColor??r.style.borderColor,h=r.style.borderLeftColor??r.style.borderColor,y=r.style.borderRightColor??r.style.borderColor,D=r.style.borderTopDimColor??r.style.borderDimColor,R=r.style.borderBottomDimColor??r.style.borderDimColor,O=r.style.borderLeftDimColor??r.style.borderDimColor,G=r.style.borderRightDimColor??r.style.borderDimColor,ne=r.style.borderTop!==!1,oe=r.style.borderBottom!==!1,$=r.style.borderLeft!==!1,Z=r.style.borderRight!==!1,q=s-($?1:0)-(Z?1:0),X=ne?qA(($?u.topLeft:"")+u.top.repeat(q)+(Z?u.topRight:""),E,"foreground"):void 0;ne&&D&&(X=An.dim(X));let fe=a;ne&&(fe-=1),oe&&(fe-=1);let Be=(qA(u.left,h,"foreground")+` +`).repeat(fe);O&&(Be=An.dim(Be));let Ae=(qA(u.right,y,"foreground")+` +`).repeat(fe);G&&(Ae=An.dim(Ae));let xe=oe?qA(($?u.bottomLeft:"")+u.bottom.repeat(q)+(Z?u.bottomRight:""),I,"foreground"):void 0;oe&&R&&(xe=An.dim(xe));let de=ne?1:0;X&&i.write(e,t,X,{transformers:[]}),$&&i.write(e,t+de,Be,{transformers:[]}),Z&&i.write(e+s-1,t+de,Ae,{transformers:[]}),xe&&i.write(e,t+a-1,xe,{transformers:[]})}},ID=nR;var oR=(e,t)=>{let r=e.childNodes[0]?.yogaNode;if(r){let i=r.getComputedLeft(),s=r.getComputedTop();t=` +`.repeat(s)+Bm(t,i)}return t},hD=(e,t,r)=>{let{offsetX:i=0,offsetY:s=0,transformers:a=[],skipStaticElements:u}=r;if(u&&e.internal_static)return;let{yogaNode:E}=e;if(E){if(E.getDisplay()===ot.DISPLAY_NONE)return;let I=i+E.getComputedLeft(),h=s+E.getComputedTop(),y=a;if(typeof e.internal_transform=="function"&&(y=[e.internal_transform,...a]),e.nodeName==="ink-text"){let R=id(e);if(R.length>0){let O=Ua(R),G=rD(E);if(O>G){let ne=e.style.textWrap??"wrap";R=od(R,G,ne)}R=oR(e,R),t.write(I,h,R,{transformers:y})}return}let D=!1;if(e.nodeName==="ink-box"){ID(I,h,e,t);let R=e.style.overflowX==="hidden"||e.style.overflow==="hidden",O=e.style.overflowY==="hidden"||e.style.overflow==="hidden";if(R||O){let G=R?I+E.getComputedBorder(ot.EDGE_LEFT):void 0,ne=R?I+E.getComputedWidth()-E.getComputedBorder(ot.EDGE_RIGHT):void 0,oe=O?h+E.getComputedBorder(ot.EDGE_TOP):void 0,$=O?h+E.getComputedHeight()-E.getComputedBorder(ot.EDGE_BOTTOM):void 0;t.clip({x1:G,x2:ne,y1:oe,y2:$}),D=!0}}if(e.nodeName==="ink-root"||e.nodeName==="ink-box"){for(let R of e.childNodes)hD(R,t,{offsetX:I,offsetY:h,transformers:y,skipStaticElements:u});D&&t.unclip()}}},Sm=hD;function _m(e){return Number.isInteger(e)?nf(e)||of(e):!1}var iR=new Set([27,155]),sR="0".codePointAt(0),AR="9".codePointAt(0),aR=19,bm=new Set,Rm=new Map;for(let[e,t]of Vr.codes)bm.add(Vr.color.ansi(t)),Rm.set(Vr.color.ansi(e),Vr.color.ansi(t));function lR(e){if(bm.has(e))return e;if(Rm.has(e))return Rm.get(e);e=e.slice(2),e.includes(";")&&(e=e[0]+"0");let t=Vr.codes.get(Number.parseInt(e,10));return t?Vr.color.ansi(t):Vr.reset.open}function uR(e){for(let t=0;t=sR&&r<=AR)return t}return-1}function cR(e,t){e=e.slice(t,t+aR);let r=uR(e);if(r!==-1){let i=e.indexOf("m",r);return i===-1&&(i=e.length),e.slice(0,i+1)}}function fR(e,t=Number.POSITIVE_INFINITY){let r=[],i=0,s=0;for(;i=t)break}return r}function CD(e){let t=[];for(let r of e)r.code===Vr.reset.open?t=[]:bm.has(r.code)?t=t.filter(i=>i.endCode!==r.code):(t=t.filter(i=>i.endCode!==r.endCode),t.push(r));return t}function gR(e){return CD(e).map(({endCode:i})=>i).reverse().join("")}function Fm(e,t,r){let i=fR(e,r),s=[],a=0,u="",E=!1;for(let I of i){if(r!==void 0&&a>=r)break;I.type==="ansi"?(s.push(I),E&&(u+=I.code)):(!E&&a>=t&&(E=!0,s=CD(s),u=s.map(({code:h})=>h).join("")),E&&(u+=I.value),a+=I.isFullWidth?2:I.value.length)}return u+=gR(s),u}var BD=new Set([27,155]),_d=new Set,xm=new Map;for(let[e,t]of Vr.codes)_d.add(Vr.color.ansi(t)),xm.set(Vr.color.ansi(e),Vr.color.ansi(t));var Rd="\x1B]8;;",km=Rd.split("").map(e=>e.charCodeAt(0)),DD="\x07",ON=DD.charCodeAt(0),dR=`\x1B]8;;${DD}`;function yD(e){if(_d.has(e))return e;if(xm.has(e))return xm.get(e);if(e.startsWith(Rd))return dR;e=e.slice(2),e.includes(";")&&(e=e[0]+"0");let t=Vr.codes.get(parseInt(e,10));return t?Vr.color.ansi(t):Vr.reset.open}function If(e){return e.map(t=>t.code).join("")}function Nm(e){return bd([],e)}function bd(e,t){let r=[...e];for(let i of t)i.code===Vr.reset.open?r=[]:_d.has(i.code)?r=r.filter(s=>s.endCode!==i.code):(r=r.filter(s=>s.endCode!==i.endCode),r.push(i));return r}function Tm(e){return Nm(e).reverse().map(t=>({...t,code:t.endCode}))}function Fd(e,t){let r=new Set(t.map(s=>s.endCode)),i=new Set(e.map(s=>s.code));return[...Tm(e.filter(s=>!r.has(s.endCode))),...t.filter(s=>!i.has(s.code))]}function QD(e){let t=[],r=[];for(let i of e)i.type==="ansi"?t=bd(t,[i]):i.type==="char"&&r.push({...i,styles:[...t]});return r}function wD(e){let t="";for(let r=0;r=48&&r<=57)return t}return-1}function ER(e,t){e=e.slice(t);for(let i=1;i=t)break}return r}var Qu=class{width;height;operations=[];constructor(t){let{width:r,height:i}=t;this.width=r,this.height=i}write(t,r,i,s){let{transformers:a}=s;i&&this.operations.push({type:"write",x:t,y:r,text:i,transformers:a})}clip(t){this.operations.push({type:"clip",clip:t})}unclip(){this.operations.push({type:"unclip"})}get(){let t=[];for(let s=0;sy.x2)continue}if(O){let G=h.length;if(I+Gy.y2)continue}if(R&&(h=h.map(G=>{let ne=Ey.x2?y.x2-E:oe;return Fm(G,ne,$)}),Ey.y2?y.y2-I:ne;h=h.slice(G,oe),I1;Z&&(G[oe+1]={type:"char",value:"",fullWidth:!1,styles:$.styles}),oe+=Z?2:1}D++}}return{output:t.map(s=>{let a=s.filter(u=>u!==void 0);return wD(a).trimEnd()}).join(` +`),height:t.length}}};var IR=e=>{if(e.yogaNode){let t=new Qu({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});Sm(e,t,{skipStaticElements:!0});let r;e.staticNode?.yogaNode&&(r=new Qu({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),Sm(e.staticNode,r,{skipStaticElements:!1}));let{output:i,height:s}=t.get();return{output:i,outputHeight:s,staticOutput:r?`${r.get().output} +`:""}}return{output:"",outputHeight:0,staticOutput:""}},SD=IR;import TD from"node:process";var xD=Le(FD(),1),kD=Le(yE(),1);import CR from"node:process";var BR=(0,xD.default)(()=>{(0,kD.default)(()=>{CR.stderr.write("\x1B[?25h")},{alwaysLast:!0})}),ND=BR;var Nd=!1,wu={};wu.show=(e=TD.stderr)=>{e.isTTY&&(Nd=!1,e.write("\x1B[?25h"))};wu.hide=(e=TD.stderr)=>{e.isTTY&&(ND(),Nd=!0,e.write("\x1B[?25l"))};wu.toggle=(e,t)=>{e!==void 0&&(Nd=e),Nd?wu.show(t):wu.hide(t)};var vu=wu;var DR=(e,{showCursor:t=!1}={})=>{let r=0,i="",s=!1,a=u=>{!t&&!s&&(vu.hide(),s=!0);let E=u+` `;E!==i&&(i=E,e.write(ko.eraseLines(r)+E),r=E.split(` -`).length)};return a.clear=()=>{e.write(ko.eraseLines(r)),i="",r=0},a.done=()=>{i="",r=0,t||(vu.show(),s=!1)},a},hR={create:IR},xD=hR;var CR=new WeakMap,wu=CR;var oA=Me(jt(),1);import{EventEmitter as NR}from"node:events";import TR from"node:process";var kD=Me(jt(),1),ND=(0,kD.createContext)({exit(){}});ND.displayName="InternalAppContext";var kd=ND;var TD=Me(jt(),1);import{EventEmitter as BR}from"node:events";import DR from"node:process";var OD=(0,TD.createContext)({stdin:DR.stdin,internal_eventEmitter:new BR,setRawMode(){},isRawModeSupported:!1,internal_exitOnCtrlC:!0});OD.displayName="InternalStdinContext";var Nd=OD;var LD=Me(jt(),1);import yR from"node:process";var MD=(0,LD.createContext)({stdout:yR.stdout,write(){}});MD.displayName="InternalStdoutContext";var Td=MD;var PD=Me(jt(),1);import QR from"node:process";var UD=(0,PD.createContext)({stderr:QR.stderr,write(){}});UD.displayName="InternalStderrContext";var Tm=UD;var GD=Me(jt(),1),HD=(0,GD.createContext)({activeId:void 0,add(){},remove(){},activate(){},deactivate(){},enableFocus(){},disableFocus(){},focusNext(){},focusPrevious(){},focus(){}});HD.displayName="InternalFocusContext";var Od=HD;var Qn=Me(jt(),1),Mm=Me(VD(),1);import*as Md from"node:fs";import{cwd as ey}from"node:process";var bR=(e,t=2)=>e.replace(/^\t+/gm,r=>" ".repeat(r.length*t)),qD=bR;var xR=(e,t)=>{let r=[],i=e-t,s=e+t;for(let a=i;a<=s;a++)r.push(a);return r},kR=(e,t,r={})=>{var i;if(typeof e!="string")throw new TypeError("Source code is missing.");if(!t||t<1)throw new TypeError("Line number must start from `1`.");let s=qD(e).split(/\r?\n/);if(!(t>s.length))return xR(t,(i=r.around)!==null&&i!==void 0?i:3).filter(a=>s[a-1]!==void 0).map(a=>({line:a,value:s[a-1]}))},zD=kR;var Ld=Me(jt(),1),Lm=(0,Ld.forwardRef)(({children:e,...t},r)=>Ld.default.createElement("ink-box",{ref:r,style:{...t,overflowX:t.overflowX??t.overflow??"visible",overflowY:t.overflowY??t.overflow??"visible"}},e));Lm.displayName="Box";Lm.defaultProps={flexWrap:"nowrap",flexDirection:"row",flexGrow:0,flexShrink:1};var Qe=Lm;var $D=Me(jt(),1);function k({color:e,backgroundColor:t,dimColor:r=!1,bold:i=!1,italic:s=!1,underline:a=!1,strikethrough:u=!1,inverse:E=!1,wrap:I="wrap",children:C}){if(C==null)return null;let y=D=>(r&&(D=An.dim(D)),e&&(D=qA(D,e,"foreground")),t&&(D=qA(D,t,"background")),i&&(D=An.bold(D)),s&&(D=An.italic(D)),a&&(D=An.underline(D)),u&&(D=An.strikethrough(D)),E&&(D=An.inverse(D)),D);return $D.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:I},internal_transform:y},C)}var XD=e=>e?.replace(`file://${ey()}/`,""),ZD=new Mm.default({cwd:ey(),internals:Mm.default.nodeInternals()});function Pm({error:e}){let t=e.stack?e.stack.split(` -`).slice(1):void 0,r=t?ZD.parseLine(t[0]):void 0,i=XD(r?.file),s,a=0;if(i&&r?.line&&Md.existsSync(i)){let u=Md.readFileSync(i,"utf8");if(s=zD(u,r.line),s)for(let{line:E}of s)a=Math.max(a,String(E).length)}return Qn.default.createElement(Qe,{flexDirection:"column",padding:1},Qn.default.createElement(Qe,null,Qn.default.createElement(k,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Qn.default.createElement(k,null," ",e.message)),r&&i&&Qn.default.createElement(Qe,{marginTop:1},Qn.default.createElement(k,{dimColor:!0},i,":",r.line,":",r.column)),r&&s&&Qn.default.createElement(Qe,{marginTop:1,flexDirection:"column"},s.map(({line:u,value:E})=>Qn.default.createElement(Qe,{key:u},Qn.default.createElement(Qe,{width:a+1},Qn.default.createElement(k,{dimColor:u!==r.line,backgroundColor:u===r.line?"red":void 0,color:u===r.line?"white":void 0},String(u).padStart(a," "),":")),Qn.default.createElement(k,{key:u,backgroundColor:u===r.line?"red":void 0,color:u===r.line?"white":void 0}," "+E)))),e.stack&&Qn.default.createElement(Qe,{marginTop:1,flexDirection:"column"},e.stack.split(` -`).slice(1).map(u=>{let E=ZD.parseLine(u);return E?Qn.default.createElement(Qe,{key:u},Qn.default.createElement(k,{dimColor:!0},"- "),Qn.default.createElement(k,{dimColor:!0,bold:!0},E.function),Qn.default.createElement(k,{dimColor:!0,color:"gray"}," ","(",XD(E.file)??"",":",E.line,":",E.column,")")):Qn.default.createElement(Qe,{key:u},Qn.default.createElement(k,{dimColor:!0},"- "),Qn.default.createElement(k,{dimColor:!0,bold:!0},u))})))}var OR=" ",LR="\x1B[Z",MR="\x1B",If=class extends oA.PureComponent{static displayName="InternalApp";static getDerivedStateFromError(t){return{error:t}}state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0};rawModeEnabledCount=0;internal_eventEmitter=new NR;isRawModeSupported(){return this.props.stdin.isTTY}render(){return oA.default.createElement(kd.Provider,{value:{exit:this.handleExit}},oA.default.createElement(Nd.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC,internal_eventEmitter:this.internal_eventEmitter}},oA.default.createElement(Td.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},oA.default.createElement(Tm.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},oA.default.createElement(Od.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?oA.default.createElement(Pm,{error:this.state.error}):this.props.children)))))}componentDidMount(){vu.hide(this.props.stdout)}componentWillUnmount(){vu.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(t){this.handleExit(t)}handleSetRawMode=t=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===TR.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default. +`).length)};return a.clear=()=>{e.write(ko.eraseLines(r)),i="",r=0},a.done=()=>{i="",r=0,t||(vu.show(),s=!1)},a},yR={create:DR},OD=yR;var QR=new WeakMap,Su=QR;var oA=Le(jt(),1);import{EventEmitter as MR}from"node:events";import PR from"node:process";var LD=Le(jt(),1),MD=(0,LD.createContext)({exit(){}});MD.displayName="InternalAppContext";var Td=MD;var PD=Le(jt(),1);import{EventEmitter as wR}from"node:events";import vR from"node:process";var UD=(0,PD.createContext)({stdin:vR.stdin,internal_eventEmitter:new wR,setRawMode(){},isRawModeSupported:!1,internal_exitOnCtrlC:!0});UD.displayName="InternalStdinContext";var Od=UD;var GD=Le(jt(),1);import SR from"node:process";var HD=(0,GD.createContext)({stdout:SR.stdout,write(){}});HD.displayName="InternalStdoutContext";var Ld=HD;var WD=Le(jt(),1);import _R from"node:process";var KD=(0,WD.createContext)({stderr:_R.stderr,write(){}});KD.displayName="InternalStderrContext";var Lm=KD;var JD=Le(jt(),1),jD=(0,JD.createContext)({activeId:void 0,add(){},remove(){},activate(){},deactivate(){},enableFocus(){},disableFocus(){},focusNext(){},focusPrevious(){},focus(){}});jD.displayName="InternalFocusContext";var Md=jD;var Qn=Le(jt(),1),Um=Le(XD(),1);import*as Ud from"node:fs";import{cwd as oy}from"node:process";var TR=(e,t=2)=>e.replace(/^\t+/gm,r=>" ".repeat(r.length*t)),ZD=TR;var OR=(e,t)=>{let r=[],i=e-t,s=e+t;for(let a=i;a<=s;a++)r.push(a);return r},LR=(e,t,r={})=>{var i;if(typeof e!="string")throw new TypeError("Source code is missing.");if(!t||t<1)throw new TypeError("Line number must start from `1`.");let s=ZD(e).split(/\r?\n/);if(!(t>s.length))return OR(t,(i=r.around)!==null&&i!==void 0?i:3).filter(a=>s[a-1]!==void 0).map(a=>({line:a,value:s[a-1]}))},ey=LR;var Pd=Le(jt(),1),Pm=(0,Pd.forwardRef)(({children:e,...t},r)=>Pd.default.createElement("ink-box",{ref:r,style:{...t,overflowX:t.overflowX??t.overflow??"visible",overflowY:t.overflowY??t.overflow??"visible"}},e));Pm.displayName="Box";Pm.defaultProps={flexWrap:"nowrap",flexDirection:"row",flexGrow:0,flexShrink:1};var ye=Pm;var ty=Le(jt(),1);function N({color:e,backgroundColor:t,dimColor:r=!1,bold:i=!1,italic:s=!1,underline:a=!1,strikethrough:u=!1,inverse:E=!1,wrap:I="wrap",children:h}){if(h==null)return null;let y=D=>(r&&(D=An.dim(D)),e&&(D=qA(D,e,"foreground")),t&&(D=qA(D,t,"background")),i&&(D=An.bold(D)),s&&(D=An.italic(D)),a&&(D=An.underline(D)),u&&(D=An.strikethrough(D)),E&&(D=An.inverse(D)),D);return ty.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:I},internal_transform:y},h)}var ry=e=>e?.replace(`file://${oy()}/`,""),ny=new Um.default({cwd:oy(),internals:Um.default.nodeInternals()});function Gm({error:e}){let t=e.stack?e.stack.split(` +`).slice(1):void 0,r=t?ny.parseLine(t[0]):void 0,i=ry(r?.file),s,a=0;if(i&&r?.line&&Ud.existsSync(i)){let u=Ud.readFileSync(i,"utf8");if(s=ey(u,r.line),s)for(let{line:E}of s)a=Math.max(a,String(E).length)}return Qn.default.createElement(ye,{flexDirection:"column",padding:1},Qn.default.createElement(ye,null,Qn.default.createElement(N,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Qn.default.createElement(N,null," ",e.message)),r&&i&&Qn.default.createElement(ye,{marginTop:1},Qn.default.createElement(N,{dimColor:!0},i,":",r.line,":",r.column)),r&&s&&Qn.default.createElement(ye,{marginTop:1,flexDirection:"column"},s.map(({line:u,value:E})=>Qn.default.createElement(ye,{key:u},Qn.default.createElement(ye,{width:a+1},Qn.default.createElement(N,{dimColor:u!==r.line,backgroundColor:u===r.line?"red":void 0,color:u===r.line?"white":void 0},String(u).padStart(a," "),":")),Qn.default.createElement(N,{key:u,backgroundColor:u===r.line?"red":void 0,color:u===r.line?"white":void 0}," "+E)))),e.stack&&Qn.default.createElement(ye,{marginTop:1,flexDirection:"column"},e.stack.split(` +`).slice(1).map(u=>{let E=ny.parseLine(u);return E?Qn.default.createElement(ye,{key:u},Qn.default.createElement(N,{dimColor:!0},"- "),Qn.default.createElement(N,{dimColor:!0,bold:!0},E.function),Qn.default.createElement(N,{dimColor:!0,color:"gray"}," ","(",ry(E.file)??"",":",E.line,":",E.column,")")):Qn.default.createElement(ye,{key:u},Qn.default.createElement(N,{dimColor:!0},"- "),Qn.default.createElement(N,{dimColor:!0,bold:!0},u))})))}var UR=" ",GR="\x1B[Z",HR="\x1B",hf=class extends oA.PureComponent{static displayName="InternalApp";static getDerivedStateFromError(t){return{error:t}}state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0};rawModeEnabledCount=0;internal_eventEmitter=new MR;isRawModeSupported(){return this.props.stdin.isTTY}render(){return oA.default.createElement(Td.Provider,{value:{exit:this.handleExit}},oA.default.createElement(Od.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC,internal_eventEmitter:this.internal_eventEmitter}},oA.default.createElement(Ld.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},oA.default.createElement(Lm.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},oA.default.createElement(Md.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?oA.default.createElement(Gm,{error:this.state.error}):this.props.children)))))}componentDidMount(){vu.hide(this.props.stdout)}componentWillUnmount(){vu.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(t){this.handleExit(t)}handleSetRawMode=t=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===PR.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default. Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink. -Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),t){this.rawModeEnabledCount===0&&(r.ref(),r.setRawMode(!0),r.addListener("readable",this.handleReadable)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("readable",this.handleReadable),r.unref())};handleReadable=()=>{let t;for(;(t=this.props.stdin.read())!==null;)this.handleInput(t),this.internal_eventEmitter.emit("input",t)};handleInput=t=>{t===""&&this.props.exitOnCtrlC&&this.handleExit(),t===MR&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(t===OR&&this.focusNext(),t===LR&&this.focusPrevious())};handleExit=t=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(t)};enableFocus=()=>{this.setState({isFocusEnabled:!0})};disableFocus=()=>{this.setState({isFocusEnabled:!1})};focus=t=>{this.setState(r=>r.focusables.some(s=>s?.id===t)?{activeFocusId:t}:r)};focusNext=()=>{this.setState(t=>{let r=t.focusables.find(s=>s.isActive)?.id;return{activeFocusId:this.findNextFocusable(t)??r}})};focusPrevious=()=>{this.setState(t=>{let r=t.focusables.findLast(s=>s.isActive)?.id;return{activeFocusId:this.findPreviousFocusable(t)??r}})};addFocusable=(t,{autoFocus:r})=>{this.setState(i=>{let s=i.activeFocusId;return!s&&r&&(s=t),{activeFocusId:s,focusables:[...i.focusables,{id:t,isActive:!0}]}})};removeFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.filter(i=>i.id!==t)}))};activateFocusable=t=>{this.setState(r=>({focusables:r.focusables.map(i=>i.id!==t?i:{id:t,isActive:!0})}))};deactivateFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.map(i=>i.id!==t?i:{id:t,isActive:!1})}))};findNextFocusable=t=>{let r=t.focusables.findIndex(i=>i.id===t.activeFocusId);for(let i=r+1;i{let r=t.focusables.findIndex(i=>i.id===t.activeFocusId);for(let i=r-1;i>=0;i--){let s=t.focusables[i];if(s?.isActive)return s.id}}};var ty=()=>{},hf=class{options;log;throttledLog;isUnmounted;lastOutput;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(t){IE(this),this.options=t,this.rootNode=od("ink-root"),this.rootNode.onComputeLayout=this.calculateLayout,this.rootNode.onRender=t.debug?this.onRender:Pg(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=xD.create(t.stdout),this.throttledLog=t.debug?this.log:Pg(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=Ja.createContainer(this.rootNode,0,null,!1,null,"id",()=>{},null),this.unsubscribeExit=(0,ny.default)(this.unmount,{alwaysLast:!1}),PR.env.DEV==="true"&&Ja.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"}),t.patchConsole&&this.patchConsole(),Na||(t.stdout.on("resize",this.resized),this.unsubscribeResize=()=>{t.stdout.off("resize",this.resized)})}resized=()=>{this.calculateLayout(),this.onRender()};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{let t=this.options.stdout.columns||80;this.rootNode.yogaNode.setWidth(t),this.rootNode.yogaNode.calculateLayout(void 0,void 0,it.DIRECTION_LTR)};onRender=()=>{if(this.isUnmounted)return;let{output:t,outputHeight:r,staticOutput:i}=yD(this.rootNode),s=i&&i!==` -`;if(this.options.debug){s&&(this.fullStaticOutput+=i),this.options.stdout.write(this.fullStaticOutput+t);return}if(Na){s&&this.options.stdout.write(i),this.lastOutput=t;return}if(s&&(this.fullStaticOutput+=i),r>=this.options.stdout.rows){this.options.stdout.write(ko.clearTerminal+this.fullStaticOutput+t),this.lastOutput=t;return}s&&(this.log.clear(),this.options.stdout.write(i),this.log(t)),!s&&t!==this.lastOutput&&this.throttledLog(t),this.lastOutput=t};render(t){let r=ry.default.createElement(If,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},t);Ja.updateContainer(r,this.container,null,ty)}writeToStdout(t){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(t+this.fullStaticOutput+this.lastOutput);return}if(Na){this.options.stdout.write(t);return}this.log.clear(),this.options.stdout.write(t),this.log(this.lastOutput)}}writeToStderr(t){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(t),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(Na){this.options.stderr.write(t);return}this.log.clear(),this.options.stderr.write(t),this.log(this.lastOutput)}}unmount(t){this.isUnmounted||(this.calculateLayout(),this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),Na?this.options.stdout.write(this.lastOutput+` -`):this.options.debug||this.log.done(),this.isUnmounted=!0,Ja.updateContainer(null,this.container,null,ty),wu.delete(this.options.stdout),t instanceof Error?this.rejectExitPromise(t):this.resolveExitPromise())}async waitUntilExit(){return this.exitPromise||=new Promise((t,r)=>{this.resolveExitPromise=t,this.rejectExitPromise=r}),this.exitPromise}clear(){!Na&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=Wh((t,r)=>{t==="stdout"&&this.writeToStdout(r),t==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};var GR=(e,t)=>{let r={stdout:Pd.stdout,stdin:Pd.stdin,stderr:Pd.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,...HR(t)},i=WR(r.stdout,()=>new hf(r));return i.render(e),{rerender:i.render,unmount(){i.unmount()},waitUntilExit:i.waitUntilExit,cleanup:()=>wu.delete(r.stdout),clear:i.clear}},Um=GR,HR=(e={})=>e instanceof UR?{stdout:e,stdin:Pd.stdin}:e,WR=(e,t)=>{let r=wu.get(e);return r||(r=t(),wu.set(e,r)),r};var iA=Me(jt(),1);function Cf(e){let{items:t,children:r,style:i}=e,[s,a]=(0,iA.useState)(0),u=(0,iA.useMemo)(()=>t.slice(s),[t,s]);(0,iA.useLayoutEffect)(()=>{a(t.length)},[t.length]);let E=u.map((C,y)=>r(C,s+y)),I=(0,iA.useMemo)(()=>({position:"absolute",flexDirection:"column",...i}),[i]);return iA.default.createElement("ink-box",{internal_static:!0,style:I},E)}var KR=Me(jt(),1);var JR=Me(jt(),1);var jR=Me(jt(),1);var Gm=Me(jt(),1);import{Buffer as YR}from"node:buffer";var VR=/^(?:\x1b)([a-zA-Z0-9])$/,qR=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,oy={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},iy=[...Object.values(oy),"backspace"],zR=e=>["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(e),$R=e=>["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(e),XR=(e="")=>{let t;YR.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e="\x1B"+String(e)):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");let r={name:"",ctrl:!1,meta:!1,shift:!1,option:!1,sequence:e,raw:e};if(r.sequence=r.sequence||e||r.name,e==="\r")r.raw=void 0,r.name="return";else if(e===` -`)r.name="enter";else if(e===" ")r.name="tab";else if(e==="\b"||e==="\x1B\b")r.name="backspace",r.meta=e.charAt(0)==="\x1B";else if(e==="\x7F"||e==="\x1B\x7F")r.name="delete",r.meta=e.charAt(0)==="\x1B";else if(e==="\x1B"||e==="\x1B\x1B")r.name="escape",r.meta=e.length===2;else if(e===" "||e==="\x1B ")r.name="space",r.meta=e.length===2;else if(e.length===1&&e<="")r.name=String.fromCharCode(e.charCodeAt(0)+97-1),r.ctrl=!0;else if(e.length===1&&e>="0"&&e<="9")r.name="number";else if(e.length===1&&e>="a"&&e<="z")r.name=e;else if(e.length===1&&e>="A"&&e<="Z")r.name=e.toLowerCase(),r.shift=!0;else if(t=VR.exec(e))r.meta=!0,r.shift=/^[A-Z]$/.test(t[1]);else if(t=qR.exec(e)){let i=[...e];i[0]==="\x1B"&&i[1]==="\x1B"&&(r.option=!0);let s=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),a=(t[3]||t[5]||1)-1;r.ctrl=!!(a&4),r.meta=!!(a&10),r.shift=!!(a&1),r.code=s,r.name=oy[s],r.shift=zR(s)||r.shift,r.ctrl=$R(s)||r.ctrl}return r},sy=XR;var Ay=Me(jt(),1);var ZR=()=>(0,Ay.useContext)(Nd),Ud=ZR;var eF=(e,t={})=>{let{stdin:r,setRawMode:i,internal_exitOnCtrlC:s,internal_eventEmitter:a}=Ud();(0,Gm.useEffect)(()=>{if(t.isActive!==!1)return i(!0),()=>{i(!1)}},[t.isActive,i]),(0,Gm.useEffect)(()=>{if(t.isActive===!1)return;let u=E=>{let I=sy(E),C={upArrow:I.name==="up",downArrow:I.name==="down",leftArrow:I.name==="left",rightArrow:I.name==="right",pageDown:I.name==="pagedown",pageUp:I.name==="pageup",return:I.name==="return",escape:I.name==="escape",ctrl:I.ctrl,shift:I.shift,tab:I.name==="tab",backspace:I.name==="backspace",delete:I.name==="delete",meta:I.meta||I.name==="escape"||I.option},y=I.ctrl?I.name:I.sequence;iy.includes(I.name)&&(y=""),y.startsWith("\x1B")&&(y=y.slice(1)),y.length===1&&typeof y[0]=="string"&&/[A-Z]/.test(y[0])&&(C.shift=!0),(!(y==="c"&&C.ctrl)||!s)&&Ja.batchedUpdates(()=>{e(y,C)})};return a?.on("input",u),()=>{a?.removeListener("input",u)}},[t.isActive,r,s,e])},rs=eF;var ay=Me(jt(),1);var tF=()=>(0,ay.useContext)(kd),sA=tF;var ly=Me(jt(),1);var rF=()=>(0,ly.useContext)(Td),AA=rF;var nF=Me(jt(),1);var Hm=Me(jt(),1);var oF=Me(jt(),1);mm();import{randomUUID as Wd}from"node:crypto";import{homedir as dF}from"node:os";import{posix as pF,win32 as Ym}from"node:path";var Wm=class extends Error{status;method;path;constructor(t,r,i,s){super(t),this.name="ApiError",this.status=r,this.method=i,this.path=s}};function iF(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";try{let r=JSON.parse(e);for(let i of["detail","error","message"]){let s=r[i];if(typeof s=="string"&&s.trim())return s.trim();if(Array.isArray(s)){let a=s.map(u=>u&&typeof u=="object"?String(u.msg??""):"").filter(Boolean);if(a.length)return a.join("; ")}}}catch{}return t.startsWith("typeof D=="string"):[],u=Km(i?.major),E=Km(i?.minor);if(!r||!i||!s)return{compatible:!1,reason:"malformed /api/meta response"};if(typeof s.source_root!="string"||Km(s.pid)===null||typeof s.package_version!="string"||typeof s.release_id!="string")return{compatible:!1,reason:"malformed /api/meta runtime identity"};if(r.service!==AF)return{compatible:!1,reason:`unexpected service ${String(r.service||"unknown")}`};let I=e;if(i.name!==Su.name||u!==Su.major)return{compatible:!1,reason:`protocol ${String(i.name||"unknown")}/${String(u)} is incompatible with client ${Su.name}/${Su.major}`,meta:I};if(E===null||E!a.includes(D));if(C.length>0)return{compatible:!1,reason:`missing capabilities: ${C.join(", ")}`,meta:I};if(s.source_root_matches_config===!1)return{compatible:!1,reason:`backend loaded source ${String(s.source_root)} but ARGUS_SKILL_SOURCE_ROOT points to ${String(s.configured_source_root)}`,meta:I};if(s.release_id!==t.releaseId)return{compatible:!1,reason:`backend release ${String(s.release_id)} does not match client release ${t.releaseId}`,meta:I};if(t.sourceDigest){if(typeof s.runtime_source_digest!="string"||!s.runtime_source_digest)return{compatible:!1,reason:"backend process does not report the source digest required by this local checkout",meta:I};if(s.runtime_source_digest!==t.sourceDigest)return{compatible:!1,reason:`backend process source ${String(s.runtime_source_digest).slice(0,16)} does not match local source ${t.sourceDigest.slice(0,16)}`,meta:I}}return{compatible:!0,reason:"",warning:s.release_matches_source===!1?"backend source differs from its prebuilt release artifacts; pull a complete published revision and reinstall":void 0,meta:I}}function cy(e,t){let r=Jm(e);if(!r.compatible||!r.meta)throw new Error(`incompatible Argus API: ${r.reason}`);return r.warning&&t?.(r.warning),r.meta}function fy(e){let t=Bf(e),r=Bf(t?.daemon);if(!t||t.schema_version!==Hd)throw new Error(`incompatible snapshot schema: expected ${Hd}, got ${String(t?.schema_version??"missing")}`);if(!r)throw new Error("invalid snapshot: daemon section is missing");let s=["global_daily_cap_usd","read_status","read_error","protocol_compatible","protocol_error"].filter(E=>!Object.hasOwn(r,E));if(s.length>0)throw new Error(`invalid snapshot: daemon fields missing: ${s.join(", ")}`);let u=["spend_usd","spend_status","usage_summary","request_usage","cost_control","daemon_commands","observability","mission_view","partial","diagnostics"].filter(E=>!Object.hasOwn(t,E));if(u.length>0)throw new Error(`invalid snapshot: fields missing: ${u.join(", ")}`);if(!Array.isArray(t.diagnostics))throw new Error("invalid snapshot: diagnostics must be an array");return e}function jm(e){let t=typeof e=="string"||e instanceof URL?String(e):e.url;try{let r=new URL(t);return r.username="",r.password="",r.searchParams.has("token")&&r.searchParams.set("token","[redacted]"),r.toString()}catch{return t}}function ja(e,t){return typeof e=="object"&&e!==null?e[t]:void 0}function lF(e){let t=ja(e,"cause"),r=new Set;for(;ja(t,"cause")&&!r.has(t);)r.add(t),t=ja(t,"cause");return t??e}function uF(e,t,r="GET"){let i=lF(e),s=String(ja(i,"code")??"").trim(),a=String(ja(i,"address")??"").trim(),u=String(ja(i,"port")??"").trim(),E=a&&u?`${a}:${u}`:a,I=i instanceof Error?i.message.trim():String(i??"").trim(),C=e instanceof Error?e.message.trim():String(e??"").trim(),y;return s==="ECONNREFUSED"?y=`connection refused${E?` by ${E}`:""}`:s==="ECONNRESET"?y="connection reset by the local service":s==="ETIMEDOUT"?y="connection timed out":s==="ENOTFOUND"?y="host name could not be resolved":I&&I!==C?y=I:y=C||"network request failed",`${r.toUpperCase()} ${jm(t)} failed: ${y}${s?` (${s})`:""}`}function gy(e){return e%1e3===0?`${e/1e3}s`:`${e}ms`}async function cF(e,t,r,i,s){let a=Number.isFinite(r)&&r>0?Math.max(1,Math.trunc(r)):1,u=new AbortController,E=t.signal,I=!1,C=!1,y=()=>u.abort(E?.reason);E?.aborted?y():E?.addEventListener("abort",y,{once:!0});let D=(async()=>{let G=await fetch(e,{...t,signal:u.signal});return C=!0,await s(G)})(),R,O=new Promise((G,ne)=>{R=setTimeout(()=>{I=!0;let oe=new Error(`request timed out after ${gy(a)}`);u.abort(oe),ne(oe)},a)});try{return await Promise.race([D,O])}catch(G){throw I?new Error(`${i.toUpperCase()} ${jm(e)} timed out after ${gy(a)}; the local Argus service did not respond`,{cause:G}):E?.aborted?E.reason instanceof Error?E.reason:new Error(`${i.toUpperCase()} ${jm(e)} was aborted`,{cause:G}):C&&ja(G,"cause")===void 0?G:new Error(uF(G,e,i),{cause:G})}finally{R&&clearTimeout(R),E?.removeEventListener("abort",y)}}function zA(e,t,r,i,s=t.method??"GET"){return cF(e,t,r,s,i)}function EF(e,t=dF()){let r=E=>E.includes("\\")||/^[A-Za-z]:[\\/]/.test(E),i=r(e)?Ym:pF,s=i.resolve(e),a=E=>i===Ym?E.toLowerCase():E,u=r(t)===(i===Ym)?a(i.resolve(t)):"";if(!(a(s)===u||a(s)===a(i.parse(s).root)))return s}function mF(e,t=""){let r=t.trim();return e===4401?{code:e,reason:r||"event stream authentication was rejected",retryable:!1}:e===4404?{code:e,reason:r||"the selected project no longer exists",retryable:!1}:{code:e,reason:r,retryable:!0}}function Vm(e){let t=e.item?.title||"new mission";return e.daemon?.admission_required?`\u2192 queued: choose one running session to park before starting ${t}`:e.daemon&&e.daemon.rc!==0?`\u2192 queued but not running: ${e.daemon.error||"background executor failed to start"}`:`\u2192 dispatched to the team: ${t}`}function dy(e){let t=[],r;for(;(r=e.indexOf(` +Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),t){this.rawModeEnabledCount===0&&(r.ref(),r.setRawMode(!0),r.addListener("readable",this.handleReadable)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("readable",this.handleReadable),r.unref())};handleReadable=()=>{let t;for(;(t=this.props.stdin.read())!==null;)this.handleInput(t),this.internal_eventEmitter.emit("input",t)};handleInput=t=>{t===""&&this.props.exitOnCtrlC&&this.handleExit(),t===HR&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(t===UR&&this.focusNext(),t===GR&&this.focusPrevious())};handleExit=t=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(t)};enableFocus=()=>{this.setState({isFocusEnabled:!0})};disableFocus=()=>{this.setState({isFocusEnabled:!1})};focus=t=>{this.setState(r=>r.focusables.some(s=>s?.id===t)?{activeFocusId:t}:r)};focusNext=()=>{this.setState(t=>{let r=t.focusables.find(s=>s.isActive)?.id;return{activeFocusId:this.findNextFocusable(t)??r}})};focusPrevious=()=>{this.setState(t=>{let r=t.focusables.findLast(s=>s.isActive)?.id;return{activeFocusId:this.findPreviousFocusable(t)??r}})};addFocusable=(t,{autoFocus:r})=>{this.setState(i=>{let s=i.activeFocusId;return!s&&r&&(s=t),{activeFocusId:s,focusables:[...i.focusables,{id:t,isActive:!0}]}})};removeFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.filter(i=>i.id!==t)}))};activateFocusable=t=>{this.setState(r=>({focusables:r.focusables.map(i=>i.id!==t?i:{id:t,isActive:!0})}))};deactivateFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.map(i=>i.id!==t?i:{id:t,isActive:!1})}))};findNextFocusable=t=>{let r=t.focusables.findIndex(i=>i.id===t.activeFocusId);for(let i=r+1;i{let r=t.focusables.findIndex(i=>i.id===t.activeFocusId);for(let i=r-1;i>=0;i--){let s=t.focusables[i];if(s?.isActive)return s.id}}};var iy=()=>{},Cf=class{options;log;throttledLog;isUnmounted;lastOutput;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(t){CE(this),this.options=t,this.rootNode=sd("ink-root"),this.rootNode.onComputeLayout=this.calculateLayout,this.rootNode.onRender=t.debug?this.onRender:Gg(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=OD.create(t.stdout),this.throttledLog=t.debug?this.log:Gg(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=ja.createContainer(this.rootNode,0,null,!1,null,"id",()=>{},null),this.unsubscribeExit=(0,Ay.default)(this.unmount,{alwaysLast:!1}),WR.env.DEV==="true"&&ja.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"}),t.patchConsole&&this.patchConsole(),Ta||(t.stdout.on("resize",this.resized),this.unsubscribeResize=()=>{t.stdout.off("resize",this.resized)})}resized=()=>{this.calculateLayout(),this.onRender()};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{let t=this.options.stdout.columns||80;this.rootNode.yogaNode.setWidth(t),this.rootNode.yogaNode.calculateLayout(void 0,void 0,ot.DIRECTION_LTR)};onRender=()=>{if(this.isUnmounted)return;let{output:t,outputHeight:r,staticOutput:i}=SD(this.rootNode),s=i&&i!==` +`;if(this.options.debug){s&&(this.fullStaticOutput+=i),this.options.stdout.write(this.fullStaticOutput+t);return}if(Ta){s&&this.options.stdout.write(i),this.lastOutput=t;return}if(s&&(this.fullStaticOutput+=i),r>=this.options.stdout.rows){this.options.stdout.write(ko.clearTerminal+this.fullStaticOutput+t),this.lastOutput=t;return}s&&(this.log.clear(),this.options.stdout.write(i),this.log(t)),!s&&t!==this.lastOutput&&this.throttledLog(t),this.lastOutput=t};render(t){let r=sy.default.createElement(hf,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},t);ja.updateContainer(r,this.container,null,iy)}writeToStdout(t){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(t+this.fullStaticOutput+this.lastOutput);return}if(Ta){this.options.stdout.write(t);return}this.log.clear(),this.options.stdout.write(t),this.log(this.lastOutput)}}writeToStderr(t){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(t),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(Ta){this.options.stderr.write(t);return}this.log.clear(),this.options.stderr.write(t),this.log(this.lastOutput)}}unmount(t){this.isUnmounted||(this.calculateLayout(),this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),Ta?this.options.stdout.write(this.lastOutput+` +`):this.options.debug||this.log.done(),this.isUnmounted=!0,ja.updateContainer(null,this.container,null,iy),Su.delete(this.options.stdout),t instanceof Error?this.rejectExitPromise(t):this.resolveExitPromise())}async waitUntilExit(){return this.exitPromise||=new Promise((t,r)=>{this.resolveExitPromise=t,this.rejectExitPromise=r}),this.exitPromise}clear(){!Ta&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=Yh((t,r)=>{t==="stdout"&&this.writeToStdout(r),t==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};var JR=(e,t)=>{let r={stdout:Gd.stdout,stdin:Gd.stdin,stderr:Gd.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,...jR(t)},i=YR(r.stdout,()=>new Cf(r));return i.render(e),{rerender:i.render,unmount(){i.unmount()},waitUntilExit:i.waitUntilExit,cleanup:()=>Su.delete(r.stdout),clear:i.clear}},Hm=JR,jR=(e={})=>e instanceof KR?{stdout:e,stdin:Gd.stdin}:e,YR=(e,t)=>{let r=Su.get(e);return r||(r=t(),Su.set(e,r)),r};var iA=Le(jt(),1);function Bf(e){let{items:t,children:r,style:i}=e,[s,a]=(0,iA.useState)(0),u=(0,iA.useMemo)(()=>t.slice(s),[t,s]);(0,iA.useLayoutEffect)(()=>{a(t.length)},[t.length]);let E=u.map((h,y)=>r(h,s+y)),I=(0,iA.useMemo)(()=>({position:"absolute",flexDirection:"column",...i}),[i]);return iA.default.createElement("ink-box",{internal_static:!0,style:I},E)}var VR=Le(jt(),1);var qR=Le(jt(),1);var zR=Le(jt(),1);var Wm=Le(jt(),1);import{Buffer as $R}from"node:buffer";var XR=/^(?:\x1b)([a-zA-Z0-9])$/,ZR=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,ay={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},ly=[...Object.values(ay),"backspace"],eb=e=>["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(e),tb=e=>["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(e),rb=(e="")=>{let t;$R.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e="\x1B"+String(e)):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");let r={name:"",ctrl:!1,meta:!1,shift:!1,option:!1,sequence:e,raw:e};if(r.sequence=r.sequence||e||r.name,e==="\r")r.raw=void 0,r.name="return";else if(e===` +`)r.name="enter";else if(e===" ")r.name="tab";else if(e==="\b"||e==="\x1B\b")r.name="backspace",r.meta=e.charAt(0)==="\x1B";else if(e==="\x7F"||e==="\x1B\x7F")r.name="delete",r.meta=e.charAt(0)==="\x1B";else if(e==="\x1B"||e==="\x1B\x1B")r.name="escape",r.meta=e.length===2;else if(e===" "||e==="\x1B ")r.name="space",r.meta=e.length===2;else if(e.length===1&&e<="")r.name=String.fromCharCode(e.charCodeAt(0)+97-1),r.ctrl=!0;else if(e.length===1&&e>="0"&&e<="9")r.name="number";else if(e.length===1&&e>="a"&&e<="z")r.name=e;else if(e.length===1&&e>="A"&&e<="Z")r.name=e.toLowerCase(),r.shift=!0;else if(t=XR.exec(e))r.meta=!0,r.shift=/^[A-Z]$/.test(t[1]);else if(t=ZR.exec(e)){let i=[...e];i[0]==="\x1B"&&i[1]==="\x1B"&&(r.option=!0);let s=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),a=(t[3]||t[5]||1)-1;r.ctrl=!!(a&4),r.meta=!!(a&10),r.shift=!!(a&1),r.code=s,r.name=ay[s],r.shift=eb(s)||r.shift,r.ctrl=tb(s)||r.ctrl}return r},uy=rb;var cy=Le(jt(),1);var nb=()=>(0,cy.useContext)(Od),Hd=nb;var ob=(e,t={})=>{let{stdin:r,setRawMode:i,internal_exitOnCtrlC:s,internal_eventEmitter:a}=Hd();(0,Wm.useEffect)(()=>{if(t.isActive!==!1)return i(!0),()=>{i(!1)}},[t.isActive,i]),(0,Wm.useEffect)(()=>{if(t.isActive===!1)return;let u=E=>{let I=uy(E),h={upArrow:I.name==="up",downArrow:I.name==="down",leftArrow:I.name==="left",rightArrow:I.name==="right",pageDown:I.name==="pagedown",pageUp:I.name==="pageup",return:I.name==="return",escape:I.name==="escape",ctrl:I.ctrl,shift:I.shift,tab:I.name==="tab",backspace:I.name==="backspace",delete:I.name==="delete",meta:I.meta||I.name==="escape"||I.option},y=I.ctrl?I.name:I.sequence;ly.includes(I.name)&&(y=""),y.startsWith("\x1B")&&(y=y.slice(1)),y.length===1&&typeof y[0]=="string"&&/[A-Z]/.test(y[0])&&(h.shift=!0),(!(y==="c"&&h.ctrl)||!s)&&ja.batchedUpdates(()=>{e(y,h)})};return a?.on("input",u),()=>{a?.removeListener("input",u)}},[t.isActive,r,s,e])},rs=ob;var fy=Le(jt(),1);var ib=()=>(0,fy.useContext)(Td),sA=ib;var gy=Le(jt(),1);var sb=()=>(0,gy.useContext)(Ld),AA=sb;var Ab=Le(jt(),1);var Km=Le(jt(),1);var ab=Le(jt(),1);hm();import{randomUUID as Jd}from"node:crypto";import{homedir as Ib}from"node:os";import{posix as hb,win32 as qm}from"node:path";var Jm=class extends Error{status;method;path;constructor(t,r,i,s){super(t),this.name="ApiError",this.status=r,this.method=i,this.path=s}};function lb(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";try{let r=JSON.parse(e);for(let i of["detail","error","message"]){let s=r[i];if(typeof s=="string"&&s.trim())return s.trim();if(Array.isArray(s)){let a=s.map(u=>u&&typeof u=="object"?String(u.msg??""):"").filter(Boolean);if(a.length)return a.join("; ")}}}catch{}return t.startsWith("typeof D=="string"):[],u=jm(i?.major),E=jm(i?.minor);if(!r||!i||!s)return{compatible:!1,reason:"malformed /api/meta response"};if(typeof s.source_root!="string"||jm(s.pid)===null||typeof s.package_version!="string"||typeof s.release_id!="string")return{compatible:!1,reason:"malformed /api/meta runtime identity"};if(r.service!==cb)return{compatible:!1,reason:`unexpected service ${String(r.service||"unknown")}`};let I=e;if(i.name!==_u.name||u!==_u.major)return{compatible:!1,reason:`protocol ${String(i.name||"unknown")}/${String(u)} is incompatible with client ${_u.name}/${_u.major}`,meta:I};if(E===null||E<_u.minServerMinor)return{compatible:!1,reason:`server protocol minor ${String(E)} is older than required ${_u.minServerMinor}`,meta:I};if(r.snapshot_schema_version!==Kd)return{compatible:!1,reason:`snapshot schema ${String(r.snapshot_schema_version)} is incompatible with required ${Kd}`,meta:I};let h=fb.filter(D=>!a.includes(D));if(h.length>0)return{compatible:!1,reason:`missing capabilities: ${h.join(", ")}`,meta:I};if(s.source_root_matches_config===!1)return{compatible:!1,reason:`backend loaded source ${String(s.source_root)} but ARGUS_SKILL_SOURCE_ROOT points to ${String(s.configured_source_root)}`,meta:I};if(s.release_id!==t.releaseId)return{compatible:!1,reason:`backend release ${String(s.release_id)} does not match client release ${t.releaseId}`,meta:I};if(t.sourceDigest){if(typeof s.runtime_source_digest!="string"||!s.runtime_source_digest)return{compatible:!1,reason:"backend process does not report the source digest required by this local checkout",meta:I};if(s.runtime_source_digest!==t.sourceDigest)return{compatible:!1,reason:`backend process source ${String(s.runtime_source_digest).slice(0,16)} does not match local source ${t.sourceDigest.slice(0,16)}`,meta:I}}return{compatible:!0,reason:"",warning:s.release_matches_source===!1?"backend source differs from its prebuilt release artifacts; pull a complete published revision and reinstall":void 0,meta:I}}function py(e,t){let r=Ym(e);if(!r.compatible||!r.meta)throw new Error(`incompatible Argus API: ${r.reason}`);return r.warning&&t?.(r.warning),r.meta}function Ey(e){let t=Df(e),r=Df(t?.daemon);if(!t||t.schema_version!==Kd)throw new Error(`incompatible snapshot schema: expected ${Kd}, got ${String(t?.schema_version??"missing")}`);if(!r)throw new Error("invalid snapshot: daemon section is missing");let s=["global_daily_cap_usd","read_status","read_error","protocol_compatible","protocol_error"].filter(E=>!Object.hasOwn(r,E));if(s.length>0)throw new Error(`invalid snapshot: daemon fields missing: ${s.join(", ")}`);let u=["spend_usd","spend_status","usage_summary","request_usage","cost_control","daemon_commands","observability","mission_view","partial","diagnostics"].filter(E=>!Object.hasOwn(t,E));if(u.length>0)throw new Error(`invalid snapshot: fields missing: ${u.join(", ")}`);if(!Array.isArray(t.diagnostics))throw new Error("invalid snapshot: diagnostics must be an array");return e}function Vm(e){let t=typeof e=="string"||e instanceof URL?String(e):e.url;try{let r=new URL(t);return r.username="",r.password="",r.searchParams.has("token")&&r.searchParams.set("token","[redacted]"),r.toString()}catch{return t}}function Ya(e,t){return typeof e=="object"&&e!==null?e[t]:void 0}function gb(e){let t=Ya(e,"cause"),r=new Set;for(;Ya(t,"cause")&&!r.has(t);)r.add(t),t=Ya(t,"cause");return t??e}function db(e,t,r="GET"){let i=gb(e),s=String(Ya(i,"code")??"").trim(),a=String(Ya(i,"address")??"").trim(),u=String(Ya(i,"port")??"").trim(),E=a&&u?`${a}:${u}`:a,I=i instanceof Error?i.message.trim():String(i??"").trim(),h=e instanceof Error?e.message.trim():String(e??"").trim(),y;return s==="ECONNREFUSED"?y=`connection refused${E?` by ${E}`:""}`:s==="ECONNRESET"?y="connection reset by the local service":s==="ETIMEDOUT"?y="connection timed out":s==="ENOTFOUND"?y="host name could not be resolved":I&&I!==h?y=I:y=h||"network request failed",`${r.toUpperCase()} ${Vm(t)} failed: ${y}${s?` (${s})`:""}`}function my(e){return e%1e3===0?`${e/1e3}s`:`${e}ms`}async function pb(e,t,r,i,s){let a=Number.isFinite(r)&&r>0?Math.max(1,Math.trunc(r)):1,u=new AbortController,E=t.signal,I=!1,h=!1,y=()=>u.abort(E?.reason);E?.aborted?y():E?.addEventListener("abort",y,{once:!0});let D=(async()=>{let G=await fetch(e,{...t,signal:u.signal});return h=!0,await s(G)})(),R,O=new Promise((G,ne)=>{R=setTimeout(()=>{I=!0;let oe=new Error(`request timed out after ${my(a)}`);u.abort(oe),ne(oe)},a)});try{return await Promise.race([D,O])}catch(G){throw I?new Error(`${i.toUpperCase()} ${Vm(e)} timed out after ${my(a)}; the local Argus service did not respond`,{cause:G}):E?.aborted?E.reason instanceof Error?E.reason:new Error(`${i.toUpperCase()} ${Vm(e)} was aborted`,{cause:G}):h&&Ya(G,"cause")===void 0?G:new Error(db(G,e,i),{cause:G})}finally{R&&clearTimeout(R),E?.removeEventListener("abort",y)}}function zA(e,t,r,i,s=t.method??"GET"){return pb(e,t,r,s,i)}function Cb(e,t=Ib()){let r=E=>E.includes("\\")||/^[A-Za-z]:[\\/]/.test(E),i=r(e)?qm:hb,s=i.resolve(e),a=E=>i===qm?E.toLowerCase():E,u=r(t)===(i===qm)?a(i.resolve(t)):"";if(!(a(s)===u||a(s)===a(i.parse(s).root)))return s}function Bb(e,t=""){let r=t.trim();return e===4401?{code:e,reason:r||"event stream authentication was rejected",retryable:!1}:e===4404?{code:e,reason:r||"the selected project no longer exists",retryable:!1}:{code:e,reason:r,retryable:!0}}function zm(e){let t=e.item?.title||"new mission";return e.daemon?.admission_required?`\u2192 queued: choose one running session to park before starting ${t}`:e.daemon&&e.daemon.rc!==0?`\u2192 queued but not running: ${e.daemon.error||"background executor failed to start"}`:`\u2192 dispatched to the team: ${t}`}function Iy(e){let t=[],r;for(;(r=e.indexOf(` `))>=0;){let i=e.slice(0,r);e=e.slice(r+2);for(let s of i.split(` -`)){let a=s.trim();if(a.startsWith("data:"))try{t.push(JSON.parse(a.slice(5).trim()))}catch{}}}return{frames:t,rest:e}}var ns=class{httpBase;wsBase;project;token;onCompatibilityWarning;metaTimeoutMs;readTimeoutMs;metaPromise;constructor(t){this.httpBase=`http://${t.host}:${t.port}`,this.wsBase=`ws://${t.host}:${t.port}`,this.project=t.project,this.token=t.token,this.onCompatibilityWarning=t.onCompatibilityWarning,this.metaTimeoutMs=t.metaTimeoutMs??8e3,this.readTimeoutMs=t.readTimeoutMs??12e3}authHeaders(){return this.token?{Authorization:`Bearer ${this.token}`}:{}}p(t){return`${this.httpBase}/api/projects/${encodeURIComponent(this.project)}${t}`}meta(){if(!this.metaPromise){let t="/api/meta",r=zA(`${this.httpBase}${t}`,{headers:this.authHeaders()},this.metaTimeoutMs,async i=>{if(i.status===404)throw new Error("incompatible Argus API: service does not expose /api/meta");return await co(i,"GET",t),cy(await i.json(),this.onCompatibilityWarning)});this.metaPromise=r,r.catch(()=>{this.metaPromise===r&&(this.metaPromise=void 0)})}return this.metaPromise}async listProjects(){return await this.meta(),zA(`${this.httpBase}/api/projects`,{headers:this.authHeaders()},this.readTimeoutMs,async t=>(await co(t,"GET","/api/projects"),(await t.json()).projects))}async createDaemon(t="",r="",i=process.cwd(),s,a=Wd()){let u="/api/daemons",E=EF(i),I={objective:t,name:r,launch_cwd:i,command_id:a,expected_revision:s};E&&(I.workdir=E);let C=JSON.stringify(I),y=()=>fetch(`${this.httpBase}${u}`,{method:"POST",headers:{"Content-Type":"application/json",Connection:"close",...this.authHeaders()},body:C}),D=await y();return D.status===400&&/Invalid HTTP request received/i.test(await D.clone().text())&&(D=await y()),await co(D,"POST",u),await D.json()}async replaceDaemon(t,r=!1,i,s=Wd()){return await this.post("/daemon/replace",{victim_sid:t,resume_continuous:r,command_id:s,expected_revision:i})}async scheduleDaemonUpgrade(t,r,i=Wd()){let s=`/api/projects/${encodeURIComponent(t)}/daemon/upgrade-schedule`,a=await fetch(`${this.httpBase}${s}`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({command_id:i,expected_revision:r})});return await co(a,"POST",s),await a.json()}stopDaemon(t=Wd()){let r="/daemon/stop";return zA(this.p(r),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({force:!1,drain:!1,command_id:t})},this.readTimeoutMs,async i=>{await co(i,"POST",r);let s=await i.json(),a=Number(s.rc??0);if(!Number.isFinite(a)||![0,1].includes(a)){let u=String(s.error??s.message??`rc=${String(s.rc??"unknown")}`);throw new Error(`executor did not stop cleanly: ${u}`)}return s})}async setProjectLaunchCwd(t,r){let i=`/api/projects/${encodeURIComponent(t)}/launch-cwd`,s=await fetch(`${this.httpBase}${i}`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({launch_cwd:r})});await co(s,"POST",i)}async setProjectWorkdir(t,r){let i=`/api/projects/${encodeURIComponent(t)}/workdir`,s=await fetch(`${this.httpBase}${i}`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({workdir:r})});await co(s,"POST",i)}async renameProject(t){let r=this.p(""),i=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({name:t})});return await co(i,"PATCH",r),await i.json()}async snapshot(t=1,r){return await this.meta(),zA(this.p(`/snapshot?compact=true&events_limit=${t}`),{headers:this.authHeaders(),signal:r},this.readTimeoutMs,async i=>(await co(i,"GET","/snapshot"),fy(await i.json())))}async postTask(t){let r=await fetch(this.p("/tasks"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t})});return await co(r,"POST","/tasks"),(await r.json()).item}async postNudge(t){let r=await fetch(this.p("/nudge"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t})});await co(r,"POST","/nudge")}async message(t,r){let i=await fetch(this.p("/message"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t}),signal:r});return await co(i,"POST","/message"),await i.json()}async messageStream(t,r,i){let s=await fetch(this.p("/message/stream"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t}),signal:i});if(await co(s,"POST","/message/stream"),!s.body)throw new Error("Manager stream returned no response body");let a=C=>{if(!i?.aborted)if(C.type==="phase"){let y=Number(C.quiet_s??0);r.onPhase?.(String(C.label??""),String(C.role??"manager"),{heartbeat:C.heartbeat===!0,quietS:Number.isFinite(y)?y:0,kind:String(C.kind??""),detail:String(C.detail??"")})}else C.type==="delta"?r.onDelta?.(String(C.text??""),String(C.message_id??""),String(C.fragment_mode??"auto")):C.type==="done"?r.onDone?.(C.result??{}):C.type==="error"&&r.onError?.(new Error(String(C.error??"stream error")))},u=s.body.getReader(),E=new TextDecoder,I="";for(;;){let{done:C,value:y}=await u.read();if(C)break;I+=E.decode(y,{stream:!0});let D=dy(I);I=D.rest,D.frames.forEach(a)}i?.aborted||dy(I+` +`)){let a=s.trim();if(a.startsWith("data:"))try{t.push(JSON.parse(a.slice(5).trim()))}catch{}}}return{frames:t,rest:e}}var ns=class{httpBase;wsBase;project;token;onCompatibilityWarning;metaTimeoutMs;readTimeoutMs;metaPromise;constructor(t){this.httpBase=`http://${t.host}:${t.port}`,this.wsBase=`ws://${t.host}:${t.port}`,this.project=t.project,this.token=t.token,this.onCompatibilityWarning=t.onCompatibilityWarning,this.metaTimeoutMs=t.metaTimeoutMs??8e3,this.readTimeoutMs=t.readTimeoutMs??12e3}authHeaders(){return this.token?{Authorization:`Bearer ${this.token}`}:{}}p(t){return`${this.httpBase}/api/projects/${encodeURIComponent(this.project)}${t}`}meta(){if(!this.metaPromise){let t="/api/meta",r=zA(`${this.httpBase}${t}`,{headers:this.authHeaders()},this.metaTimeoutMs,async i=>{if(i.status===404)throw new Error("incompatible Argus API: service does not expose /api/meta");return await co(i,"GET",t),py(await i.json(),this.onCompatibilityWarning)});this.metaPromise=r,r.catch(()=>{this.metaPromise===r&&(this.metaPromise=void 0)})}return this.metaPromise}async listProjects(){return await this.meta(),zA(`${this.httpBase}/api/projects`,{headers:this.authHeaders()},this.readTimeoutMs,async t=>(await co(t,"GET","/api/projects"),(await t.json()).projects))}async createDaemon(t="",r="",i=process.cwd(),s,a=Jd()){let u="/api/daemons",E=Cb(i),I={objective:t,name:r,launch_cwd:i,command_id:a,expected_revision:s};E&&(I.workdir=E);let h=JSON.stringify(I),y=()=>fetch(`${this.httpBase}${u}`,{method:"POST",headers:{"Content-Type":"application/json",Connection:"close",...this.authHeaders()},body:h}),D=await y();return D.status===400&&/Invalid HTTP request received/i.test(await D.clone().text())&&(D=await y()),await co(D,"POST",u),await D.json()}async replaceDaemon(t,r=!1,i,s=Jd()){return await this.post("/daemon/replace",{victim_sid:t,resume_continuous:r,command_id:s,expected_revision:i})}async scheduleDaemonUpgrade(t,r,i=Jd()){let s=`/api/projects/${encodeURIComponent(t)}/daemon/upgrade-schedule`,a=await fetch(`${this.httpBase}${s}`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({command_id:i,expected_revision:r})});return await co(a,"POST",s),await a.json()}stopDaemon(t=Jd()){let r="/daemon/stop";return zA(this.p(r),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({force:!1,drain:!1,command_id:t})},this.readTimeoutMs,async i=>{await co(i,"POST",r);let s=await i.json(),a=Number(s.rc??0);if(!Number.isFinite(a)||![0,1].includes(a)){let u=String(s.error??s.message??`rc=${String(s.rc??"unknown")}`);throw new Error(`executor did not stop cleanly: ${u}`)}return s})}async setProjectLaunchCwd(t,r){let i=`/api/projects/${encodeURIComponent(t)}/launch-cwd`,s=await fetch(`${this.httpBase}${i}`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({launch_cwd:r})});await co(s,"POST",i)}async setProjectWorkdir(t,r){let i=`/api/projects/${encodeURIComponent(t)}/workdir`,s=await fetch(`${this.httpBase}${i}`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({workdir:r})});await co(s,"POST",i)}async renameProject(t){let r=this.p(""),i=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({name:t})});return await co(i,"PATCH",r),await i.json()}async snapshot(t=1,r){return await this.meta(),zA(this.p(`/snapshot?compact=true&events_limit=${t}`),{headers:this.authHeaders(),signal:r},this.readTimeoutMs,async i=>(await co(i,"GET","/snapshot"),Ey(await i.json())))}async postTask(t){let r=await fetch(this.p("/tasks"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t})});return await co(r,"POST","/tasks"),(await r.json()).item}async postNudge(t){let r=await fetch(this.p("/nudge"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t})});await co(r,"POST","/nudge")}async message(t,r){let i=await fetch(this.p("/message"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t}),signal:r});return await co(i,"POST","/message"),await i.json()}async messageStream(t,r,i){let s=await fetch(this.p("/message/stream"),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:JSON.stringify({text:t}),signal:i});if(await co(s,"POST","/message/stream"),!s.body)throw new Error("Manager stream returned no response body");let a=h=>{if(!i?.aborted)if(h.type==="phase"){let y=Number(h.quiet_s??0);r.onPhase?.(String(h.label??""),String(h.role??"manager"),{heartbeat:h.heartbeat===!0,quietS:Number.isFinite(y)?y:0,kind:String(h.kind??""),detail:String(h.detail??"")})}else h.type==="delta"?r.onDelta?.(String(h.text??""),String(h.message_id??""),String(h.fragment_mode??"auto")):h.type==="done"?r.onDone?.(h.result??{}):h.type==="error"&&r.onError?.(new Error(String(h.error??"stream error")))},u=s.body.getReader(),E=new TextDecoder,I="";for(;;){let{done:h,value:y}=await u.read();if(h)break;I+=E.decode(y,{stream:!0});let D=Iy(I);I=D.rest,D.frames.forEach(a)}i?.aborted||Iy(I+` -`).frames.forEach(a)}async getJson(t){return zA(this.p(t),{headers:this.authHeaders()},this.readTimeoutMs,async r=>(await co(r,"GET",t),await r.json()))}async post(t,r){let i=await fetch(this.p(t),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:r===void 0?void 0:JSON.stringify(r)});return await co(i,"POST",t),await i.json()}getStatus(){return this.getJson("/status")}async getJournal(t=10){return(await this.getJson(`/journal?n=${t}`)).journal}getDoctor(){return this.getJson("/doctor")}getConfig(){return this.getJson("/config")}async getIdentity(){return(await this.getJson("/identity")).identity}async getTranscript(t=20){return(await this.getJson(`/transcript?n=${t}`)).turns}async getArtifacts(){return(await this.getJson("/artifacts")).artifacts}async getBacklogItem(t){return(await this.getJson(`/backlog/${encodeURIComponent(t)}`)).item}answerPending(t,r){return this.post(`/backlog/${encodeURIComponent(t)}/answer`,{text:r})}resolveDecision(t,r,i){return this.post(`/decisions/${encodeURIComponent(t)}/resolve`,{option_id:r,note:i})}getArtifact(t){let r=new URLSearchParams({path:t});return this.getJson(`/artifact?${r}`)}async postNote(t){await this.post("/note",{text:t})}async previewPlan(t){return await this.post("/plan",{text:t})}async rewritePrompt(t){return await this.post("/prompt/rewrite",{text:t})}async setConfig(t,r){return this.post("/config/set",{name:t,value:r})}async setIdentity(t){await this.post("/identity",{text:t})}async resetManager(){await this.post("/reset")}async skills(t="ls"){return String((await this.post("/skills",{args:t})).text??"")}async disposeBacklog(t,r){return(await this.post(`/backlog/${encodeURIComponent(t)}/dispose`,{op:r})).item}async stopBacklog(t){return(await this.post(`/backlog/${encodeURIComponent(t)}/stop`)).item}async abortMission(t=""){return await this.post("/mission/abort",{reason:t})}connectStream(t){let r=new URLSearchParams;t.replay!=null&&r.set("replay",String(t.replay)),this.token&&r.set("token",this.token);let i=`${this.wsBase}/api/projects/${encodeURIComponent(this.project)}/stream?${r}`,s=new Bd(i);return s.on("open",()=>t.onOpen?.()),s.on("message",a=>{try{let u=JSON.parse(String(a));u&&typeof u=="object"&&t.onEvent(u)}catch{}}),s.on("close",(a,u)=>t.onClose?.(mF(a,u.toString("utf8")))),s.on("error",a=>t.onError?.(a)),s}};var gr=Me(jt(),1);var aA={value:"",cursor:0},No=e=>Array.from(e);function os(e,t){let r=Math.max(0,Math.min(t,e.length));return{value:e.join(""),cursor:r}}function lA(e,t=Array.from(e).length){return os(No(e),t)}function uA(e,t){if(!t)return e;let r=No(e.value),i=No(t);return r.splice(e.cursor,0,...i),os(r,e.cursor+i.length)}function _u(e){if(e.cursor<=0)return e;let t=No(e.value);return t.splice(e.cursor-1,1),os(t,e.cursor-1)}function Ey(e){let t=No(e.value);return e.cursor>=t.length?e:(t.splice(e.cursor,1),os(t,e.cursor))}function Ya(e){return e.cursor<=0?e:os(No(e.value),e.cursor-1)}function Va(e){let t=No(e.value).length;return e.cursor>=t?e:os(No(e.value),e.cursor+1)}function Kd(e){return os(No(e.value),0)}function Jd(e){let t=No(e.value);return os(t,t.length)}function py(e){return/\S/.test(e)}function Ru(e){let t=No(e.value),r=e.cursor;for(;r>0&&!py(t[r-1]);)r--;for(;r>0&&py(t[r-1]);)r--;return r===e.cursor?e:(t.splice(r,e.cursor-r),os(t,r))}function Fu(e){if(e.cursor<=0)return e;let t=No(e.value);return t.splice(0,e.cursor),os(t,0)}function bu(e){let t=No(e.value);return e.cursor>=t.length?e:(t.splice(e.cursor),os(t,e.cursor))}function my(e){let t=No(e.value);return{before:t.slice(0,e.cursor).join(""),at:t[e.cursor]??"",after:t.slice(e.cursor+1).join("")}}var Iy={entries:[],pos:0,draft:""};function qm(e,t){let r=t.trim();return r?{entries:e.entries[e.entries.length-1]===r?e.entries:[...e.entries,r],pos:0,draft:""}:{entries:e.entries,pos:0,draft:""}}function hy(e,t){if(e.entries.length===0)return{h:e,value:t};let r=e.pos===0?t:e.draft,i=Math.min(e.pos+1,e.entries.length),s=i===0?r:e.entries[e.entries.length-i];return{h:{...e,pos:i,draft:r},value:s}}function Cy(e){let t=Math.max(e.pos-1,0),r=t===0?e.draft:e.entries[e.entries.length-t];return{h:{...e,pos:t},value:r}}var z={AGENT_IO_START:"agent.io.start",AGENT_IO_STREAM:"agent.io.stream",AGENT_IO_COMPLETE:"agent.io.complete",AGENT_IO_ERROR:"agent.io.error",USAGE_RECORDED:"usage.recorded",PROVIDER_REQUEST_STARTED:"provider.request.started",PROVIDER_REQUEST_COMPLETED:"provider.request.completed",PROVIDER_REQUEST_DENIED:"provider.request.denied",CODEX_UTIL_COMPLETED:"codex.util.completed",SKILL_COST_COMPLETED:"skill.cost.completed",BUDGET_RESERVATION_CREATED:"budget.reservation.created",BUDGET_RESERVATION_DENIED:"budget.reservation.denied",BUDGET_RESERVATION_SETTLED:"budget.reservation.settled",BUDGET_RESERVATION_RELEASED:"budget.reservation.released",BUDGET_UNPRICED_BLOCKED:"budget.unpriced.blocked",LOOP_START:"loop.start",LOOP_DONE:"loop.done",ROUND_START:"round.start",ROUND_MAIN_COMPLETED:"round.main.completed",ROUND_REVIEW_STARTED:"round.review.started",ROUND_REVIEW_DEFERRED:"round.review.deferred",ROUND_REVIEW_COMPLETED:"round.review.completed",ROUND_CHECKPOINT_RECORDED:"round.checkpoint.recorded",ROUND_CHECKPOINT_FAILED:"round.checkpoint.failed",ROUND_SECRET_REDACTED:"round.secret_redacted",ROUND_ESCALATED:"round.escalated",ROUND_STALL:"round.stall",ROUND_REVIEWER_BACKEND_FAILURE:"round.reviewer_backend_failure",ROLE_SESSION_TURN:"role.session.turn",ENGINEER_PROGRESS:"engineer.progress",ENGINEER_SELF_REVIEW_ACCEPTED:"engineer.self_review.accepted",ENGINEER_SELF_REVIEW_REJECTED:"engineer.self_review.rejected",ENGINEER_SKILL_MAINTENANCE_STARTED:"engineer.skill_maintenance.started",ENGINEER_SKILL_MAINTENANCE_COMPLETED:"engineer.skill_maintenance.completed",LIFE_STATUS:"life.status",LIFE_PHASE_STARTED:"life.phase.started",LIFE_MISSION_STARTED:"life.mission.started",LIFE_MISSION_COMPLETED:"life.mission.completed",LIFE_MISSION_FAILED:"life.mission.failed",LIFE_MISSION_SKIPPED:"life.mission.skipped",LIFE_MISSION_ORPHANED:"life.mission.orphaned",LIFE_MISSION_REQUEUED:"life.mission.requeued",LIFE_MANAGER_INTENT_STARTED:"life.manager.intent.started",LIFE_MANAGER_INTENT_COMPLETED:"life.manager.intent.completed",LIFE_MANAGER_INTENT_FAILED:"life.manager.intent.failed",LIFE_MANAGER_STAGE_DECISION:"life.manager.stage_decision",LIFE_MANAGER_PLAN_CHALLENGE_DECIDED:"life.manager.plan_challenge.decided",LIFE_VERTICAL_RESOLVED:"life.vertical.resolved",LIFE_PLANNER_START:"life.planner.start",LIFE_PLANNER_TASK_ADDED:"life.planner.task_added",LIFE_PLANNER_TASK_SKIPPED:"life.planner.task_skipped",LIFE_PLANNER_VERDICT:"life.planner.verdict",LIFE_PLANNER_WAITING:"life.planner.waiting",LIFE_PLANNER_WAITING_WOKEN:"life.planner.waiting_woken",LIFE_PLANNER_TERMINAL_IDLE:"life.planner.terminal_idle",LIFE_PLANNER_VERIFICATION_PROBE:"life.planner.verification_probe",LIFE_PLANNER_STALL_ESCALATION:"life.planner.stall_escalation",LIFE_PLANNER_ERROR:"life.planner.error",LIFE_PLAN_SIGNAL:"life.plan.signal",LIFE_PLAN_REVISION_PROPOSED:"life.plan.revision.proposed",LIFE_PLAN_REVISION_REJECTED:"life.plan.revision.rejected",LIFE_PLAN_REVISION_COMMITTED:"life.plan.revision.committed",LIFE_PLAN_NODE_SUPERSEDED:"life.plan.node.superseded",LIFE_BUDGET_PAUSE:"life.budget.pause",LIFE_LIFECYCLE_BLOCK:"life.lifecycle.block",LIFE_LIFECYCLE_TRANSITION:"life.lifecycle.transition",LIFE_INBOX_QUEUED:"life.inbox.queued",LIFE_INBOX_DRAINED:"life.inbox.drained",LIFE_OPERATOR_QUESTION_PENDING:"life.operator_question.pending",LIFE_OPERATOR_QUESTION_ANSWERED:"life.operator_question.answered",LIFE_DAEMON_IDLE_TIMEOUT:"life.daemon.idle_timeout",PROJECT_COMPLETED:"project.completed",PROJECT_COMPLETION_REFUSED:"project.completion_refused",DAEMON_PARKED:"daemon.parked",DAEMON_COMMAND_SUBMITTED:"daemon.command.submitted",DAEMON_COMMAND_COMPLETED:"daemon.command.completed",DAEMON_COMMAND_REJECTED:"daemon.command.rejected",IDEA_SEARCH_STARTED:"idea.search.started",IDEA_SEARCH_COMPLETED:"idea.search.completed",IDEA_SEARCH_SKIPPED:"idea.search.skipped",VENUE_RESEARCH_STARTED:"venue.research.started",VENUE_RESEARCH_COMPLETED:"venue.research.completed",RESEARCH_ACHIEVEMENT_CERTIFIED:"research.achievement.certified",SKILL_LIBRARY_AVAILABLE:"skill.library.available",SKILL_CREATED:"skill.created",SKILL_UPDATED:"skill.updated",SKILL_ARCHIVED:"skill.archived",SKILL_OUTCOME:"skill.outcome",SKILL_TRANSFER_STARTED:"skill.transfer.started",SKILL_TRANSFER_COMPLETED:"skill.transfer.completed",SKILL_SCIENTIST_STARTED:"skill.scientist.started",SKILL_SCIENTIST_CREATED:"skill.scientist.created",SKILL_SCIENTIST_ADAPTATION_STARTED:"skill.scientist.adaptation_started",SKILL_SCIENTIST_ADAPTATION_CREATED:"skill.scientist.adaptation_created",SKILL_TIDIED:"skill.tidied",SKILL_COMPACTED:"skill.compacted",SKILL_COMPACT_ERROR:"skill.compact.error",SKILL_OP_ERROR:"skill.op.error",SKILL_OP_REFUSED:"skill.op.refused",SKILL_PROPOSAL_REJECTED:"skill.proposal.rejected",SKILL_DISTILL_REJECTED:"skill.distill.rejected",SKILL_REVISED:"skill.revised",SKILL_USE_RECORDED:"skill.use.recorded",SKILL_HISTORY_COMPRESSED:"skill.history.compressed",SKILL_EVOLUTION_COMPLETED:"skill.evolution.completed",WIKI_INITIALIZED:"wiki.initialized",WIKI_INITIALIZATION_FAILED:"wiki.initialization.failed",WIKI_HOOK_OK:"wiki.hook.ok",WIKI_HOOK_WARNING:"wiki.hook.warning",WIKI_COMPACTED:"wiki.compacted",WIKI_COMPACT_ERROR:"wiki.compact.error",WIKI_CREATED:"wiki.created",WIKI_UPDATED:"wiki.updated",WIKI_RETIRED:"wiki.retired",WIKI_SOURCE_CREATED:"wiki.source.created",WIKI_SOURCE_SKIPPED:"wiki.source.skipped",WIKI_PROMOTION_PROMOTED:"wiki.promotion.promoted",WIKI_PROMOTION_DEMOTED:"wiki.promotion.demoted",WIKI_RETIRED_COMPRESSED:"wiki.retired.compressed",WIKI_EVOLUTION_COMPLETED:"wiki.evolution.completed",OPERATOR_ALERT:"operator_alert"},IF={"loop.started":z.LOOP_START,"loop.completed":z.LOOP_DONE,"round.started":z.ROUND_START,"mission.started":z.LIFE_MISSION_STARTED,"mission.completed":z.LIFE_MISSION_COMPLETED,"mission.error":z.LIFE_MISSION_FAILED},DL=new Set([z.LOOP_START,z.LOOP_DONE,z.ROUND_START,z.ROUND_MAIN_COMPLETED,z.ROUND_REVIEW_DEFERRED,z.ROUND_REVIEW_COMPLETED,z.ROUND_CHECKPOINT_RECORDED,z.ROUND_CHECKPOINT_FAILED,z.ROUND_SECRET_REDACTED,z.ROUND_ESCALATED,z.ROUND_STALL,z.ROUND_REVIEWER_BACKEND_FAILURE,z.ENGINEER_SELF_REVIEW_ACCEPTED,z.ENGINEER_SELF_REVIEW_REJECTED,z.ENGINEER_SKILL_MAINTENANCE_STARTED,z.ENGINEER_SKILL_MAINTENANCE_COMPLETED,z.SKILL_LIBRARY_AVAILABLE,z.SKILL_CREATED,z.SKILL_UPDATED,z.SKILL_ARCHIVED,z.SKILL_OUTCOME,z.SKILL_TRANSFER_STARTED,z.SKILL_TRANSFER_COMPLETED,z.SKILL_SCIENTIST_STARTED,z.SKILL_SCIENTIST_CREATED,z.SKILL_SCIENTIST_ADAPTATION_STARTED,z.SKILL_SCIENTIST_ADAPTATION_CREATED,z.SKILL_TIDIED,z.SKILL_COMPACTED,z.SKILL_COMPACT_ERROR,z.SKILL_OP_ERROR,z.SKILL_OP_REFUSED,z.SKILL_PROPOSAL_REJECTED,z.SKILL_DISTILL_REJECTED,z.SKILL_REVISED,z.SKILL_USE_RECORDED,z.SKILL_HISTORY_COMPRESSED,z.SKILL_EVOLUTION_COMPLETED,z.WIKI_INITIALIZED,z.WIKI_INITIALIZATION_FAILED,z.WIKI_HOOK_OK,z.WIKI_HOOK_WARNING,z.WIKI_COMPACTED,z.WIKI_COMPACT_ERROR,z.WIKI_CREATED,z.WIKI_UPDATED,z.WIKI_RETIRED,z.WIKI_SOURCE_CREATED,z.WIKI_SOURCE_SKIPPED,z.WIKI_PROMOTION_PROMOTED,z.WIKI_PROMOTION_DEMOTED,z.WIKI_RETIRED_COMPRESSED,z.WIKI_EVOLUTION_COMPLETED,z.LIFE_MISSION_STARTED,z.LIFE_MISSION_COMPLETED,z.LIFE_MANAGER_INTENT_STARTED,z.LIFE_MANAGER_INTENT_COMPLETED,z.LIFE_MANAGER_INTENT_FAILED,z.LIFE_MANAGER_STAGE_DECISION,z.LIFE_MANAGER_PLAN_CHALLENGE_DECIDED,z.LIFE_VERTICAL_RESOLVED,z.LIFE_PLANNER_START,z.LIFE_PLANNER_TASK_ADDED,z.LIFE_PLANNER_TASK_SKIPPED,z.LIFE_PLANNER_VERDICT,z.LIFE_PLANNER_WAITING,z.LIFE_PLANNER_WAITING_WOKEN,z.LIFE_PLANNER_TERMINAL_IDLE,z.LIFE_PLANNER_VERIFICATION_PROBE,z.LIFE_PLANNER_STALL_ESCALATION,z.LIFE_PLAN_SIGNAL,z.LIFE_PLAN_REVISION_PROPOSED,z.LIFE_PLAN_REVISION_REJECTED,z.LIFE_PLAN_REVISION_COMMITTED,z.LIFE_PLAN_NODE_SUPERSEDED,z.LIFE_BUDGET_PAUSE,z.BUDGET_RESERVATION_DENIED,z.BUDGET_UNPRICED_BLOCKED,z.LIFE_LIFECYCLE_BLOCK,z.LIFE_LIFECYCLE_TRANSITION,z.PROVIDER_REQUEST_STARTED,z.PROVIDER_REQUEST_COMPLETED,z.PROVIDER_REQUEST_DENIED,z.LIFE_INBOX_QUEUED,z.LIFE_INBOX_DRAINED,z.LIFE_DAEMON_IDLE_TIMEOUT,z.PROJECT_COMPLETED,z.PROJECT_COMPLETION_REFUSED,z.DAEMON_PARKED,z.DAEMON_COMMAND_COMPLETED,z.DAEMON_COMMAND_REJECTED,z.IDEA_SEARCH_STARTED,z.IDEA_SEARCH_COMPLETED,z.IDEA_SEARCH_SKIPPED,z.VENUE_RESEARCH_STARTED,z.VENUE_RESEARCH_COMPLETED,z.RESEARCH_ACHIEVEMENT_CERTIFIED,z.OPERATOR_ALERT]),yL=new Set([z.AGENT_IO_START,z.AGENT_IO_COMPLETE,z.AGENT_IO_ERROR,z.PROVIDER_REQUEST_STARTED,z.PROVIDER_REQUEST_COMPLETED,z.PROVIDER_REQUEST_DENIED,z.USAGE_RECORDED]);function $A(e){let t=String(e??"").trim();return IF[t]??t}function zm(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(zm).join(",")}]`;let t=e;return`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${zm(t[r])}`).join(",")}}`}function hF(e){let t=2166136261;for(let r=0;r>>0).toString(36)}function XA(e){let t=e.event_id??e.id??e.seq??e._offset,r=String(e.type??"event");if(t!=null&&t!=="")return`${r}-${String(t)}`;let i=String(e.ts??e.time??"");return`${r}-${i}-${hF(zm(e))}`}function $m(e){return e.type===z.ENGINEER_PROGRESS&&e.kind==="reasoning"}function jd(e){if(e.type!==z.ENGINEER_PROGRESS||!["assistant_message","agent_message","message"].includes(String(e.kind??"")))return!1;let t=String(e.agent_layer??e.actor??"");return String(e.text??"").trimStart().startsWith("{")?t==="reviewer"||t==="planner":!1}var CF=/^(?:MILESTONE_STATUS|OPERATOR_QUESTION|OPERATOR_OPTIONS)\s*=/i;function By(e){return String(e??"").split(/\r?\n/).filter(t=>!CF.test(t.trim())).join(` -`).trim()}function Df(e){let t=String(e.fragment_mode??"");return t==="append"||t==="snapshot"?t:e.replace===!0?"snapshot":"auto"}function BF(e,t){let r=Math.min(e.length,t.length);for(let i=r;i>=8;i-=1)if(e.endsWith(t.slice(0,i)))return i;return 0}function Xm(e,t,r="auto"){let i=(e||"").trim(),s=(t||"").trim();if(!i)return s;if(!s)return i;if(r==="snapshot")return s;if(i.includes(s))return i;if(r==="append")return`${i} -${s}`;if(s.includes(i))return s;let a=BF(i,s);return a?`${i}${s.slice(a)}`:`${i} -${s}`}var Dy=["all","attention","milestones","messages"],DF=new Set([z.LIFE_MISSION_STARTED,z.LIFE_MISSION_COMPLETED,z.LIFE_MISSION_FAILED,z.LOOP_START,z.LOOP_DONE,z.LIFE_PLANNER_VERDICT,"final.report.ready","pptx.report.ready","plan.completed",z.LIFE_BUDGET_PAUSE,z.LIFE_LIFECYCLE_BLOCK]);function yy(e,t,r="all",i=""){let s=$A(e.canonical_type??e.type),a=String(e.kind??"");if(r==="attention"&&!["warn","err"].includes(String(t.tone??""))&&e.operator_alert!==!0||r==="milestones"&&!(t.rule&&!s.startsWith("ui."))&&!DF.has(s)||r==="messages"&&t.tone!=="bright"&&!["assistant_message","agent_message","message"].includes(a)&&!["ui.operator","ui.argus"].includes(s))return!1;let u=i.trim().toLocaleLowerCase();return u?[s,a,t.role,t.label,t.text,e.title,e.objective,e.text,e.summary,e.reason,e.error,e.status,e.action_summary,e.command,e.path,Array.isArray(e.tags)?e.tags.join(" "):e.tags].some(I=>String(I??"").toLocaleLowerCase().includes(u)):!0}var yf=[{id:"status",name:"/status",argument:"none",desc:"roles, queued work, journal, and health",group:"Everyday",kind:"panel"},{id:"roles",name:"/roles",argument:"none",desc:"per-role backend / model / effort + live activity",group:"Everyday",kind:"panel"},{id:"journal",name:"/journal",arg:"[N]",argument:"optional",desc:"recent journal entries (default 10)",group:"Everyday",kind:"panel"},{id:"backlog",name:"/backlog",arg:"[all]",argument:"optional",desc:"pending tasks (all = incl. done/skipped)",group:"Everyday",kind:"panel"},{id:"artifacts",name:"/artifacts",argument:"none",desc:"reviewer-approved result files (Enter previews)",group:"Everyday",kind:"panel"},{id:"artifact",name:"/artifact",arg:"",argument:"required",desc:"preview one approved result file",group:"Everyday",kind:"panel"},{id:"events",name:"/events",arg:"[filter] [query]",argument:"optional",desc:"search feed: all / watch / milestones / messages",group:"Everyday",kind:"panel"},{id:"find",name:"/find",arg:"",argument:"required",desc:"search the current event buffer",group:"Everyday",kind:"panel"},{id:"cancel",name:"/cancel",argument:"none",desc:"stop waiting for the current Manager reply",group:"Everyday",kind:"local"},{id:"ask",name:"/ask",arg:"",argument:"required",desc:"answer inline \u2014 no task queued, no Planner/Engineer/Reviewer",aliases:["/chat"],group:"Everyday",kind:"action"},{id:"task",name:"/task",arg:"",argument:"required",desc:"queue work directly",aliases:["/add"],group:"Task management",kind:"action"},{id:"plan",name:"/plan",arg:"",argument:"required",desc:"preview a Planner-authored execution plan",group:"Task management",kind:"action"},{id:"rewrite",name:"/rewrite",arg:"[text]",argument:"optional",desc:"let the Manager rewrite your prompt before sending",aliases:["/refine"],group:"Task management",kind:"action"},{id:"nudge",name:"/nudge",arg:"",argument:"required",desc:"inject guidance into the running mission",aliases:["/inject","/notify"],group:"Task management",kind:"action"},{id:"abort",name:"/abort",argument:"none",desc:"immediately stop the running mission",group:"Task management",kind:"action"},{id:"note",name:"/note",arg:"",argument:"required",desc:"append a manual note to the timeline",group:"Task management",kind:"action"},{id:"done",name:"/done",arg:"",argument:"required",desc:"mark a task done",group:"Task management",kind:"action"},{id:"skip",name:"/skip",arg:"",argument:"required",desc:"skip a task",aliases:["/rm"],group:"Task management",kind:"action"},{id:"stop",name:"/stop",arg:"",argument:"required",desc:"stop a task's auto-iteration",group:"Task management",kind:"action"},{id:"item",name:"/item",arg:"",argument:"required",desc:"inspect a full task contract",group:"Task management",kind:"panel"},{id:"run",name:"/run",argument:"none",desc:"return to the always-live mission feed",group:"Task management",kind:"local"},{id:"new",name:"/new",arg:"[objective]",argument:"optional",desc:"review, create, and switch to a fresh conversation",group:"Sessions & diagnostics",kind:"action"},{id:"daemons",name:"/daemons",arg:"[query]",argument:"optional",desc:"find every session + switch or create",group:"Sessions & diagnostics",kind:"panel"},{id:"resume",name:"/resume",arg:"[list|]",argument:"optional",desc:"switch to another project/session",group:"Sessions & diagnostics",kind:"action"},{id:"attach",name:"/attach",arg:"",argument:"required",desc:"follow another project (read the stream)",group:"Sessions & diagnostics",kind:"action"},{id:"rename",name:"/rename",arg:"",argument:"required",desc:"rename the current conversation",group:"Sessions & diagnostics",kind:"action"},{id:"doctor",name:"/doctor",argument:"none",desc:"diagnose 'why isn't anything running'",group:"Sessions & diagnostics",kind:"panel"},{id:"backend",name:"/backend",arg:"[codex|claude|copilot|opencode|pi|grok]",argument:"optional",desc:"view or change the shared runner backend",group:"Configuration",kind:"action"},{id:"config",name:"/config",arg:"[key=value \u2026]",argument:"optional",desc:"view or change runtime settings",group:"Configuration",kind:"panel"},{id:"identity",name:"/identity",arg:"[set ]",argument:"optional",desc:"view or replace the operator identity card",group:"Configuration",kind:"panel"},{id:"reset",name:"/reset",argument:"none",desc:"drop the warm Manager conversation context",group:"Configuration",kind:"action"},{id:"skills",name:"/skills",arg:"[ls|promote ]",argument:"optional",desc:"inspect or promote runtime skills",group:"Configuration",kind:"action"},{id:"clear",name:"/clear",argument:"none",desc:"clear the event feed view",group:"Other",kind:"local"},{id:"reconnect",name:"/reconnect",argument:"none",desc:"reconnect the live event stream",group:"Other",kind:"local"},{id:"help",name:"/help",argument:"none",desc:"keys + full command reference",aliases:["/?","/commands"],group:"Other",kind:"local"},{id:"quit",name:"/quit",argument:"none",desc:"leave the cockpit (background work keeps running)",aliases:["/exit","/q"],group:"Other",kind:"local"}],_L=new Map(yf.map(e=>[e.id,e])),Yd=new Map;for(let e of yf)for(let t of[e.name,...e.aliases??[]])Yd.set(t.toLowerCase(),e);var yF=/^\/[A-Za-z0-9_-]+$/;function Qf(e){if(!e.startsWith("/"))return!1;let t=e.indexOf(" "),r=t===-1?e:e.slice(0,t);return yF.test(r)}function QF(e){return e.startsWith("/")&&!e.includes(" ")&&!e.slice(1).includes("/")}function Vd(e){if(!QF(e))return[];let t=e.toLowerCase(),r=new Set,i=[];for(let s of yf)[s.name,...s.aliases??[]].some(u=>u.toLowerCase().startsWith(t))&&!r.has(s.name)&&(r.add(s.name),i.push(s));return i.sort((s,a)=>Number(Qy(a,t))-Number(Qy(s,t)))}function Qy(e,t){return[e.name,...e.aliases??[]].some(r=>r.toLowerCase()===t)}function qd(e){return e.arg?`${e.name} `:e.name}function Zm(e){let t=e.trim();return!t||t.toLowerCase()==="list"?{kind:"list"}:{kind:"project",query:t}}function eI(e){let t=e.trim();if(!t)return{filter:"all",query:""};let[r,...i]=t.split(/\s+/);return r.toLowerCase()==="watch"?{filter:"attention",query:i.join(" ")}:Dy.includes(r.toLowerCase())?{filter:r.toLowerCase(),query:i.join(" ")}:{filter:"all",query:t}}function tI(e){if(!Qf(e))return null;let t=e.indexOf(" "),r=(t===-1?e:e.slice(0,t)).toLowerCase(),i=t===-1?"":e.slice(t+1).trim(),s=Yd.get(r)??null;return{cmd:s,name:s?s.name:r,rest:i}}function rI(e){let t=e.toLowerCase(),r=null,i=0;for(let s of Yd.keys()){let a=vF(t,s);a>i&&(i=a,r=Yd.get(s).name)}return i>=.6?r:null}function vF(e,t){let r=wF(e,t),i=Math.max(e.length,t.length)||1;return 1-r/i}function wF(e,t){let r=e.length,i=t.length,s=Array.from({length:r+1},(a,u)=>[u,...Array(i).fill(0)]);for(let a=0;a<=i;a+=1)s[0][a]=a;for(let a=1;a<=r;a+=1)for(let u=1;u<=i;u+=1)s[a][u]=Math.min(s[a-1][u]+1,s[a][u-1]+1,s[a-1][u-1]+(e[a-1]===t[u-1]?0:1));return s[r][i]}function nI(){let e=["Everyday","Task management","Sessions & diagnostics","Configuration","Other"],t=new Map;for(let r of yf){let i=r.aliases?.length?` (= ${r.aliases.join(", ")})`:"",s=`${r.name}${r.arg?` ${r.arg}`:""}${i}`;t.has(r.group)||t.set(r.group,[]),t.get(r.group).push({label:s,desc:r.desc})}return e.filter(r=>t.has(r)).map(r=>({group:r,rows:t.get(r)}))}var me={accent:"#e6b450",border:"#8a93a6",success:"#3aa76a",error:"#d15c6a",warning:"#d0a850",info:"#5a9beb",role:{manager:"blue",planner:"magenta",engineer:"green",reviewer:"yellow"}},xu=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],vy=["#3b6fd4","#4d86e0","#5f9deb","#72b4f0","#89dceb"],oI="#48506b",wy="#f4e0a8",Sy="#6c7086";function _y(e){switch(e){case"medium":return me.info;case"high":return me.warning;case"xhigh":return me.accent;case"max":return me.error;default:return"gray"}}var cA=Me(Pt(),1),xy="argus";function fA({d:e="solid",lit:t=xy.length,sh:r=-1}){let i=e==="ghost"?oI:me.accent;return(0,cA.jsxs)(k,{children:[(0,cA.jsx)(k,{color:i,bold:e==="solid",dimColor:e==="flick",children:"\u25C9"}),t>=0?(0,cA.jsxs)(cA.Fragment,{children:[(0,cA.jsx)(k,{children:" "}),[...xy].map((s,a)=>{let u=a===r,E=u?wy:ae.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`;function ky({width:e,health:t=""}){return(0,qa.jsxs)(Qe,{flexDirection:"column",children:[(0,qa.jsxs)(Qe,{children:[(0,qa.jsx)(fA,{}),(0,qa.jsx)(k,{dimColor:!0,children:" \xB7 Autonomous Research Lab"})]}),t?(0,qa.jsx)(k,{color:me.warning,children:` ! ${kF(t,Math.max(12,e-6))}`}):null]})}var $a=Me(jt(),1);var NF=new Set(["done","success","completed"]),TF=new Set(["research_incomplete","paused_no_breakthrough","exhausted_current_methods"]),OF=new Set(["no_progress","max_rounds"]),LF=new Set(["blocked","infra_blocked"]),MF=new Set(["error","failed","supervisor_error"]),PF={completed:{glyph:"\u{1F389}",tone:"ok",missionStatus:"complete"},incomplete:{glyph:"\u25CC",tone:"warn",missionStatus:"incomplete"},stalled:{glyph:"\u23F8",tone:"warn",missionStatus:"stalled"},blocked:{glyph:"\u26D4",tone:"err",missionStatus:"blocked"},failed:{glyph:"\u{1F4A5}",tone:"err",missionStatus:"failed"},ended:{glyph:"\u25A0",tone:"info",missionStatus:"ended"}},UF={completed:"Task completed",incomplete:"Mission incomplete",stalled:"Mission stalled",blocked:"Mission blocked",failed:"Mission failed",ended:"Mission ended"};function za(e){return String(e??"").trim().toLowerCase()}function GF(e){let t=za(e);switch(t){case"completed":case"incomplete":case"stalled":case"blocked":case"failed":case"ended":return t;default:return null}}function iI(e){let t=za(e.status);return e.success===!0||NF.has(t)?"completed":TF.has(t)?"incomplete":OF.has(t)?"stalled":LF.has(t)?"blocked":MF.has(t)?"failed":"ended"}function sI(e){let t=e.outcome;if(t&&typeof t=="object"&&!Array.isArray(t)){let r=t;return{execution_status:za(r.execution_status)||iI(e),review_status:za(r.review_status)||"not_assessed",stage_certification:za(r.stage_certification)||"not_assessed",interruption_kind:za(r.interruption_kind)||"none",resumable:r.resumable===!0}}return{execution_status:iI(e),review_status:"not_assessed",stage_certification:"not_assessed",interruption_kind:za(e.stop_kind)||"none",resumable:e.resumable===!0}}function $d(e){return e?.execution_status?[`execution=${e.execution_status}`,e.review_status&&e.review_status!=="not_assessed"?`review=${e.review_status}`:"",e.stage_certification&&e.stage_certification!=="not_assessed"?`stage=${e.stage_certification}`:"",e.interruption_kind&&e.interruption_kind!=="none"?`interrupt=${e.interruption_kind}`:"",e.resumable?"resumable=yes":""].filter(Boolean):[]}function vf(e){let t=GF(e.outcome_class)??iI(e),r=String(e.status??"").trim(),i=PF[t],s=t==="completed"&&e.final_submission_certified===!0?"Submission certified":t==="ended"&&r?`Mission ended \xB7 ${r}`:UF[t];return{outcomeClass:t,label:s,glyph:i.glyph,tone:i.tone,missionStatus:i.missionStatus}}var Xd=["manager","planner","engineer","reviewer"],Ny=new Set(["planner","engineer","reviewer"]),HF=new Set(["running","in_progress","claimed"]),_e=(e,t)=>String(e[t]??"").trim(),vs=(e,t)=>{let r=Number(e[t]);return Number.isFinite(r)?r:null};function Zd(e){let t=[e.route?e.route.toUpperCase():"",e.vertical,e.workflow_mode?e.workflow_mode.toUpperCase():""].filter(Boolean);return e.lifetime==="standing"?t.push("STANDING \xB7 OPEN-ENDED"):e.lifetime==="bounded_increment"?t.push("BOUNDED INCREMENT"):e.lifetime==="bounded"&&e.continuous?t.push("BOUNDED \xB7 FINITE CONTINUOUS"):e.lifetime&&t.push(e.lifetime.toUpperCase()),t.join(" \xB7 ")}function WF(e){return JSON.parse(JSON.stringify(e))}function Ty(){return{schema_version:5,bootstrapped:!1,mission:{id:"",title:"",objective:"",summary:"",status:"idle",started_at:null,completed_at:null,elapsed_seconds:0,campaign_started_at:null,campaign_elapsed_seconds:0},stage:{id:"",label:""},routing:{route:"",vertical:"",workflow_mode:"",lifetime:"",continuous:!1,open_ended:!1},round:{current:0,max:0},active_role:"",roles:Xd.map(e=>({role:e,status:"waiting",label:"Waiting",updated_at:0})),role_work:[],dag:[],timeline:[],artifacts:[],learned_skills:[],learned_wiki_pages:[],storage:{project_skill_dir:"",global_skill_dir:"",project_skill_count:0,global_skill_count:0,skill_history_compressed:0,wiki_retired_compressed:0,skill_history_bytes_saved:0,wiki_retired_bytes_saved:0,wiki_paths:[]},achievement:null,review:{status:"",reason:"",rejected_attempts:0},frontier:{change:"",summary:"",updated_at:0},outcome:{},last_event_ts:0,updated_at:0}}function gA(e,t,r,i){if(r==null||r==="")return;let s=e.findIndex(a=>a[t]===r);s>=0?e[s]={...e[s],...i}:e.push(i)}function pn(e,t,r,i,s){if(!Xd.includes(t))return;r==="active"&&Ny.has(t)&&e.roles.forEach(u=>{Ny.has(u.role)&&u.role!==t&&u.status==="active"&&Object.assign(u,{status:"done",label:"Handed off",updated_at:s})});let a={role:t,status:r,label:i,updated_at:s};gA(e.roles,"role",t,a),r==="active"?e.active_role=t:e.active_role===t&&(e.active_role="")}function Gn(e,t,r,i,s="",a="neutral"){let u=XA(t);if(e.timeline.some(I=>I.id===u))return;let E={id:u,ts:Number(t.ts??Date.now()/1e3),type:$A(t.type),role:r,title:i.slice(0,180),detail:s.slice(0,500),tone:a};["item_id","branch_id"].forEach(I=>{let C=_e(t,I);C&&(E[I]=C)}),e.timeline=[...e.timeline,E].slice(-120)}function To(e,t,r,i,s,a="",u=""){if(!Xd.includes(r))return;let E=_e(t,"message_id"),I=E?`${r}:${E}`:XA(t),C=e.role_work.find(G=>G.id===I),y=C&&C.detail.length>a.length?C.detail:a,D={id:I,ts:Number(t.ts??Date.now()/1e3),role:r,kind:i,title:s.slice(0,240),detail:y.slice(0,4e3),status:u,item_id:_e(t,"item_id"),mission_id:e.mission.id,mission_title:e.mission.title.slice(0,240),round_index:vs(t,"round_index")},R=e.role_work.findIndex(G=>G.id===I);R>=0?e.role_work[R]=D:e.role_work.push(D);let O=new Set;Xd.forEach(G=>{e.role_work.filter(ne=>ne.role===G).slice(-40).forEach(ne=>O.add(ne.id))}),e.role_work=e.role_work.filter(G=>O.has(G.id))}function KF(e){return e==="ok"?"success":e==="err"?"error":"info"}var JF={agent_message:"Reporting progress",assistant_message:"Reporting progress",command_execution:"Running a command",reasoning:"Reasoning",tool_use:"Using a tool",tool_result:"Inspecting tool output",codex_idle:"Waiting for model output"};function jF(e,t){let r=$A(t.type),i=Number(t.ts??Date.now()/1e3);if(e.last_event_ts=Math.max(e.last_event_ts,i),r===z.LIFE_MANAGER_INTENT_STARTED)e.mission.id=_e(t,"item_id")||_e(t,"intent_id"),e.mission.title=_e(t,"objective").slice(0,240),e.mission.objective=_e(t,"objective"),e.mission.status="grounding",pn(e,"manager","active","Grounding project",i),Gn(e,t,"manager","Project grounding started",_e(t,"objective")),To(e,t,"manager","grounding","Grounding project",_e(t,"objective"),"active");else if(r===z.LIFE_MANAGER_INTENT_COMPLETED){e.mission.id=_e(t,"item_id"),e.mission.title=_e(t,"objective").slice(0,240),e.mission.objective=_e(t,"objective"),e.mission.status="framed",e.routing.route=_e(t,"route")||e.routing.route||"team",e.routing.vertical=_e(t,"vertical")||e.routing.vertical,e.routing.workflow_mode=_e(t,"workflow_mode")||e.routing.workflow_mode,e.routing.lifetime=_e(t,"lifetime")||e.routing.lifetime,"continuous"in t&&(e.routing.continuous=t.continuous===!0),"open_ended"in t&&(e.routing.open_ended=t.open_ended===!0);let s=_e(t,"current_stage"),a=Array.isArray(t.stages)?t.stages:[];if(s)e.stage={id:s,label:s.replaceAll("_"," ")};else if(!e.stage.id&&a[0]){let u=String(a[0]);e.stage={id:u,label:u.replaceAll("_"," ")}}pn(e,"manager","done","Goal framed",i),Gn(e,t,"manager","Goal framed",_e(t,"reason"),"success"),To(e,t,"manager","decision","Goal framed",_e(t,"reason")||_e(t,"execution_task"),"done")}else if(r===z.LIFE_MANAGER_INTENT_FAILED)e.mission.status="failed",pn(e,"manager","error","Manager routing failed",i),Gn(e,t,"manager","Manager routing failed",_e(t,"error")||_e(t,"reason"),"error"),To(e,t,"manager","grounding","Manager routing failed",_e(t,"error")||_e(t,"reason"),"error");else if(r===z.LIFE_MANAGER_STAGE_DECISION){let s=_e(t,"target_stage")||_e(t,"stage")||_e(t,"current_stage");s&&(e.stage={id:s,label:s.replaceAll("_"," ")}),pn(e,"manager","done",s?`Stage \xB7 ${s}`:"Stage reviewed",i),Gn(e,t,"manager",s?`Stage \u2192 ${s}`:"Stage reviewed",_e(t,"reason")),To(e,t,"manager","stage_decision",s?`Stage \u2192 ${s}`:"Stage reviewed",_e(t,"reason"),_e(t,"action"))}else if(r===z.LIFE_PLANNER_START)pn(e,"planner","active","Planning next work",i),To(e,t,"planner","planning","Planning next work",_e(t,"objective"),"active");else if(r===z.LIFE_PLANNER_TASK_ADDED){let s=_e(t,"item_id"),a={id:s,title:_e(t,"title"),objective:_e(t,"objective"),status:"pending",deps:Array.isArray(t.deps)?t.deps.map(String):[],branch_id:_e(t,"branch_id")||s,parent_branch_id:_e(t,"parent_branch_id")||null};gA(e.dag,"id",s,a),pn(e,"planner","done","Research branch added",i),Gn(e,t,"planner","Research branch added",a.title,"info"),To(e,t,"planner","task",a.title||"Task added",a.objective,"pending")}else if(r===z.LIFE_PLANNER_VERDICT){let s=!!t.project_done,a=s?"Project reviewed":"Planning complete";pn(e,"planner","done",a,i),Gn(e,t,"planner",a,_e(t,"reason"),s?"success":"neutral"),To(e,t,"planner","verdict",a,_e(t,"reason"),s?"done":"planned")}else if(r===z.LIFE_PLANNER_WAITING){pn(e,"planner","waiting","Waiting on external work",i);let s=_e(t,"reason")||_e(t,"waiting_reason");Gn(e,t,"planner","Planner waiting",s),To(e,t,"planner","waiting","Planner waiting",s,"waiting")}else if(r===z.LIFE_MISSION_STARTED)e.review={status:"",reason:"",rejected_attempts:0},e.mission.campaign_started_at??=i,e.mission={...e.mission,id:_e(t,"item_id"),title:_e(t,"title"),objective:_e(t,"objective"),summary:"",status:"working",started_at:i,completed_at:null},pn(e,"reviewer","waiting","Awaiting engineer handoff",i),pn(e,"engineer","active","Starting mission",i),Gn(e,t,"engineer","Mission started",_e(t,"title"),"info"),To(e,t,"engineer","task",_e(t,"title")||"Mission started",_e(t,"objective"),"active");else if(r===z.ROUND_START)e.round={current:vs(t,"round_index")??0,max:vs(t,"round_max")??e.round.max},pn(e,"engineer","active",`Running round ${e.round.current}`,i),Gn(e,t,"engineer",`Round ${e.round.current} started`);else if(r===z.ENGINEER_PROGRESS){let s=_e(t,"agent_layer")||_e(t,"actor")||"engineer",a=s==="main"?"engineer":s,u=_e(t,"kind"),E=JF[u]??"Working";pn(e,a,"active",E,i);let I=_e(t,"action_summary")||_e(t,"text");I&&!$m(t)&&!jd(t)&&To(e,t,a,u||"progress",E,I,"active"),["reasoning","assistant_message","agent_message"].includes(u)||Gn(e,t,a,E,_e(t,"action_summary")||_e(t,"text"))}else if(r===z.ROUND_MAIN_COMPLETED)pn(e,"engineer","done","Engineer handoff ready",i),To(e,t,"engineer","handoff","Engineer handoff ready",_e(t,"text")||_e(t,"summary"),"done");else if(r===z.ROUND_REVIEW_STARTED)pn(e,"reviewer","active","Reviewing benchmark evidence",i),To(e,t,"reviewer","review","Review started","","active");else if(r===z.ROUND_REVIEW_DEFERRED){let s=_e(t,"next_step");pn(e,"engineer","active","Continuing before review",i),pn(e,"reviewer","waiting","Review deferred for one round",i),Gn(e,t,"engineer","Continued before review",s,"info")}else if(r===z.ROUND_REVIEW_COMPLETED){let s=_e(t,"status"),a=_e(t,"reason");e.review={status:s,reason:a,rejected_attempts:e.review.rejected_attempts+(["continue","blocked"].includes(s)?1:0)};let u=_e(t,"frontier_change");u&&(e.frontier={change:u,summary:_e(t,"frontier_summary"),updated_at:i}),pn(e,"reviewer",s==="done"?"done":"rejected",s==="done"?"Accepted evidence":"Requested another attempt",i),Gn(e,t,"reviewer",s==="done"?"Evidence accepted":"Attempt rejected",a,s==="done"?"success":"error");let E=_e(t,"next_action");To(e,t,"reviewer","verdict",s==="done"?"Evidence accepted":"Attempt rejected",E?`${a} +`).frames.forEach(a)}async getJson(t){return zA(this.p(t),{headers:this.authHeaders()},this.readTimeoutMs,async r=>(await co(r,"GET",t),await r.json()))}async post(t,r){let i=await fetch(this.p(t),{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders()},body:r===void 0?void 0:JSON.stringify(r)});return await co(i,"POST",t),await i.json()}getStatus(){return this.getJson("/status")}async getJournal(t=10){return(await this.getJson(`/journal?n=${t}`)).journal}getDoctor(){return this.getJson("/doctor")}getConfig(){return this.getJson("/config")}async getIdentity(){return(await this.getJson("/identity")).identity}async getTranscript(t=20){return(await this.getJson(`/transcript?n=${t}`)).turns}async getArtifacts(){return(await this.getJson("/artifacts")).artifacts}async getBacklogItem(t){return(await this.getJson(`/backlog/${encodeURIComponent(t)}`)).item}answerPending(t,r){return this.post(`/backlog/${encodeURIComponent(t)}/answer`,{text:r})}resolveDecision(t,r,i){return this.post(`/decisions/${encodeURIComponent(t)}/resolve`,{option_id:r,note:i})}getArtifact(t){let r=new URLSearchParams({path:t});return this.getJson(`/artifact?${r}`)}async postNote(t){await this.post("/note",{text:t})}async previewPlan(t){return await this.post("/plan",{text:t})}async rewritePrompt(t){return await this.post("/prompt/rewrite",{text:t})}async setConfig(t,r){return this.post("/config/set",{name:t,value:r})}async setIdentity(t){await this.post("/identity",{text:t})}async resetManager(){await this.post("/reset")}async skills(t="ls"){return String((await this.post("/skills",{args:t})).text??"")}async disposeBacklog(t,r){return(await this.post(`/backlog/${encodeURIComponent(t)}/dispose`,{op:r})).item}async stopBacklog(t){return(await this.post(`/backlog/${encodeURIComponent(t)}/stop`)).item}async abortMission(t=""){return await this.post("/mission/abort",{reason:t})}connectStream(t){let r=new URLSearchParams;t.replay!=null&&r.set("replay",String(t.replay)),this.token&&r.set("token",this.token);let i=`${this.wsBase}/api/projects/${encodeURIComponent(this.project)}/stream?${r}`,s=new yd(i);return s.on("open",()=>t.onOpen?.()),s.on("message",a=>{try{let u=JSON.parse(String(a));u&&typeof u=="object"&&t.onEvent(u)}catch{}}),s.on("close",(a,u)=>t.onClose?.(Bb(a,u.toString("utf8")))),s.on("error",a=>t.onError?.(a)),s}};var gr=Le(jt(),1);var aA={value:"",cursor:0},No=e=>Array.from(e);function os(e,t){let r=Math.max(0,Math.min(t,e.length));return{value:e.join(""),cursor:r}}function lA(e,t=Array.from(e).length){return os(No(e),t)}function uA(e,t){if(!t)return e;let r=No(e.value),i=No(t);return r.splice(e.cursor,0,...i),os(r,e.cursor+i.length)}function Ru(e){if(e.cursor<=0)return e;let t=No(e.value);return t.splice(e.cursor-1,1),os(t,e.cursor-1)}function Cy(e){let t=No(e.value);return e.cursor>=t.length?e:(t.splice(e.cursor,1),os(t,e.cursor))}function Va(e){return e.cursor<=0?e:os(No(e.value),e.cursor-1)}function qa(e){let t=No(e.value).length;return e.cursor>=t?e:os(No(e.value),e.cursor+1)}function jd(e){return os(No(e.value),0)}function Yd(e){let t=No(e.value);return os(t,t.length)}function hy(e){return/\S/.test(e)}function bu(e){let t=No(e.value),r=e.cursor;for(;r>0&&!hy(t[r-1]);)r--;for(;r>0&&hy(t[r-1]);)r--;return r===e.cursor?e:(t.splice(r,e.cursor-r),os(t,r))}function Fu(e){if(e.cursor<=0)return e;let t=No(e.value);return t.splice(0,e.cursor),os(t,0)}function xu(e){let t=No(e.value);return e.cursor>=t.length?e:(t.splice(e.cursor),os(t,e.cursor))}function By(e){let t=No(e.value);return{before:t.slice(0,e.cursor).join(""),at:t[e.cursor]??"",after:t.slice(e.cursor+1).join("")}}var Dy={entries:[],pos:0,draft:""};function $m(e,t){let r=t.trim();return r?{entries:e.entries[e.entries.length-1]===r?e.entries:[...e.entries,r],pos:0,draft:""}:{entries:e.entries,pos:0,draft:""}}function yy(e,t){if(e.entries.length===0)return{h:e,value:t};let r=e.pos===0?t:e.draft,i=Math.min(e.pos+1,e.entries.length),s=i===0?r:e.entries[e.entries.length-i];return{h:{...e,pos:i,draft:r},value:s}}function Qy(e){let t=Math.max(e.pos-1,0),r=t===0?e.draft:e.entries[e.entries.length-t];return{h:{...e,pos:t},value:r}}var z={AGENT_IO_START:"agent.io.start",AGENT_IO_STREAM:"agent.io.stream",AGENT_IO_COMPLETE:"agent.io.complete",AGENT_IO_ERROR:"agent.io.error",USAGE_RECORDED:"usage.recorded",PROVIDER_REQUEST_STARTED:"provider.request.started",PROVIDER_REQUEST_COMPLETED:"provider.request.completed",PROVIDER_REQUEST_DENIED:"provider.request.denied",CODEX_UTIL_COMPLETED:"codex.util.completed",SKILL_COST_COMPLETED:"skill.cost.completed",BUDGET_RESERVATION_CREATED:"budget.reservation.created",BUDGET_RESERVATION_DENIED:"budget.reservation.denied",BUDGET_RESERVATION_SETTLED:"budget.reservation.settled",BUDGET_RESERVATION_RELEASED:"budget.reservation.released",BUDGET_UNPRICED_BLOCKED:"budget.unpriced.blocked",LOOP_START:"loop.start",LOOP_DONE:"loop.done",ROUND_START:"round.start",ROUND_MAIN_COMPLETED:"round.main.completed",ROUND_REVIEW_STARTED:"round.review.started",ROUND_REVIEW_DEFERRED:"round.review.deferred",ROUND_REVIEW_COMPLETED:"round.review.completed",ROUND_CHECKPOINT_RECORDED:"round.checkpoint.recorded",ROUND_CHECKPOINT_FAILED:"round.checkpoint.failed",ROUND_SECRET_REDACTED:"round.secret_redacted",ROUND_ESCALATED:"round.escalated",ROUND_STALL:"round.stall",ROUND_REVIEWER_BACKEND_FAILURE:"round.reviewer_backend_failure",ROLE_SESSION_TURN:"role.session.turn",ENGINEER_PROGRESS:"engineer.progress",ENGINEER_SELF_REVIEW_ACCEPTED:"engineer.self_review.accepted",ENGINEER_SELF_REVIEW_REJECTED:"engineer.self_review.rejected",ENGINEER_SKILL_MAINTENANCE_STARTED:"engineer.skill_maintenance.started",ENGINEER_SKILL_MAINTENANCE_COMPLETED:"engineer.skill_maintenance.completed",LIFE_STATUS:"life.status",LIFE_PHASE_STARTED:"life.phase.started",LIFE_MISSION_STARTED:"life.mission.started",LIFE_MISSION_COMPLETED:"life.mission.completed",LIFE_MISSION_FAILED:"life.mission.failed",LIFE_MISSION_SKIPPED:"life.mission.skipped",LIFE_MISSION_ORPHANED:"life.mission.orphaned",LIFE_MISSION_REQUEUED:"life.mission.requeued",LIFE_MANAGER_INTENT_STARTED:"life.manager.intent.started",LIFE_MANAGER_INTENT_COMPLETED:"life.manager.intent.completed",LIFE_MANAGER_INTENT_FAILED:"life.manager.intent.failed",LIFE_MANAGER_STAGE_DECISION:"life.manager.stage_decision",LIFE_MANAGER_PLAN_CHALLENGE_DECIDED:"life.manager.plan_challenge.decided",LIFE_VERTICAL_RESOLVED:"life.vertical.resolved",LIFE_PLANNER_START:"life.planner.start",LIFE_PLANNER_TASK_ADDED:"life.planner.task_added",LIFE_PLANNER_TASK_SKIPPED:"life.planner.task_skipped",LIFE_PLANNER_VERDICT:"life.planner.verdict",LIFE_PLANNER_WAITING:"life.planner.waiting",LIFE_PLANNER_WAITING_WOKEN:"life.planner.waiting_woken",LIFE_PLANNER_TERMINAL_IDLE:"life.planner.terminal_idle",LIFE_PLANNER_VERIFICATION_PROBE:"life.planner.verification_probe",LIFE_PLANNER_STALL_ESCALATION:"life.planner.stall_escalation",LIFE_PLANNER_ERROR:"life.planner.error",LIFE_PLAN_SIGNAL:"life.plan.signal",LIFE_PLAN_REVISION_PROPOSED:"life.plan.revision.proposed",LIFE_PLAN_REVISION_REJECTED:"life.plan.revision.rejected",LIFE_PLAN_REVISION_COMMITTED:"life.plan.revision.committed",LIFE_PLAN_NODE_SUPERSEDED:"life.plan.node.superseded",LIFE_BUDGET_PAUSE:"life.budget.pause",LIFE_LIFECYCLE_BLOCK:"life.lifecycle.block",LIFE_LIFECYCLE_TRANSITION:"life.lifecycle.transition",LIFE_INBOX_QUEUED:"life.inbox.queued",LIFE_INBOX_DRAINED:"life.inbox.drained",LIFE_OPERATOR_QUESTION_PENDING:"life.operator_question.pending",LIFE_OPERATOR_QUESTION_ANSWERED:"life.operator_question.answered",LIFE_DAEMON_IDLE_TIMEOUT:"life.daemon.idle_timeout",PROJECT_COMPLETED:"project.completed",PROJECT_COMPLETION_REFUSED:"project.completion_refused",DAEMON_PARKED:"daemon.parked",DAEMON_COMMAND_SUBMITTED:"daemon.command.submitted",DAEMON_COMMAND_COMPLETED:"daemon.command.completed",DAEMON_COMMAND_REJECTED:"daemon.command.rejected",IDEA_SEARCH_STARTED:"idea.search.started",IDEA_SEARCH_COMPLETED:"idea.search.completed",IDEA_SEARCH_SKIPPED:"idea.search.skipped",VENUE_RESEARCH_STARTED:"venue.research.started",VENUE_RESEARCH_COMPLETED:"venue.research.completed",RESEARCH_ACHIEVEMENT_CERTIFIED:"research.achievement.certified",SKILL_LIBRARY_AVAILABLE:"skill.library.available",SKILL_CREATED:"skill.created",SKILL_UPDATED:"skill.updated",SKILL_ARCHIVED:"skill.archived",SKILL_OUTCOME:"skill.outcome",SKILL_TRANSFER_STARTED:"skill.transfer.started",SKILL_TRANSFER_COMPLETED:"skill.transfer.completed",SKILL_SCIENTIST_STARTED:"skill.scientist.started",SKILL_SCIENTIST_CREATED:"skill.scientist.created",SKILL_SCIENTIST_ADAPTATION_STARTED:"skill.scientist.adaptation_started",SKILL_SCIENTIST_ADAPTATION_CREATED:"skill.scientist.adaptation_created",SKILL_TIDIED:"skill.tidied",SKILL_COMPACTED:"skill.compacted",SKILL_COMPACT_ERROR:"skill.compact.error",SKILL_OP_ERROR:"skill.op.error",SKILL_OP_REFUSED:"skill.op.refused",SKILL_PROPOSAL_REJECTED:"skill.proposal.rejected",SKILL_DISTILL_REJECTED:"skill.distill.rejected",SKILL_REVISED:"skill.revised",SKILL_USE_RECORDED:"skill.use.recorded",SKILL_HISTORY_COMPRESSED:"skill.history.compressed",SKILL_EVOLUTION_COMPLETED:"skill.evolution.completed",WIKI_INITIALIZED:"wiki.initialized",WIKI_INITIALIZATION_FAILED:"wiki.initialization.failed",WIKI_HOOK_OK:"wiki.hook.ok",WIKI_HOOK_WARNING:"wiki.hook.warning",WIKI_COMPACTED:"wiki.compacted",WIKI_COMPACT_ERROR:"wiki.compact.error",WIKI_CREATED:"wiki.created",WIKI_UPDATED:"wiki.updated",WIKI_RETIRED:"wiki.retired",WIKI_SOURCE_CREATED:"wiki.source.created",WIKI_SOURCE_SKIPPED:"wiki.source.skipped",WIKI_PROMOTION_PROMOTED:"wiki.promotion.promoted",WIKI_PROMOTION_DEMOTED:"wiki.promotion.demoted",WIKI_RETIRED_COMPRESSED:"wiki.retired.compressed",WIKI_EVOLUTION_COMPLETED:"wiki.evolution.completed",OPERATOR_ALERT:"operator_alert"},Db={"loop.started":z.LOOP_START,"loop.completed":z.LOOP_DONE,"round.started":z.ROUND_START,"mission.started":z.LIFE_MISSION_STARTED,"mission.completed":z.LIFE_MISSION_COMPLETED,"mission.error":z.LIFE_MISSION_FAILED},bL=new Set([z.LOOP_START,z.LOOP_DONE,z.ROUND_START,z.ROUND_MAIN_COMPLETED,z.ROUND_REVIEW_DEFERRED,z.ROUND_REVIEW_COMPLETED,z.ROUND_CHECKPOINT_RECORDED,z.ROUND_CHECKPOINT_FAILED,z.ROUND_SECRET_REDACTED,z.ROUND_ESCALATED,z.ROUND_STALL,z.ROUND_REVIEWER_BACKEND_FAILURE,z.ENGINEER_SELF_REVIEW_ACCEPTED,z.ENGINEER_SELF_REVIEW_REJECTED,z.ENGINEER_SKILL_MAINTENANCE_STARTED,z.ENGINEER_SKILL_MAINTENANCE_COMPLETED,z.SKILL_LIBRARY_AVAILABLE,z.SKILL_CREATED,z.SKILL_UPDATED,z.SKILL_ARCHIVED,z.SKILL_OUTCOME,z.SKILL_TRANSFER_STARTED,z.SKILL_TRANSFER_COMPLETED,z.SKILL_SCIENTIST_STARTED,z.SKILL_SCIENTIST_CREATED,z.SKILL_SCIENTIST_ADAPTATION_STARTED,z.SKILL_SCIENTIST_ADAPTATION_CREATED,z.SKILL_TIDIED,z.SKILL_COMPACTED,z.SKILL_COMPACT_ERROR,z.SKILL_OP_ERROR,z.SKILL_OP_REFUSED,z.SKILL_PROPOSAL_REJECTED,z.SKILL_DISTILL_REJECTED,z.SKILL_REVISED,z.SKILL_USE_RECORDED,z.SKILL_HISTORY_COMPRESSED,z.SKILL_EVOLUTION_COMPLETED,z.WIKI_INITIALIZED,z.WIKI_INITIALIZATION_FAILED,z.WIKI_HOOK_OK,z.WIKI_HOOK_WARNING,z.WIKI_COMPACTED,z.WIKI_COMPACT_ERROR,z.WIKI_CREATED,z.WIKI_UPDATED,z.WIKI_RETIRED,z.WIKI_SOURCE_CREATED,z.WIKI_SOURCE_SKIPPED,z.WIKI_PROMOTION_PROMOTED,z.WIKI_PROMOTION_DEMOTED,z.WIKI_RETIRED_COMPRESSED,z.WIKI_EVOLUTION_COMPLETED,z.LIFE_MISSION_STARTED,z.LIFE_MISSION_COMPLETED,z.LIFE_MANAGER_INTENT_STARTED,z.LIFE_MANAGER_INTENT_COMPLETED,z.LIFE_MANAGER_INTENT_FAILED,z.LIFE_MANAGER_STAGE_DECISION,z.LIFE_MANAGER_PLAN_CHALLENGE_DECIDED,z.LIFE_VERTICAL_RESOLVED,z.LIFE_PLANNER_START,z.LIFE_PLANNER_TASK_ADDED,z.LIFE_PLANNER_TASK_SKIPPED,z.LIFE_PLANNER_VERDICT,z.LIFE_PLANNER_WAITING,z.LIFE_PLANNER_WAITING_WOKEN,z.LIFE_PLANNER_TERMINAL_IDLE,z.LIFE_PLANNER_VERIFICATION_PROBE,z.LIFE_PLANNER_STALL_ESCALATION,z.LIFE_PLAN_SIGNAL,z.LIFE_PLAN_REVISION_PROPOSED,z.LIFE_PLAN_REVISION_REJECTED,z.LIFE_PLAN_REVISION_COMMITTED,z.LIFE_PLAN_NODE_SUPERSEDED,z.LIFE_BUDGET_PAUSE,z.BUDGET_RESERVATION_DENIED,z.BUDGET_UNPRICED_BLOCKED,z.LIFE_LIFECYCLE_BLOCK,z.LIFE_LIFECYCLE_TRANSITION,z.PROVIDER_REQUEST_STARTED,z.PROVIDER_REQUEST_COMPLETED,z.PROVIDER_REQUEST_DENIED,z.LIFE_INBOX_QUEUED,z.LIFE_INBOX_DRAINED,z.LIFE_DAEMON_IDLE_TIMEOUT,z.PROJECT_COMPLETED,z.PROJECT_COMPLETION_REFUSED,z.DAEMON_PARKED,z.DAEMON_COMMAND_COMPLETED,z.DAEMON_COMMAND_REJECTED,z.IDEA_SEARCH_STARTED,z.IDEA_SEARCH_COMPLETED,z.IDEA_SEARCH_SKIPPED,z.VENUE_RESEARCH_STARTED,z.VENUE_RESEARCH_COMPLETED,z.RESEARCH_ACHIEVEMENT_CERTIFIED,z.OPERATOR_ALERT]),FL=new Set([z.AGENT_IO_START,z.AGENT_IO_COMPLETE,z.AGENT_IO_ERROR,z.PROVIDER_REQUEST_STARTED,z.PROVIDER_REQUEST_COMPLETED,z.PROVIDER_REQUEST_DENIED,z.USAGE_RECORDED]);function $A(e){let t=String(e??"").trim();return Db[t]??t}function Xm(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Xm).join(",")}]`;let t=e;return`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${Xm(t[r])}`).join(",")}}`}function yb(e){let t=2166136261;for(let r=0;r>>0).toString(36)}function XA(e){let t=e.event_id??e.id??e.seq??e._offset,r=String(e.type??"event");if(t!=null&&t!=="")return`${r}-${String(t)}`;let i=String(e.ts??e.time??"");return`${r}-${i}-${yb(Xm(e))}`}function Zm(e){return e.type===z.ENGINEER_PROGRESS&&e.kind==="reasoning"}function Vd(e){if(e.type!==z.ENGINEER_PROGRESS||!["assistant_message","agent_message","message"].includes(String(e.kind??"")))return!1;let t=String(e.agent_layer??e.actor??"");return String(e.text??"").trimStart().startsWith("{")?t==="reviewer"||t==="planner":!1}var Qb=/^(?:MILESTONE_STATUS|OPERATOR_QUESTION|OPERATOR_OPTIONS)\s*=/i;function wy(e){return String(e??"").split(/\r?\n/).filter(t=>!Qb.test(t.trim())).join(` +`).trim()}function yf(e){let t=String(e.fragment_mode??"");return t==="append"||t==="snapshot"?t:e.replace===!0?"snapshot":"auto"}function wb(e,t){let r=Math.min(e.length,t.length);for(let i=r;i>=8;i-=1)if(e.endsWith(t.slice(0,i)))return i;return 0}function eI(e,t,r="auto"){let i=(e||"").trim(),s=(t||"").trim();if(!i)return s;if(!s)return i;if(r==="snapshot")return s;if(i.includes(s))return i;if(r==="append")return`${i} +${s}`;if(s.includes(i))return s;let a=wb(i,s);return a?`${i}${s.slice(a)}`:`${i} +${s}`}var vy=["all","attention","milestones","messages"],vb=new Set([z.LIFE_MISSION_STARTED,z.LIFE_MISSION_COMPLETED,z.LIFE_MISSION_FAILED,z.LOOP_START,z.LOOP_DONE,z.LIFE_PLANNER_VERDICT,"final.report.ready","pptx.report.ready","plan.completed",z.LIFE_BUDGET_PAUSE,z.LIFE_LIFECYCLE_BLOCK]);function Sy(e,t,r="all",i=""){let s=$A(e.canonical_type??e.type),a=String(e.kind??"");if(r==="attention"&&!["warn","err"].includes(String(t.tone??""))&&e.operator_alert!==!0||r==="milestones"&&!(t.rule&&!s.startsWith("ui."))&&!vb.has(s)||r==="messages"&&t.tone!=="bright"&&!["assistant_message","agent_message","message"].includes(a)&&!["ui.operator","ui.argus"].includes(s))return!1;let u=i.trim().toLocaleLowerCase();return u?[s,a,t.role,t.label,t.text,e.title,e.objective,e.text,e.summary,e.reason,e.error,e.status,e.action_summary,e.command,e.path,Array.isArray(e.tags)?e.tags.join(" "):e.tags].some(I=>String(I??"").toLocaleLowerCase().includes(u)):!0}var Qf=[{id:"status",name:"/status",argument:"none",desc:"roles, queued work, journal, and health",group:"Everyday",kind:"panel"},{id:"roles",name:"/roles",argument:"none",desc:"per-role backend / model / effort + live activity",group:"Everyday",kind:"panel"},{id:"journal",name:"/journal",arg:"[N]",argument:"optional",desc:"recent journal entries (default 10)",group:"Everyday",kind:"panel"},{id:"backlog",name:"/backlog",arg:"[all]",argument:"optional",desc:"pending tasks (all = incl. done/skipped)",group:"Everyday",kind:"panel"},{id:"artifacts",name:"/artifacts",argument:"none",desc:"reviewer-approved result files (Enter previews)",group:"Everyday",kind:"panel"},{id:"artifact",name:"/artifact",arg:"",argument:"required",desc:"preview one approved result file",group:"Everyday",kind:"panel"},{id:"events",name:"/events",arg:"[filter] [query]",argument:"optional",desc:"search feed: all / watch / milestones / messages",group:"Everyday",kind:"panel"},{id:"find",name:"/find",arg:"",argument:"required",desc:"search the current event buffer",group:"Everyday",kind:"panel"},{id:"cancel",name:"/cancel",argument:"none",desc:"stop waiting for the current Manager reply",group:"Everyday",kind:"local"},{id:"ask",name:"/ask",arg:"",argument:"required",desc:"answer inline \u2014 no task queued, no Planner/Engineer/Reviewer",aliases:["/chat"],group:"Everyday",kind:"action"},{id:"task",name:"/task",arg:"",argument:"required",desc:"queue work directly",aliases:["/add"],group:"Task management",kind:"action"},{id:"plan",name:"/plan",arg:"",argument:"required",desc:"preview a Planner-authored execution plan",group:"Task management",kind:"action"},{id:"rewrite",name:"/rewrite",arg:"[text]",argument:"optional",desc:"let the Manager rewrite your prompt before sending",aliases:["/refine"],group:"Task management",kind:"action"},{id:"nudge",name:"/nudge",arg:"",argument:"required",desc:"inject guidance into the running mission",aliases:["/inject","/notify"],group:"Task management",kind:"action"},{id:"abort",name:"/abort",argument:"none",desc:"immediately stop the running mission",group:"Task management",kind:"action"},{id:"note",name:"/note",arg:"",argument:"required",desc:"append a manual note to the timeline",group:"Task management",kind:"action"},{id:"done",name:"/done",arg:"",argument:"required",desc:"mark a task done",group:"Task management",kind:"action"},{id:"skip",name:"/skip",arg:"",argument:"required",desc:"skip a task",aliases:["/rm"],group:"Task management",kind:"action"},{id:"stop",name:"/stop",arg:"",argument:"required",desc:"stop a task's auto-iteration",group:"Task management",kind:"action"},{id:"item",name:"/item",arg:"",argument:"required",desc:"inspect a full task contract",group:"Task management",kind:"panel"},{id:"run",name:"/run",argument:"none",desc:"return to the always-live mission feed",group:"Task management",kind:"local"},{id:"new",name:"/new",arg:"[objective]",argument:"optional",desc:"review, create, and switch to a fresh conversation",group:"Sessions & diagnostics",kind:"action"},{id:"daemons",name:"/daemons",arg:"[query]",argument:"optional",desc:"find every session + switch or create",group:"Sessions & diagnostics",kind:"panel"},{id:"resume",name:"/resume",arg:"[list|]",argument:"optional",desc:"switch to another project/session",group:"Sessions & diagnostics",kind:"action"},{id:"attach",name:"/attach",arg:"",argument:"required",desc:"follow another project (read the stream)",group:"Sessions & diagnostics",kind:"action"},{id:"rename",name:"/rename",arg:"",argument:"required",desc:"rename the current conversation",group:"Sessions & diagnostics",kind:"action"},{id:"doctor",name:"/doctor",argument:"none",desc:"diagnose 'why isn't anything running'",group:"Sessions & diagnostics",kind:"panel"},{id:"backend",name:"/backend",arg:"[codex|claude|copilot|opencode|pi|grok]",argument:"optional",desc:"view or change the shared runner backend",group:"Configuration",kind:"action"},{id:"config",name:"/config",arg:"[key=value \u2026]",argument:"optional",desc:"view or change runtime settings",group:"Configuration",kind:"panel"},{id:"identity",name:"/identity",arg:"[set ]",argument:"optional",desc:"view or replace the operator identity card",group:"Configuration",kind:"panel"},{id:"reset",name:"/reset",argument:"none",desc:"drop the warm Manager conversation context",group:"Configuration",kind:"action"},{id:"skills",name:"/skills",arg:"[ls|promote ]",argument:"optional",desc:"inspect or promote runtime skills",group:"Configuration",kind:"action"},{id:"clear",name:"/clear",argument:"none",desc:"clear the event feed view",group:"Other",kind:"local"},{id:"reconnect",name:"/reconnect",argument:"none",desc:"reconnect the live event stream",group:"Other",kind:"local"},{id:"help",name:"/help",argument:"none",desc:"keys + full command reference",aliases:["/?","/commands"],group:"Other",kind:"local"},{id:"quit",name:"/quit",argument:"none",desc:"leave the cockpit (background work keeps running)",aliases:["/exit","/q"],group:"Other",kind:"local"}],OL=new Map(Qf.map(e=>[e.id,e])),qd=new Map;for(let e of Qf)for(let t of[e.name,...e.aliases??[]])qd.set(t.toLowerCase(),e);var Sb=/^\/[A-Za-z0-9_-]+$/;function wf(e){if(!e.startsWith("/"))return!1;let t=e.indexOf(" "),r=t===-1?e:e.slice(0,t);return Sb.test(r)}function _b(e){return e.startsWith("/")&&!e.includes(" ")&&!e.slice(1).includes("/")}function zd(e){if(!_b(e))return[];let t=e.toLowerCase(),r=new Set,i=[];for(let s of Qf)[s.name,...s.aliases??[]].some(u=>u.toLowerCase().startsWith(t))&&!r.has(s.name)&&(r.add(s.name),i.push(s));return i.sort((s,a)=>Number(_y(a,t))-Number(_y(s,t)))}function _y(e,t){return[e.name,...e.aliases??[]].some(r=>r.toLowerCase()===t)}function $d(e){return e.arg?`${e.name} `:e.name}function tI(e){let t=e.trim();return!t||t.toLowerCase()==="list"?{kind:"list"}:{kind:"project",query:t}}function rI(e){let t=e.trim();if(!t)return{filter:"all",query:""};let[r,...i]=t.split(/\s+/);return r.toLowerCase()==="watch"?{filter:"attention",query:i.join(" ")}:vy.includes(r.toLowerCase())?{filter:r.toLowerCase(),query:i.join(" ")}:{filter:"all",query:t}}function nI(e){if(!wf(e))return null;let t=e.indexOf(" "),r=(t===-1?e:e.slice(0,t)).toLowerCase(),i=t===-1?"":e.slice(t+1).trim(),s=qd.get(r)??null;return{cmd:s,name:s?s.name:r,rest:i}}function oI(e){let t=e.toLowerCase(),r=null,i=0;for(let s of qd.keys()){let a=Rb(t,s);a>i&&(i=a,r=qd.get(s).name)}return i>=.6?r:null}function Rb(e,t){let r=bb(e,t),i=Math.max(e.length,t.length)||1;return 1-r/i}function bb(e,t){let r=e.length,i=t.length,s=Array.from({length:r+1},(a,u)=>[u,...Array(i).fill(0)]);for(let a=0;a<=i;a+=1)s[0][a]=a;for(let a=1;a<=r;a+=1)for(let u=1;u<=i;u+=1)s[a][u]=Math.min(s[a-1][u]+1,s[a][u-1]+1,s[a-1][u-1]+(e[a-1]===t[u-1]?0:1));return s[r][i]}function iI(){let e=["Everyday","Task management","Sessions & diagnostics","Configuration","Other"],t=new Map;for(let r of Qf){let i=r.aliases?.length?` (= ${r.aliases.join(", ")})`:"",s=`${r.name}${r.arg?` ${r.arg}`:""}${i}`;t.has(r.group)||t.set(r.group,[]),t.get(r.group).push({label:s,desc:r.desc})}return e.filter(r=>t.has(r)).map(r=>({group:r,rows:t.get(r)}))}var Ie={accent:"#e6b450",border:"#8a93a6",success:"#3aa76a",error:"#d15c6a",warning:"#d0a850",info:"#5a9beb",role:{manager:"blue",planner:"magenta",engineer:"green",reviewer:"yellow"}},ku=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Ry=["#3b6fd4","#4d86e0","#5f9deb","#72b4f0","#89dceb"],sI="#48506b",by="#f4e0a8",Fy="#6c7086";function xy(e){switch(e){case"medium":return Ie.info;case"high":return Ie.warning;case"xhigh":return Ie.accent;case"max":return Ie.error;default:return"gray"}}var cA=Le(Pt(),1),Oy="argus";function fA({d:e="solid",lit:t=Oy.length,sh:r=-1}){let i=e==="ghost"?sI:Ie.accent;return(0,cA.jsxs)(N,{children:[(0,cA.jsx)(N,{color:i,bold:e==="solid",dimColor:e==="flick",children:"\u25C9"}),t>=0?(0,cA.jsxs)(cA.Fragment,{children:[(0,cA.jsx)(N,{children:" "}),[...Oy].map((s,a)=>{let u=a===r,E=u?by:ae.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`;function Ly({width:e,health:t=""}){return(0,za.jsxs)(ye,{flexDirection:"column",children:[(0,za.jsxs)(ye,{children:[(0,za.jsx)(fA,{}),(0,za.jsx)(N,{dimColor:!0,children:" \xB7 Autonomous Research Lab"})]}),t?(0,za.jsx)(N,{color:Ie.warning,children:` ! ${Lb(t,Math.max(12,e-6))}`}):null]})}var Xa=Le(jt(),1);var Mb=new Set(["done","success","completed"]),Pb=new Set(["research_incomplete","paused_no_breakthrough","exhausted_current_methods"]),Ub=new Set(["no_progress","max_rounds"]),Gb=new Set(["blocked","infra_blocked"]),Hb=new Set(["error","failed","supervisor_error"]),Wb={completed:{glyph:"\u{1F389}",tone:"ok",missionStatus:"complete"},incomplete:{glyph:"\u25CC",tone:"warn",missionStatus:"incomplete"},stalled:{glyph:"\u23F8",tone:"warn",missionStatus:"stalled"},blocked:{glyph:"\u26D4",tone:"err",missionStatus:"blocked"},failed:{glyph:"\u{1F4A5}",tone:"err",missionStatus:"failed"},ended:{glyph:"\u25A0",tone:"info",missionStatus:"ended"}},Kb={completed:"Task completed",incomplete:"Mission incomplete",stalled:"Mission stalled",blocked:"Mission blocked",failed:"Mission failed",ended:"Mission ended"};function $a(e){return String(e??"").trim().toLowerCase()}function Jb(e){let t=$a(e);switch(t){case"completed":case"incomplete":case"stalled":case"blocked":case"failed":case"ended":return t;default:return null}}function AI(e){let t=$a(e.status);return e.success===!0||Mb.has(t)?"completed":Pb.has(t)?"incomplete":Ub.has(t)?"stalled":Gb.has(t)?"blocked":Hb.has(t)?"failed":"ended"}function aI(e){let t=e.outcome;if(t&&typeof t=="object"&&!Array.isArray(t)){let r=t;return{execution_status:$a(r.execution_status)||AI(e),review_status:$a(r.review_status)||"not_assessed",stage_certification:$a(r.stage_certification)||"not_assessed",interruption_kind:$a(r.interruption_kind)||"none",resumable:r.resumable===!0}}return{execution_status:AI(e),review_status:"not_assessed",stage_certification:"not_assessed",interruption_kind:$a(e.stop_kind)||"none",resumable:e.resumable===!0}}function Zd(e){return e?.execution_status?[`execution=${e.execution_status}`,e.review_status&&e.review_status!=="not_assessed"?`review=${e.review_status}`:"",e.stage_certification&&e.stage_certification!=="not_assessed"?`stage=${e.stage_certification}`:"",e.interruption_kind&&e.interruption_kind!=="none"?`interrupt=${e.interruption_kind}`:"",e.resumable?"resumable=yes":""].filter(Boolean):[]}function vf(e){let t=Jb(e.outcome_class)??AI(e),r=String(e.status??"").trim(),i=Wb[t],s=t==="completed"&&e.final_submission_certified===!0?"Submission certified":t==="ended"&&r?`Mission ended \xB7 ${r}`:Kb[t];return{outcomeClass:t,label:s,glyph:i.glyph,tone:i.tone,missionStatus:i.missionStatus}}var ep=["manager","planner","engineer","reviewer"],My=new Set(["planner","engineer","reviewer"]),jb=new Set(["running","in_progress","claimed"]),Se=(e,t)=>String(e[t]??"").trim(),ws=(e,t)=>{let r=Number(e[t]);return Number.isFinite(r)?r:null};function tp(e){let t=[e.route?e.route.toUpperCase():"",e.vertical,e.workflow_mode?e.workflow_mode.toUpperCase():""].filter(Boolean);return e.lifetime==="standing"?t.push("STANDING \xB7 OPEN-ENDED"):e.lifetime==="bounded_increment"?t.push("BOUNDED INCREMENT"):e.lifetime==="bounded"&&e.continuous?t.push("BOUNDED \xB7 FINITE CONTINUOUS"):e.lifetime&&t.push(e.lifetime.toUpperCase()),t.join(" \xB7 ")}function Yb(e){return JSON.parse(JSON.stringify(e))}function Py(){return{schema_version:5,bootstrapped:!1,mission:{id:"",title:"",objective:"",summary:"",status:"idle",started_at:null,completed_at:null,elapsed_seconds:0,campaign_started_at:null,campaign_elapsed_seconds:0},stage:{id:"",label:""},routing:{route:"",vertical:"",workflow_mode:"",lifetime:"",continuous:!1,open_ended:!1},round:{current:0,max:0},active_role:"",roles:ep.map(e=>({role:e,status:"waiting",label:"Waiting",updated_at:0})),role_work:[],dag:[],timeline:[],artifacts:[],learned_skills:[],learned_wiki_pages:[],storage:{project_skill_dir:"",global_skill_dir:"",project_skill_count:0,global_skill_count:0,skill_history_compressed:0,wiki_retired_compressed:0,skill_history_bytes_saved:0,wiki_retired_bytes_saved:0,wiki_paths:[]},achievement:null,review:{status:"",reason:"",rejected_attempts:0},frontier:{change:"",summary:"",updated_at:0},outcome:{},last_event_ts:0,updated_at:0}}function gA(e,t,r,i){if(r==null||r==="")return;let s=e.findIndex(a=>a[t]===r);s>=0?e[s]={...e[s],...i}:e.push(i)}function pn(e,t,r,i,s){if(!ep.includes(t))return;r==="active"&&My.has(t)&&e.roles.forEach(u=>{My.has(u.role)&&u.role!==t&&u.status==="active"&&Object.assign(u,{status:"done",label:"Handed off",updated_at:s})});let a={role:t,status:r,label:i,updated_at:s};gA(e.roles,"role",t,a),r==="active"?e.active_role=t:e.active_role===t&&(e.active_role="")}function Gn(e,t,r,i,s="",a="neutral"){let u=XA(t);if(e.timeline.some(I=>I.id===u))return;let E={id:u,ts:Number(t.ts??Date.now()/1e3),type:$A(t.type),role:r,title:i.slice(0,180),detail:s.slice(0,500),tone:a};["item_id","branch_id"].forEach(I=>{let h=Se(t,I);h&&(E[I]=h)}),e.timeline=[...e.timeline,E].slice(-120)}function To(e,t,r,i,s,a="",u=""){if(!ep.includes(r))return;let E=Se(t,"message_id"),I=E?`${r}:${E}`:XA(t),h=e.role_work.find(G=>G.id===I),y=h&&h.detail.length>a.length?h.detail:a,D={id:I,ts:Number(t.ts??Date.now()/1e3),role:r,kind:i,title:s.slice(0,240),detail:y.slice(0,4e3),status:u,item_id:Se(t,"item_id"),mission_id:e.mission.id,mission_title:e.mission.title.slice(0,240),round_index:ws(t,"round_index")},R=e.role_work.findIndex(G=>G.id===I);R>=0?e.role_work[R]=D:e.role_work.push(D);let O=new Set;ep.forEach(G=>{e.role_work.filter(ne=>ne.role===G).slice(-40).forEach(ne=>O.add(ne.id))}),e.role_work=e.role_work.filter(G=>O.has(G.id))}function Vb(e){return e==="ok"?"success":e==="err"?"error":"info"}var qb={agent_message:"Reporting progress",assistant_message:"Reporting progress",command_execution:"Running a command",reasoning:"Reasoning",tool_use:"Using a tool",tool_result:"Inspecting tool output",codex_idle:"Waiting for model output"};function zb(e,t){let r=$A(t.type),i=Number(t.ts??Date.now()/1e3);if(e.last_event_ts=Math.max(e.last_event_ts,i),r===z.LIFE_MANAGER_INTENT_STARTED)e.mission.id=Se(t,"item_id")||Se(t,"intent_id"),e.mission.title=Se(t,"objective").slice(0,240),e.mission.objective=Se(t,"objective"),e.mission.status="grounding",pn(e,"manager","active","Grounding project",i),Gn(e,t,"manager","Project grounding started",Se(t,"objective")),To(e,t,"manager","grounding","Grounding project",Se(t,"objective"),"active");else if(r===z.LIFE_MANAGER_INTENT_COMPLETED){e.mission.id=Se(t,"item_id"),e.mission.title=Se(t,"objective").slice(0,240),e.mission.objective=Se(t,"objective"),e.mission.status="framed",e.routing.route=Se(t,"route")||e.routing.route||"team",e.routing.vertical=Se(t,"vertical")||e.routing.vertical,e.routing.workflow_mode=Se(t,"workflow_mode")||e.routing.workflow_mode,e.routing.lifetime=Se(t,"lifetime")||e.routing.lifetime,"continuous"in t&&(e.routing.continuous=t.continuous===!0),"open_ended"in t&&(e.routing.open_ended=t.open_ended===!0);let s=Se(t,"current_stage"),a=Array.isArray(t.stages)?t.stages:[];if(s)e.stage={id:s,label:s.replaceAll("_"," ")};else if(!e.stage.id&&a[0]){let u=String(a[0]);e.stage={id:u,label:u.replaceAll("_"," ")}}pn(e,"manager","done","Goal framed",i),Gn(e,t,"manager","Goal framed",Se(t,"reason"),"success"),To(e,t,"manager","decision","Goal framed",Se(t,"reason")||Se(t,"execution_task"),"done")}else if(r===z.LIFE_MANAGER_INTENT_FAILED)e.mission.status="failed",pn(e,"manager","error","Manager routing failed",i),Gn(e,t,"manager","Manager routing failed",Se(t,"error")||Se(t,"reason"),"error"),To(e,t,"manager","grounding","Manager routing failed",Se(t,"error")||Se(t,"reason"),"error");else if(r===z.LIFE_MANAGER_STAGE_DECISION){let s=Se(t,"target_stage")||Se(t,"stage")||Se(t,"current_stage");s&&(e.stage={id:s,label:s.replaceAll("_"," ")}),pn(e,"manager","done",s?`Stage \xB7 ${s}`:"Stage reviewed",i),Gn(e,t,"manager",s?`Stage \u2192 ${s}`:"Stage reviewed",Se(t,"reason")),To(e,t,"manager","stage_decision",s?`Stage \u2192 ${s}`:"Stage reviewed",Se(t,"reason"),Se(t,"action"))}else if(r===z.LIFE_PLANNER_START)pn(e,"planner","active","Planning next work",i),To(e,t,"planner","planning","Planning next work",Se(t,"objective"),"active");else if(r===z.LIFE_PLANNER_TASK_ADDED){let s=Se(t,"item_id"),a={id:s,title:Se(t,"title"),objective:Se(t,"objective"),status:"pending",deps:Array.isArray(t.deps)?t.deps.map(String):[],branch_id:Se(t,"branch_id")||s,parent_branch_id:Se(t,"parent_branch_id")||null};gA(e.dag,"id",s,a),pn(e,"planner","done","Research branch added",i),Gn(e,t,"planner","Research branch added",a.title,"info"),To(e,t,"planner","task",a.title||"Task added",a.objective,"pending")}else if(r===z.LIFE_PLANNER_VERDICT){let s=!!t.project_done,a=s?"Project reviewed":"Planning complete";pn(e,"planner","done",a,i),Gn(e,t,"planner",a,Se(t,"reason"),s?"success":"neutral"),To(e,t,"planner","verdict",a,Se(t,"reason"),s?"done":"planned")}else if(r===z.LIFE_PLANNER_WAITING){pn(e,"planner","waiting","Waiting on external work",i);let s=Se(t,"reason")||Se(t,"waiting_reason");Gn(e,t,"planner","Planner waiting",s),To(e,t,"planner","waiting","Planner waiting",s,"waiting")}else if(r===z.LIFE_MISSION_STARTED)e.review={status:"",reason:"",rejected_attempts:0},e.mission.campaign_started_at??=i,e.mission={...e.mission,id:Se(t,"item_id"),title:Se(t,"title"),objective:Se(t,"objective"),summary:"",status:"working",started_at:i,completed_at:null},pn(e,"reviewer","waiting","Awaiting engineer handoff",i),pn(e,"engineer","active","Starting mission",i),Gn(e,t,"engineer","Mission started",Se(t,"title"),"info"),To(e,t,"engineer","task",Se(t,"title")||"Mission started",Se(t,"objective"),"active");else if(r===z.ROUND_START)e.round={current:ws(t,"round_index")??0,max:ws(t,"round_max")??e.round.max},pn(e,"engineer","active",`Running round ${e.round.current}`,i),Gn(e,t,"engineer",`Round ${e.round.current} started`);else if(r===z.ENGINEER_PROGRESS){let s=Se(t,"agent_layer")||Se(t,"actor")||"engineer",a=s==="main"?"engineer":s,u=Se(t,"kind"),E=qb[u]??"Working";pn(e,a,"active",E,i);let I=Se(t,"action_summary")||Se(t,"text");I&&!Zm(t)&&!Vd(t)&&To(e,t,a,u||"progress",E,I,"active"),["reasoning","assistant_message","agent_message"].includes(u)||Gn(e,t,a,E,Se(t,"action_summary")||Se(t,"text"))}else if(r===z.ROUND_MAIN_COMPLETED)pn(e,"engineer","done","Engineer handoff ready",i),To(e,t,"engineer","handoff","Engineer handoff ready",Se(t,"text")||Se(t,"summary"),"done");else if(r===z.ROUND_REVIEW_STARTED)pn(e,"reviewer","active","Reviewing benchmark evidence",i),To(e,t,"reviewer","review","Review started","","active");else if(r===z.ROUND_REVIEW_DEFERRED){let s=Se(t,"next_step");pn(e,"engineer","active","Continuing before review",i),pn(e,"reviewer","waiting","Review deferred for one round",i),Gn(e,t,"engineer","Continued before review",s,"info")}else if(r===z.ROUND_REVIEW_COMPLETED){let s=Se(t,"status"),a=Se(t,"reason");e.review={status:s,reason:a,rejected_attempts:e.review.rejected_attempts+(["continue","blocked"].includes(s)?1:0)};let u=Se(t,"frontier_change");u&&(e.frontier={change:u,summary:Se(t,"frontier_summary"),updated_at:i}),pn(e,"reviewer",s==="done"?"done":"rejected",s==="done"?"Accepted evidence":"Requested another attempt",i),Gn(e,t,"reviewer",s==="done"?"Evidence accepted":"Attempt rejected",a,s==="done"?"success":"error");let E=Se(t,"next_action");To(e,t,"reviewer","verdict",s==="done"?"Evidence accepted":"Attempt rejected",E?`${a} -Next action: ${E}`:a,s)}else if([z.SKILL_CREATED,z.SKILL_UPDATED].includes(r)){let s=_e(t,"skill_id")||_e(t,"name");s&&(gA(e.learned_skills,"id",s,{id:s,name:_e(t,"name"),version:vs(t,"version")??1,scope:_e(t,"scope"),path:_e(t,"path"),status:"active",updated_at:i,mission_id:e.mission.id,mission_title:e.mission.title}),Gn(e,t,"reviewer",r===z.SKILL_CREATED?"Capability unlocked":"Capability upgraded",_e(t,"name"),"skill"))}else if(r===z.SKILL_EVOLUTION_COMPLETED)e.storage.project_skill_dir=_e(t,"project_skill_dir")||e.storage.project_skill_dir,e.storage.global_skill_dir=_e(t,"global_skill_dir")||e.storage.global_skill_dir,e.storage.project_skill_count=vs(t,"project_skill_count")??e.storage.project_skill_count,e.storage.global_skill_count=vs(t,"global_skill_count")??e.storage.global_skill_count;else if(r===z.SKILL_HISTORY_COMPRESSED)e.storage.skill_history_compressed+=vs(t,"count")??0,e.storage.skill_history_bytes_saved+=vs(t,"bytes_saved")??0;else if(r===z.SKILL_TIDIED){let s=_e(t,"name");if(s){let a=e.learned_skills.find(E=>E.name===s),u={source_path:_e(t,"path"),source_placement:_e(t,"placement"),source_vertical:_e(t,"vertical"),updated_at:i};a?Object.assign(a,u):gA(e.learned_skills,"id",s,{id:s,name:s,version:1,scope:"",path:"",status:"active",...u}),Gn(e,t,"manager","Capability promoted to source",s,"skill")}}else if([z.WIKI_INITIALIZED,z.WIKI_EVOLUTION_COMPLETED].includes(r)){let s=[...(Array.isArray(t.paths)?t.paths:[]).map(a=>String(a)),_e(t,"path")].filter(Boolean);e.storage.wiki_paths=[...new Set([...e.storage.wiki_paths,...s])]}else if(r===z.WIKI_RETIRED_COMPRESSED)e.storage.wiki_retired_compressed+=vs(t,"count")??0,e.storage.wiki_retired_bytes_saved+=vs(t,"bytes_saved")??0;else if([z.WIKI_CREATED,z.WIKI_UPDATED].includes(r)){let s=_e(t,"page_id");s&&(gA(e.learned_wiki_pages,"id",s,{id:s,title:_e(t,"title")||s,card_type:_e(t,"card_type"),status:_e(t,"status")||"scratch",path:_e(t,"path"),updated_at:i}),Gn(e,t,"reviewer",r===z.WIKI_CREATED?"Knowledge captured":"Knowledge refined",_e(t,"title")||s,"skill"))}else if(r===z.WIKI_RETIRED){let s=_e(t,"page_id");if(s){let a=e.learned_wiki_pages.find(u=>u.id===s);a?Object.assign(a,{status:"retired",updated_at:i}):gA(e.learned_wiki_pages,"id",s,{id:s,title:s,card_type:_e(t,"card_type"),status:"retired",path:"",updated_at:i}),Gn(e,t,"reviewer","Knowledge retired",s,"error")}}else if([z.WIKI_PROMOTION_PROMOTED,z.WIKI_PROMOTION_DEMOTED].includes(r)){let s=_e(t,"page_id");if(s){let a=e.learned_wiki_pages.find(E=>E.id===s);a?Object.assign(a,{status:_e(t,"to_status"),updated_at:i}):gA(e.learned_wiki_pages,"id",s,{id:s,title:s,card_type:_e(t,"card_type"),status:_e(t,"to_status"),path:"",updated_at:i});let u=r===z.WIKI_PROMOTION_PROMOTED;Gn(e,t,"reviewer",u?"Knowledge promoted":"Knowledge demoted",`${s} \u2192 ${_e(t,"to_status")}`,u?"success":"neutral")}}else if(r===z.RESEARCH_ACHIEVEMENT_CERTIFIED)e.achievement={id:_e(t,"achievement_id"),title:_e(t,"title"),goal:_e(t,"goal"),summary:_e(t,"summary"),rejected_attempts:e.review.rejected_attempts,skills_learned:e.learned_skills.filter(s=>s.status==="active").length,artifacts:e.artifacts.length,elapsed_seconds:e.mission.elapsed_seconds,evidence:Array.isArray(t.evidence)?t.evidence.map(String):[],reviewer_certified:!0,certified_at:i};else if([z.LIFE_MISSION_COMPLETED,z.LIFE_MISSION_FAILED].includes(r)){let s=r===z.LIFE_MISSION_FAILED?vf({...t,outcome_class:"failed",status:_e(t,"status")||"failed",success:!1}):vf(t);e.mission.id=_e(t,"item_id")||e.mission.id,e.mission.title=_e(t,"title")||e.mission.title,e.mission.objective=_e(t,"objective")||e.mission.objective,e.mission.summary=_e(t,"summary"),e.mission.status=s.missionStatus,e.mission.completed_at=i,e.outcome=sI(t),pn(e,"engineer",s.missionStatus==="complete"?"done":s.missionStatus,s.label,i),Gn(e,t,"engineer",s.label,_e(t,"summary")||_e(t,"title")||_e(t,"status"),KF(s.tone)),To(e,t,"engineer","completion",s.label,_e(t,"summary")||_e(t,"title")||_e(t,"status"),s.missionStatus)}return e.updated_at=Date.now()/1e3,e}function YF(e,t,r){let i=t.backlog.find(D=>HF.has(D.status)),s=t.backlog.find(D=>D.status==="pending"),a=t.backlog.find(D=>D.id===e.mission.id),u=i??a,E=!!(i||s||t.continuous?.enabled||t.continuous?.done_reason||t.continuous?.done_at||e.mission.id||!["","idle"].includes(e.mission.status));t.continuous?.enabled&&(e.routing.route=e.routing.route||"team",e.routing.continuous=!0,e.routing.open_ended=t.continuous.open_ended===!0,e.routing.lifetime=e.routing.open_ended?"standing":e.routing.lifetime||"bounded");let I=u?.objective||u?.title||(t.continuous?.enabled?t.continuous.objective:"")||t.session.objective||(e.mission.id?"":s?.objective)||(e.mission.id?"":s?.title)||e.mission.objective;I&&(e.mission.objective=I,u?e.mission.title=(u.title||I.split(` +Next action: ${E}`:a,s)}else if([z.SKILL_CREATED,z.SKILL_UPDATED].includes(r)){let s=Se(t,"skill_id")||Se(t,"name");s&&(gA(e.learned_skills,"id",s,{id:s,name:Se(t,"name"),version:ws(t,"version")??1,scope:Se(t,"scope"),path:Se(t,"path"),status:"active",updated_at:i,mission_id:e.mission.id,mission_title:e.mission.title}),Gn(e,t,"reviewer",r===z.SKILL_CREATED?"Capability unlocked":"Capability upgraded",Se(t,"name"),"skill"))}else if(r===z.SKILL_EVOLUTION_COMPLETED)e.storage.project_skill_dir=Se(t,"project_skill_dir")||e.storage.project_skill_dir,e.storage.global_skill_dir=Se(t,"global_skill_dir")||e.storage.global_skill_dir,e.storage.project_skill_count=ws(t,"project_skill_count")??e.storage.project_skill_count,e.storage.global_skill_count=ws(t,"global_skill_count")??e.storage.global_skill_count;else if(r===z.SKILL_HISTORY_COMPRESSED)e.storage.skill_history_compressed+=ws(t,"count")??0,e.storage.skill_history_bytes_saved+=ws(t,"bytes_saved")??0;else if(r===z.SKILL_TIDIED){let s=Se(t,"name");if(s){let a=e.learned_skills.find(E=>E.name===s),u={source_path:Se(t,"path"),source_placement:Se(t,"placement"),source_vertical:Se(t,"vertical"),updated_at:i};a?Object.assign(a,u):gA(e.learned_skills,"id",s,{id:s,name:s,version:1,scope:"",path:"",status:"active",...u}),Gn(e,t,"manager","Capability promoted to source",s,"skill")}}else if([z.WIKI_INITIALIZED,z.WIKI_EVOLUTION_COMPLETED].includes(r)){let s=[...(Array.isArray(t.paths)?t.paths:[]).map(a=>String(a)),Se(t,"path")].filter(Boolean);e.storage.wiki_paths=[...new Set([...e.storage.wiki_paths,...s])]}else if(r===z.WIKI_RETIRED_COMPRESSED)e.storage.wiki_retired_compressed+=ws(t,"count")??0,e.storage.wiki_retired_bytes_saved+=ws(t,"bytes_saved")??0;else if([z.WIKI_CREATED,z.WIKI_UPDATED].includes(r)){let s=Se(t,"page_id");s&&(gA(e.learned_wiki_pages,"id",s,{id:s,title:Se(t,"title")||s,card_type:Se(t,"card_type"),status:Se(t,"status")||"scratch",path:Se(t,"path"),updated_at:i}),Gn(e,t,"reviewer",r===z.WIKI_CREATED?"Knowledge captured":"Knowledge refined",Se(t,"title")||s,"skill"))}else if(r===z.WIKI_RETIRED){let s=Se(t,"page_id");if(s){let a=e.learned_wiki_pages.find(u=>u.id===s);a?Object.assign(a,{status:"retired",updated_at:i}):gA(e.learned_wiki_pages,"id",s,{id:s,title:s,card_type:Se(t,"card_type"),status:"retired",path:"",updated_at:i}),Gn(e,t,"reviewer","Knowledge retired",s,"error")}}else if([z.WIKI_PROMOTION_PROMOTED,z.WIKI_PROMOTION_DEMOTED].includes(r)){let s=Se(t,"page_id");if(s){let a=e.learned_wiki_pages.find(E=>E.id===s);a?Object.assign(a,{status:Se(t,"to_status"),updated_at:i}):gA(e.learned_wiki_pages,"id",s,{id:s,title:s,card_type:Se(t,"card_type"),status:Se(t,"to_status"),path:"",updated_at:i});let u=r===z.WIKI_PROMOTION_PROMOTED;Gn(e,t,"reviewer",u?"Knowledge promoted":"Knowledge demoted",`${s} \u2192 ${Se(t,"to_status")}`,u?"success":"neutral")}}else if(r===z.RESEARCH_ACHIEVEMENT_CERTIFIED)e.achievement={id:Se(t,"achievement_id"),title:Se(t,"title"),goal:Se(t,"goal"),summary:Se(t,"summary"),rejected_attempts:e.review.rejected_attempts,skills_learned:e.learned_skills.filter(s=>s.status==="active").length,artifacts:e.artifacts.length,elapsed_seconds:e.mission.elapsed_seconds,evidence:Array.isArray(t.evidence)?t.evidence.map(String):[],reviewer_certified:!0,certified_at:i};else if([z.LIFE_MISSION_COMPLETED,z.LIFE_MISSION_FAILED].includes(r)){let s=r===z.LIFE_MISSION_FAILED?vf({...t,outcome_class:"failed",status:Se(t,"status")||"failed",success:!1}):vf(t);e.mission.id=Se(t,"item_id")||e.mission.id,e.mission.title=Se(t,"title")||e.mission.title,e.mission.objective=Se(t,"objective")||e.mission.objective,e.mission.summary=Se(t,"summary"),e.mission.status=s.missionStatus,e.mission.completed_at=i,e.outcome=aI(t),pn(e,"engineer",s.missionStatus==="complete"?"done":s.missionStatus,s.label,i),Gn(e,t,"engineer",s.label,Se(t,"summary")||Se(t,"title")||Se(t,"status"),Vb(s.tone)),To(e,t,"engineer","completion",s.label,Se(t,"summary")||Se(t,"title")||Se(t,"status"),s.missionStatus)}return e.updated_at=Date.now()/1e3,e}function $b(e,t,r){let i=t.backlog.find(D=>jb.has(D.status)),s=t.backlog.find(D=>D.status==="pending"),a=t.backlog.find(D=>D.id===e.mission.id),u=i??a,E=!!(i||s||t.continuous?.enabled||t.continuous?.done_reason||t.continuous?.done_at||e.mission.id||!["","idle"].includes(e.mission.status));t.continuous?.enabled&&(e.routing.route=e.routing.route||"team",e.routing.continuous=!0,e.routing.open_ended=t.continuous.open_ended===!0,e.routing.lifetime=e.routing.open_ended?"standing":e.routing.lifetime||"bounded");let I=u?.objective||u?.title||(t.continuous?.enabled?t.continuous.objective:"")||t.session.objective||(e.mission.id?"":s?.objective)||(e.mission.id?"":s?.title)||e.mission.objective;I&&(e.mission.objective=I,u?e.mission.title=(u.title||I.split(` `)[0]).slice(0,240):e.mission.title||(e.mission.title=I.split(` -`)[0].slice(0,240))),i?(e.mission.id=i.id,e.mission.status="working",e.mission.started_at=e.mission.started_at??i.started_ts??null):a?a.status==="pending"&&(e.mission.status="queued"):t.continuous?.done_reason||t.continuous?.done_at?e.mission.status="complete":s||t.continuous?.enabled?e.mission.status="queued":t.daemon.alive&&(e.mission.status="idle"),t.roles.forEach(D=>{D.active?pn(e,D.role,"active",D.label||D.status||"Working",Date.now()/1e3-(D.age_s??0)):E||pn(e,D.role,"waiting","Waiting",Date.now()/1e3);let R=e.roles.find(O=>O.role===D.role);R&&Object.assign(R,{backend:D.backend,model:D.model,effort:D.effort})});let C=t.roles.filter(D=>D.active);C.length?e.active_role=C[C.length-1].role:E||(e.active_role=""),t.backlog.forEach(D=>{let R={id:D.id,title:D.title,objective:D.objective,status:D.status,deps:D.deps??[],branch_id:D.id,parent_branch_id:D.deps?.[0]??null,acceptance_check:D.acceptance_check??"",plan_hypothesis:D.plan_hypothesis??"",goal_contribution:D.goal_contribution??"",expected_regressions:D.expected_regressions??"",decision_rule:D.decision_rule??"",non_goals:D.non_goals??[]};gA(e.dag,"id",R.id,R)});let y=u?.outcome?.execution_status?u.outcome:e.mission.id?void 0:[...t.backlog].filter(D=>D.outcome?.execution_status).sort((D,R)=>Number(D.finished_ts??0)-Number(R.finished_ts??0)).at(-1)?.outcome;return!i&&y&&(e.outcome=sI({outcome:y,status:"done",success:!0})),r.forEach(D=>{gA(e.artifacts,"path",D.path,{id:D.path,path:D.path,title:D.name,kind:D.kind,why:D.why,exists:D.exists,source:D.source})}),E}function VF(e,t,r,i){i||(t.roles.forEach(u=>{u.active||pn(e,u.role,"waiting","Waiting",Date.now()/1e3)}),e.active_role="");let s=Date.now()/1e3,a=e.mission.campaign_started_at??t.session.created??e.mission.started_at;a&&(e.mission.campaign_started_at=a,e.mission.campaign_elapsed_seconds=Math.max(0,s-a)),e.mission.started_at&&e.mission.status==="working"?e.mission.elapsed_seconds=Math.max(0,s-e.mission.started_at):e.mission.started_at&&e.mission.completed_at&&(e.mission.elapsed_seconds=Math.max(0,e.mission.completed_at-e.mission.started_at)),e.achievement?.reviewer_certified&&(e.achievement.elapsed_seconds=e.mission.elapsed_seconds,e.achievement.rejected_attempts=e.review.rejected_attempts,e.achievement.skills_learned=e.learned_skills.filter(u=>u.status==="active").length,e.achievement.artifacts=r.filter(u=>u.exists).length)}function Oy(e,t=[],r=[]){let i=e.mission_view?WF(e.mission_view):Ty();i.storage??=Ty().storage,i.storage.skill_history_compressed??=0,i.storage.wiki_retired_compressed??=0,i.storage.skill_history_bytes_saved??=0,i.storage.wiki_retired_bytes_saved??=0,i.learned_wiki_pages??=[],i.role_work??=[],i.outcome??={};let s=i.last_event_ts,a=YF(i,e,r);return t.filter(u=>u.ts==null||Number(u.ts)>s).sort((u,E)=>Number(u.ts??0)-Number(E.ts??0)).forEach(u=>jF(i,u)),VF(i,e,r,a),i}function Ly(e){return String(e||"").replace(/\\([*_`~])/g,"$1").replace(/\\\\(?=[A-Za-z])/g,"\\")}function AI(e){let t=Math.max(0,Math.floor(e)),r=Math.floor(t/3600),i=Math.floor(t%3600/60);return r?`${r}h ${i}m`:i?`${i}m`:`${t}s`}var aI={manager:"Manager",planner:"Planner",engineer:"Engineer",reviewer:"Reviewer",critic:"Critic",system:"Argus"};function ep(e){switch(e){case"bright":return"white";case"dim":return"gray";case"accent":return me.accent;case"ok":return me.success;case"warn":return me.warning;case"err":return me.error;case"info":return me.info}}function tp(e){return me.role[e]??"gray"}function ur(e,t){let r=(e||"").replace(/```[a-z]*\n?/gi,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"[$1]").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"\u2026"}var Ke=(e,t)=>String(e[t]??""),lI=e=>{let t=e,r=t.round_index??t.round;return typeof r=="string"||typeof r=="number"?r:"?"};function My(e){let t=Ke(e,"type");if(t==="engineer.progress"){let r=Ke(e,"kind"),i=Ke(e,"agent_layer")||"engineer",s=aI[i]||"Engineer";if(r==="reasoning"){let a=ur(Ke(e,"text"),280);return a?{role:i,label:s,glyph:"\u2234",text:a,tone:"dim",reasoning:!0}:null}if(r==="assistant_message"||r==="agent_message"||r==="message"){if(jd(e))return null;let a=By(Ke(e,"text"));return a?{role:i,label:s,glyph:"\u258C",text:a,tone:"bright",expand:!0}:null}if(r==="command_execution"){let a=Ke(e,"text")||Ke(e,"command")||Ke(e,"action_summary");return a?{role:i,label:s,glyph:"\u25B8 $",text:a,tone:Ke(e,"status")==="failed"?"err":"dim",expand:!0}:null}if(r==="tool_use"||r==="file_change"){let a=Ke(e,"text")||Ke(e,"action_summary");return a?{role:i,label:s,glyph:r==="file_change"?"\u270E":"\u2699",text:a,tone:Ke(e,"status")==="failed"?"err":"dim",expand:!0}:null}return null}if(t==="role.activity"){let r=Ke(e,"status");if(r==="running")return null;let i=Ke(e,"role")||"engineer",s=e.milestone===!0;return r!=="error"&&!s?null:{role:i,label:aI[i]||i,glyph:r==="error"?"\u2715":"\u2713",text:ur(Ke(e,"label")||"activity completed",180),tone:r==="error"?"err":"ok"}}if(t==="life.manager.intent.started")return{role:"manager",label:"Manager",glyph:"\u{1F9ED}",text:"\u5224\u65AD\u4EFB\u52A1\u5F52\u5C5E\u2026",tone:"info"};if(t==="life.manager.intent.completed")return{role:"manager",label:"Manager",glyph:"\u{1F9ED}",text:`\u2192 ${Zd({route:Ke(e,"route")||"team",vertical:Ke(e,"vertical"),workflow_mode:Ke(e,"workflow_mode"),lifetime:Ke(e,"lifetime"),continuous:e.continuous===!0,open_ended:e.open_ended===!0})||Ke(e,"kind")||"resolved"}`,tone:"info"};if(t==="life.manager.intent.failed")return{role:"manager",label:"Manager",glyph:"\u26A0",text:`\u5206\u6D41\u5931\u8D25 ${ur(Ke(e,"error"),160)}`,tone:"err"};if(t==="life.manager.stage_decision"){let r=Ke(e,"target_stage")||Ke(e,"stage")||Ke(e,"current_stage");return{role:"manager",label:"Manager",glyph:"\u{1F9ED}",text:`${Ke(e,"action")}${r?` \u2192 ${r}`:""} ${ur(Ke(e,"reason"),140)}`,tone:"info"}}if(t==="life.planner.start")return{role:"planner",label:"Planner",glyph:"\u{1F4CB}",text:`planning ${ur(Ke(e,"objective"),160)}`,tone:"accent"};if(t==="life.planner.verdict")return Ke(e,"status")==="done"||e.project_done===!0?{role:"planner",label:"Planner",glyph:"\u{1F3C1}",text:"project done",tone:"ok"}:{role:"planner",label:"Planner",glyph:"\u{1F4CB}",text:`queued ${Ke(e,"queued")||Ke(e,"n")||"next"} task(s)`,tone:"accent"};if(t==="life.planner.task_added")return{role:"planner",label:"Planner",glyph:"\uFF0B",text:`added ${ur(Ke(e,"title")||Ke(e,"objective"),160)}`,tone:"accent"};if(t==="life.planner.task_skipped")return{role:"planner",label:"Planner",glyph:"\u23ED",text:`skipped duplicate ${ur(Ke(e,"title"),140)}`,tone:"dim"};if(t==="life.planner.error")return{role:"planner",label:"Planner",glyph:"\u26A0",text:`planner error ${ur(Ke(e,"error")||Ke(e,"text"),160)}`,tone:"err"};if(t==="life.mission.started"||t==="mission.started")return{role:"engineer",label:"Engineer",glyph:"\u{1F680}",text:ur(Ke(e,"title")||Ke(e,"objective")||Ke(e,"text")||"mission started",180),tone:"info",rule:!0};if(t==="round.started"||t==="round.start")return{role:"engineer",label:"Engineer",glyph:"\u2500\u2500",text:`round ${lI(e)}`,tone:"dim",rule:!0};if(t==="life.phase.started"){let r=Ke(e,"label")||Ke(e,"phase");if(!r)return null;let i=Ke(e,"agent_layer")||"engineer";return{role:i,label:aI[i]||i,glyph:"\u{1F504}",text:`\u8FDB\u5165 ${r}`,tone:"info"}}if(t==="round.review.started")return{role:"reviewer",label:"Reviewer",glyph:"\u{1F504}",text:`review round ${lI(e)}`,tone:"info"};if(t==="round.review.deferred")return{role:"engineer",label:"Engineer",glyph:"\u21AA",text:`continues before review \xB7 ${ur(Ke(e,"next_step"),180)}`,tone:"info"};if(t==="round.main.completed")return{role:"engineer",label:"Engineer",glyph:"\u2705",text:`round ${lI(e)} completed`,tone:"info"};if(t==="round.review.completed"){let r=Ke(e,"status"),i=r==="done"?"ok":r==="blocked"||r==="no_progress"?"err":"warn";return{role:"reviewer",label:"Reviewer",glyph:r==="done"?"\u2705":r==="blocked"||r==="no_progress"?"\u26D4":"\u21BB",text:`${r||"?"} \xB7 ${ur(Ke(e,"reason"),200)}`,tone:i}}if(t==="life.iteration.critic")return{role:"critic",label:"Critic",glyph:"\u{1F454}",text:`${Ke(e,"decision")||""} ${ur(Ke(e,"reason"),160)}`,tone:"info"};if(t==="life.iteration.continued")return{role:"critic",label:"Critic",glyph:"\u{1F501}",text:"queued next iteration",tone:"dim"};if(t==="life.mission.completed"||t==="mission.completed"||t==="loop.completed"){let r=vf(e),i=ur(Ke(e,"summary"),240);return{role:"engineer",label:"Engineer",glyph:r.glyph,text:i?`${r.label} \xB7 ${i}`:r.label,tone:r.tone,rule:!0}}if(t==="life.mission.failed"||t==="mission.error")return{role:"engineer",label:"Engineer",glyph:"\u274C",text:`mission failed ${ur(Ke(e,"reason")||Ke(e,"error"),160)}`,tone:"err",rule:!0};if(t==="loop.start")return{role:"engineer",label:"Engineer",glyph:"\u25B6",text:ur(Ke(e,"text")||Ke(e,"objective"),16e3),tone:"info",expand:!0};if(t==="loop.done")return{role:"engineer",label:"Engineer",glyph:"\u{1F3C1}",text:`loop done ${ur(Ke(e,"text"),140)}`,tone:"dim"};if(t==="life.inbox.queued")return{role:"system",label:"You",glyph:"\u{1F4E5}",text:`nudge \xB7 ${ur(Ke(e,"text"),180)}`,tone:"accent"};if(t==="final.report.ready"||t==="pptx.report.ready")return{role:"system",label:"Argus",glyph:"\u{1F4C4}",text:"report ready",tone:"accent"};if(t==="plan.completed")return{role:"planner",label:"Planner",glyph:"\u{1F4CB}",text:"plan completed",tone:"accent"};if(t==="daemon.stopping")return{role:"system",label:"Daemon",glyph:"\u{1F6D1}",text:"stopping",tone:"err"};if(t==="daemon.parked")return{role:"system",label:"Argus",glyph:"\u2161",text:`session parked \xB7 state saved${Ke(e,"replaced_by")?` \xB7 replaced by ${Ke(e,"replaced_by")}`:""}`,tone:"warn",rule:!0};if(t==="provider.request.denied")return{role:"system",label:"Quota",glyph:"\u23F8",text:`${Ke(e,"provider")||"provider"} request blocked \xB7 ${ur(Ke(e,"reason"),160)}`,tone:"warn",rule:!0};if(t==="round.reviewer_backend_failure")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:`reviewer backend down \u2014 holding, won't continue blind \xB7 ${ur(Ke(e,"text"),150)}`,tone:"err",rule:!0};if(t==="round.stall")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:ur(Ke(e,"text")||"no forward progress \u2014 watching closely",170),tone:"warn"};if(t==="round.escalated")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:ur(Ke(e,"text")||"soft round limit \u2014 escalating external blockers",170),tone:"warn"};if(t==="life.planner.stall_escalation")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:`planner stalled \u2014 ${ur(Ke(e,"reason")||Ke(e,"text"),150)}`,tone:"warn"};if(t==="life.budget.pause")return{role:"system",label:"Watch",glyph:"\u23F8",text:`budget cap reached \u2014 paused \xB7 ${ur(Ke(e,"text")||Ke(e,"reason"),140)}`,tone:"warn"};if(t==="budget.reservation.denied")return{role:"system",label:"Budget",glyph:"$",text:`budget denied \u2014 ${ur(Ke(e,"reason")||Ke(e,"text"),160)}`,tone:"err",rule:!0};if(t==="budget.unpriced.blocked")return{role:"system",label:"Budget",glyph:"$",text:`budget blocked by unresolved cost \u2014 ${ur(Ke(e,"reason")||Ke(e,"text"),160)}`,tone:"err",rule:!0};if(t==="life.lifecycle.block")return{role:"system",label:"Watch",glyph:"\u26D4",text:`blocked \u2014 needs you \xB7 ${ur(Ke(e,"text")||Ke(e,"reason"),150)}`,tone:"err",rule:!0};if(t==="life.daemon.idle_timeout")return{role:"system",label:"Watch",glyph:"\u{1F7E6}",text:ur(Ke(e,"text")||"idle timeout \u2014 standing by",150),tone:"dim"};if(t==="round.watchdog.restart_requested")return{role:"system",label:"Watch",glyph:"\u{1F504}",text:`stall caught \u2014 restarting the round \xB7 ${ur(Ke(e,"reason"),170)}`,tone:"warn"};if(t==="engineer.failure_nudge")return{role:"engineer",label:"Engineer",glyph:"\u26A0",text:`repeated tool failure \u2014 ${ur(Ke(e,"text")||Ke(e,"reason"),170)}`,tone:"warn"};if(t==="mission.idle")return{role:"system",label:"Argus",glyph:"\u{1F7E6}",text:ur(Ke(e,"text")||"idle \u2014 awaiting the next mission",160),tone:"dim"};if(e.operator_alert===!0){let r=ur(Ke(e,"text")||Ke(e,"reason")||t,170);if(r)return{role:"system",label:"Watch",glyph:"\u{1F441}",text:r,tone:"err",rule:!0}}if(t==="ui.operator")return{role:"system",label:"You",glyph:"\u203A",text:Ke(e,"text"),tone:"accent",rule:!0};if(t==="ui.argus"){let r=Ke(e,"text");return r?{role:"manager",label:"Argus",glyph:"\u258C",text:r,tone:"bright"}:null}if(t==="ui.activity"){let r=Ke(e,"text");return r?{role:"manager",label:"Steps",glyph:"\u22EE",text:r,tone:"dim"}:null}return null}function uI(e){let t=e,r=String(t.kind??"");return String(t.type)==="engineer.progress"&&["assistant_message","agent_message","message","reasoning"].includes(r)||String(t.type)==="ui.argus"?String(t.message_id??""):""}var Py=["turning it over","consulting a hundred eyes","reading the room","weighing it","thinking it through","cross-checking the evidence","running the numbers","sizing up the angles","following the thread","letting it settle"],cI=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Uy(e,t,r=20){return e.length===0?"":e[Math.floor(t/r)%e.length]}function fI(e){return cI[e%cI.length]}function Gy(e,t,r=!1,i=0){let s=`${Uy(Py,t)}\u2026`;if(r){let u=Math.max(0,Math.floor(Number.isFinite(i)?i:0));return`${s} \xB7 Manager alive \xB7 ${u}s quiet`}let a=e||s;return a.includes("[SESSION HANDOFF")?"Manager context refreshed \xB7 working on your message\u2026":a.replace(/^Manager\s*·\s*/i,"").slice(0,100)}var Hy="a hundred eyes on your research \u2014 some never close";var Wy=["All quiet. Argus keeps watch.","Nothing stirring \u2014 some eyes stay open.","Standing watch. Say the word.","Resting, not sleeping.","Quiet stretch. The watch continues.","No signal yet \u2014 Argus doesn't blink first.","The feed is calm. So is Argus.","Waiting, unhurried."];function Ky(e,t=3800){return e.length===0?"":e[Math.floor(Date.now()/t)%e.length]}function rp(e){let t=[],r=new Map,i=new Set(e.map(s=>String(s.recovered_from_message_id??"")).filter(Boolean));return e.forEach(s=>{if(i.has(uI(s))&&s.final_delivery!==!0)return;let a=My(s);if(!a)return;let u=uI(s);if(u&&r.has(u)){let I=r.get(u),C={...t[I],ev:{...t[I].ev,...s},r:{...t[I].r,...a,text:Xm(t[I].r.text,a.text,Df(s))}};if(I===t.length-1){t[I]=C;return}t.splice(I,1);for(let[y,D]of r)D>I&&r.set(y,D-1);t.push(C),r.set(u,t.length-1);return}let E=u||XA(s);u&&r.set(u,t.length),t.push({ev:s,r:a,key:E,mid:u})}),t}function Jy(e,t=""){let r=e.at(-1),i=t?e.findIndex(E=>E.mid===t):-1,s=!!(r?.mid&&r.ev.type==="engineer.progress"&&r.ev.replace===!0),a=i>=0?i:s?e.length-1:-1,u=a>=0?e[a]:null;return{committed:u?e.filter((E,I)=>I!==a):e,live:u}}var Oo=Me(Pt(),1);function jy({r:e,compact:t,width:r}){let i=t?`${e.label.slice(0,1)} `:e.label.padEnd(9),s=Math.max(12,r-(t?8:15));return(0,Oo.jsxs)(Qe,{flexDirection:"column",children:[e.rule&&(0,Oo.jsx)(k,{dimColor:!0,children:" \u2500\u2500"}),(0,Oo.jsxs)(Qe,{children:[(0,Oo.jsx)(k,{children:" "}),(0,Oo.jsx)(k,{color:tp(e.role),bold:!0,children:i}),(0,Oo.jsx)(Qe,{width:s,children:(0,Oo.jsxs)(k,{color:e.reasoning?void 0:ep(e.tone),dimColor:e.reasoning,italic:e.reasoning,wrap:e.expand||e.tone==="bright"?"wrap":"truncate-end",children:[e.glyph," ",e.text]})})]})]})}function Yy({events:e,width:t,mode:r="all",liveMessageId:i="",collapsed:s=!1,showIdle:a=!0,showReasoning:u=!1}){let E=(0,$a.useMemo)(()=>{let J=rp(e),X=u?J:J.filter(Z=>!Z.r.reasoning);return r==="conversation"?X.filter(Z=>["ui.operator","ui.argus","ui.activity"].includes(String(Z.ev.type??""))||Z.r.reasoning):X},[e,r,u]),{committed:I,live:C}=Jy(E,i),y=C&&Df(C.ev)==="append"?C:null,D=C&&!y&&C.ev.type!=="ui.argus"?C:null,{write:R}=AA(),O=(0,$a.useRef)(new Set),G=(0,$a.useRef)(null),ne=t<80,oe=!a&&E.length===0,$=I.filter(J=>!O.current.has(J.key)||Df(J.ev)!=="append");return(0,$a.useEffect)(()=>{if(!y){G.current&&(R(` -`),G.current=null);return}let J=G.current,X="";!J||J.key!==y.key?(J&&R(` -`),X=` ${ne?`${y.r.label.slice(0,1)} `:y.r.label.padEnd(9)}${y.r.glyph} ${y.r.text}`):y.r.text.startsWith(J.text)?X=y.r.text.slice(J.text.length):y.r.text!==J.text&&(X=` - ${ne?`${y.r.label.slice(0,1)} `:y.r.label.padEnd(9)}${y.r.glyph} ${y.r.text}`),O.current.add(y.key),G.current={key:y.key,text:y.r.text},X&&R(X)},[ne,C?.key,y?.key,y?.r.glyph,y?.r.label,y?.r.text,R]),(0,Oo.jsxs)(Qe,{flexDirection:"column",marginTop:s||oe?0:1,children:[(0,Oo.jsx)(Cf,{items:$,children:J=>(0,Oo.jsx)(jy,{r:J.r,compact:ne,width:t},J.key)}),!s&&D?(0,Oo.jsx)(jy,{r:D.r,compact:ne,width:t}):null,!s&&a&&E.length===0?(0,Oo.jsx)(k,{dimColor:!0,children:` ${Ky(Wy)}`}):null]})}var ku=Me(jt(),1);var Xy=Me(Pt(),1),qF={enabled:!1,activate:()=>()=>{}},Vy=(0,ku.createContext)(qF);function qy({controller:e,children:t}){return(0,Xy.jsx)(Vy.Provider,{value:e,children:t})}function zy(e){let t=(0,ku.useContext)(Vy);return(0,ku.useEffect)(()=>t.activate(e),[t,e.column,e.rowsAboveFrameBottom]),t.enabled}var gI=class{constructor(t,r){this.target=t;this.enabled=r??!!(t.isTTY&&process.env.TERM!=="dumb"),this.rawWrite=t.write.bind(t),this.stdout=this.enabled?new Proxy(t,{get:(i,s)=>{if(s==="write")return this.write;let a=Reflect.get(i,s,i);return typeof a=="function"?a.bind(i):a}}):t}target;enabled;stdout;active=null;anchoredRows=0;anchored=!1;baseAfterNewline=!0;pending=null;disposed=!1;rawWrite;activate(t){if(!this.enabled||this.disposed)return()=>{};let r=Symbol("ime-cursor-target");return this.active={token:r,target:{rowsAboveFrameBottom:Math.max(0,Math.floor(t.rowsAboveFrameBottom)),column:Math.max(0,Math.floor(t.column))}},this.scheduleAnchor(),()=>{this.active?.token===r&&(this.active=null,this.cancelAnchor(),this.restoreFrameCursor())}}dispose(){this.disposed||(this.disposed=!0,this.active=null,this.cancelAnchor(),this.restoreFrameCursor(),this.rawWrite(ko.cursorShow))}write=(...t)=>{this.cancelAnchor(),this.restoreFrameCursor();let r=t[0],i=Buffer.isBuffer(r)?r.toString():String(r??""),s=this.rawWrite(...t);return this.observeFrameEnd(i),this.scheduleAnchor(),s};observeFrameEnd(t){(t.includes(` +`)[0].slice(0,240))),i?(e.mission.id=i.id,e.mission.status="working",e.mission.started_at=e.mission.started_at??i.started_ts??null):a?a.status==="pending"&&(e.mission.status="queued"):t.continuous?.done_reason||t.continuous?.done_at?e.mission.status="complete":s||t.continuous?.enabled?e.mission.status="queued":t.daemon.alive&&(e.mission.status="idle"),t.roles.forEach(D=>{D.active?pn(e,D.role,"active",D.label||D.status||"Working",Date.now()/1e3-(D.age_s??0)):E||pn(e,D.role,"waiting","Waiting",Date.now()/1e3);let R=e.roles.find(O=>O.role===D.role);R&&Object.assign(R,{backend:D.backend,model:D.model,effort:D.effort})});let h=t.roles.filter(D=>D.active);h.length?e.active_role=h[h.length-1].role:E||(e.active_role=""),t.backlog.forEach(D=>{let R={id:D.id,title:D.title,objective:D.objective,status:D.status,deps:D.deps??[],branch_id:D.id,parent_branch_id:D.deps?.[0]??null,acceptance_check:D.acceptance_check??"",plan_hypothesis:D.plan_hypothesis??"",goal_contribution:D.goal_contribution??"",expected_regressions:D.expected_regressions??"",decision_rule:D.decision_rule??"",non_goals:D.non_goals??[]};gA(e.dag,"id",R.id,R)});let y=u?.outcome?.execution_status?u.outcome:e.mission.id?void 0:[...t.backlog].filter(D=>D.outcome?.execution_status).sort((D,R)=>Number(D.finished_ts??0)-Number(R.finished_ts??0)).at(-1)?.outcome;return!i&&y&&(e.outcome=aI({outcome:y,status:"done",success:!0})),r.forEach(D=>{gA(e.artifacts,"path",D.path,{id:D.path,path:D.path,title:D.name,kind:D.kind,why:D.why,exists:D.exists,source:D.source})}),E}function Xb(e,t,r,i){i||(t.roles.forEach(u=>{u.active||pn(e,u.role,"waiting","Waiting",Date.now()/1e3)}),e.active_role="");let s=Date.now()/1e3,a=e.mission.campaign_started_at??t.session.created??e.mission.started_at;a&&(e.mission.campaign_started_at=a,e.mission.campaign_elapsed_seconds=Math.max(0,s-a)),e.mission.started_at&&e.mission.status==="working"?e.mission.elapsed_seconds=Math.max(0,s-e.mission.started_at):e.mission.started_at&&e.mission.completed_at&&(e.mission.elapsed_seconds=Math.max(0,e.mission.completed_at-e.mission.started_at)),e.achievement?.reviewer_certified&&(e.achievement.elapsed_seconds=e.mission.elapsed_seconds,e.achievement.rejected_attempts=e.review.rejected_attempts,e.achievement.skills_learned=e.learned_skills.filter(u=>u.status==="active").length,e.achievement.artifacts=r.filter(u=>u.exists).length)}function Uy(e,t=[],r=[]){let i=e.mission_view?Yb(e.mission_view):Py();i.storage??=Py().storage,i.storage.skill_history_compressed??=0,i.storage.wiki_retired_compressed??=0,i.storage.skill_history_bytes_saved??=0,i.storage.wiki_retired_bytes_saved??=0,i.learned_wiki_pages??=[],i.role_work??=[],i.outcome??={};let s=i.last_event_ts,a=$b(i,e,r);return t.filter(u=>u.ts==null||Number(u.ts)>s).sort((u,E)=>Number(u.ts??0)-Number(E.ts??0)).forEach(u=>zb(i,u)),Xb(i,e,r,a),i}function Gy(e){return String(e||"").replace(/\\([*_`~])/g,"$1").replace(/\\\\(?=[A-Za-z])/g,"\\")}function lI(e){let t=Math.max(0,Math.floor(e)),r=Math.floor(t/3600),i=Math.floor(t%3600/60);return r?`${r}h ${i}m`:i?`${i}m`:`${t}s`}var uI={manager:"Manager",planner:"Planner",engineer:"Engineer",reviewer:"Reviewer",critic:"Critic",system:"Argus"};function rp(e){switch(e){case"bright":return"white";case"dim":return"gray";case"accent":return Ie.accent;case"ok":return Ie.success;case"warn":return Ie.warning;case"err":return Ie.error;case"info":return Ie.info}}function np(e){return Ie.role[e]??"gray"}function ur(e,t){let r=(e||"").replace(/```[a-z]*\n?/gi,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"[$1]").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"\u2026"}var We=(e,t)=>String(e[t]??""),cI=e=>{let t=e,r=t.round_index??t.round;return typeof r=="string"||typeof r=="number"?r:"?"};function Hy(e){let t=We(e,"type");if(t==="engineer.progress"){let r=We(e,"kind"),i=We(e,"agent_layer")||"engineer",s=uI[i]||"Engineer";if(r==="reasoning"){let a=ur(We(e,"text"),280);return a?{role:i,label:s,glyph:"\u2234",text:a,tone:"dim",reasoning:!0}:null}if(r==="assistant_message"||r==="agent_message"||r==="message"){if(Vd(e))return null;let a=wy(We(e,"text"));return a?{role:i,label:s,glyph:"\u258C",text:a,tone:"bright",expand:!0}:null}if(r==="command_execution"){let a=We(e,"text")||We(e,"command")||We(e,"action_summary");return a?{role:i,label:s,glyph:"\u25B8 $",text:a,tone:We(e,"status")==="failed"?"err":"dim",expand:!0}:null}if(r==="tool_use"||r==="file_change"){let a=We(e,"text")||We(e,"action_summary");return a?{role:i,label:s,glyph:r==="file_change"?"\u270E":"\u2699",text:a,tone:We(e,"status")==="failed"?"err":"dim",expand:!0}:null}return null}if(t==="role.activity"){let r=We(e,"status");if(r==="running")return null;let i=We(e,"role")||"engineer",s=e.milestone===!0;return r!=="error"&&!s?null:{role:i,label:uI[i]||i,glyph:r==="error"?"\u2715":"\u2713",text:ur(We(e,"label")||"activity completed",180),tone:r==="error"?"err":"ok"}}if(t==="life.manager.intent.started")return{role:"manager",label:"Manager",glyph:"\u{1F9ED}",text:"\u5224\u65AD\u4EFB\u52A1\u5F52\u5C5E\u2026",tone:"info"};if(t==="life.manager.intent.completed")return{role:"manager",label:"Manager",glyph:"\u{1F9ED}",text:`\u2192 ${tp({route:We(e,"route")||"team",vertical:We(e,"vertical"),workflow_mode:We(e,"workflow_mode"),lifetime:We(e,"lifetime"),continuous:e.continuous===!0,open_ended:e.open_ended===!0})||We(e,"kind")||"resolved"}`,tone:"info"};if(t==="life.manager.intent.failed")return{role:"manager",label:"Manager",glyph:"\u26A0",text:`\u5206\u6D41\u5931\u8D25 ${ur(We(e,"error"),160)}`,tone:"err"};if(t==="life.manager.stage_decision"){let r=We(e,"target_stage")||We(e,"stage")||We(e,"current_stage");return{role:"manager",label:"Manager",glyph:"\u{1F9ED}",text:`${We(e,"action")}${r?` \u2192 ${r}`:""} ${ur(We(e,"reason"),140)}`,tone:"info"}}if(t==="life.planner.start")return{role:"planner",label:"Planner",glyph:"\u{1F4CB}",text:`planning ${ur(We(e,"objective"),160)}`,tone:"accent"};if(t==="life.planner.verdict")return We(e,"status")==="done"||e.project_done===!0?{role:"planner",label:"Planner",glyph:"\u{1F3C1}",text:"project done",tone:"ok"}:{role:"planner",label:"Planner",glyph:"\u{1F4CB}",text:`queued ${We(e,"queued")||We(e,"n")||"next"} task(s)`,tone:"accent"};if(t==="life.planner.task_added")return{role:"planner",label:"Planner",glyph:"\uFF0B",text:`added ${ur(We(e,"title")||We(e,"objective"),160)}`,tone:"accent"};if(t==="life.planner.task_skipped")return{role:"planner",label:"Planner",glyph:"\u23ED",text:`skipped duplicate ${ur(We(e,"title"),140)}`,tone:"dim"};if(t==="life.planner.error")return{role:"planner",label:"Planner",glyph:"\u26A0",text:`planner error ${ur(We(e,"error")||We(e,"text"),160)}`,tone:"err"};if(t==="life.mission.started"||t==="mission.started")return{role:"engineer",label:"Engineer",glyph:"\u{1F680}",text:ur(We(e,"title")||We(e,"objective")||We(e,"text")||"mission started",180),tone:"info",rule:!0};if(t==="round.started"||t==="round.start")return{role:"engineer",label:"Engineer",glyph:"\u2500\u2500",text:`round ${cI(e)}`,tone:"dim",rule:!0};if(t==="life.phase.started"){let r=We(e,"label")||We(e,"phase");if(!r)return null;let i=We(e,"agent_layer")||"engineer";return{role:i,label:uI[i]||i,glyph:"\u{1F504}",text:`\u8FDB\u5165 ${r}`,tone:"info"}}if(t==="round.review.started")return{role:"reviewer",label:"Reviewer",glyph:"\u{1F504}",text:`review round ${cI(e)}`,tone:"info"};if(t==="round.review.deferred")return{role:"engineer",label:"Engineer",glyph:"\u21AA",text:`continues before review \xB7 ${ur(We(e,"next_step"),180)}`,tone:"info"};if(t==="round.main.completed")return{role:"engineer",label:"Engineer",glyph:"\u2705",text:`round ${cI(e)} completed`,tone:"info"};if(t==="round.review.completed"){let r=We(e,"status"),i=r==="done"?"ok":r==="blocked"||r==="no_progress"?"err":"warn";return{role:"reviewer",label:"Reviewer",glyph:r==="done"?"\u2705":r==="blocked"||r==="no_progress"?"\u26D4":"\u21BB",text:`${r||"?"} \xB7 ${ur(We(e,"reason"),200)}`,tone:i}}if(t==="life.iteration.critic")return{role:"critic",label:"Critic",glyph:"\u{1F454}",text:`${We(e,"decision")||""} ${ur(We(e,"reason"),160)}`,tone:"info"};if(t==="life.iteration.continued")return{role:"critic",label:"Critic",glyph:"\u{1F501}",text:"queued next iteration",tone:"dim"};if(t==="life.mission.completed"||t==="mission.completed"||t==="loop.completed"){let r=vf(e),i=ur(We(e,"summary"),240);return{role:"engineer",label:"Engineer",glyph:r.glyph,text:i?`${r.label} \xB7 ${i}`:r.label,tone:r.tone,rule:!0}}if(t==="life.mission.failed"||t==="mission.error")return{role:"engineer",label:"Engineer",glyph:"\u274C",text:`mission failed ${ur(We(e,"reason")||We(e,"error"),160)}`,tone:"err",rule:!0};if(t==="loop.start")return{role:"engineer",label:"Engineer",glyph:"\u25B6",text:ur(We(e,"text")||We(e,"objective"),16e3),tone:"info",expand:!0};if(t==="loop.done")return{role:"engineer",label:"Engineer",glyph:"\u{1F3C1}",text:`loop done ${ur(We(e,"text"),140)}`,tone:"dim"};if(t==="life.inbox.queued")return{role:"system",label:"You",glyph:"\u{1F4E5}",text:`nudge \xB7 ${ur(We(e,"text"),180)}`,tone:"accent"};if(t==="final.report.ready"||t==="pptx.report.ready")return{role:"system",label:"Argus",glyph:"\u{1F4C4}",text:"report ready",tone:"accent"};if(t==="plan.completed")return{role:"planner",label:"Planner",glyph:"\u{1F4CB}",text:"plan completed",tone:"accent"};if(t==="daemon.stopping")return{role:"system",label:"Daemon",glyph:"\u{1F6D1}",text:"stopping",tone:"err"};if(t==="daemon.parked")return{role:"system",label:"Argus",glyph:"\u2161",text:`session parked \xB7 state saved${We(e,"replaced_by")?` \xB7 replaced by ${We(e,"replaced_by")}`:""}`,tone:"warn",rule:!0};if(t==="provider.request.denied")return{role:"system",label:"Quota",glyph:"\u23F8",text:`${We(e,"provider")||"provider"} request blocked \xB7 ${ur(We(e,"reason"),160)}`,tone:"warn",rule:!0};if(t==="round.reviewer_backend_failure")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:`reviewer backend down \u2014 holding, won't continue blind \xB7 ${ur(We(e,"text"),150)}`,tone:"err",rule:!0};if(t==="round.stall")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:ur(We(e,"text")||"no forward progress \u2014 watching closely",170),tone:"warn"};if(t==="round.escalated")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:ur(We(e,"text")||"soft round limit \u2014 escalating external blockers",170),tone:"warn"};if(t==="life.planner.stall_escalation")return{role:"system",label:"Watch",glyph:"\u{1F441}",text:`planner stalled \u2014 ${ur(We(e,"reason")||We(e,"text"),150)}`,tone:"warn"};if(t==="life.budget.pause")return{role:"system",label:"Watch",glyph:"\u23F8",text:`budget cap reached \u2014 paused \xB7 ${ur(We(e,"text")||We(e,"reason"),140)}`,tone:"warn"};if(t==="budget.reservation.denied")return{role:"system",label:"Budget",glyph:"$",text:`budget denied \u2014 ${ur(We(e,"reason")||We(e,"text"),160)}`,tone:"err",rule:!0};if(t==="budget.unpriced.blocked")return{role:"system",label:"Budget",glyph:"$",text:`budget blocked by unresolved cost \u2014 ${ur(We(e,"reason")||We(e,"text"),160)}`,tone:"err",rule:!0};if(t==="life.lifecycle.block")return{role:"system",label:"Watch",glyph:"\u26D4",text:`blocked \u2014 needs you \xB7 ${ur(We(e,"text")||We(e,"reason"),150)}`,tone:"err",rule:!0};if(t==="life.daemon.idle_timeout")return{role:"system",label:"Watch",glyph:"\u{1F7E6}",text:ur(We(e,"text")||"idle timeout \u2014 standing by",150),tone:"dim"};if(t==="round.watchdog.restart_requested")return{role:"system",label:"Watch",glyph:"\u{1F504}",text:`stall caught \u2014 restarting the round \xB7 ${ur(We(e,"reason"),170)}`,tone:"warn"};if(t==="engineer.failure_nudge")return{role:"engineer",label:"Engineer",glyph:"\u26A0",text:`repeated tool failure \u2014 ${ur(We(e,"text")||We(e,"reason"),170)}`,tone:"warn"};if(t==="mission.idle")return{role:"system",label:"Argus",glyph:"\u{1F7E6}",text:ur(We(e,"text")||"idle \u2014 awaiting the next mission",160),tone:"dim"};if(e.operator_alert===!0){let r=ur(We(e,"text")||We(e,"reason")||t,170);if(r)return{role:"system",label:"Watch",glyph:"\u{1F441}",text:r,tone:"err",rule:!0}}if(t==="ui.operator")return{role:"system",label:"You",glyph:"\u203A",text:We(e,"text"),tone:"accent",rule:!0};if(t==="ui.argus"){let r=We(e,"text");return r?{role:"manager",label:"Argus",glyph:"\u258C",text:r,tone:"bright"}:null}if(t==="ui.activity"){let r=We(e,"text");return r?{role:"manager",label:"Steps",glyph:"\u22EE",text:r,tone:"dim"}:null}return null}function fI(e){let t=e,r=String(t.kind??"");return String(t.type)==="engineer.progress"&&["assistant_message","agent_message","message","reasoning"].includes(r)||String(t.type)==="ui.argus"?String(t.message_id??""):""}var Wy=["turning it over","consulting a hundred eyes","reading the room","weighing it","thinking it through","cross-checking the evidence","running the numbers","sizing up the angles","following the thread","letting it settle"],gI=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Ky(e,t,r=20){return e.length===0?"":e[Math.floor(t/r)%e.length]}function dI(e){return gI[e%gI.length]}function Jy(e,t,r=!1,i=0){let s=`${Ky(Wy,t)}\u2026`;if(r){let u=Math.max(0,Math.floor(Number.isFinite(i)?i:0));return`${s} \xB7 Manager alive \xB7 ${u}s quiet`}let a=e||s;return a.includes("[SESSION HANDOFF")?"Manager context refreshed \xB7 working on your message\u2026":a.replace(/^Manager\s*·\s*/i,"").slice(0,100)}var jy="a hundred eyes on your research \u2014 some never close";var Yy=["All quiet. Argus keeps watch.","Nothing stirring \u2014 some eyes stay open.","Standing watch. Say the word.","Resting, not sleeping.","Quiet stretch. The watch continues.","No signal yet \u2014 Argus doesn't blink first.","The feed is calm. So is Argus.","Waiting, unhurried."];function Vy(e,t=3800){return e.length===0?"":e[Math.floor(Date.now()/t)%e.length]}function op(e){let t=[],r=new Map,i=new Set(e.map(s=>String(s.recovered_from_message_id??"")).filter(Boolean));return e.forEach(s=>{if(i.has(fI(s))&&s.final_delivery!==!0)return;let a=Hy(s);if(!a)return;let u=fI(s);if(u&&r.has(u)){let I=r.get(u),h={...t[I],ev:{...t[I].ev,...s},r:{...t[I].r,...a,text:eI(t[I].r.text,a.text,yf(s))}};if(I===t.length-1){t[I]=h;return}t.splice(I,1);for(let[y,D]of r)D>I&&r.set(y,D-1);t.push(h),r.set(u,t.length-1);return}let E=u||XA(s);u&&r.set(u,t.length),t.push({ev:s,r:a,key:E,mid:u})}),t}function qy(e,t=""){let r=e.at(-1),i=t?e.findIndex(E=>E.mid===t):-1,s=!!(r?.mid&&r.ev.type==="engineer.progress"&&r.ev.replace===!0),a=i>=0?i:s?e.length-1:-1,u=a>=0?e[a]:null;return{committed:u?e.filter((E,I)=>I!==a):e,live:u}}var Oo=Le(Pt(),1);function zy({r:e,compact:t,width:r}){let i=t?`${e.label.slice(0,1)} `:e.label.padEnd(9),s=Math.max(12,r-(t?8:15));return(0,Oo.jsxs)(ye,{flexDirection:"column",children:[e.rule&&(0,Oo.jsx)(N,{dimColor:!0,children:" \u2500\u2500"}),(0,Oo.jsxs)(ye,{children:[(0,Oo.jsx)(N,{children:" "}),(0,Oo.jsx)(N,{color:np(e.role),bold:!0,children:i}),(0,Oo.jsx)(ye,{width:s,children:(0,Oo.jsxs)(N,{color:e.reasoning?void 0:rp(e.tone),dimColor:e.reasoning,italic:e.reasoning,wrap:e.expand||e.tone==="bright"?"wrap":"truncate-end",children:[e.glyph," ",e.text]})})]})]})}function $y({events:e,width:t,mode:r="all",liveMessageId:i="",collapsed:s=!1,showIdle:a=!0,showReasoning:u=!1}){let E=(0,Xa.useMemo)(()=>{let Z=op(e),q=u?Z:Z.filter(X=>!X.r.reasoning);return r==="conversation"?q.filter(X=>["ui.operator","ui.argus","ui.activity"].includes(String(X.ev.type??""))||X.r.reasoning):q},[e,r,u]),{committed:I,live:h}=qy(E,i),y=h&&yf(h.ev)==="append"?h:null,D=h&&!y&&h.ev.type!=="ui.argus"?h:null,{write:R}=AA(),O=(0,Xa.useRef)(new Set),G=(0,Xa.useRef)(null),ne=t<80,oe=!a&&E.length===0,$=I.filter(Z=>!O.current.has(Z.key)||yf(Z.ev)!=="append");return(0,Xa.useEffect)(()=>{if(!y){G.current&&(R(` +`),G.current=null);return}let Z=G.current,q="";!Z||Z.key!==y.key?(Z&&R(` +`),q=` ${ne?`${y.r.label.slice(0,1)} `:y.r.label.padEnd(9)}${y.r.glyph} ${y.r.text}`):y.r.text.startsWith(Z.text)?q=y.r.text.slice(Z.text.length):y.r.text!==Z.text&&(q=` + ${ne?`${y.r.label.slice(0,1)} `:y.r.label.padEnd(9)}${y.r.glyph} ${y.r.text}`),O.current.add(y.key),G.current={key:y.key,text:y.r.text},q&&R(q)},[ne,h?.key,y?.key,y?.r.glyph,y?.r.label,y?.r.text,R]),(0,Oo.jsxs)(ye,{flexDirection:"column",marginTop:s||oe?0:1,children:[(0,Oo.jsx)(Bf,{items:$,children:Z=>(0,Oo.jsx)(zy,{r:Z.r,compact:ne,width:t},Z.key)}),!s&&D?(0,Oo.jsx)(zy,{r:D.r,compact:ne,width:t}):null,!s&&a&&E.length===0?(0,Oo.jsx)(N,{dimColor:!0,children:` ${Vy(Yy)}`}):null]})}var Nu=Le(jt(),1);var rQ=Le(Pt(),1),Zb={enabled:!1,activate:()=>()=>{}},Xy=(0,Nu.createContext)(Zb);function Zy({controller:e,children:t}){return(0,rQ.jsx)(Xy.Provider,{value:e,children:t})}function eQ(e){let t=(0,Nu.useContext)(Xy);return(0,Nu.useEffect)(()=>t.activate(e),[t,e.column,e.rowsAboveFrameBottom]),t.enabled}var pI=class{constructor(t,r){this.target=t;this.enabled=r??!!(t.isTTY&&process.env.TERM!=="dumb"),this.rawWrite=t.write.bind(t),this.stdout=this.enabled?new Proxy(t,{get:(i,s)=>{if(s==="write")return this.write;let a=Reflect.get(i,s,i);return typeof a=="function"?a.bind(i):a}}):t}target;enabled;stdout;active=null;anchoredRows=0;anchored=!1;baseAfterNewline=!0;pending=null;disposed=!1;rawWrite;activate(t){if(!this.enabled||this.disposed)return()=>{};let r=Symbol("ime-cursor-target");return this.active={token:r,target:{rowsAboveFrameBottom:Math.max(0,Math.floor(t.rowsAboveFrameBottom)),column:Math.max(0,Math.floor(t.column))}},this.scheduleAnchor(),()=>{this.active?.token===r&&(this.active=null,this.cancelAnchor(),this.restoreFrameCursor())}}dispose(){this.disposed||(this.disposed=!0,this.active=null,this.cancelAnchor(),this.restoreFrameCursor(),this.rawWrite(ko.cursorShow))}write=(...t)=>{this.cancelAnchor(),this.restoreFrameCursor();let r=t[0],i=Buffer.isBuffer(r)?r.toString():String(r??""),s=this.rawWrite(...t);return this.observeFrameEnd(i),this.scheduleAnchor(),s};observeFrameEnd(t){(t.includes(` `)||t.includes("\x1B[2J"))&&(this.baseAfterNewline=t.endsWith(` -`))}scheduleAnchor(){!this.enabled||this.disposed||!this.active||(this.cancelAnchor(),this.pending=setImmediate(()=>{this.pending=null,this.anchorAtInput()}))}cancelAnchor(){this.pending&&(clearImmediate(this.pending),this.pending=null)}anchorAtInput(){if(this.anchored||!this.active||this.disposed)return;let{target:t}=this.active,r=t.rowsAboveFrameBottom+(this.baseAfterNewline?1:0);this.rawWrite("\r"+(r>0?ko.cursorUp(r):"")+(t.column>0?ko.cursorForward(t.column):"")+ko.cursorShow),this.anchoredRows=r,this.anchored=!0}restoreFrameCursor(){this.anchored&&(this.rawWrite(ko.cursorHide+"\r"+(this.anchoredRows>0?ko.cursorDown(this.anchoredRows):"")+"\r"),this.anchoredRows=0,this.anchored=!1)}};function $y(e,t={}){let r=new gI(e,t.force);return{stdout:r.stdout,controller:r,dispose:()=>r.dispose()}}var si=Me(Pt(),1),Zy=4,zF="talk to Argus \u203A ",$F="\u203A ";function eQ(e){return e===` -`?"\u21B5":e===" "?"\u21E5":e}function XF(e,t){let r=e[e.length-1];if(r&&r.kind===t.kind&&t.kind!=="caret"){r.text+=t.text,r.width+=t.width;return}e.push({...t})}function ZF(e,t){let r=[],i=[],s=0;for(let a of e)i.length>0&&a.width>0&&s+a.width>t&&(r.push(i),i=[],s=0),XF(i,a),s+=a.width;return i.length>0&&r.push(i),r}function eb(e,t){let r=Array.from(e.value),i=Math.max(0,Math.min(e.cursor,r.length)),s=r.map(O=>dn(eQ(O))),a=i===r.length?1:0;if(s.reduce((O,G)=>O+G,0)+a<=t)return{chars:r,cursor:i,start:0,end:r.length};let E=Math.max(1,t-2-a),I=i,C=i,y=0;i0&&R+s[I-1]<=D;)I-=1,R+=s[I],y+=s[I];for(;C0&&y+s[I-1]<=E;)I-=1,y+=s[I];return{chars:r,cursor:i,start:I,end:C}}function tb(e,t){let r=t*Zy-(Zy-1),{chars:i,cursor:s,start:a,end:u}=eb(e,r),E=[];a>0&&E.push({kind:"dim",text:"\u2026",width:1});for(let D=a;D{let O=0;for(let G of D){if(G.kind==="caret")return C=R,y=O,!0;O+=G.width}return!1}),{rows:I,clipped:a>0||u(0,si.jsx)(k,{wrap:"truncate-end",children:E.map((C,y)=>C.kind==="caret"?u?(0,si.jsx)(k,{children:C.text==="\u258F"?" ":C.text},y):(0,si.jsx)(k,{inverse:!0,children:C.text},y):(0,si.jsx)(k,{dimColor:C.kind==="dim",children:C.text},y))},I)),a.clipped?(0,si.jsx)(Qe,{justifyContent:"flex-end",children:(0,si.jsx)(k,{dimColor:!0,wrap:"truncate-end",children:`${a.length} chars`})}):null]})]})}var rQ=Me(jt(),1);var dA=Me(Pt(),1),dI=8,rb=3,nb=10;function nQ(e){let t=Number.isFinite(e)?Math.max(1,Math.floor(e)):24;return Math.max(1,Math.min(dI,t-rb-nb))}function ob(e,t,r,i=0){if(e<=0)return{start:0,end:0,selected:-1};let s=Number.isFinite(r)?Math.floor(r):dI,a=Math.max(1,Math.min(e,s)),u=Math.max(0,Math.min(e-1,t)),E=Math.max(0,Math.min(e-a,i));return u=E+a&&(E=u+1-a),{start:E,end:E+a,selected:u}}function oQ({items:e,selected:t,maxVisible:r=dI}){let i=(0,rQ.useRef)(0),s=ob(e.length,t,r,i.current);return i.current=s.start,e.length===0?(i.current=0,null):(0,dA.jsxs)(Qe,{flexDirection:"column",marginTop:1,marginLeft:1,overflow:"hidden",children:[e.slice(s.start,s.end).map((a,u)=>{let I=s.start+u===s.selected;return(0,dA.jsx)(Qe,{height:1,width:"100%",overflow:"hidden",children:(0,dA.jsxs)(k,{wrap:"truncate-end",children:[(0,dA.jsxs)(k,{color:I?me.accent:void 0,bold:I,children:[I?"\u276F ":" ",a.name,a.arg?` ${a.arg}`:""]}),(0,dA.jsx)(k,{dimColor:!0,children:` ${a.desc}`})]})},a.name)}),(0,dA.jsx)(Qe,{height:1,overflow:"hidden",children:(0,dA.jsx)(k,{dimColor:!0,wrap:"truncate-end",children:` \u2191\u2193 ${s.selected+1}/${e.length} \xB7 Tab complete \xB7 Esc dismiss`})})]})}var sQ=Me(Pt(),1),ib="Enter send \xB7 Ctrl-R rewrite \xB7 / commands \xB7 scroll up \xB7 Ctrl-C quit UI",sb="Enter send \xB7 Ctrl-R rewrite \xB7 / commands \xB7 Ctrl-C quit UI";function iQ({notice:e,health:t,width:r}){let i=e||(t?`\u26A0 ${t}`:"")||(r<132?sb:ib),s=Math.max(12,r-2),a=i.length<=s?i:`${i.slice(0,s-1)}\u2026`;return(0,sQ.jsx)(k,{dimColor:!0,wrap:"truncate-end",children:a})}var pI=()=>Date.now()/1e3;function AQ(e){return e.trim().replace(/[.…]+$/u,"").toLowerCase()}function aQ(e,t,r=pI()){let i=(t.label??"").trim();if(!i)return e;let s=t.heartbeat===!0,a=e.slice(),u=a[a.length-1];if(u&&!u.endedTs){if(AQ(u.label)===AQ(i)||s&&u.heartbeat)return a[a.length-1]={...u,label:i,detail:t.detail||u.detail,kind:t.kind||u.kind,heartbeat:s,endedTs:0},a;a[a.length-1]={...u,endedTs:r}}return a.push({id:`${a.length}:${i}:${r}`,role:(t.role||"manager").trim()||"manager",label:i,detail:(t.detail||"").trim(),kind:(t.kind||"").trim(),startedTs:r,endedTs:0,heartbeat:s}),a}function lQ(e,t=pI()){if(e.length===0)return[];let r=e.slice(),i=r[r.length-1];return i&&!i.endedTs&&(r[r.length-1]={...i,endedTs:t}),r}function uQ(e,t=6){let r=Math.max(1,t);return e.length<=r?e:e.slice(e.length-r)}function EI(e,t=pI()){let r=e.endedTs||t;return Math.max(0,r-e.startedTs)}function mI(e){if(!Number.isFinite(e)||e<1)return"";if(e<60)return`${Math.floor(e)}s`;let t=Math.floor(e/60),r=Math.floor(e%60);return r?`${t}m${r}s`:`${t}m`}function cQ(e){let t=e.filter(i=>!i.heartbeat&&i.label.trim());if(t.length===0)return"";let r=t.map(i=>{let s=mI(EI(i,i.endedTs||i.startedTs));return` ${i.label}${s?` \xB7 ${s}`:""}`});return[`did ${t.length} step${t.length===1?"":"s"}:`,...r].join(` -`)}var Lo=Me(Pt(),1);function fQ({tick:e,phase:t,elapsedS:r,heartbeat:i=!1,quietS:s=0,steps:a=[],width:u=80}){let E=fI(e),I=Gy(t,e,i,s),C=uQ(a),y=Date.now()/1e3,D=u>=100;return(0,Lo.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,Lo.jsxs)(k,{wrap:"truncate-end",children:[" ",(0,Lo.jsx)(k,{color:me.role.manager??"magenta",children:E})," ",(0,Lo.jsx)(k,{color:me.role.manager??"magenta",bold:!0,children:"Your message"})," ",(0,Lo.jsx)(k,{color:me.accent,children:I}),(0,Lo.jsx)(k,{dimColor:!0,children:` ${r}s`})]}),C.map((R,O)=>{let G=O===C.length-1&&!R.endedTs,ne=mI(EI(R,y));return(0,Lo.jsxs)(k,{wrap:"truncate-end",children:[" ",(0,Lo.jsx)(k,{color:G?me.role[R.role]??me.info:me.success,children:G?E:"\u2713"})," ",(0,Lo.jsx)(k,{dimColor:!G,children:R.label}),ne?(0,Lo.jsx)(k,{dimColor:!0,children:` \xB7 ${ne}`}):null,D&&R.detail&&R.detail!==R.label?(0,Lo.jsx)(k,{dimColor:!0,children:` \xB7 ${R.detail}`}):null]},R.id)}),(0,Lo.jsx)(k,{dimColor:!0,children:" Esc stop waiting \xB7 /cancel"})]})}var Nu=Me(Pt(),1);function gQ({alert:e}){if(!e)return null;let t=e.tone==="block",r=t?me.error:me.warning;return(0,Nu.jsxs)(Qe,{marginTop:1,borderStyle:"round",borderColor:r,paddingX:1,children:[(0,Nu.jsxs)(k,{color:r,bold:!0,children:[t?"\u26D4":"\u{1F441}"," ",t?"NEEDS YOU":"WATCHING"]}),(0,Nu.jsx)(k,{children:" "}),(0,Nu.jsx)(k,{color:r,children:e.text})]})}var np=Me(jt(),1);var Ab={name:80,objective:4e3};function wf(e="",t=e.trim()?"objective":"name"){return{name:aA,objective:lA(e),field:t,busy:!1,error:""}}function Tu(e){return{name:e.name.value.trim(),objective:e.objective.value.trim()}}function ab(e){return e==="name"?"objective":"name"}function ws(e,t){return{...e,[e.field]:t(e[e.field]),error:""}}function Sf(e,t,r){return e.busy?{draft:e}:r.escape?{draft:e,intent:"cancel"}:r.return?{draft:e,intent:"submit"}:r.tab||r.upArrow||r.downArrow?{draft:{...e,field:ab(e.field)}}:r.leftArrow||r.ctrl&&t==="b"?{draft:ws(e,Ya)}:r.rightArrow||r.ctrl&&t==="f"?{draft:ws(e,Va)}:r.ctrl&&t==="a"?{draft:ws(e,Kd)}:r.ctrl&&t==="e"?{draft:ws(e,Jd)}:r.ctrl&&t==="w"?{draft:ws(e,Ru)}:r.ctrl&&t==="u"?{draft:ws(e,Fu)}:r.ctrl&&t==="k"?{draft:ws(e,bu)}:r.backspace?{draft:ws(e,_u)}:r.delete?{draft:ws(e,Ey)}:t&&!r.ctrl&&!r.meta?{draft:ws(e,i=>{let s=Ab[e.field]-Array.from(i.value).length;return s>0?uA(i,Array.from(t).slice(0,s).join("")):i})}:{draft:e}}var vr=Me(Pt(),1);function dQ({field:e,label:t,edit:r,active:i}){let{before:s,at:a,after:u}=my(r);return(0,vr.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,vr.jsx)(k,{color:i?me.accent:void 0,bold:i,dimColor:!i,children:`${i?"\u203A":" "} ${t} (optional)`}),(0,vr.jsx)(Qe,{paddingLeft:2,children:i?(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(k,{children:s}),a?(0,vr.jsx)(k,{inverse:!0,children:a}):(0,vr.jsx)(k,{color:me.accent,children:"\u258F"}),(0,vr.jsx)(k,{children:u})]}):r.value?(0,vr.jsx)(k,{children:r.value}):(0,vr.jsx)(k,{dimColor:!0,children:e==="name"?"generated automatically":"start with a conversation"})})]})}function op({draft:e,title:t="/new \u2014 open a fresh daemon",cancelHint:r="Esc/Ctrl-C cancel"}){let[i,s]=(0,np.useState)(0);(0,np.useEffect)(()=>{if(!e.busy)return;let I=setInterval(()=>s(C=>C+1),90);return()=>clearInterval(I)},[e.busy]);let{objective:a}=Tu(e),u=!!a,E=u?"create & start":"create idle daemon";return(0,vr.jsxs)(Qe,{flexDirection:"column",borderStyle:"round",borderColor:me.border,paddingX:2,marginTop:1,children:[(0,vr.jsx)(k,{bold:!0,color:me.accent,children:t}),(0,vr.jsx)(k,{dimColor:!0,children:"A clean Manager context with its own project timeline."}),(0,vr.jsx)(dQ,{field:"name",label:"Name",edit:e.name,active:e.field==="name"}),(0,vr.jsx)(dQ,{field:"objective",label:"Objective",edit:e.objective,active:e.field==="objective"}),(0,vr.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,vr.jsx)(k,{color:u?me.accent:me.info,children:u?"\u25CF Campaign starts immediately":"\u25CB Idle until you message Argus"}),(0,vr.jsx)(k,{dimColor:!0,children:u?"The objective is persisted, continuous mode is armed, and the executor starts.":"No executor is spawned yet; your first message can reply or dispatch work."})]}),(0,vr.jsx)(Qe,{marginTop:1,children:e.error?(0,vr.jsx)(k,{color:me.error,children:`Could not create daemon \xB7 ${e.error} \xB7 Enter to retry`}):e.busy?(0,vr.jsx)(k,{color:me.accent,children:`${xu[i%xu.length]} ${u?"creating daemon + starting campaign\u2026":"creating idle daemon\u2026"}`}):(0,vr.jsx)(k,{dimColor:!0,children:`Tab/\u2191\u2193 field \xB7 Enter ${E} \xB7 ${r}`})}),(0,vr.jsx)(k,{children:" "})]})}function pQ(e){let t=(e.label||e.display_name||"").trim();return!!(t&&t!==e.id)}function is(e){return[...e].sort((t,r)=>{if(t.daemon_alive!==r.daemon_alive)return t.daemon_alive?-1:1;let i=pQ(t),s=pQ(r);return i!==s?i?-1:1:(r.last_active||0)-(t.last_active||0)})}function lb(e){return is(e)[0]}function mQ(e,t){let r=t?.trim()||null;return r&&e.some(i=>i.id===r)?{id:r,requested:r,recovered:!1}:{id:lb(e)?.id??null,requested:r,recovered:!!r}}function ub(e,t){let r=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return!0;let i=e.daemon_alive?"live running":"stopped idle",s=[e.id,e.label,e.display_name,e.objective,i].filter(Boolean).join(" ").toLowerCase();return r.every(a=>s.includes(a))}function Xa(e,t){return e.filter(r=>ub(r,t))}function II(e){let t=e.trim(),r=t.includes("\\")||/^[A-Za-z]:[\\/]/.test(t),s=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\/+$/,"")||"/";return r?s.toLowerCase():s}function EQ(e,t){return e===t?!0:t==="/"?e.startsWith("/"):e.startsWith(`${t}/`)}function ip(e,t,r=!1){if(r)return e;let i=II(t);return e.filter(s=>{let a=(s.launch_cwd||"").trim();if(a){let I=II(a);return EQ(I,i)}let u=(s.cwd||"").trim();if(!u)return!1;let E=II(u);return E.includes("/.argus-skill/projects/")?!1:EQ(E,i)})}var cb=new Set(["done","completed","failed","skipped"]);function fb(e){return cb.has(e.status)}function sp(e,t){return e.filter(r=>fb(r)===t)}var gb=120,hr=(e,t)=>String(e[t]??"").trim(),eo=(e,t)=>{let r=Number(e[t]);return Number.isFinite(r)?r:0};function hQ(e,t=180){let r=String(e??"").split(` -`).find(i=>i.trim())?.trim()??"";return r.length<=t?r:`${r.slice(0,t-1).trimEnd()}\u2026`}function db(e){let t=e.toLowerCase();return t.includes("compaction_batch")||t.includes("compaction-batch")?"maintenance":t.includes("reviewer")||t.startsWith("review")?"reviewer":t.includes("planner")||t.startsWith("plan")?"planner":t.includes("manager")||t.startsWith("router")||t.startsWith("chat-")||t.startsWith("simple-")?"manager":"engineer"}function IQ(e){let t=e.match(/(?:^|[-_.])r(?:ound)?[-_.]?(\d+)/i);return t?` \xB7 round ${t[1]}`:""}function pb(e){let t=e.toLowerCase(),r=db(e);if(r==="maintenance")return{role:r,label:"compacting the reusable skill library"};if(t==="matcher"||t.includes("skill-match"))return{role:"engineer",label:"matching reusable skills"};if(t==="idea-search"||t.includes("idea.search"))return{role:"engineer",label:"searching recent papers + generating candidate ideas"};if(t.includes("distill")||t.includes("scientist"))return{role:"engineer",label:"building a task-specific playbook"};if(r==="reviewer")return{role:r,label:`reviewing evidence${IQ(t)}`};if(r==="planner")return{role:r,label:"planning the next work"};if(t.includes("vertical"))return{role:"manager",label:"choosing the task workflow"};if(r==="manager")return{role:r,label:"handling the operator request"};if(t.startsWith("engineer")||t.startsWith("main"))return{role:"engineer",label:`working on the mission${IQ(t)}`};let i=e.replace(/[._-]+/g," ").replace(/\s+/g," ").trim();return{role:r,label:i?`running ${i}`:"working"}}function Eb(e,t,r){let i=e.toLowerCase();return i==="matcher"?"phase:matcher":i==="idea-search"?"phase:idea-search":t||`run:${e||"unknown"}:${r}`}function mb(e,t){let r=Number(e.split("-",1)[0]);return Number.isFinite(r)&&r>0?r/1e3:t}function Ib(e){if(hr(e,"type")!=="agent.io.stream")return"";try{let t=JSON.parse(hr(e,"line")),r=t.data&&typeof t.data=="object"?t.data:{},i=String(t.model??r.model??"").trim();return/^[A-Za-z0-9._:/+-]{1,80}$/.test(i)?i:""}catch{return""}}function hb(e){let t=hr(e,"type");if(!["agent.io.start","agent.io.stream","agent.io.complete","agent.io.error"].includes(t))return e;let r=hr(e,"run_label"),i=hr(e,"call_id"),s=eo(e,"ts")||Date.now()/1e3,a=pb(r),u=e.exit_code,E=t==="agent.io.error"||typeof u=="number"&&u!==0||e.turn_failed===!0||!!hr(e,"fatal_error"),I=["agent.io.start","agent.io.stream"].includes(t)?"running":E?"error":"done",C={type:"role.activity",activity_id:Eb(r,i,s),role:a.role,label:a.label,status:I,run_label:r,ts:s};I==="running"&&(C.started_ts=mb(i,s)),t==="agent.io.stream"&&(C.heartbeat=!0);let y=hr(e,"model")||Ib(e),D=hr(e,"backend");return y&&(C.model=y),D&&(C.backend=D),E&&(C.error=hQ(hr(e,"fatal_error")||hr(e,"error")||`exit ${u}`)),C}function Cb(e){let t=hr(e,"text"),r=t.toLowerCase(),i=eo(e,"ts")||Date.now()/1e3,s=r.includes("matcher picked:"),a=r.includes("no match")||r.includes("matched: none"),u="matching reusable skills",E=hQ(t,120);if(s){let I=t.split(":").slice(1).join(":").split("(")[0].trim();u=I?`selected skill \xB7 ${I}`:"selected a reusable skill",E=""}else if(a)u="no reusable skill matched",E="";else{let I=t.match(/\(([^)]+)\) against (\d+) candidates/i),C=t.match(/pool\s+(\d+)→(\d+)/i);I?E=`${I[1]} \xB7 ${I[2]} candidates`:C&&(E=`${C[1]}\u2192${C[2]} candidates`)}return{type:"role.activity",activity_id:"phase:matcher",role:"engineer",label:u,detail:E,status:s||a?"done":"running",milestone:s||a,started_ts:i,ts:i}}function Bb(e){let t=hr(e,"type"),r=eo(e,"ts")||Date.now()/1e3,i=eo(e,"count");return t==="idea.search.completed"?{type:"role.activity",activity_id:"phase:idea-search",role:"engineer",label:i?`generated ${i} candidate ideas`:"candidate idea search completed",status:"done",milestone:!0,ts:r}:t==="idea.search.skipped"?{type:"role.activity",activity_id:"phase:idea-search",role:"engineer",label:"candidate idea search skipped",status:"done",ts:r}:{type:"role.activity",activity_id:"phase:idea-search",role:"engineer",label:"searching recent papers + generating candidate ideas",status:"running",started_ts:r,ts:r}}function Db(e){let t=hr(e,"type");return t.startsWith("agent.io.")?hb(e):t==="match.info"?Cb(e):t.startsWith("idea.search.")?Bb(e):e}function yb(e,t){let r=eo(e,"started_ts"),i=eo(t,"started_ts"),s=r&&i?Math.min(r,i):r||i||eo(e,"ts")||eo(t,"ts"),a={...e,...t,started_ts:s},u=hr(a,"status"),E=eo(a,"ts");return u!=="running"&&s&&E>=s&&(a.elapsed_s=E-s),a}function Ap(e,t,r=400){let i=Db(t);if(!i)return e;if(i.type==="ui.operator"||i.type==="ui.argus"){let a=hr(i,"text"),u=eo(i,"ts"),E=hr(i,"message_id");if(E&&e.some(D=>hr(D,"confirmed_message_id")===E))return e;let C=E?e.findIndex(D=>D.type===i.type&&hr(D,"text")===a&&D.local_optimistic===!0):-1;if(C>=0){let D=e.slice();return D[C]={...D[C],local_optimistic:!1,confirmed_message_id:E},D}if(e.some(D=>{let R=hr(D,"message_id");return D.type===i.type&&hr(D,"text")===a&&Math.abs(eo(D,"ts")-u)<=2&&!(E&&R&&E!==R)}))return e}if(i.type==="role.activity"){let a=hr(i,"activity_id"),u=e.findIndex(E=>E.type==="role.activity"&&hr(E,"activity_id")===a);if(u>=0){if(i.heartbeat===!0&&eo(i,"ts")-eo(e[u],"ts")<1)return e;let E=e.slice();return E[u]=yb(E[u],i),E}}else{let a=XA(i);if(e.some(u=>XA(u)===a))return e}let s=e.concat(i);return s.length>r?s.slice(s.length-r):s}function CQ(e){if(e.type!=="role.activity")return null;let t=eo(e,"started_ts")||eo(e,"ts"),r=eo(e,"ts")||t;return{id:hr(e,"activity_id"),role:hr(e,"role")||"engineer",label:hr(e,"label")||"working",detail:hr(e,"detail"),status:hr(e,"status")||"running",startedTs:t,updatedTs:r,elapsedS:eo(e,"elapsed_s")||Math.max(0,r-t),model:hr(e,"model"),backend:hr(e,"backend"),milestone:!!e.milestone}}function Qb(e,t=[]){let r=new Set(t),i=Date.now()/1e3;return e.map(CQ).filter(s=>s?.status==="running"&&!r.has(s.role)&&i-s.updatedTs<=gb).sort((s,a)=>a.updatedTs-s.updatedTs)}function BQ(e,t){let r=new Map(Qb(t).map(u=>[u.role,u])),i=new Set(e.map(u=>u.role)),s=Date.now()/1e3,a=e.map(u=>{let E=r.get(u.role);return E?{...u,active:!0,label:E.label,status:"running",age_s:Math.max(0,s-E.updatedTs)}:u});for(let u of r.values())i.has(u.role)||a.push({role:u.role,backend:u.backend,backend_label:u.backend,model:u.model,effort:null,active:!0,label:u.label,status:"running",age_s:Math.max(0,s-u.updatedTs)});return a}function DQ(e,t,r,i=0){let s=r.trim()||"working",a=Math.max(0,i),u=!1,E=e.map(I=>I.role!==t?I:(u=!0,{...I,active:!0,label:s,status:"running",age_s:a}));return u?E:E.concat({role:t,backend:"",backend_label:"",model:"",effort:null,active:!0,label:s,status:"running",age_s:a})}function yQ(e,t=10){return e.map(CQ).filter(r=>!!r).sort((r,i)=>r.updatedTs-i.updatedTs).slice(-t)}function hI(e,t){return!t||t<=0?0:Math.min(1,Math.max(0,e/t))}var ss=Me(Pt(),1);function QQ({settledUsd:e,spendStatus:t,usageSummary:r,daemon:i,requestUsage:s,costControl:a,width:u}){let E=i?.global_daily_cap_usd??null,I=e??0,C=t==="partial"||t==="unpriced";if(I<=0&&!C&&!E&&!s&&!a?.active_reservations&&!a?.unresolved_calls)return null;let y=hI(I,E),D=y<.6?me.success:y<.85?me.warning:me.error,R=s?.codex,O=s?.copilot;return(0,ss.jsxs)(Qe,{flexDirection:"column",children:[I>0||C||E?(0,ss.jsxs)(Qe,{children:[(0,ss.jsx)(k,{dimColor:!0,children:"model/API spend "}),(0,ss.jsx)(k,{color:D,children:e==null&&C?t:`$${I.toFixed(2)}${C?"+":""}`}),C&&e!=null?(0,ss.jsx)(k,{dimColor:!0,children:` \xB7 ${t}`}):null,E?(0,ss.jsx)(k,{dimColor:!0,children:` \xB7 model cap $${E.toFixed(0)}/d`}):null]}):null,s?(0,ss.jsx)(k,{dimColor:!0,wrap:"truncate-end",children:u<80?`requests \xB7 C ${R?.daily_calls??0}/${R?.daily_cap||"\u221E"} \xB7 P ${O?.daily_calls??0}/${O?.daily_cap||"\u221E"}`:`requests today \xB7 Codex ${R?.daily_calls??0}/${R?.daily_cap||"\u221E"} \xB7 Copilot ${O?.daily_calls??0}/${O?.daily_cap||"\u221E"} \xB7 premium ${(O?.premium_requests??0).toFixed(1)}/${O?.premium_cap||"\u221E"}`}):null,a&&(a.active_reservations>0||a.unresolved_calls>0)?(0,ss.jsx)(k,{color:(a.blocking_unresolved_calls??0)>0?me.error:void 0,dimColor:(a.blocking_unresolved_calls??0)===0,children:`cost control \xB7 in-flight ${a.active_reservations} \xB7 unresolved ${a.unresolved_calls}`}):null,r&&r.call_count>0?(0,ss.jsx)(k,{dimColor:!0,wrap:"truncate-end",children:u<80?`tokens \xB7 in ${r.input_tokens} \xB7 out ${r.output_tokens}`:`tokens \xB7 input ${r.input_tokens} \xB7 cache read ${r.cached_input_tokens} \xB7 cache write ${r.cache_write_tokens} \xB7 output ${r.output_tokens} \xB7 reasoning ${r.reasoning_output_tokens}`}):null]})}var te=Me(Pt(),1);function fo({title:e,children:t,page:r=0,pages:i=1,hint:s}){return(0,te.jsxs)(Qe,{flexDirection:"column",borderStyle:"round",borderColor:me.border,paddingX:2,marginTop:1,children:[(0,te.jsx)(k,{bold:!0,color:me.accent,children:e}),(0,te.jsx)(Qe,{flexDirection:"column",marginTop:1,children:t}),(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:s??(i>1?`\u2191/k \u2193/j page ${r+1}/${i} \xB7 Enter/Esc close`:"Enter/Esc close")})]})}var vQ=e=>e?"\u25CF":"\u25CB";function wQ({panel:e,snap:t,viewportRows:r,activeProject:i,events:s=[],viewportColumns:a=80}){let u=Math.max(4,r-10);if(e.loading)return(0,te.jsx)(fo,{title:e.kind,children:(0,te.jsx)(k,{dimColor:!0,children:"loading\u2026"})});if(e.error)return(0,te.jsx)(fo,{title:e.kind,children:(0,te.jsx)(k,{color:me.error,children:e.error})});switch(e.kind){case"operations":return(0,te.jsx)(vb,{snap:t,events:s,width:a,height:r});case"help":return(0,te.jsx)(wb,{page:e.page??0,pageSize:u});case"status":return(0,te.jsx)(Sb,{s:e.data});case"doctor":return(0,te.jsx)(_b,{r:e.data});case"backlog":return(0,te.jsx)(Rb,{items:t?.backlog??[],all:!!e.all,selected:e.selection??0,pageSize:u});case"journal":return(0,te.jsx)(xb,{entries:e.data??[],page:e.page??0,pageSize:u});case"config":return(0,te.jsx)(kb,{c:e.data});case"identity":return(0,te.jsx)(Nb,{text:e.data??"",page:e.page??0,pageSize:u});case"daemons":return(0,te.jsx)(Tb,{rows:e.data??[],selected:e.selection??0,pageSize:u,activeProject:i,query:e.query??""});case"artifacts":return(0,te.jsx)(Ob,{rows:e.data??[],selected:e.selection??0,pageSize:Math.max(2,Math.floor(u/2))});case"artifact":return(0,te.jsx)(Lb,{artifact:e.data,page:e.page??0,pageSize:u});case"events":return(0,te.jsx)(Fb,{events:s,filter:e.filter??"all",query:e.query??"",page:e.page??0,pageSize:Math.max(3,Math.floor(u/2)),width:a});case"task":return(0,te.jsx)(bb,{item:e.data,page:e.page??0,pageSize:u,width:a})}}function vb({snap:e,events:t,width:r,height:i}){if(!e)return(0,te.jsx)(fo,{title:"Operations",hint:"Esc close",children:(0,te.jsx)(k,{dimColor:!0,children:"loading\u2026"})});let s=yQ(t,8),a=e.observability?.slo,u=e.mission_view?.storage,E=i<=24,I=i<=20,C=I?e.roles.slice(0,2):e.roles;return(0,te.jsxs)(fo,{title:"Operations",hint:"Esc close \xB7 /status and /doctor for details",children:[(0,te.jsx)(Fn,{k:"daemon",v:e.daemon.alive?`\u25CF pid ${e.daemon.pid??"\u2014"} \xB7 ${Math.floor((e.daemon.uptime_seconds??0)/60)}m`:"\u25CB stopped",c:e.daemon.alive?me.success:"gray"}),(0,te.jsx)(Fn,{k:"backend",v:e.daemon.backend_label||e.daemon.backend||"\u2014"}),I?null:(0,te.jsx)(Fn,{k:"protocol",v:`${e.daemon.protocol?.name||"\u2014"}/${e.daemon.protocol?.major??"\u2014"}.${e.daemon.protocol?.minor??"\u2014"}`}),E?null:(0,te.jsx)(k,{children:" "}),(0,te.jsx)(QQ,{settledUsd:e.global_spend_usd,spendStatus:e.global_spend_status,usageSummary:e.global_usage_summary,daemon:e.daemon,requestUsage:e.request_usage,costControl:e.cost_control,width:r}),E?null:(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:"roles"}),C.map(y=>(0,te.jsxs)(k,{children:[(0,te.jsx)(k,{color:me.role[y.role]??"white",children:y.role.padEnd(10)}),(0,te.jsx)(k,{dimColor:!0,children:`${y.backend_label||y.backend} \xB7 ${y.model||"\u2014"} \xB7 ${y.effort||"default"}`})]},y.role)),I&&e.roles.length>C.length?(0,te.jsx)(k,{dimColor:!0,children:` + ${e.roles.length-C.length} roles \xB7 /status`}):null,!E&&u&&(u.project_skill_dir||u.global_skill_dir||u.wiki_paths.length||u.skill_history_compressed||u.wiki_retired_compressed)?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:"self-evolution storage"}),u.project_skill_dir?(0,te.jsx)(Fn,{k:"project skills",v:`${u.project_skill_count} \xB7 ${u.project_skill_dir}`}):null,u.global_skill_dir?(0,te.jsx)(Fn,{k:"global skills",v:`${u.global_skill_count} \xB7 ${u.global_skill_dir}`}):null,u.wiki_paths.map((y,D)=>(0,te.jsx)(Fn,{k:D?"":"project wiki",v:y},y)),u.skill_history_compressed||u.wiki_retired_compressed?(0,te.jsx)(Fn,{k:"cold history",v:`skill ${u.skill_history_compressed} \xB7 wiki ${u.wiki_retired_compressed} \xB7 ${CI(u.skill_history_bytes_saved+u.wiki_retired_bytes_saved)} saved`}):null]}):null,E&&a?.status==="degraded"?(0,te.jsx)(Fn,{k:"SLO",v:a.violations[0]||"degraded",c:me.error}):a?.status==="degraded"?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{color:me.error,children:"SLO degraded"}),a.violations.slice(0,5).map(y=>(0,te.jsx)(k,{dimColor:!0,children:` ! ${y}`},y))]}):null,E&&s.length?(0,te.jsx)(Fn,{k:"activity",v:`${s[0]?.role} \xB7 ${s[0]?.label}`}):s.length?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:"recent observable activity"}),s.map(y=>(0,te.jsx)(k,{dimColor:!0,children:` \xB7 ${y.role} \xB7 ${y.label}`},y.id))]}):null]})}function pA(e,t,r){let i=Math.max(1,Math.ceil(e.length/r)),s=Math.min(Math.max(0,t),i-1);return{shown:e.slice(s*r,(s+1)*r),page:s,pages:i}}function wb({page:e,pageSize:t}){let r=nI().flatMap(s=>s.rows.map(a=>({...a,group:s.group}))),i=pA(r,e,t);return(0,te.jsxs)(fo,{title:"argus cockpit \u2014 commands",page:i.page,pages:i.pages,children:[(0,te.jsx)(k,{dimColor:!0,children:"type freely to chat/queue \xB7 commands start with /"}),(0,te.jsx)(k,{children:" "}),i.shown.map((s,a)=>(0,te.jsxs)(Qe,{flexDirection:"column",children:[(a===0||i.shown[a-1]?.group!==s.group)&&(0,te.jsx)(k,{bold:!0,color:"cyan",children:s.group}),(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:me.accent,children:` ${s.label}`.padEnd(34)}),(0,te.jsx)(k,{dimColor:!0,children:s.desc})]})]},s.label))]})}function Sb({s:e}){return(0,te.jsxs)(fo,{title:"/status",children:[(0,te.jsx)(Fn,{k:"daemon",v:e.daemon.alive?`\u25CF alive (pid ${e.daemon.pid})`:"\u25CB no daemon",c:e.daemon.alive?me.success:"gray"}),(0,te.jsx)(Fn,{k:"active role",v:e.active_role??"idle"}),(0,te.jsx)(Fn,{k:"continuous",v:e.continuous.enabled?`on \xB7 ${e.continuous.objective}`:"off"}),(0,te.jsx)(Fn,{k:"inbox",v:`${e.inbox_pending} pending`}),(0,te.jsx)(Fn,{k:"backlog",v:`${e.backlog_pending.length} pending`}),e.request_usage?(0,te.jsx)(Fn,{k:"requests",v:`Codex ${e.request_usage.codex.daily_calls}/${e.request_usage.codex.daily_cap||"\u221E"} \xB7 Copilot ${e.request_usage.copilot.daily_calls}/${e.request_usage.copilot.daily_cap||"\u221E"}`}):null,e.pending_questions.length>0?(0,te.jsx)(Fn,{k:"questions",v:`${e.pending_questions.length} awaiting you`,c:me.warning}):null,(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:"recent journal:"}),e.journal.length===0?(0,te.jsx)(k,{dimColor:!0,children:" (none)"}):e.journal.slice(-3).map(t=>(0,te.jsx)(k,{dimColor:!0,children:` \xB7 ${t.title||t.kind}`},t.id)),e.identity?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:`identity: ${e.identity.split(` -`)[0].slice(0,70)}`})]}):null]})}function _b({r:e}){return(0,te.jsxs)(fo,{title:"/doctor \u2014 why isn't anything running?",children:[e.checks.map(t=>(0,te.jsxs)(Qe,{children:[(0,te.jsxs)(k,{color:t.ok?me.success:me.error,children:[vQ(t.ok)," "]}),(0,te.jsx)(k,{children:t.name.padEnd(20)}),(0,te.jsx)(k,{dimColor:!0,children:t.detail})]},t.name)),e.recommended?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{color:me.accent,children:`\u2192 recommended: ${e.recommended.fix||e.recommended.detail}`})]}):(0,te.jsx)(k,{color:me.success,children:` -\u2713 all checks pass`}),e.log_tail?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:"recent daemon.log:"}),e.log_tail.split(` -`).slice(-6).map((t,r)=>(0,te.jsx)(k,{dimColor:!0,children:` ${t}`},r))]}):null]})}function Rb({items:e,all:t,selected:r,pageSize:i}){let s=t?e:sp(e,!1),a=Math.min(Math.max(0,r),Math.max(0,s.length-1)),u=pA(s,Math.floor(a/i),i),E=I=>I==="pending"?"cyan":I==="running"?me.info:I==="done"||I==="completed"?me.success:I==="failed"||I==="blocked"?me.error:"gray";return(0,te.jsx)(fo,{title:`/backlog${t?" all":""}`,page:u.page,pages:u.pages,hint:`\u2191/k \u2193/j select${u.pages>1?` \xB7 page ${u.page+1}/${u.pages}`:""} \xB7 Enter details \xB7 Esc close`,children:s.length===0?(0,te.jsx)(k,{dimColor:!0,children:"(backlog is empty \u2014 type a task or /task )"}):u.shown.map((I,C)=>{let y=u.page*i+C===a;return(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:y?me.accent:"gray",children:y?"\u203A ":" "}),(0,te.jsx)(k,{color:E(I.status),children:I.status.padEnd(10)}),(0,te.jsx)(k,{dimColor:!0,children:`${I.id.slice(0,8)} `}),(0,te.jsx)(k,{bold:y,children:I.title||I.objective})]},I.id)})})}function Fb({events:e,filter:t,query:r,page:i,pageSize:s,width:a}){let u=rp(e),E=u.filter(y=>yy(y.ev,y.r,t,r)).reverse(),I=pA(E,i,s),C=r?` \xB7 \u201C${r.slice(0,Math.max(8,a-34))}${r.length>a-34?"\u2026":""}\u201D`:"";return(0,te.jsx)(fo,{title:`/events ${t}${C} \xB7 ${E.length}/${u.length}`,page:I.page,pages:I.pages,children:E.length===0?(0,te.jsx)(k,{dimColor:!0,children:"(no events match this view)"}):I.shown.map(y=>(0,te.jsxs)(Qe,{flexDirection:"column",children:[(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:tp(y.r.role),bold:!0,children:`${y.r.label}`.padEnd(10)}),(0,te.jsx)(k,{color:ep(y.r.tone),children:`${["err","warn"].includes(y.r.tone)?"!":"\xB7"} ${y.r.text.slice(0,Math.max(18,a-19))}`})]}),(0,te.jsx)(k,{dimColor:!0,children:` ${String(y.ev.type??"event")}`})]},y.key))})}function Za(e,t){let r=Math.max(20,t-8);return String(e||"").split(` -`).flatMap(i=>{if(!i)return[" "];let s=[];for(let a=0;a`${I?" ":"outcome "}${E}`):[],`priority p${e.priority}`,...Za(`iteration ${e.iterate?"auto":"single"} \xB7 ${e.iteration_cycles_done??0}/${e.iteration_max_cycles??"\u2014"} cycles \xB7 cost $${(e.iteration_cost_usd??0).toFixed(2)}`,i),...e.pending_question?["","WAITING ON YOU",...Za(e.pending_question,i)]:[],"","OBJECTIVE",...Za(e.objective||e.original_objective||"(none)",i),...e.last_error?["","LAST ERROR",...Za(e.last_error,i)]:[],...e.notes?["","NOTES",...Za(e.notes,i)]:[],...e.tags?.length?["",...Za(`tags ${e.tags.join(", ")}`,i)]:[],...e.deps?.length?Za(`depends on ${e.deps.join(", ")}`,i):[]],u=pA(a,t,r);return(0,te.jsx)(fo,{title:`/item ${e.id} \u2014 ${(e.title||"task").slice(0,Math.max(10,i-e.id.length-18))}`,page:u.page,pages:u.pages,children:u.shown.map((E,I)=>{let C=["WAITING ON YOU","OBJECTIVE","LAST ERROR","NOTES"].includes(E);return(0,te.jsx)(k,{bold:C,color:E==="WAITING ON YOU"?me.warning:C?me.accent:void 0,children:E},`${u.page}-${I}`)})})}function xb({entries:e,page:t,pageSize:r}){let i=pA(e.slice(-20).reverse(),t,Math.max(2,Math.floor(r/2)));return(0,te.jsx)(fo,{title:"/journal",page:i.page,pages:i.pages,children:e.length===0?(0,te.jsx)(k,{dimColor:!0,children:"(no journal entries yet)"}):i.shown.map(s=>{let a=s.summary||"",u=s.extra?.final_submission_certified===!0;return(0,te.jsxs)(Qe,{flexDirection:"column",children:[(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:s.kind==="mission_complete"?me.success:"cyan",children:`${s.kind}`.padEnd(18)}),(0,te.jsxs)(k,{children:[u?"\u2713 certified \xB7 ":"",s.title]})]}),a?(0,te.jsx)(k,{dimColor:!0,children:` ${a.slice(0,100)}`}):null]},s.id)})})}function kb({c:e}){return(0,te.jsxs)(fo,{title:"/config \u2014 runtime settings",children:[e.roles.map(t=>(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:me.role[t.role]??"white",children:`${t.role}`.padEnd(10)}),(0,te.jsx)(k,{dimColor:!0,children:`${t.backend_label} \xB7 ${t.model} \xB7 `}),(0,te.jsx)(k,{color:_y(t.effort),children:`effort ${t.effort??"\u2014"}`})]},t.role)),(0,te.jsx)(k,{children:" "}),(0,te.jsx)(k,{dimColor:!0,children:"NL-editable: model \xB7 effort \xB7 backend \xB7 caps \xB7 safe_mode"}),(0,te.jsx)(k,{dimColor:!0,children:"full list: argus-skill --config-help"})]})}function Nb({text:e,page:t,pageSize:r}){let i=(e||"(no identity set)").split(` -`),s=pA(i,t,r);return(0,te.jsx)(fo,{title:"/identity \u2014 operator card",page:s.page,pages:s.pages,children:s.shown.map((a,u)=>(0,te.jsx)(k,{children:a||" "},u))})}function Tb({rows:e,selected:t,pageSize:r,activeProject:i,query:s}){let a=Xa(is(e),s),u=Math.min(Math.max(0,t),Math.max(0,a.length-1)),E=pA(a,Math.floor(u/r),r);return(0,te.jsx)(fo,{page:E.page,pages:E.pages,title:s?`/daemons \xB7 \u201C${s}\u201D \xB7 ${a.length}/${e.length}`:"/daemons \u2014 select project",hint:`\u2191/k \u2193/j select${E.pages>1?` \xB7 page ${E.page+1}/${E.pages}`:""} \xB7 Enter switch \xB7 / search \xB7 n new \xB7 Esc close`,children:a.length===0?(0,te.jsx)(k,{dimColor:!0,children:s?`(no daemons match \u201C${s}\u201D)`:"(no projects \u2014 press n to create one)"}):E.shown.map((I,C)=>{let D=E.page*r+C===u,R=I.id===i;return(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:D?me.accent:"gray",children:D?"\u203A ":" "}),(0,te.jsxs)(k,{color:I.daemon_alive?me.success:"gray",children:[vQ(I.daemon_alive)," "]}),(0,te.jsx)(k,{color:D?me.accent:void 0,dimColor:!D,children:`${I.id.slice(0,12)} `}),(0,te.jsx)(k,{bold:D,children:I.label||I.id}),I.daemon_alive?(0,te.jsx)(k,{dimColor:!0,children:` pid ${I.daemon_pid}`}):null,R?(0,te.jsx)(k,{color:me.success,children:" current"}):null]},I.id)})})}function CI(e){return!Number.isFinite(e)||e<=0?"0 B":e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(e>=10*1024?0:1)} KB`:`${(e/1024**2).toFixed(e>=10*1024**2?0:1)} MB`}function Ob({rows:e,selected:t,pageSize:r}){let i=Math.min(Math.max(0,t),Math.max(0,e.length-1)),s=pA(e,Math.floor(i/r),r);return(0,te.jsx)(fo,{title:"/artifacts \u2014 latest reviewed result",page:s.page,pages:s.pages,hint:`\u2191/k \u2193/j select${s.pages>1?` \xB7 page ${s.page+1}/${s.pages}`:""} \xB7 Enter preview \xB7 Esc close`,children:e.length===0?(0,te.jsx)(k,{dimColor:!0,children:"(the latest result has no reviewer-approved files)"}):s.shown.map((a,u)=>{let E=s.page*r+u===i;return(0,te.jsxs)(Qe,{flexDirection:"column",children:[(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{color:E?me.accent:"gray",children:E?"\u203A ":" "}),(0,te.jsx)(k,{color:a.exists?me.success:me.error,children:a.exists?"\u25C6 ":"\xD7 "}),(0,te.jsx)(k,{bold:E,color:E?me.accent:void 0,children:a.path}),(0,te.jsx)(k,{dimColor:!0,children:` ${a.kind} \xB7 ${CI(a.size)}`})]}),a.why?(0,te.jsx)(k,{dimColor:!0,children:` ${a.why.slice(0,110)}`}):null]},a.path)})})}function Lb({artifact:e,page:t,pageSize:r}){let i=["text","markdown","json","table"].includes(e?.kind),s=i?(e.preview||"(empty file)").split(` -`):[],a=pA(s,t,r);return(0,te.jsxs)(fo,{title:`/artifact ${e?.path??""}`,page:a.page,pages:a.pages,hint:a.pages>1?`\u2191/k \u2193/j page ${a.page+1}/${a.pages} \xB7 Enter/Esc close`:"Enter/Esc close",children:[(0,te.jsx)(Fn,{k:"type",v:`${e.kind} \xB7 ${e.mime}`}),(0,te.jsx)(Fn,{k:"size",v:CI(e.size)}),e.why?(0,te.jsx)(Fn,{k:"reviewer",v:e.why,c:me.accent}):null,(0,te.jsx)(k,{children:" "}),i?(0,te.jsxs)(te.Fragment,{children:[a.shown.map((u,E)=>(0,te.jsx)(k,{children:u||" "},`${a.page}-${E}`)),e.truncated&&a.page===a.pages-1?(0,te.jsx)(k,{color:me.warning,children:"\u2026 preview truncated; use the Web UI to download the complete file"}):null]}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(k,{dimColor:!0,children:e.kind==="binary"?"No safe inline preview for this file type.":`${e.kind.toUpperCase()} preview is available in the Web UI.`}),(0,te.jsx)(k,{dimColor:!0,children:"Use the authenticated Web cockpit to preview or download it."})]})]})}function Fn({k:e,v:t,c:r}){return(0,te.jsxs)(Qe,{children:[(0,te.jsx)(k,{dimColor:!0,children:`${e}`.padEnd(14)}),(0,te.jsx)(k,{color:r,children:t})]})}var Mb={[z.LIFE_LIFECYCLE_BLOCK]:"block",[z.ROUND_REVIEWER_BACKEND_FAILURE]:"block",[z.LIFE_BUDGET_PAUSE]:"warn",[z.ROUND_STALL]:"warn",[z.ROUND_ESCALATED]:"warn",[z.LIFE_PLANNER_STALL_ESCALATION]:"warn"},Pb=new Set([z.BUDGET_RESERVATION_DENIED,z.BUDGET_UNPRICED_BLOCKED]),Ub=new Set([z.LIFE_MISSION_STARTED,z.ROUND_MAIN_COMPLETED,z.LIFE_MISSION_COMPLETED,z.LOOP_DONE,z.ROUND_START,"ui.operator"]),Gb=new Set([z.BUDGET_RESERVATION_CREATED,z.PROVIDER_REQUEST_STARTED]);function Hb(e){let t=$A(e.canonical_type??e.type);if(e.event_validation?.status==="invalid")return{tone:"warn",text:`invalid event ${t||"unknown"}: ${e.event_validation.errors.join("; ")}`};if(Pb.has(t))return{tone:"block",kind:"budget",text:`Budget exhausted or blocked \u2014 ${String(e.reason??e.text??t).trim()}`};let r=e.operator_alert===!0?"block":Mb[t];return r?{tone:r,text:String(e.text??e.reason??t).trim()}:null}function BI(e){let t=null;for(let r of e){let i=$A(r.canonical_type??r.type),s=Hb(r);s?t=s:(t?.kind==="budget"&&Gb.has(i)||t&&t.kind!=="budget"&&Ub.has(i))&&(t=null)}return t}function SQ(e=process.env){let t=String(e.ARGUS_SKILL_SHOW_REASONING??"").trim().toLowerCase();return["1","true","yes","on"].includes(t)}var ap=Me(jt(),1);function Ou(){let{stdout:e}=AA(),t=()=>({columns:Math.max(40,e.columns||80),rows:Math.max(16,e.rows||24)}),[r,i]=(0,ap.useState)(t);return(0,ap.useEffect)(()=>{let s=()=>i(t());return e.on("resize",s),()=>{e.off("resize",s)}},[e]),r}function el(e,t,r){return t<=0?0:(((Number.isFinite(e)?Math.trunc(e):0)+r)%t+t)%t}var He=Me(Pt(),1),lp=["manager","planner","engineer","reviewer"];function _f(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ri(e,t){let r=String(e||"").replace(/\s+/g," ").trim();return r.length<=t?r:`${r.slice(0,Math.max(1,t-1))}\u2026`}function DI(e){if(e.tone==="error")return me.error;if(e.tone==="success"||e.tone==="skill")return me.success;if(e.tone==="info")return me.info}function _Q(e,t,r){let i=e==null?t&&t!=="empty"?t:"$0.00 model calls":`$${e.toFixed(2)} model calls`,s=r?` / $${r.toFixed(0)} daily cap`:"";return i+s}function RQ(e){let t=e?.codex,r=e?.copilot;return[`Codex ${t?.daily_calls??0}/${t?.daily_cap||"\u221E"}`,`Copilot ${r?.daily_calls??0}/${r?.daily_cap||"\u221E"}`,`premium ${(r?.premium_requests??0).toFixed(1)}/${r?.premium_cap||"\u221E"}`].join(" \xB7 ")}function FQ({view:e,width:t,height:r,busy:i=!1,spentUsd:s,spendStatus:a,globalDailyCapUsd:u,requestUsage:E}){let I=Ly(e.mission.objective||e.mission.title||"Waiting for a mission"),C=e.timeline.slice(-Math.max(3,t<80?4:6)),y=new Map(e.roles.map(J=>[J.role,J])),D=e.timeline.map(J=>J.role).filter((J,X,Z)=>lp.includes(J)&&(X===0||J!==Z[X-1])),R=D.length>1?`${_f(D[D.length-2])} \u2192 ${_f(D[D.length-1])}`:"",O=e.stage.label||e.stage.id||"\u2014",G=Zd(e.routing),ne=e.round.max>0?`${e.round.current} / ${e.round.max}`:e.round.current?String(e.round.current):"\u2014",oe=$d(e.outcome),$=r!=null&&r<36;if(i){let J=lp.map(X=>y.get(X)).filter(X=>X&&X.status==="active").map(X=>_f(X.role));return(0,He.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"MISSION "}),(0,He.jsx)(k,{bold:!0,children:Ri(I,Math.max(18,t-10))})]}),(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"STAGE "}),(0,He.jsx)(k,{color:me.info,children:Ri(O,20)}),(0,He.jsx)(k,{dimColor:!0,children:` \xB7 ROUND ${ne} \xB7 TEAM `}),(0,He.jsx)(k,{children:J.length?J.join(", "):"Manager"})]}),G?(0,He.jsx)(k,{dimColor:!0,children:`MODE ${G}`}):null]})}if($){let J=C[C.length-1];return(0,He.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,He.jsx)(k,{dimColor:!0,children:"MISSION"}),(0,He.jsx)(k,{bold:!0,children:Ri(I,Math.max(24,t-2))}),(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"STAGE "}),(0,He.jsx)(k,{color:me.info,children:Ri(O,20)}),(0,He.jsx)(k,{dimColor:!0,children:` \xB7 ROUND ${ne} \xB7 ELAPSED `}),(0,He.jsx)(k,{children:AI(e.mission.elapsed_seconds)})]}),G?(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"MODE "}),(0,He.jsx)(k,{children:Ri(G,Math.max(18,t-7))})]}):null,(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"MODEL SPEND "}),(0,He.jsx)(k,{color:a==="partial"||a==="unpriced"?me.warning:me.success,children:_Q(s,a,u)}),(0,He.jsx)(k,{dimColor:!0,children:` \xB7 ${RQ(E)}`})]}),oe.length?(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"OUTCOME "}),(0,He.jsx)(k,{children:oe.join(" \xB7 ")})]}):null,e.mission.summary?(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"SUMMARY "}),(0,He.jsx)(k,{children:Ri(e.mission.summary,Math.max(18,t-10))})]}):null,(0,He.jsxs)(Qe,{flexDirection:"column",children:[(0,He.jsx)(k,{dimColor:!0,children:"AI RESEARCH TEAM"}),lp.map(X=>{let Z=y.get(X),ge=Z?.status??"waiting",he=ge==="active"?"\u25CF":ge==="done"?"\u2713":ge==="rejected"||ge==="error"?"!":"\u25CB",ue=ge==="rejected"||ge==="error"?me.error:ge==="done"?me.success:ge==="active"?me.role[X]??me.info:"gray";return(0,He.jsxs)(Qe,{children:[(0,He.jsx)(Qe,{width:11,children:(0,He.jsx)(k,{color:me.role[X]??"white",bold:!0,children:X.toUpperCase()})}),(0,He.jsxs)(k,{color:ue,children:[he," "]}),(0,He.jsx)(k,{color:ge==="waiting"?"gray":void 0,dimColor:ge==="waiting",children:Ri(Z?.label||(ge==="waiting"?"Waiting":_f(ge)),Math.max(20,t-16))})]},X)})]}),(0,He.jsxs)(k,{wrap:"truncate-end",children:[(0,He.jsx)(k,{dimColor:!0,children:"TIMELINE "}),J?(0,He.jsx)(k,{color:DI(J),children:Ri(J.title+(J.detail?` \xB7 ${J.detail}`:""),Math.max(18,t-12))}):(0,He.jsx)(k,{dimColor:!0,children:"Waiting for structured research events\u2026"})]})]})}return(0,He.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,He.jsx)(k,{dimColor:!0,children:"MISSION"}),(0,He.jsx)(k,{bold:!0,children:Ri(I,Math.max(24,t-2))}),(0,He.jsxs)(Qe,{marginTop:1,gap:t>=76?4:2,children:[(0,He.jsx)(k,{dimColor:!0,children:"STAGE "}),(0,He.jsx)(k,{color:me.info,children:Ri(O,t<76?14:22)}),(0,He.jsx)(k,{dimColor:!0,children:" ELAPSED "}),(0,He.jsx)(k,{children:AI(e.mission.elapsed_seconds)})]}),(0,He.jsxs)(Qe,{gap:t>=76?4:2,children:[(0,He.jsx)(k,{dimColor:!0,children:"ROUND "}),(0,He.jsx)(k,{children:ne})]}),G?(0,He.jsxs)(Qe,{children:[(0,He.jsx)(k,{dimColor:!0,children:"MODE "}),(0,He.jsx)(k,{wrap:"wrap",children:G})]}):null,(0,He.jsxs)(Qe,{children:[(0,He.jsx)(k,{dimColor:!0,children:"MODEL SPEND "}),(0,He.jsx)(k,{color:a==="partial"||a==="unpriced"?me.warning:me.success,children:_Q(s,a,u)})]}),(0,He.jsxs)(Qe,{children:[(0,He.jsx)(k,{dimColor:!0,children:"REQUESTS "}),(0,He.jsx)(k,{dimColor:!0,wrap:"truncate-end",children:RQ(E)})]}),oe.length?(0,He.jsxs)(Qe,{children:[(0,He.jsx)(k,{dimColor:!0,children:"OUTCOME "}),(0,He.jsx)(k,{wrap:"truncate-end",children:oe.join(" \xB7 ")})]}):null,e.mission.summary?(0,He.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,He.jsx)(k,{dimColor:!0,children:"MISSION SUMMARY"}),(0,He.jsx)(k,{wrap:"wrap",children:e.mission.summary})]}):null,(0,He.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,He.jsx)(k,{dimColor:!0,children:"AI RESEARCH TEAM"}),R?(0,He.jsx)(k,{dimColor:!0,children:`handoff \xB7 ${R}`}):null,lp.map(J=>{let X=y.get(J),Z=X?.status??"waiting",ge=Z==="active"?"\u25CF":Z==="done"?"\u2713":Z==="rejected"||Z==="error"?"!":"\u25CB",he=Z==="rejected"||Z==="error"?me.error:Z==="done"?me.success:Z==="active"?me.role[J]??me.info:"gray";return(0,He.jsxs)(Qe,{children:[(0,He.jsx)(Qe,{width:11,children:(0,He.jsx)(k,{color:me.role[J]??"white",bold:!0,children:J.toUpperCase()})}),(0,He.jsxs)(k,{color:he,children:[ge," "]}),(0,He.jsx)(k,{color:Z==="waiting"?"gray":void 0,dimColor:Z==="waiting",children:Ri(X?.label||(Z==="waiting"?"Waiting":_f(Z)),Math.max(20,t-16))})]},J)})]}),(0,He.jsxs)(Qe,{flexDirection:"column",marginTop:1,children:[(0,He.jsx)(k,{dimColor:!0,children:"LIVE RESEARCH TIMELINE"}),C.length?C.map(J=>(0,He.jsxs)(Qe,{children:[(0,He.jsx)(k,{dimColor:!0,children:`${new Date(J.ts*1e3).toISOString().slice(11,16)} `}),(0,He.jsxs)(k,{color:DI(J),children:[J.tone==="error"?"!":J.tone==="success"||J.tone==="skill"?"\u2713":"\xB7"," "]}),(0,He.jsx)(k,{color:DI(J),children:Ri(J.title+(J.detail?` \xB7 ${J.detail}`:""),Math.max(18,t-10))})]},J.id)):(0,He.jsx)(k,{dimColor:!0,children:" Waiting for structured research events\u2026"})]})]})}var Wb=/(?:\u001b)?\[200~/g,Kb=/(?:\u001b)?\[201~/g;function Jb(e){return e.replace(Wb,"").replace(Kb,"").replace(/\r\n/g,` +`))}scheduleAnchor(){!this.enabled||this.disposed||!this.active||(this.cancelAnchor(),this.pending=setImmediate(()=>{this.pending=null,this.anchorAtInput()}))}cancelAnchor(){this.pending&&(clearImmediate(this.pending),this.pending=null)}anchorAtInput(){if(this.anchored||!this.active||this.disposed)return;let{target:t}=this.active,r=t.rowsAboveFrameBottom+(this.baseAfterNewline?1:0);this.rawWrite("\r"+(r>0?ko.cursorUp(r):"")+(t.column>0?ko.cursorForward(t.column):"")+ko.cursorShow),this.anchoredRows=r,this.anchored=!0}restoreFrameCursor(){this.anchored&&(this.rawWrite(ko.cursorHide+"\r"+(this.anchoredRows>0?ko.cursorDown(this.anchoredRows):"")+"\r"),this.anchoredRows=0,this.anchored=!1)}};function tQ(e,t={}){let r=new pI(e,t.force);return{stdout:r.stdout,controller:r,dispose:()=>r.dispose()}}var si=Le(Pt(),1),nQ=4,eF="talk to Argus \u203A ",tF="\u203A ";function oQ(e){return e===` +`?"\u21B5":e===" "?"\u21E5":e}function rF(e,t){let r=e[e.length-1];if(r&&r.kind===t.kind&&t.kind!=="caret"){r.text+=t.text,r.width+=t.width;return}e.push({...t})}function nF(e,t){let r=[],i=[],s=0;for(let a of e)i.length>0&&a.width>0&&s+a.width>t&&(r.push(i),i=[],s=0),rF(i,a),s+=a.width;return i.length>0&&r.push(i),r}function oF(e,t){let r=Array.from(e.value),i=Math.max(0,Math.min(e.cursor,r.length)),s=r.map(O=>dn(oQ(O))),a=i===r.length?1:0;if(s.reduce((O,G)=>O+G,0)+a<=t)return{chars:r,cursor:i,start:0,end:r.length};let E=Math.max(1,t-2-a),I=i,h=i,y=0;i0&&R+s[I-1]<=D;)I-=1,R+=s[I],y+=s[I];for(;h0&&y+s[I-1]<=E;)I-=1,y+=s[I];return{chars:r,cursor:i,start:I,end:h}}function iF(e,t){let r=t*nQ-(nQ-1),{chars:i,cursor:s,start:a,end:u}=oF(e,r),E=[];a>0&&E.push({kind:"dim",text:"\u2026",width:1});for(let D=a;D{let O=0;for(let G of D){if(G.kind==="caret")return h=R,y=O,!0;O+=G.width}return!1}),{rows:I,clipped:a>0||u(0,si.jsx)(N,{wrap:"truncate-end",children:E.map((h,y)=>h.kind==="caret"?u?(0,si.jsx)(N,{children:h.text==="\u258F"?" ":h.text},y):(0,si.jsx)(N,{inverse:!0,children:h.text},y):(0,si.jsx)(N,{dimColor:h.kind==="dim",children:h.text},y))},I)),a.clipped?(0,si.jsx)(ye,{justifyContent:"flex-end",children:(0,si.jsx)(N,{dimColor:!0,wrap:"truncate-end",children:`${a.length} chars`})}):null]})]})}var sQ=Le(jt(),1);var dA=Le(Pt(),1),EI=8,sF=3,AF=10;function AQ(e){let t=Number.isFinite(e)?Math.max(1,Math.floor(e)):24;return Math.max(1,Math.min(EI,t-sF-AF))}function aF(e,t,r,i=0){if(e<=0)return{start:0,end:0,selected:-1};let s=Number.isFinite(r)?Math.floor(r):EI,a=Math.max(1,Math.min(e,s)),u=Math.max(0,Math.min(e-1,t)),E=Math.max(0,Math.min(e-a,i));return u=E+a&&(E=u+1-a),{start:E,end:E+a,selected:u}}function aQ({items:e,selected:t,maxVisible:r=EI}){let i=(0,sQ.useRef)(0),s=aF(e.length,t,r,i.current);return i.current=s.start,e.length===0?(i.current=0,null):(0,dA.jsxs)(ye,{flexDirection:"column",marginTop:1,marginLeft:1,overflow:"hidden",children:[e.slice(s.start,s.end).map((a,u)=>{let I=s.start+u===s.selected;return(0,dA.jsx)(ye,{height:1,width:"100%",overflow:"hidden",children:(0,dA.jsxs)(N,{wrap:"truncate-end",children:[(0,dA.jsxs)(N,{color:I?Ie.accent:void 0,bold:I,children:[I?"\u276F ":" ",a.name,a.arg?` ${a.arg}`:""]}),(0,dA.jsx)(N,{dimColor:!0,children:` ${a.desc}`})]})},a.name)}),(0,dA.jsx)(ye,{height:1,overflow:"hidden",children:(0,dA.jsx)(N,{dimColor:!0,wrap:"truncate-end",children:` \u2191\u2193 ${s.selected+1}/${e.length} \xB7 Tab complete \xB7 Esc dismiss`})})]})}var uQ=Le(Pt(),1),lF="Enter send \xB7 Ctrl-R rewrite \xB7 / commands \xB7 scroll up \xB7 Ctrl-C quit UI",uF="Enter send \xB7 Ctrl-R rewrite \xB7 / commands \xB7 Ctrl-C quit UI";function lQ({notice:e,health:t,width:r}){let i=e||(t?`\u26A0 ${t}`:"")||(r<132?uF:lF),s=Math.max(12,r-2),a=i.length<=s?i:`${i.slice(0,s-1)}\u2026`;return(0,uQ.jsx)(N,{dimColor:!0,wrap:"truncate-end",children:a})}var mI=()=>Date.now()/1e3;function cQ(e){return e.trim().replace(/[.…]+$/u,"").toLowerCase()}function fQ(e,t,r=mI()){let i=(t.label??"").trim();if(!i)return e;let s=t.heartbeat===!0,a=e.slice(),u=a[a.length-1];if(u&&!u.endedTs){if(cQ(u.label)===cQ(i)||s&&u.heartbeat)return a[a.length-1]={...u,label:i,detail:t.detail||u.detail,kind:t.kind||u.kind,heartbeat:s,endedTs:0},a;a[a.length-1]={...u,endedTs:r}}return a.push({id:`${a.length}:${i}:${r}`,role:(t.role||"manager").trim()||"manager",label:i,detail:(t.detail||"").trim(),kind:(t.kind||"").trim(),startedTs:r,endedTs:0,heartbeat:s}),a}function gQ(e,t=mI()){if(e.length===0)return[];let r=e.slice(),i=r[r.length-1];return i&&!i.endedTs&&(r[r.length-1]={...i,endedTs:t}),r}function dQ(e,t=6){let r=Math.max(1,t);return e.length<=r?e:e.slice(e.length-r)}function II(e,t=mI()){let r=e.endedTs||t;return Math.max(0,r-e.startedTs)}function hI(e){if(!Number.isFinite(e)||e<1)return"";if(e<60)return`${Math.floor(e)}s`;let t=Math.floor(e/60),r=Math.floor(e%60);return r?`${t}m${r}s`:`${t}m`}function pQ(e){let t=e.filter(i=>!i.heartbeat&&i.label.trim());if(t.length===0)return"";let r=t.map(i=>{let s=hI(II(i,i.endedTs||i.startedTs));return` ${i.label}${s?` \xB7 ${s}`:""}`});return[`did ${t.length} step${t.length===1?"":"s"}:`,...r].join(` +`)}var Lo=Le(Pt(),1);function EQ({tick:e,phase:t,elapsedS:r,heartbeat:i=!1,quietS:s=0,steps:a=[],width:u=80}){let E=dI(e),I=Jy(t,e,i,s),h=dQ(a),y=Date.now()/1e3,D=u>=100;return(0,Lo.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Lo.jsxs)(N,{wrap:"truncate-end",children:[" ",(0,Lo.jsx)(N,{color:Ie.role.manager??"magenta",children:E})," ",(0,Lo.jsx)(N,{color:Ie.role.manager??"magenta",bold:!0,children:"Your message"})," ",(0,Lo.jsx)(N,{color:Ie.accent,children:I}),(0,Lo.jsx)(N,{dimColor:!0,children:` ${r}s`})]}),h.map((R,O)=>{let G=O===h.length-1&&!R.endedTs,ne=hI(II(R,y));return(0,Lo.jsxs)(N,{wrap:"truncate-end",children:[" ",(0,Lo.jsx)(N,{color:G?Ie.role[R.role]??Ie.info:Ie.success,children:G?E:"\u2713"})," ",(0,Lo.jsx)(N,{dimColor:!G,children:R.label}),ne?(0,Lo.jsx)(N,{dimColor:!0,children:` \xB7 ${ne}`}):null,D&&R.detail&&R.detail!==R.label?(0,Lo.jsx)(N,{dimColor:!0,children:` \xB7 ${R.detail}`}):null]},R.id)}),(0,Lo.jsx)(N,{dimColor:!0,children:" Esc stop waiting \xB7 /cancel"})]})}var Tu=Le(Pt(),1);function mQ({alert:e}){if(!e)return null;let t=e.tone==="block",r=t?Ie.error:Ie.warning;return(0,Tu.jsxs)(ye,{marginTop:1,borderStyle:"round",borderColor:r,paddingX:1,children:[(0,Tu.jsxs)(N,{color:r,bold:!0,children:[t?"\u26D4":"\u{1F441}"," ",t?"NEEDS YOU":"WATCHING"]}),(0,Tu.jsx)(N,{children:" "}),(0,Tu.jsx)(N,{color:r,children:e.text})]})}var ip=Le(jt(),1);var cF={name:80,objective:4e3};function Sf(e="",t=e.trim()?"objective":"name"){return{name:aA,objective:lA(e),field:t,busy:!1,error:""}}function Ou(e){return{name:e.name.value.trim(),objective:e.objective.value.trim()}}function fF(e){return e==="name"?"objective":"name"}function vs(e,t){return{...e,[e.field]:t(e[e.field]),error:""}}function _f(e,t,r){return e.busy?{draft:e}:r.escape?{draft:e,intent:"cancel"}:r.return?{draft:e,intent:"submit"}:r.tab||r.upArrow||r.downArrow?{draft:{...e,field:fF(e.field)}}:r.leftArrow||r.ctrl&&t==="b"?{draft:vs(e,Va)}:r.rightArrow||r.ctrl&&t==="f"?{draft:vs(e,qa)}:r.ctrl&&t==="a"?{draft:vs(e,jd)}:r.ctrl&&t==="e"?{draft:vs(e,Yd)}:r.ctrl&&t==="w"?{draft:vs(e,bu)}:r.ctrl&&t==="u"?{draft:vs(e,Fu)}:r.ctrl&&t==="k"?{draft:vs(e,xu)}:r.backspace?{draft:vs(e,Ru)}:r.delete?{draft:vs(e,Cy)}:t&&!r.ctrl&&!r.meta?{draft:vs(e,i=>{let s=cF[e.field]-Array.from(i.value).length;return s>0?uA(i,Array.from(t).slice(0,s).join("")):i})}:{draft:e}}var wr=Le(Pt(),1);function IQ({field:e,label:t,edit:r,active:i}){let{before:s,at:a,after:u}=By(r);return(0,wr.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,wr.jsx)(N,{color:i?Ie.accent:void 0,bold:i,dimColor:!i,children:`${i?"\u203A":" "} ${t} (optional)`}),(0,wr.jsx)(ye,{paddingLeft:2,children:i?(0,wr.jsxs)(wr.Fragment,{children:[(0,wr.jsx)(N,{children:s}),a?(0,wr.jsx)(N,{inverse:!0,children:a}):(0,wr.jsx)(N,{color:Ie.accent,children:"\u258F"}),(0,wr.jsx)(N,{children:u})]}):r.value?(0,wr.jsx)(N,{children:r.value}):(0,wr.jsx)(N,{dimColor:!0,children:e==="name"?"generated automatically":"start with a conversation"})})]})}function sp({draft:e,title:t="/new \u2014 open a fresh daemon",cancelHint:r="Esc/Ctrl-C cancel"}){let[i,s]=(0,ip.useState)(0);(0,ip.useEffect)(()=>{if(!e.busy)return;let I=setInterval(()=>s(h=>h+1),90);return()=>clearInterval(I)},[e.busy]);let{objective:a}=Ou(e),u=!!a,E=u?"create & start":"create idle daemon";return(0,wr.jsxs)(ye,{flexDirection:"column",borderStyle:"round",borderColor:Ie.border,paddingX:2,marginTop:1,children:[(0,wr.jsx)(N,{bold:!0,color:Ie.accent,children:t}),(0,wr.jsx)(N,{dimColor:!0,children:"A clean Manager context with its own project timeline."}),(0,wr.jsx)(IQ,{field:"name",label:"Name",edit:e.name,active:e.field==="name"}),(0,wr.jsx)(IQ,{field:"objective",label:"Objective",edit:e.objective,active:e.field==="objective"}),(0,wr.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,wr.jsx)(N,{color:u?Ie.accent:Ie.info,children:u?"\u25CF Campaign starts immediately":"\u25CB Idle until you message Argus"}),(0,wr.jsx)(N,{dimColor:!0,children:u?"The objective is persisted, continuous mode is armed, and the executor starts.":"No executor is spawned yet; your first message can reply or dispatch work."})]}),(0,wr.jsx)(ye,{marginTop:1,children:e.error?(0,wr.jsx)(N,{color:Ie.error,children:`Could not create daemon \xB7 ${e.error} \xB7 Enter to retry`}):e.busy?(0,wr.jsx)(N,{color:Ie.accent,children:`${ku[i%ku.length]} ${u?"creating daemon + starting campaign\u2026":"creating idle daemon\u2026"}`}):(0,wr.jsx)(N,{dimColor:!0,children:`Tab/\u2191\u2193 field \xB7 Enter ${E} \xB7 ${r}`})}),(0,wr.jsx)(N,{children:" "})]})}function hQ(e){let t=(e.label||e.display_name||"").trim();return!!(t&&t!==e.id)}function is(e){return[...e].sort((t,r)=>{if(t.daemon_alive!==r.daemon_alive)return t.daemon_alive?-1:1;let i=hQ(t),s=hQ(r);return i!==s?i?-1:1:(r.last_active||0)-(t.last_active||0)})}function gF(e){return is(e)[0]}function BQ(e,t){let r=t?.trim()||null;return r&&e.some(i=>i.id===r)?{id:r,requested:r,recovered:!1}:{id:gF(e)?.id??null,requested:r,recovered:!!r}}function dF(e,t){let r=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return!0;let i=e.daemon_alive?"live running":"stopped idle",s=[e.id,e.label,e.display_name,e.objective,i].filter(Boolean).join(" ").toLowerCase();return r.every(a=>s.includes(a))}function Za(e,t){return e.filter(r=>dF(r,t))}function CI(e){let t=e.trim(),r=t.includes("\\")||/^[A-Za-z]:[\\/]/.test(t),s=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\/+$/,"")||"/";return r?s.toLowerCase():s}function CQ(e,t){return e===t?!0:t==="/"?e.startsWith("/"):e.startsWith(`${t}/`)}function Ap(e,t,r=!1){if(r)return e;let i=CI(t);return e.filter(s=>{let a=(s.launch_cwd||"").trim();if(a){let I=CI(a);return CQ(I,i)}let u=(s.cwd||"").trim();if(!u)return!1;let E=CI(u);return E.includes("/.argus-skill/projects/")?!1:CQ(E,i)})}var pF=new Set(["done","completed","failed","skipped"]);function EF(e){return pF.has(e.status)}function ap(e,t){return e.filter(r=>EF(r)===t)}var mF=120,hr=(e,t)=>String(e[t]??"").trim(),eo=(e,t)=>{let r=Number(e[t]);return Number.isFinite(r)?r:0};function yQ(e,t=180){let r=String(e??"").split(` +`).find(i=>i.trim())?.trim()??"";return r.length<=t?r:`${r.slice(0,t-1).trimEnd()}\u2026`}function IF(e){let t=e.toLowerCase();return t.includes("compaction_batch")||t.includes("compaction-batch")?"maintenance":t.includes("reviewer")||t.startsWith("review")?"reviewer":t.includes("planner")||t.startsWith("plan")?"planner":t.includes("manager")||t.startsWith("router")||t.startsWith("chat-")||t.startsWith("simple-")?"manager":"engineer"}function DQ(e){let t=e.match(/(?:^|[-_.])r(?:ound)?[-_.]?(\d+)/i);return t?` \xB7 round ${t[1]}`:""}function hF(e){let t=e.toLowerCase(),r=IF(e);if(r==="maintenance")return{role:r,label:"compacting the reusable skill library"};if(t==="matcher"||t.includes("skill-match"))return{role:"engineer",label:"matching reusable skills"};if(t==="idea-search"||t.includes("idea.search"))return{role:"engineer",label:"searching recent papers + generating candidate ideas"};if(t.includes("distill")||t.includes("scientist"))return{role:"engineer",label:"building a task-specific playbook"};if(r==="reviewer")return{role:r,label:`reviewing evidence${DQ(t)}`};if(r==="planner")return{role:r,label:"planning the next work"};if(t.includes("vertical"))return{role:"manager",label:"choosing the task workflow"};if(r==="manager")return{role:r,label:"handling the operator request"};if(t.startsWith("engineer")||t.startsWith("main"))return{role:"engineer",label:`working on the mission${DQ(t)}`};let i=e.replace(/[._-]+/g," ").replace(/\s+/g," ").trim();return{role:r,label:i?`running ${i}`:"working"}}function CF(e,t,r){let i=e.toLowerCase();return i==="matcher"?"phase:matcher":i==="idea-search"?"phase:idea-search":t||`run:${e||"unknown"}:${r}`}function BF(e,t){let r=Number(e.split("-",1)[0]);return Number.isFinite(r)&&r>0?r/1e3:t}function DF(e){if(hr(e,"type")!=="agent.io.stream")return"";try{let t=JSON.parse(hr(e,"line")),r=t.data&&typeof t.data=="object"?t.data:{},i=String(t.model??r.model??"").trim();return/^[A-Za-z0-9._:/+-]{1,80}$/.test(i)?i:""}catch{return""}}function yF(e){let t=hr(e,"type");if(!["agent.io.start","agent.io.stream","agent.io.complete","agent.io.error"].includes(t))return e;let r=hr(e,"run_label"),i=hr(e,"call_id"),s=eo(e,"ts")||Date.now()/1e3,a=hF(r),u=e.exit_code,E=t==="agent.io.error"||typeof u=="number"&&u!==0||e.turn_failed===!0||!!hr(e,"fatal_error"),I=["agent.io.start","agent.io.stream"].includes(t)?"running":E?"error":"done",h={type:"role.activity",activity_id:CF(r,i,s),role:a.role,label:a.label,status:I,run_label:r,ts:s};I==="running"&&(h.started_ts=BF(i,s)),t==="agent.io.stream"&&(h.heartbeat=!0);let y=hr(e,"model")||DF(e),D=hr(e,"backend");return y&&(h.model=y),D&&(h.backend=D),E&&(h.error=yQ(hr(e,"fatal_error")||hr(e,"error")||`exit ${u}`)),h}function QF(e){let t=hr(e,"text"),r=t.toLowerCase(),i=eo(e,"ts")||Date.now()/1e3,s=r.includes("matcher picked:"),a=r.includes("no match")||r.includes("matched: none"),u="matching reusable skills",E=yQ(t,120);if(s){let I=t.split(":").slice(1).join(":").split("(")[0].trim();u=I?`selected skill \xB7 ${I}`:"selected a reusable skill",E=""}else if(a)u="no reusable skill matched",E="";else{let I=t.match(/\(([^)]+)\) against (\d+) candidates/i),h=t.match(/pool\s+(\d+)→(\d+)/i);I?E=`${I[1]} \xB7 ${I[2]} candidates`:h&&(E=`${h[1]}\u2192${h[2]} candidates`)}return{type:"role.activity",activity_id:"phase:matcher",role:"engineer",label:u,detail:E,status:s||a?"done":"running",milestone:s||a,started_ts:i,ts:i}}function wF(e){let t=hr(e,"type"),r=eo(e,"ts")||Date.now()/1e3,i=eo(e,"count");return t==="idea.search.completed"?{type:"role.activity",activity_id:"phase:idea-search",role:"engineer",label:i?`generated ${i} candidate ideas`:"candidate idea search completed",status:"done",milestone:!0,ts:r}:t==="idea.search.skipped"?{type:"role.activity",activity_id:"phase:idea-search",role:"engineer",label:"candidate idea search skipped",status:"done",ts:r}:{type:"role.activity",activity_id:"phase:idea-search",role:"engineer",label:"searching recent papers + generating candidate ideas",status:"running",started_ts:r,ts:r}}function vF(e){let t=hr(e,"type");return t.startsWith("agent.io.")?yF(e):t==="match.info"?QF(e):t.startsWith("idea.search.")?wF(e):e}function SF(e,t){let r=eo(e,"started_ts"),i=eo(t,"started_ts"),s=r&&i?Math.min(r,i):r||i||eo(e,"ts")||eo(t,"ts"),a={...e,...t,started_ts:s},u=hr(a,"status"),E=eo(a,"ts");return u!=="running"&&s&&E>=s&&(a.elapsed_s=E-s),a}function lp(e,t,r=400){let i=vF(t);if(!i)return e;if(i.type==="ui.operator"||i.type==="ui.argus"){let a=hr(i,"text"),u=eo(i,"ts"),E=hr(i,"message_id");if(E&&e.some(D=>hr(D,"confirmed_message_id")===E))return e;let h=E?e.findIndex(D=>D.type===i.type&&hr(D,"text")===a&&D.local_optimistic===!0):-1;if(h>=0){let D=e.slice();return D[h]={...D[h],local_optimistic:!1,confirmed_message_id:E},D}if(e.some(D=>{let R=hr(D,"message_id");return D.type===i.type&&hr(D,"text")===a&&Math.abs(eo(D,"ts")-u)<=2&&!(E&&R&&E!==R)}))return e}if(i.type==="role.activity"){let a=hr(i,"activity_id"),u=e.findIndex(E=>E.type==="role.activity"&&hr(E,"activity_id")===a);if(u>=0){if(i.heartbeat===!0&&eo(i,"ts")-eo(e[u],"ts")<1)return e;let E=e.slice();return E[u]=SF(E[u],i),E}}else{let a=XA(i);if(e.some(u=>XA(u)===a))return e}let s=e.concat(i);return s.length>r?s.slice(s.length-r):s}function QQ(e){if(e.type!=="role.activity")return null;let t=eo(e,"started_ts")||eo(e,"ts"),r=eo(e,"ts")||t;return{id:hr(e,"activity_id"),role:hr(e,"role")||"engineer",label:hr(e,"label")||"working",detail:hr(e,"detail"),status:hr(e,"status")||"running",startedTs:t,updatedTs:r,elapsedS:eo(e,"elapsed_s")||Math.max(0,r-t),model:hr(e,"model"),backend:hr(e,"backend"),milestone:!!e.milestone}}function _F(e,t=[]){let r=new Set(t),i=Date.now()/1e3;return e.map(QQ).filter(s=>s?.status==="running"&&!r.has(s.role)&&i-s.updatedTs<=mF).sort((s,a)=>a.updatedTs-s.updatedTs)}function wQ(e,t){let r=new Map(_F(t).map(u=>[u.role,u])),i=new Set(e.map(u=>u.role)),s=Date.now()/1e3,a=e.map(u=>{let E=r.get(u.role);return E?{...u,active:!0,label:E.label,status:"running",age_s:Math.max(0,s-E.updatedTs)}:u});for(let u of r.values())i.has(u.role)||a.push({role:u.role,backend:u.backend,backend_label:u.backend,model:u.model,effort:null,active:!0,label:u.label,status:"running",age_s:Math.max(0,s-u.updatedTs)});return a}function vQ(e,t,r,i=0){let s=r.trim()||"working",a=Math.max(0,i),u=!1,E=e.map(I=>I.role!==t?I:(u=!0,{...I,active:!0,label:s,status:"running",age_s:a}));return u?E:E.concat({role:t,backend:"",backend_label:"",model:"",effort:null,active:!0,label:s,status:"running",age_s:a})}function SQ(e,t=10){return e.map(QQ).filter(r=>!!r).sort((r,i)=>r.updatedTs-i.updatedTs).slice(-t)}function BI(e,t){return!t||t<=0?0:Math.min(1,Math.max(0,e/t))}var ss=Le(Pt(),1);function _Q({settledUsd:e,spendStatus:t,usageSummary:r,daemon:i,requestUsage:s,costControl:a,width:u}){let E=i?.global_daily_cap_usd??null,I=e??0,h=t==="partial"||t==="unpriced";if(I<=0&&!h&&!E&&!s&&!a?.active_reservations&&!a?.unresolved_calls)return null;let y=BI(I,E),D=y<.6?Ie.success:y<.85?Ie.warning:Ie.error,R=s?.codex,O=s?.copilot;return(0,ss.jsxs)(ye,{flexDirection:"column",children:[I>0||h||E?(0,ss.jsxs)(ye,{children:[(0,ss.jsx)(N,{dimColor:!0,children:"model/API spend "}),(0,ss.jsx)(N,{color:D,children:e==null&&h?t:`$${I.toFixed(2)}${h?"+":""}`}),h&&e!=null?(0,ss.jsx)(N,{dimColor:!0,children:` \xB7 ${t}`}):null,E?(0,ss.jsx)(N,{dimColor:!0,children:` \xB7 model cap $${E.toFixed(0)}/d`}):null]}):null,s?(0,ss.jsx)(N,{dimColor:!0,wrap:"truncate-end",children:u<80?`requests \xB7 C ${R?.daily_calls??0}/${R?.daily_cap||"\u221E"} \xB7 P ${O?.daily_calls??0}/${O?.daily_cap||"\u221E"}`:`requests today \xB7 Codex ${R?.daily_calls??0}/${R?.daily_cap||"\u221E"} \xB7 Copilot ${O?.daily_calls??0}/${O?.daily_cap||"\u221E"} \xB7 premium ${(O?.premium_requests??0).toFixed(1)}/${O?.premium_cap||"\u221E"}`}):null,a&&(a.active_reservations>0||a.unresolved_calls>0)?(0,ss.jsx)(N,{color:(a.blocking_unresolved_calls??0)>0?Ie.error:void 0,dimColor:(a.blocking_unresolved_calls??0)===0,children:`cost control \xB7 in-flight ${a.active_reservations} \xB7 unresolved ${a.unresolved_calls}`}):null,r&&r.call_count>0?(0,ss.jsx)(N,{dimColor:!0,wrap:"truncate-end",children:u<80?`tokens \xB7 in ${r.input_tokens} \xB7 out ${r.output_tokens}`:`tokens \xB7 input ${r.input_tokens} \xB7 cache read ${r.cached_input_tokens} \xB7 cache write ${r.cache_write_tokens} \xB7 output ${r.output_tokens} \xB7 reasoning ${r.reasoning_output_tokens}`}):null]})}var te=Le(Pt(),1);function fo({title:e,children:t,page:r=0,pages:i=1,hint:s}){return(0,te.jsxs)(ye,{flexDirection:"column",borderStyle:"round",borderColor:Ie.border,paddingX:2,marginTop:1,children:[(0,te.jsx)(N,{bold:!0,color:Ie.accent,children:e}),(0,te.jsx)(ye,{flexDirection:"column",marginTop:1,children:t}),(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:s??(i>1?`\u2191/k \u2193/j page ${r+1}/${i} \xB7 Enter/Esc close`:"Enter/Esc close")})]})}var RQ=e=>e?"\u25CF":"\u25CB";function bQ({panel:e,snap:t,viewportRows:r,activeProject:i,events:s=[],viewportColumns:a=80}){let u=Math.max(4,r-10);if(e.loading)return(0,te.jsx)(fo,{title:e.kind,children:(0,te.jsx)(N,{dimColor:!0,children:"loading\u2026"})});if(e.error)return(0,te.jsx)(fo,{title:e.kind,children:(0,te.jsx)(N,{color:Ie.error,children:e.error})});switch(e.kind){case"operations":return(0,te.jsx)(RF,{snap:t,events:s,width:a,height:r});case"help":return(0,te.jsx)(bF,{page:e.page??0,pageSize:u});case"status":return(0,te.jsx)(FF,{s:e.data});case"doctor":return(0,te.jsx)(xF,{r:e.data});case"backlog":return(0,te.jsx)(kF,{items:t?.backlog??[],all:!!e.all,selected:e.selection??0,pageSize:u});case"journal":return(0,te.jsx)(OF,{entries:e.data??[],page:e.page??0,pageSize:u});case"config":return(0,te.jsx)(LF,{c:e.data});case"identity":return(0,te.jsx)(MF,{text:e.data??"",page:e.page??0,pageSize:u});case"daemons":return(0,te.jsx)(PF,{rows:e.data??[],selected:e.selection??0,pageSize:u,activeProject:i,query:e.query??""});case"artifacts":return(0,te.jsx)(UF,{rows:e.data??[],selected:e.selection??0,pageSize:Math.max(2,Math.floor(u/2))});case"artifact":return(0,te.jsx)(GF,{artifact:e.data,page:e.page??0,pageSize:u});case"events":return(0,te.jsx)(NF,{events:s,filter:e.filter??"all",query:e.query??"",page:e.page??0,pageSize:Math.max(3,Math.floor(u/2)),width:a});case"task":return(0,te.jsx)(TF,{item:e.data,page:e.page??0,pageSize:u,width:a})}}function RF({snap:e,events:t,width:r,height:i}){if(!e)return(0,te.jsx)(fo,{title:"Operations",hint:"Esc close",children:(0,te.jsx)(N,{dimColor:!0,children:"loading\u2026"})});let s=SQ(t,8),a=e.observability?.slo,u=e.mission_view?.storage,E=i<=24,I=i<=20,h=I?e.roles.slice(0,2):e.roles;return(0,te.jsxs)(fo,{title:"Operations",hint:"Esc close \xB7 /status and /doctor for details",children:[(0,te.jsx)(Fn,{k:"daemon",v:e.daemon.alive?`\u25CF pid ${e.daemon.pid??"\u2014"} \xB7 ${Math.floor((e.daemon.uptime_seconds??0)/60)}m`:"\u25CB stopped",c:e.daemon.alive?Ie.success:"gray"}),(0,te.jsx)(Fn,{k:"backend",v:e.daemon.backend_label||e.daemon.backend||"\u2014"}),I?null:(0,te.jsx)(Fn,{k:"protocol",v:`${e.daemon.protocol?.name||"\u2014"}/${e.daemon.protocol?.major??"\u2014"}.${e.daemon.protocol?.minor??"\u2014"}`}),E?null:(0,te.jsx)(N,{children:" "}),(0,te.jsx)(_Q,{settledUsd:e.global_spend_usd,spendStatus:e.global_spend_status,usageSummary:e.global_usage_summary,daemon:e.daemon,requestUsage:e.request_usage,costControl:e.cost_control,width:r}),E?null:(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:"roles"}),h.map(y=>(0,te.jsxs)(N,{children:[(0,te.jsx)(N,{color:Ie.role[y.role]??"white",children:y.role.padEnd(10)}),(0,te.jsx)(N,{dimColor:!0,children:`${y.backend_label||y.backend} \xB7 ${y.model||"\u2014"} \xB7 ${y.effort||"default"}`})]},y.role)),I&&e.roles.length>h.length?(0,te.jsx)(N,{dimColor:!0,children:` + ${e.roles.length-h.length} roles \xB7 /status`}):null,!E&&u&&(u.project_skill_dir||u.global_skill_dir||u.wiki_paths.length||u.skill_history_compressed||u.wiki_retired_compressed)?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:"self-evolution storage"}),u.project_skill_dir?(0,te.jsx)(Fn,{k:"project skills",v:`${u.project_skill_count} \xB7 ${u.project_skill_dir}`}):null,u.global_skill_dir?(0,te.jsx)(Fn,{k:"global skills",v:`${u.global_skill_count} \xB7 ${u.global_skill_dir}`}):null,u.wiki_paths.map((y,D)=>(0,te.jsx)(Fn,{k:D?"":"project wiki",v:y},y)),u.skill_history_compressed||u.wiki_retired_compressed?(0,te.jsx)(Fn,{k:"cold history",v:`skill ${u.skill_history_compressed} \xB7 wiki ${u.wiki_retired_compressed} \xB7 ${DI(u.skill_history_bytes_saved+u.wiki_retired_bytes_saved)} saved`}):null]}):null,E&&a?.status==="degraded"?(0,te.jsx)(Fn,{k:"SLO",v:a.violations[0]||"degraded",c:Ie.error}):a?.status==="degraded"?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{color:Ie.error,children:"SLO degraded"}),a.violations.slice(0,5).map(y=>(0,te.jsx)(N,{dimColor:!0,children:` ! ${y}`},y))]}):null,E&&s.length?(0,te.jsx)(Fn,{k:"activity",v:`${s[0]?.role} \xB7 ${s[0]?.label}`}):s.length?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:"recent observable activity"}),s.map(y=>(0,te.jsx)(N,{dimColor:!0,children:` \xB7 ${y.role} \xB7 ${y.label}`},y.id))]}):null]})}function pA(e,t,r){let i=Math.max(1,Math.ceil(e.length/r)),s=Math.min(Math.max(0,t),i-1);return{shown:e.slice(s*r,(s+1)*r),page:s,pages:i}}function bF({page:e,pageSize:t}){let r=iI().flatMap(s=>s.rows.map(a=>({...a,group:s.group}))),i=pA(r,e,t);return(0,te.jsxs)(fo,{title:"argus cockpit \u2014 commands",page:i.page,pages:i.pages,children:[(0,te.jsx)(N,{dimColor:!0,children:"type freely to chat/queue \xB7 commands start with /"}),(0,te.jsx)(N,{children:" "}),i.shown.map((s,a)=>(0,te.jsxs)(ye,{flexDirection:"column",children:[(a===0||i.shown[a-1]?.group!==s.group)&&(0,te.jsx)(N,{bold:!0,color:"cyan",children:s.group}),(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:Ie.accent,children:` ${s.label}`.padEnd(34)}),(0,te.jsx)(N,{dimColor:!0,children:s.desc})]})]},s.label))]})}function FF({s:e}){return(0,te.jsxs)(fo,{title:"/status",children:[(0,te.jsx)(Fn,{k:"daemon",v:e.daemon.alive?`\u25CF alive (pid ${e.daemon.pid})`:"\u25CB no daemon",c:e.daemon.alive?Ie.success:"gray"}),(0,te.jsx)(Fn,{k:"active role",v:e.active_role??"idle"}),(0,te.jsx)(Fn,{k:"continuous",v:e.continuous.enabled?`on \xB7 ${e.continuous.objective}`:"off"}),(0,te.jsx)(Fn,{k:"inbox",v:`${e.inbox_pending} pending`}),(0,te.jsx)(Fn,{k:"backlog",v:`${e.backlog_pending.length} pending`}),e.request_usage?(0,te.jsx)(Fn,{k:"requests",v:`Codex ${e.request_usage.codex.daily_calls}/${e.request_usage.codex.daily_cap||"\u221E"} \xB7 Copilot ${e.request_usage.copilot.daily_calls}/${e.request_usage.copilot.daily_cap||"\u221E"}`}):null,e.pending_questions.length>0?(0,te.jsx)(Fn,{k:"questions",v:`${e.pending_questions.length} awaiting you`,c:Ie.warning}):null,(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:"recent journal:"}),e.journal.length===0?(0,te.jsx)(N,{dimColor:!0,children:" (none)"}):e.journal.slice(-3).map(t=>(0,te.jsx)(N,{dimColor:!0,children:` \xB7 ${t.title||t.kind}`},t.id)),e.identity?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:`identity: ${e.identity.split(` +`)[0].slice(0,70)}`})]}):null]})}function xF({r:e}){return(0,te.jsxs)(fo,{title:"/doctor \u2014 why isn't anything running?",children:[e.checks.map(t=>(0,te.jsxs)(ye,{children:[(0,te.jsxs)(N,{color:t.ok?Ie.success:Ie.error,children:[RQ(t.ok)," "]}),(0,te.jsx)(N,{children:t.name.padEnd(20)}),(0,te.jsx)(N,{dimColor:!0,children:t.detail})]},t.name)),e.recommended?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{color:Ie.accent,children:`\u2192 recommended: ${e.recommended.fix||e.recommended.detail}`})]}):(0,te.jsx)(N,{color:Ie.success,children:` +\u2713 all checks pass`}),e.log_tail?(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:"recent daemon.log:"}),e.log_tail.split(` +`).slice(-6).map((t,r)=>(0,te.jsx)(N,{dimColor:!0,children:` ${t}`},r))]}):null]})}function kF({items:e,all:t,selected:r,pageSize:i}){let s=t?e:ap(e,!1),a=Math.min(Math.max(0,r),Math.max(0,s.length-1)),u=pA(s,Math.floor(a/i),i),E=I=>I==="pending"?"cyan":I==="running"?Ie.info:I==="done"||I==="completed"?Ie.success:I==="failed"||I==="blocked"?Ie.error:"gray";return(0,te.jsx)(fo,{title:`/backlog${t?" all":""}`,page:u.page,pages:u.pages,hint:`\u2191/k \u2193/j select${u.pages>1?` \xB7 page ${u.page+1}/${u.pages}`:""} \xB7 Enter details \xB7 Esc close`,children:s.length===0?(0,te.jsx)(N,{dimColor:!0,children:"(backlog is empty \u2014 type a task or /task )"}):u.shown.map((I,h)=>{let y=u.page*i+h===a;return(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:y?Ie.accent:"gray",children:y?"\u203A ":" "}),(0,te.jsx)(N,{color:E(I.status),children:I.status.padEnd(10)}),(0,te.jsx)(N,{dimColor:!0,children:`${I.id.slice(0,8)} `}),(0,te.jsx)(N,{bold:y,children:I.title||I.objective})]},I.id)})})}function NF({events:e,filter:t,query:r,page:i,pageSize:s,width:a}){let u=op(e),E=u.filter(y=>Sy(y.ev,y.r,t,r)).reverse(),I=pA(E,i,s),h=r?` \xB7 \u201C${r.slice(0,Math.max(8,a-34))}${r.length>a-34?"\u2026":""}\u201D`:"";return(0,te.jsx)(fo,{title:`/events ${t}${h} \xB7 ${E.length}/${u.length}`,page:I.page,pages:I.pages,children:E.length===0?(0,te.jsx)(N,{dimColor:!0,children:"(no events match this view)"}):I.shown.map(y=>(0,te.jsxs)(ye,{flexDirection:"column",children:[(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:np(y.r.role),bold:!0,children:`${y.r.label}`.padEnd(10)}),(0,te.jsx)(N,{color:rp(y.r.tone),children:`${["err","warn"].includes(y.r.tone)?"!":"\xB7"} ${y.r.text.slice(0,Math.max(18,a-19))}`})]}),(0,te.jsx)(N,{dimColor:!0,children:` ${String(y.ev.type??"event")}`})]},y.key))})}function el(e,t){let r=Math.max(20,t-8);return String(e||"").split(` +`).flatMap(i=>{if(!i)return[" "];let s=[];for(let a=0;a`${I?" ":"outcome "}${E}`):[],`priority p${e.priority}`,...el(`iteration ${e.iterate?"auto":"single"} \xB7 ${e.iteration_cycles_done??0}/${e.iteration_max_cycles??"\u2014"} cycles \xB7 cost $${(e.iteration_cost_usd??0).toFixed(2)}`,i),...e.pending_question?["","WAITING ON YOU",...el(e.pending_question,i)]:[],"","OBJECTIVE",...el(e.objective||e.original_objective||"(none)",i),...e.last_error?["","LAST ERROR",...el(e.last_error,i)]:[],...e.notes?["","NOTES",...el(e.notes,i)]:[],...e.tags?.length?["",...el(`tags ${e.tags.join(", ")}`,i)]:[],...e.deps?.length?el(`depends on ${e.deps.join(", ")}`,i):[]],u=pA(a,t,r);return(0,te.jsx)(fo,{title:`/item ${e.id} \u2014 ${(e.title||"task").slice(0,Math.max(10,i-e.id.length-18))}`,page:u.page,pages:u.pages,children:u.shown.map((E,I)=>{let h=["WAITING ON YOU","OBJECTIVE","LAST ERROR","NOTES"].includes(E);return(0,te.jsx)(N,{bold:h,color:E==="WAITING ON YOU"?Ie.warning:h?Ie.accent:void 0,children:E},`${u.page}-${I}`)})})}function OF({entries:e,page:t,pageSize:r}){let i=pA(e.slice(-20).reverse(),t,Math.max(2,Math.floor(r/2)));return(0,te.jsx)(fo,{title:"/journal",page:i.page,pages:i.pages,children:e.length===0?(0,te.jsx)(N,{dimColor:!0,children:"(no journal entries yet)"}):i.shown.map(s=>{let a=s.summary||"",u=s.extra?.final_submission_certified===!0;return(0,te.jsxs)(ye,{flexDirection:"column",children:[(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:s.kind==="mission_complete"?Ie.success:"cyan",children:`${s.kind}`.padEnd(18)}),(0,te.jsxs)(N,{children:[u?"\u2713 certified \xB7 ":"",s.title]})]}),a?(0,te.jsx)(N,{dimColor:!0,children:` ${a.slice(0,100)}`}):null]},s.id)})})}function LF({c:e}){return(0,te.jsxs)(fo,{title:"/config \u2014 runtime settings",children:[e.roles.map(t=>(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:Ie.role[t.role]??"white",children:`${t.role}`.padEnd(10)}),(0,te.jsx)(N,{dimColor:!0,children:`${t.backend_label} \xB7 ${t.model} \xB7 `}),(0,te.jsx)(N,{color:xy(t.effort),children:`effort ${t.effort??"\u2014"}`})]},t.role)),(0,te.jsx)(N,{children:" "}),(0,te.jsx)(N,{dimColor:!0,children:"NL-editable: model \xB7 effort \xB7 backend \xB7 caps \xB7 safe_mode"}),(0,te.jsx)(N,{dimColor:!0,children:"full list: argus-skill --config-help"})]})}function MF({text:e,page:t,pageSize:r}){let i=(e||"(no identity set)").split(` +`),s=pA(i,t,r);return(0,te.jsx)(fo,{title:"/identity \u2014 operator card",page:s.page,pages:s.pages,children:s.shown.map((a,u)=>(0,te.jsx)(N,{children:a||" "},u))})}function PF({rows:e,selected:t,pageSize:r,activeProject:i,query:s}){let a=Za(is(e),s),u=Math.min(Math.max(0,t),Math.max(0,a.length-1)),E=pA(a,Math.floor(u/r),r);return(0,te.jsx)(fo,{page:E.page,pages:E.pages,title:s?`/daemons \xB7 \u201C${s}\u201D \xB7 ${a.length}/${e.length}`:"/daemons \u2014 select project",hint:`\u2191/k \u2193/j select${E.pages>1?` \xB7 page ${E.page+1}/${E.pages}`:""} \xB7 Enter switch \xB7 / search \xB7 n new \xB7 Esc close`,children:a.length===0?(0,te.jsx)(N,{dimColor:!0,children:s?`(no daemons match \u201C${s}\u201D)`:"(no projects \u2014 press n to create one)"}):E.shown.map((I,h)=>{let D=E.page*r+h===u,R=I.id===i;return(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:D?Ie.accent:"gray",children:D?"\u203A ":" "}),(0,te.jsxs)(N,{color:I.daemon_alive?Ie.success:"gray",children:[RQ(I.daemon_alive)," "]}),(0,te.jsx)(N,{color:D?Ie.accent:void 0,dimColor:!D,children:`${I.id.slice(0,12)} `}),(0,te.jsx)(N,{bold:D,children:I.label||I.id}),I.daemon_alive?(0,te.jsx)(N,{dimColor:!0,children:` pid ${I.daemon_pid}`}):null,R?(0,te.jsx)(N,{color:Ie.success,children:" current"}):null]},I.id)})})}function DI(e){return!Number.isFinite(e)||e<=0?"0 B":e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(e>=10*1024?0:1)} KB`:`${(e/1024**2).toFixed(e>=10*1024**2?0:1)} MB`}function UF({rows:e,selected:t,pageSize:r}){let i=Math.min(Math.max(0,t),Math.max(0,e.length-1)),s=pA(e,Math.floor(i/r),r);return(0,te.jsx)(fo,{title:"/artifacts \u2014 latest reviewed result",page:s.page,pages:s.pages,hint:`\u2191/k \u2193/j select${s.pages>1?` \xB7 page ${s.page+1}/${s.pages}`:""} \xB7 Enter preview \xB7 Esc close`,children:e.length===0?(0,te.jsx)(N,{dimColor:!0,children:"(the latest result has no reviewer-approved files)"}):s.shown.map((a,u)=>{let E=s.page*r+u===i;return(0,te.jsxs)(ye,{flexDirection:"column",children:[(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{color:E?Ie.accent:"gray",children:E?"\u203A ":" "}),(0,te.jsx)(N,{color:a.exists?Ie.success:Ie.error,children:a.exists?"\u25C6 ":"\xD7 "}),(0,te.jsx)(N,{bold:E,color:E?Ie.accent:void 0,children:a.path}),(0,te.jsx)(N,{dimColor:!0,children:` ${a.kind} \xB7 ${DI(a.size)}`})]}),a.why?(0,te.jsx)(N,{dimColor:!0,children:` ${a.why.slice(0,110)}`}):null]},a.path)})})}function GF({artifact:e,page:t,pageSize:r}){let i=["text","markdown","json","table"].includes(e?.kind),s=i?(e.preview||"(empty file)").split(` +`):[],a=pA(s,t,r);return(0,te.jsxs)(fo,{title:`/artifact ${e?.path??""}`,page:a.page,pages:a.pages,hint:a.pages>1?`\u2191/k \u2193/j page ${a.page+1}/${a.pages} \xB7 Enter/Esc close`:"Enter/Esc close",children:[(0,te.jsx)(Fn,{k:"type",v:`${e.kind} \xB7 ${e.mime}`}),(0,te.jsx)(Fn,{k:"size",v:DI(e.size)}),e.why?(0,te.jsx)(Fn,{k:"reviewer",v:e.why,c:Ie.accent}):null,(0,te.jsx)(N,{children:" "}),i?(0,te.jsxs)(te.Fragment,{children:[a.shown.map((u,E)=>(0,te.jsx)(N,{children:u||" "},`${a.page}-${E}`)),e.truncated&&a.page===a.pages-1?(0,te.jsx)(N,{color:Ie.warning,children:"\u2026 preview truncated; use the Web UI to download the complete file"}):null]}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(N,{dimColor:!0,children:e.kind==="binary"?"No safe inline preview for this file type.":`${e.kind.toUpperCase()} preview is available in the Web UI.`}),(0,te.jsx)(N,{dimColor:!0,children:"Use the authenticated Web cockpit to preview or download it."})]})]})}function Fn({k:e,v:t,c:r}){return(0,te.jsxs)(ye,{children:[(0,te.jsx)(N,{dimColor:!0,children:`${e}`.padEnd(14)}),(0,te.jsx)(N,{color:r,children:t})]})}var HF={[z.LIFE_LIFECYCLE_BLOCK]:"block",[z.ROUND_REVIEWER_BACKEND_FAILURE]:"block",[z.LIFE_BUDGET_PAUSE]:"warn",[z.ROUND_STALL]:"warn",[z.ROUND_ESCALATED]:"warn",[z.LIFE_PLANNER_STALL_ESCALATION]:"warn"},WF=new Set([z.BUDGET_RESERVATION_DENIED,z.BUDGET_UNPRICED_BLOCKED]),KF=new Set([z.LIFE_MISSION_STARTED,z.ROUND_MAIN_COMPLETED,z.LIFE_MISSION_COMPLETED,z.LOOP_DONE,z.ROUND_START,"ui.operator"]),JF=new Set([z.BUDGET_RESERVATION_CREATED,z.PROVIDER_REQUEST_STARTED]);function jF(e){let t=$A(e.canonical_type??e.type);if(e.event_validation?.status==="invalid")return{tone:"warn",text:`invalid event ${t||"unknown"}: ${e.event_validation.errors.join("; ")}`};if(WF.has(t))return{tone:"block",kind:"budget",text:`Budget exhausted or blocked \u2014 ${String(e.reason??e.text??t).trim()}`};let r=e.operator_alert===!0?"block":HF[t];return r?{tone:r,text:String(e.text??e.reason??t).trim()}:null}function yI(e){let t=null;for(let r of e){let i=$A(r.canonical_type??r.type),s=jF(r);s?t=s:(t?.kind==="budget"&&JF.has(i)||t&&t.kind!=="budget"&&KF.has(i))&&(t=null)}return t}function FQ(e=process.env){let t=String(e.ARGUS_SKILL_SHOW_REASONING??"").trim().toLowerCase();return["1","true","yes","on"].includes(t)}var up=Le(jt(),1);function Lu(){let{stdout:e}=AA(),t=()=>({columns:Math.max(40,e.columns||80),rows:Math.max(16,e.rows||24)}),[r,i]=(0,up.useState)(t);return(0,up.useEffect)(()=>{let s=()=>i(t());return e.on("resize",s),()=>{e.off("resize",s)}},[e]),r}function tl(e,t,r){return t<=0?0:(((Number.isFinite(e)?Math.trunc(e):0)+r)%t+t)%t}var Ue=Le(Pt(),1),cp=["manager","planner","engineer","reviewer"];function Rf(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ri(e,t){let r=String(e||"").replace(/\s+/g," ").trim();return r.length<=t?r:`${r.slice(0,Math.max(1,t-1))}\u2026`}function QI(e){if(e.tone==="error")return Ie.error;if(e.tone==="success"||e.tone==="skill")return Ie.success;if(e.tone==="info")return Ie.info}function xQ(e,t,r){let i=e==null?t&&t!=="empty"?t:"$0.00 model calls":`$${e.toFixed(2)} model calls`,s=r?` / $${r.toFixed(0)} daily cap`:"";return i+s}function kQ(e){let t=e?.codex,r=e?.copilot;return[`Codex ${t?.daily_calls??0}/${t?.daily_cap||"\u221E"}`,`Copilot ${r?.daily_calls??0}/${r?.daily_cap||"\u221E"}`,`premium ${(r?.premium_requests??0).toFixed(1)}/${r?.premium_cap||"\u221E"}`].join(" \xB7 ")}function NQ({view:e,width:t,height:r,busy:i=!1,spentUsd:s,spendStatus:a,globalDailyCapUsd:u,requestUsage:E}){let I=Gy(e.mission.objective||e.mission.title||"Waiting for a mission"),h=e.timeline.slice(-Math.max(3,t<80?4:6)),y=new Map(e.roles.map(Z=>[Z.role,Z])),D=e.timeline.map(Z=>Z.role).filter((Z,q,X)=>cp.includes(Z)&&(q===0||Z!==X[q-1])),R=D.length>1?`${Rf(D[D.length-2])} \u2192 ${Rf(D[D.length-1])}`:"",O=e.stage.label||e.stage.id||"\u2014",G=tp(e.routing),ne=e.round.max>0?`${e.round.current} / ${e.round.max}`:e.round.current?String(e.round.current):"\u2014",oe=Zd(e.outcome),$=r!=null&&r<36;if(i){let Z=cp.map(q=>y.get(q)).filter(q=>q&&q.status==="active").map(q=>Rf(q.role));return(0,Ue.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MISSION "}),(0,Ue.jsx)(N,{bold:!0,children:Ri(I,Math.max(18,t-10))})]}),(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"STAGE "}),(0,Ue.jsx)(N,{color:Ie.info,children:Ri(O,20)}),(0,Ue.jsx)(N,{dimColor:!0,children:` \xB7 ROUND ${ne} \xB7 TEAM `}),(0,Ue.jsx)(N,{children:Z.length?Z.join(", "):"Manager"})]}),G?(0,Ue.jsx)(N,{dimColor:!0,children:`MODE ${G}`}):null]})}if($){let Z=h[h.length-1];return(0,Ue.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MISSION"}),(0,Ue.jsx)(N,{bold:!0,children:Ri(I,Math.max(24,t-2))}),(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"STAGE "}),(0,Ue.jsx)(N,{color:Ie.info,children:Ri(O,20)}),(0,Ue.jsx)(N,{dimColor:!0,children:` \xB7 ROUND ${ne} \xB7 ELAPSED `}),(0,Ue.jsx)(N,{children:lI(e.mission.elapsed_seconds)})]}),G?(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MODE "}),(0,Ue.jsx)(N,{children:Ri(G,Math.max(18,t-7))})]}):null,(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MODEL SPEND "}),(0,Ue.jsx)(N,{color:a==="partial"||a==="unpriced"?Ie.warning:Ie.success,children:xQ(s,a,u)}),(0,Ue.jsx)(N,{dimColor:!0,children:` \xB7 ${kQ(E)}`})]}),oe.length?(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"OUTCOME "}),(0,Ue.jsx)(N,{children:oe.join(" \xB7 ")})]}):null,e.mission.summary?(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"SUMMARY "}),(0,Ue.jsx)(N,{children:Ri(e.mission.summary,Math.max(18,t-10))})]}):null,(0,Ue.jsxs)(ye,{flexDirection:"column",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"AI RESEARCH TEAM"}),cp.map(q=>{let X=y.get(q),fe=X?.status??"waiting",Be=fe==="active"?"\u25CF":fe==="done"?"\u2713":fe==="rejected"||fe==="error"?"!":"\u25CB",Ae=fe==="rejected"||fe==="error"?Ie.error:fe==="done"?Ie.success:fe==="active"?Ie.role[q]??Ie.info:"gray";return(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(ye,{width:11,children:(0,Ue.jsx)(N,{color:Ie.role[q]??"white",bold:!0,children:q.toUpperCase()})}),(0,Ue.jsxs)(N,{color:Ae,children:[Be," "]}),(0,Ue.jsx)(N,{color:fe==="waiting"?"gray":void 0,dimColor:fe==="waiting",children:Ri(X?.label||(fe==="waiting"?"Waiting":Rf(fe)),Math.max(20,t-16))})]},q)})]}),(0,Ue.jsxs)(N,{wrap:"truncate-end",children:[(0,Ue.jsx)(N,{dimColor:!0,children:"TIMELINE "}),Z?(0,Ue.jsx)(N,{color:QI(Z),children:Ri(Z.title+(Z.detail?` \xB7 ${Z.detail}`:""),Math.max(18,t-12))}):(0,Ue.jsx)(N,{dimColor:!0,children:"Waiting for structured research events\u2026"})]})]})}return(0,Ue.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MISSION"}),(0,Ue.jsx)(N,{bold:!0,children:Ri(I,Math.max(24,t-2))}),(0,Ue.jsxs)(ye,{marginTop:1,gap:t>=76?4:2,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"STAGE "}),(0,Ue.jsx)(N,{color:Ie.info,children:Ri(O,t<76?14:22)}),(0,Ue.jsx)(N,{dimColor:!0,children:" ELAPSED "}),(0,Ue.jsx)(N,{children:lI(e.mission.elapsed_seconds)})]}),(0,Ue.jsxs)(ye,{gap:t>=76?4:2,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"ROUND "}),(0,Ue.jsx)(N,{children:ne})]}),G?(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MODE "}),(0,Ue.jsx)(N,{wrap:"wrap",children:G})]}):null,(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MODEL SPEND "}),(0,Ue.jsx)(N,{color:a==="partial"||a==="unpriced"?Ie.warning:Ie.success,children:xQ(s,a,u)})]}),(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(N,{dimColor:!0,children:"REQUESTS "}),(0,Ue.jsx)(N,{dimColor:!0,wrap:"truncate-end",children:kQ(E)})]}),oe.length?(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(N,{dimColor:!0,children:"OUTCOME "}),(0,Ue.jsx)(N,{wrap:"truncate-end",children:oe.join(" \xB7 ")})]}):null,e.mission.summary?(0,Ue.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"MISSION SUMMARY"}),(0,Ue.jsx)(N,{wrap:"wrap",children:e.mission.summary})]}):null,(0,Ue.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"AI RESEARCH TEAM"}),R?(0,Ue.jsx)(N,{dimColor:!0,children:`handoff \xB7 ${R}`}):null,cp.map(Z=>{let q=y.get(Z),X=q?.status??"waiting",fe=X==="active"?"\u25CF":X==="done"?"\u2713":X==="rejected"||X==="error"?"!":"\u25CB",Be=X==="rejected"||X==="error"?Ie.error:X==="done"?Ie.success:X==="active"?Ie.role[Z]??Ie.info:"gray";return(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(ye,{width:11,children:(0,Ue.jsx)(N,{color:Ie.role[Z]??"white",bold:!0,children:Z.toUpperCase()})}),(0,Ue.jsxs)(N,{color:Be,children:[fe," "]}),(0,Ue.jsx)(N,{color:X==="waiting"?"gray":void 0,dimColor:X==="waiting",children:Ri(q?.label||(X==="waiting"?"Waiting":Rf(X)),Math.max(20,t-16))})]},Z)})]}),(0,Ue.jsxs)(ye,{flexDirection:"column",marginTop:1,children:[(0,Ue.jsx)(N,{dimColor:!0,children:"LIVE RESEARCH TIMELINE"}),h.length?h.map(Z=>(0,Ue.jsxs)(ye,{children:[(0,Ue.jsx)(N,{dimColor:!0,children:`${new Date(Z.ts*1e3).toISOString().slice(11,16)} `}),(0,Ue.jsxs)(N,{color:QI(Z),children:[Z.tone==="error"?"!":Z.tone==="success"||Z.tone==="skill"?"\u2713":"\xB7"," "]}),(0,Ue.jsx)(N,{color:QI(Z),children:Ri(Z.title+(Z.detail?` \xB7 ${Z.detail}`:""),Math.max(18,t-10))})]},Z.id)):(0,Ue.jsx)(N,{dimColor:!0,children:" Waiting for structured research events\u2026"})]})]})}var YF=/(?:\u001b)?\[200~/g,VF=/(?:\u001b)?\[201~/g;function qF(e){return e.replace(YF,"").replace(VF,"").replace(/\r\n/g,` `).replace(/\r/g,` -`).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"")}function bQ(e,t){let r=/(?:\u001b)?\[200~/.test(e),i=/(?:\u001b)?\[201~/.test(e),s=Array.from(e).length>1;if(!(t||r||i||s))return{handled:!1,active:t,text:e,pasted:!1};let u=Jb(e);return t&&!e&&(u=` -`),{handled:!0,active:i?!1:t||r,text:u,pasted:r||i||t||s}}var to=Me(Pt(),1);function kQ(e,t,r){return r.ctrl&&(t==="c"||t==="d")?"exit":r.escape?"dismiss":e.busy?null:r.downArrow||t==="j"?"next":r.upArrow||t==="k"?"previous":r.return?"replace":null}var xQ=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`;function NQ({state:e,width:t}){let r=Math.max(20,t-12);return(0,to.jsxs)(Qe,{flexDirection:"column",borderStyle:"round",borderColor:me.warning,paddingX:2,marginTop:1,children:[(0,to.jsx)(k,{bold:!0,color:me.warning,children:`Concurrent work limit reached \xB7 ${e.activeCount}/${e.limit}`}),(0,to.jsx)(k,{dimColor:!0,children:"Choose one running session to park. Its files, backlog, checkpoints, skills, and wiki stay saved."}),(0,to.jsx)(Qe,{flexDirection:"column",marginTop:1,children:e.running.map((i,s)=>{let a=s===e.selection,u=i.label||i.display_name||i.id,E=i.activity||i.current_task||i.continuous_objective||"standing by";return(0,to.jsxs)(Qe,{flexDirection:"column",children:[(0,to.jsxs)(Qe,{children:[(0,to.jsx)(k,{color:a?me.accent:"gray",children:a?"\u203A ":" "}),(0,to.jsx)(k,{color:i.daemon_alive?me.success:"gray",children:i.daemon_alive?"\u25CF ":"\u25CB "}),(0,to.jsx)(k,{bold:a,color:a?me.accent:void 0,children:xQ(u,Math.max(12,r-24))}),(0,to.jsx)(k,{dimColor:!0,children:` ${i.id} pid ${i.daemon_pid??"\u2014"}`})]}),(0,to.jsx)(k,{dimColor:!0,children:` ${xQ(E,r)}`})]},i.id)})}),(0,to.jsx)(Qe,{marginTop:1,children:e.error?(0,to.jsx)(k,{color:me.error,children:e.error}):e.busy?(0,to.jsx)(k,{color:me.accent,children:"Parking selected session and starting queued work\u2026"}):(0,to.jsx)(k,{dimColor:!0,children:"\u2191/\u2193 select \xB7 Enter park & replace \xB7 Esc leave new work queued"})})]})}function TQ(e,t=!1,r=!1){return(t||r)&&e.toLowerCase()==="r"}var Hn=e=>String(e??"").trim(),jb=/^[a-z][a-z -]+ requires an operator-owned decision before continuing\.?$/i,Yb=e=>{let t=Hn(e);return jb.test(t)?"":t},OQ=(e,t)=>{let r=/[\u3400-\u9fff]/.test(`${e} -${t}`);return{id:"custom",label:r?"\u81EA\u5DF1\u8F93\u5165":"Write my own answer",description:r?"\u76F4\u63A5\u544A\u8BC9 Argus \u4F60\u7684\u51B3\u5B9A\u3002":"Tell Argus your decision directly.",requires_note:!0}};function LQ(e,t){let r=[...e,...t],i=[],s=new Set;for(let a of r){let u=Hn(a.id),E=a.operator_decision;if(E&&typeof E=="object"&&!Array.isArray(E)){let y=E,D=Hn(y.id);if(!D||s.has(D)||Hn(y.status)!=="pending")continue;s.add(D);let O=Hn(y.options_source)==="agent"&&Array.isArray(y.options)?y.options.filter(G=>!!Hn(G?.id)&&!!Hn(G?.label)).map(G=>({...G,requires_note:!1})):[];O.push(OQ(Hn(y.title),Hn(y.question))),i.push({id:D,item_id:Hn(y.item_id)||u,revision:Number(y.revision??1),status:"pending",title:Hn(y.title)||Hn(a.title)||"Decision required",reason:Yb(y.reason),question:Hn(y.question)||Hn(a.pending_question),evidence:Array.isArray(y.evidence)?y.evidence.filter(G=>Hn(G?.label)!=="Acceptance check"):[],options:O,options_source:O.length?"agent":"none",selected_option:"",note:""});continue}let I=Hn(a.pending_question??a.question??a.text);if(!u||!I)continue;let C=`legacy-${u}`;s.has(C)||(s.add(C),i.push({id:C,item_id:u,revision:1,status:"pending",title:Hn(a.title??a.objective)||"Blocked task",reason:"",question:I,evidence:[],options:[OQ(Hn(a.title??a.objective),I)],options_source:"none",selected_option:"",note:"",legacy:!0}))}return i}var Mo=Me(jt(),1);function Vb(e){let t=[];for(let r of e){let i=String(r.text??"").trim();if(!i)continue;let s=r.role==="operator"?"ui.operator":r.role==="argus"?"ui.argus":"";s&&t.push({type:s,text:i,...typeof r.ts=="number"?{ts:r.ts}:{}})}return t}function MQ(e,t,r=400){let i=Vb(t),s=new Map;for(let E of e){let I=String(E.type??"");if(I!=="ui.operator"&&I!=="ui.argus")continue;let C=`${I}\0${String(E.text??"")}`;s.set(C,(s.get(C)??0)+1)}let a=new Array(i.length).fill(!0);for(let E=i.length-1;E>=0;E-=1){let I=i[E],C=`${String(I.type??"")}\0${String(I.text??"")}`,y=s.get(C)??0;y>0&&(a[E]=!1,s.set(C,y-1))}let u=i.filter((E,I)=>a[I]).reduce((E,I)=>Ap(E,I,Number.MAX_SAFE_INTEGER),[...e]).sort((E,I)=>Number(E.ts??0)-Number(I.ts??0));return u.length>r?u.slice(u.length-r):u}var yI=400,qb=50;function PQ(e,t){let[r,i]=(0,Mo.useState)(null),[s,a]=(0,Mo.useState)([]),[u,E]=(0,Mo.useState)(!1),[I,C]=(0,Mo.useState)(""),[y,D]=(0,Mo.useState)(""),R=(0,Mo.useRef)(null),O=(0,Mo.useRef)(!0);(0,Mo.useEffect)(()=>{a([]),i(null),E(!1),C(""),D("")},[t]),(0,Mo.useEffect)(()=>{O.current=!0;let oe=!0,$,J=1e3,X,Z=[],ge=()=>{if(X=void 0,!oe||Z.length===0)return;let Le=Z;Z=[],a(pe=>Le.reduce((ct,De)=>Ap(ct,De,yI),pe))},he=Le=>{oe&&(Z.push(Le),X||(X=setTimeout(ge,qb)))},ue=()=>{!oe||!O.current||(R.current=e.connectStream({replay:60,onOpen:()=>{oe&&(J=1e3,E(!0),D(""))},onEvent:he,onClose:Le=>{if(oe){if(ge(),E(!1),!Le.retryable){D(`event stream closed (${Le.code}): ${Le.reason}`);return}O.current&&($=setTimeout(ue,J),J=Math.min(J*2,1e4))}},onError:Le=>{oe&&D(Le.message||"event stream unavailable")}}))};return ue(),()=>{oe=!1,$&&clearTimeout($),X&&clearTimeout(X),Z=[],R.current?.close()}},[e]),(0,Mo.useEffect)(()=>{let oe=!0;return e.getTranscript(yI).then($=>{oe&&a(J=>MQ(J,$,yI))},()=>{}),()=>{oe=!1}},[e]),(0,Mo.useEffect)(()=>{let oe=!0,$=!1,J,X=async()=>{if($)return;$=!0;let ge=new AbortController;J=ge;try{let he=await e.snapshot(1,ge.signal);oe&&(i(ue=>ue&&JSON.stringify(ue)===JSON.stringify(he)?ue:he),C(""))}catch(he){oe&&C(he.message||"snapshot refresh failed")}finally{$=!1,J===ge&&(J=void 0)}};X();let Z=setInterval(X,5e3);return()=>{oe=!1,J?.abort(),clearInterval(Z)}},[e]);let G=()=>{R.current?.close()};return{snap:r,setSnap:i,events:s,setEvents:a,connected:u,snapshotError:I,streamError:y,wsRef:R,closeStream:G,shutdown:()=>{O.current=!1,G()}}}var Po=Me(jt(),1);var zb=1e3;function UQ({api:e,projectRef:t,setEvents:r,setNotice:i,captureAdmission:s}){let[a,u]=(0,Po.useState)(!1),[E,I]=(0,Po.useState)(""),[C,y]=(0,Po.useState)(!1),[D,R]=(0,Po.useState)(0),[O,G]=(0,Po.useState)([]),[ne,oe]=(0,Po.useState)(0),[$,J]=(0,Po.useState)(0),X=(0,Po.useRef)(null),Z=(0,Po.useRef)(0),ge=()=>{let Le=!!X.current;return Z.current+=1,X.current?.controller.abort(),X.current=null,u(!1),I(""),y(!1),R(0),G([]),oe(0),Le},he=()=>{ge()?i("stopped waiting \xB7 server-side work may still finish in the project timeline"):i("no Manager reply is currently in flight")};return(0,Po.useEffect)(()=>()=>{Z.current+=1,X.current?.controller.abort(),X.current=null},[]),(0,Po.useEffect)(()=>{if(!a)return;let Le=setInterval(()=>J(pe=>pe+1),zb);return()=>clearInterval(Le)},[a]),{pending:a,phase:E,phaseHeartbeat:C,phaseQuietS:D,steps:O,startedAt:ne,tick:$,managerRequestRef:X,cancelManagerTurn:ge,stopWaiting:he,submitFreeText:async Le=>{if(X.current){i("Argus is still working \xB7 wait or switch daemons to cancel");return}let pe=t.current,ct=++Z.current,De=new AbortController;X.current={id:ct,project:pe,controller:De,messageId:""};let ve=()=>{let ke=X.current;return!!(ke&&ke.id===ct&&ke.project===pe&&t.current===pe&&!De.signal.aborted)},se=`argus-${Date.now()}`;r(ke=>[...ke,{type:"ui.operator",text:Le,ts:Date.now()/1e3,event_id:`local-${pe}-${ct}-operator`,message_id:`local-${ct}-operator`,local_request_id:ct,local_optimistic:!0}]),I(""),G([]),oe(Date.now()),J(0),u(!0),i("");let N=(ke,ft=se,pt="auto")=>{ve()&&r(Pe=>ve()?[...Pe,{type:"ui.argus",text:ke,message_id:ft,fragment_mode:pt,ts:Date.now()/1e3}]:Pe)},W=[],ae=!1,fe=()=>{if(ae||!ve())return;ae=!0;let ke=cQ(lQ(W));ke&&r(ft=>ve()?[...ft,{type:"ui.activity",text:ke,ts:Date.now()/1e3}]:ft)},Ie=!1,et=null;try{try{await e.messageStream(Le,{onPhase:(ke,ft,pt)=>{ve()&&(I(ke),y(pt.heartbeat),R(pt.quietS),W=aQ(W,{label:ke,role:ft,kind:pt.kind,detail:pt.detail,heartbeat:pt.heartbeat,quietS:pt.quietS}),G(W))},onDelta:(ke,ft,pt)=>{if(!ve())return;Ie=!0,fe(),I(""),y(!1),R(0);let Pe=ft||se,Ze=X.current;Ze?.id===ct&&(Ze.messageId=Pe),N(ke,Pe,pt==="append"||pt==="snapshot"?pt:"auto")},onDone:ke=>{ve()&&(fe(),ke.kind==="task"?(s(ke.daemon,pe,!!ke.continuous),Ie||N(Vm(ke))):Ie||N(ke.reply||"[Manager reply unavailable] No task was dispatched."))},onError:ke=>{ve()&&(et=ke)}},De.signal)}catch(ke){ve()&&(et=ke)}if(!ve())return;if(et&&!Ie)try{let ke=await e.message(Le,De.signal);if(!ve())return;ke.kind==="chat"&&ke.reply?N(ke.reply):ke.kind==="task"?(s(ke.daemon,pe,!!ke.continuous),N(Vm(ke))):N(ke.reply||"(no response)")}catch(ke){ve()&&N(`(couldn\u2019t reach Argus: ${ke.message})`)}}finally{X.current?.id===ct&&(fe(),X.current=null,u(!1),y(!1),R(0),G([]))}}}}var GQ=Me(jt(),1);function HQ(e,t){let[r,i]=(0,GQ.useState)(null);return{panel:r,setPanel:i,openPanel:(a,u={})=>{let E=!["help","backlog","events"].includes(a);if(i({kind:a,page:0,...u,loading:E}),!E)return;let C={status:()=>e.getStatus(),doctor:()=>e.getDoctor(),journal:()=>e.getJournal(20),config:()=>e.getConfig(),identity:()=>e.getIdentity(),daemons:()=>e.listProjects(),artifacts:()=>e.getArtifacts(),artifact:()=>e.getArtifact(String(u.path??"")),task:()=>e.getBacklogItem(String(u.itemId??""))}[a];C&&C().then(y=>i(D=>{if(!D||D.kind!==a)return D;let R=D.selection??0;if(a==="daemons"){let G=Xa(is(y),String(u.query??"")).findIndex(ne=>ne.id===t);R=G>=0?G:0}return{...D,loading:!1,data:y,selection:R}}),y=>i(D=>D&&D.kind===a?{...D,loading:!1,error:y.message}:D))}}}function WQ(e,t){let r=tI(e);if(!r)return;if(!r.cmd){let E=rI(r.name);t.setNotice(E?`unknown ${r.name} \u2014 did you mean ${E}?`:`unknown command ${r.name} \u2014 /help`);return}let i=E=>()=>t.setNotice(E),s=E=>t.setNotice(`error: ${E.message}`),a=E=>t.setNotice(`usage: ${E}`),u=E=>t.setEvents(I=>[...I,{type:"ui.argus",text:E,message_id:`local-${Date.now()}`,ts:Date.now()/1e3}]);switch(r.cmd.name){case"/help":t.openPanel("help");break;case"/status":t.openPanel("status");break;case"/roles":t.openPanel("config");break;case"/doctor":t.openPanel("doctor");break;case"/identity":if(!r.rest)t.openPanel("identity");else if(r.rest.toLowerCase().startsWith("set ")){let E=r.rest.slice(4).trim();E?t.api.setIdentity(E).then(i("identity updated"),s):a("/identity set ")}else a("/identity [set ]");break;case"/journal":t.openPanel("journal");break;case"/backlog":t.openPanel("backlog",{all:r.rest.trim()==="all",selection:0});break;case"/daemons":t.openPanel("daemons",{query:r.rest});break;case"/artifacts":t.openPanel("artifacts");break;case"/artifact":r.rest?t.openPanel("artifact",{path:r.rest}):a("/artifact ");break;case"/events":t.openPanel("events",{...eI(r.rest)});break;case"/find":r.rest?t.openPanel("events",{filter:"all",query:r.rest}):a("/find ");break;case"/item":r.rest?t.openPanel("task",{itemId:r.rest}):a("/item ");break;case"/resume":case"/attach":t.switchProject(r.rest);break;case"/rename":if(!r.rest){a("/rename ");break}t.api.renameProject(r.rest).then(E=>{t.setSnap(I=>I&&I.session.id===E.sid?{...I,session:{...I.session,display_name:E.name}}:I),t.projectRef.current===E.sid&&t.setNotice(`renamed conversation to ${E.name}`)},s);break;case"/clear":t.setEvents([]),t.setNotice("feed cleared");break;case"/run":t.setPanel(null),t.setNotice("already following the live daemon feed");break;case"/reconnect":t.setNotice("reconnecting\u2026"),t.closeStream();break;case"/cancel":t.stopWaiting();break;case"/abort":t.api.abortMission("operator used /abort").then(E=>t.setNotice(E.message),s);break;case"/quit":t.quit();break;case"/task":r.rest?t.api.postTask(r.rest).then(E=>t.setNotice(`queued ${E.id}`),s):a("/task ");break;case"/plan":r.rest?t.api.previewPlan(r.rest).then(E=>{if(E.error){u(`Planner could not draft a plan: ${E.error}`);return}let I=["Planner preview (nothing queued):"];E.steps.forEach((C,y)=>{I.push(`${y+1}. ${C.title}${C.detail?` \u2014 ${C.detail}`:""}`)}),E.notes.length&&I.push(`Notes: ${E.notes.join("; ")}`),I.push("Use /task to queue it."),u(I.join(` -`))},s):a("/plan ");break;case"/nudge":r.rest?t.api.postNudge(r.rest).then(i("nudge sent"),s):a("/nudge ");break;case"/rewrite":r.rest?t.rewriteDraft(r.rest):a("/rewrite \u2014 or press Ctrl+R to rewrite what you already typed");break;case"/note":r.rest?t.api.postNote(r.rest).then(i("note added"),s):a("/note ");break;case"/done":r.rest?t.api.disposeBacklog(r.rest,"done").then(i(`done ${r.rest}`),s):a("/done ");break;case"/skip":r.rest?t.api.disposeBacklog(r.rest,"skip").then(i(`skipped ${r.rest}`),s):a("/skip ");break;case"/stop":r.rest?t.api.stopBacklog(r.rest).then(i(`stopped ${r.rest}`),s):a("/stop ");break;case"/new":t.openNewDaemon(r.rest);break;case"/backend":r.rest?t.api.setConfig("backend",r.rest).then(()=>t.setNotice(`backend set to ${r.rest}`),s):t.openPanel("config");break;case"/config":{if(!r.rest){t.openPanel("config");break}let E=r.rest.split(/\s+/).filter(Boolean),I=E.find(y=>{let D=y.indexOf("=");return D<=0||D===y.length-1});if(I){t.setNotice(`expected key=value, got ${I}`);break}let C=E.map(y=>{let D=y.indexOf("=");return t.api.setConfig(y.slice(0,D),y.slice(D+1))});Promise.all(C).then(()=>t.setNotice(`updated ${C.length} setting(s)`),s);break}case"/reset":t.api.resetManager().then(i("Manager context reset"),s);break;case"/skills":t.api.skills(r.rest||"ls").then(u,s);break;default:t.setNotice(`${r.cmd.name} not yet wired`)}}var yo=Me(Pt(),1);function KQ({card:e,selection:t,note:r,busy:i,error:s}){let a=e.options[t],u=e.options.length===0;return(0,yo.jsxs)(Qe,{flexDirection:"column",borderStyle:"round",borderColor:me.warning,paddingX:1,marginTop:1,children:[(0,yo.jsx)(k,{color:me.warning,bold:!0,children:"ACTION REQUIRED"}),(0,yo.jsx)(k,{bold:!0,wrap:"wrap",children:e.title}),(0,yo.jsx)(Qe,{marginTop:1,children:(0,yo.jsx)(k,{wrap:"wrap",children:e.question})}),e.options.length?(0,yo.jsx)(Qe,{flexDirection:"column",marginTop:1,children:e.options.map((E,I)=>(0,yo.jsxs)(k,{color:I===t?me.accent:void 0,wrap:"wrap",children:[I===t?"\u203A ":" ",I+1,". ",E.label,E.description&&E.description!==e.question?` \u2014 ${E.description}`:""]},E.id))}):null,u||a?.requires_note?(0,yo.jsxs)(Qe,{marginTop:1,children:[(0,yo.jsx)(k,{color:me.accent,children:"Your response \u203A "}),(0,yo.jsx)(k,{children:r.value}),i?null:(0,yo.jsx)(k,{inverse:!0,children:" "})]}):null,s?(0,yo.jsx)(k,{color:me.error,wrap:"wrap",children:s}):null,(0,yo.jsx)(k,{dimColor:!0,children:i?"Sending your answer\u2026":u?"Type your answer \xB7 Enter send":"\u2191/\u2193 or number select \xB7 Enter confirm \xB7 typing selects an option that accepts guidance"})]})}var En=Me(Pt(),1);function up(e,t,r){return!e?.admission_required||!e.running_daemons?.length?null:{targetProject:t,running:e.running_daemons,limit:e.limit??e.running_daemons.length,activeCount:e.active_count??e.running_daemons.length,selection:0,resumeContinuous:r,busy:!1,error:""}}function JQ({host:e,port:t,token:r,project:i,initialNotice:s="",initialAdmission:a,initialResumeContinuous:u=!1,exitPolicy:E="detach",onProjectChange:I,trackDaemonCreation:C=y=>y}){let{exit:y}=sA(),{stdout:D}=AA(),R=Ou(),[O,G]=(0,gr.useState)(i),ne=(0,gr.useRef)(O);ne.current=O;let oe=(0,gr.useMemo)(()=>new ns({host:e,port:t,project:O,token:r}),[e,t,O,r]),{snap:$,setSnap:J,events:X,setEvents:Z,connected:ge,snapshotError:he,streamError:ue,closeStream:Le,shutdown:pe}=PQ(oe,O),[ct,De]=(0,gr.useState)(aA),[ve,se]=(0,gr.useState)(Iy),[N,W]=(0,gr.useState)(0),[ae,fe]=(0,gr.useState)(s),{panel:Ie,setPanel:et,openPanel:ke}=HQ(oe,O),[ft,pt]=(0,gr.useState)(null),[Pe,Ze]=(0,gr.useState)(()=>up(a,i,u)),[V,ce]=(0,gr.useState)(!1),[Ce]=(0,gr.useState)(SQ),tt=(0,gr.useMemo)(()=>LQ($?.pending_questions??[],($?.backlog??[]).map(Se=>({...Se})))[0]??null,[$?.backlog,$?.pending_questions]),[Ye,Qt]=(0,gr.useState)(0),[ut,mt]=(0,gr.useState)(aA),[vt,je]=(0,gr.useState)(!1),[Br,Ar]=(0,gr.useState)("");(0,gr.useEffect)(()=>{W(0)},[ct.value]),(0,gr.useEffect)(()=>{Qt(0),mt(aA),je(!1),Ar("")},[tt?.id]);let yr=(0,gr.useRef)(!1),Ur=(0,gr.useRef)(!0),K=(0,gr.useRef)(0),Ae=(0,gr.useRef)(!1),rt=(0,gr.useRef)(!1);(0,gr.useEffect)(()=>(Ur.current=!0,()=>{Ur.current=!1}),[]),(0,gr.useEffect)(()=>{if(D.isTTY)return D.write("\x1B[?2004h"),()=>{D.write("\x1B[?2004l")}},[D]);let dt=(Se,Te,ze)=>{let Ut=up(Se,Te,ze);Ut&&(K.current=0,Ze(Ut))};(0,gr.useEffect)(()=>{let Se=$?.daemon_admission;Pe||!Se||Se.requested_at<=K.current||Ze(up(Se,Se.target_sid||O,Se.resume_continuous))},[O,Pe,$?.daemon_admission]);let Ft=async()=>{if(!Pe||Pe.busy)return;let Se=Pe.running[Pe.selection];if(Se){Ze(Te=>Te&&{...Te,busy:!0,error:""});try{let ze=await new ns({host:e,port:t,project:Pe.targetProject,token:r}).replaceDaemon(Se.id,Pe.resumeContinuous,$?.daemon_commands?.revision);if(ze.rc!==0){let Ut=up(ze,Pe.targetProject,Pe.resumeContinuous);Ze(Ut??{...Pe,busy:!1,error:ze.error||"could not replace the selected session"});return}K.current=Date.now()/1e3,Ze(null),fe(`parked ${Se.label||Se.id} \xB7 queued work started`)}catch(Te){Ze(ze=>ze&&{...ze,busy:!1,error:Te.message})}}},{pending:_t,phase:Xt,phaseHeartbeat:or,phaseQuietS:ir,steps:tn,startedAt:Ss,tick:Uo,managerRequestRef:Wn,cancelManagerTurn:xn,stopWaiting:Ai,submitFreeText:ai}=UQ({api:oe,projectRef:ne,setEvents:Z,setNotice:fe,captureAdmission:dt}),Go=Se=>Se===ne.current?!1:(xn(),ne.current=Se,G(Se),I?.(Se),Ze(null),K.current=0,!0),kn=()=>{Ur.current=!1,xn(),pe(),y()},li=async Se=>{let Te=Zm(Se);if(Te.kind==="list"){ke("daemons");return}let ze=Te.query;try{let Ut=await oe.listProjects(),dr=Ut.find(at=>at.id===ze)||Ut.find(at=>at.id.startsWith(ze))||Ut.find(at=>(at.label||"").toLowerCase().includes(ze.toLowerCase()))||Xa(Ut,ze)[0];if(!dr){fe(`no project matching "${ze}" \u2014 /daemons to list`);return}if(dr.id===O){fe(`already on ${dr.id}`);return}Go(dr.id),fe(`switched to ${dr.label||dr.id}`)}catch(Ut){fe(`error: ${Ut.message}`)}},Xr=Se=>{if(et(null),Se.id===O){fe(`already on ${Se.label||Se.id}`);return}Go(Se.id),fe(`switched to ${Se.label||Se.id}`)},As=(Se="")=>{et(null),ce(!1),fe(""),pt(wf(Se))},ro=async()=>{if(!ft||ft.busy)return;if(yr.current){pt(ze=>ze&&{...ze,error:"a daemon is already being created"});return}let{objective:Se,name:Te}=Tu(ft);yr.current=!0,pt(ze=>ze&&{...ze,busy:!0,error:""});try{let ze=await C(oe.createDaemon(Se,Te));if(!Ur.current)return;et(null),pt(null),Go(ze.sid),dt(ze.start,ze.sid,!!Se),fe(ze.start?.admission_required?`created ${ze.sid} \xB7 choose running work to park`:ze.spawned?`created ${ze.sid} \xB7 campaign started`:`created ${ze.sid} \xB7 message Argus when ready`)}catch(ze){if(!Ur.current)return;pt(Ut=>Ut&&{...Ut,busy:!1,error:ze.message||"daemon creation failed"})}finally{yr.current=!1}},as=Se=>{let Te=(Se||"").trim();if(!Te){fe("nothing to rewrite \xB7 type a prompt first");return}rt.current||(rt.current=!0,fe("Manager is rewriting your prompt\u2026"),oe.rewritePrompt(Te).then(ze=>{if(rt.current=!1,ze.error||!ze.rewritten.trim()){fe(`rewrite failed \xB7 ${ze.error||"empty rewrite"} \xB7 your prompt is unchanged`);return}De(lA(ze.rewritten));let Ut=["Rewrote your prompt (not sent \u2014 edit it, then Enter):","",`was: ${Te}`];ze.changes.length&&Ut.push("","made explicit:",...ze.changes.map(dr=>` - ${dr}`)),ze.questions.length&&Ut.push("","Manager asks (answer these, or they stay unspecified):",...ze.questions.map(dr=>` ? ${dr}`)),Z(dr=>[...dr,{type:"ui.activity",text:Ut.join(` -`),ts:Date.now()/1e3}]),fe("prompt rewritten \xB7 review it, then Enter to send")},ze=>{rt.current=!1,fe(`rewrite failed \xB7 ${ze.message} \xB7 your prompt is unchanged`)}))},po=Se=>{WQ(Se,{api:oe,openPanel:ke,setPanel:et,setEvents:Z,setNotice:fe,setSnap:J,projectRef:ne,closeStream:Le,stopWaiting:Ai,quit:kn,switchProject:li,openNewDaemon:As,rewriteDraft:as})},_s=()=>{let Se=ct.value.trim();if(Se){if(!Qf(Se)&&Wn.current){fe("Argus is still working \xB7 wait or switch daemons to cancel");return}De(aA),W(0),se(Te=>qm(Te,Se)),Qf(Se)?po(Se):ai(Se)}},ui=async()=>{if(!tt||vt)return;let Se=tt.options.length===0,Te=tt.options[Ye],ze=ut.value.trim();if((Se||Te?.requires_note)&&!ze){Ar("Type the requested answer before confirming.");return}if(!(!Se&&!Te)){je(!0),Ar("");try{let Ut=tt.legacy?await oe.answerPending(tt.item_id,ze):await oe.resolveDecision(tt.id,Se?"custom":Te.id,ze);if(Ut.resolved===!1){Ar(String(Ut.reply||"A more specific answer is required."));return}fe(String(Ut.reply||"Your answer was delivered to the team.")),J(await oe.snapshot())}catch(Ut){Ar(Ut.message)}finally{je(!1)}}};rs((Se,Te)=>{let ze=bQ(Se,Ae.current);if(ze.handled){if(Ae.current=ze.active,tt&&ze.text){let at=tt.options.length===0,Zt=tt.options.findIndex(cr=>cr.requires_note);(at||Zt>=0)&&(Zt>=0&&Qt(Zt),mt(cr=>uA(cr,ze.text)));return}if(ze.text&&!Ie){if(Pe)return;if(ft){let at=Sf(ft,ze.text,{});pt(at.draft)}else De(at=>uA(at,ze.text)),se(at=>at.pos===0?at:{...at,pos:0});ze.pasted&&ze.text.length>20&&fe(`pasted ${Array.from(ze.text).length} chars \xB7 Enter to send`)}return}if(tt){if(Te.ctrl&&(Se==="c"||Se==="d")){kn();return}if(vt)return;if(tt.options.length===0){Te.return?ui():Te.leftArrow?mt(Ya):Te.rightArrow?mt(Va):Te.backspace||Te.delete?mt(_u):Te.ctrl&&Se==="w"?mt(Ru):Te.ctrl&&Se==="u"?mt(Fu):Te.ctrl&&Se==="k"?mt(bu):Se&&!Te.ctrl&&!Te.meta&&mt(cr=>uA(cr,Se)),Ar("");return}if(Te.downArrow){Qt(cr=>el(cr,tt.options.length,1));return}if(Te.upArrow){Qt(cr=>el(cr,tt.options.length,-1));return}if(Te.return){ui();return}if(tt.options[Ye]?.requires_note){Te.leftArrow?mt(Ya):Te.rightArrow?mt(Va):Te.backspace||Te.delete?mt(_u):Te.ctrl&&Se==="w"?mt(Ru):Te.ctrl&&Se==="u"?mt(Fu):Te.ctrl&&Se==="k"?mt(bu):Se&&!Te.ctrl&&!Te.meta&&mt(cr=>uA(cr,Se)),Ar("");return}if(/^[1-9]$/.test(Se)){let cr=Number(Se)-1;crYt.requires_note);cr>=0&&(Qt(cr),mt(Yt=>uA(Yt,Se)),Ar(""))}return}if(Pe){let at=kQ(Pe,Se,Te);at==="exit"?kn():at==="dismiss"?(K.current=Date.now()/1e3,Ze(null),fe("new work remains queued")):at==="next"?Ze(Zt=>Zt&&{...Zt,selection:el(Zt.selection,Zt.running.length,1)}):at==="previous"?Ze(Zt=>Zt&&{...Zt,selection:el(Zt.selection,Zt.running.length,-1)}):at==="replace"&&Ft();return}if(ft){if(Te.ctrl&&Se==="d"){kn();return}if(Te.ctrl&&Se==="c"){ft.busy||pt(null);return}let at=Sf(ft,Se,Te);at.intent==="submit"?ro():at.intent==="cancel"?pt(null):at.draft!==ft&&pt(at.draft);return}if(Te.ctrl&&Se==="c"){if(V){kn();return}ce(!0),fe(`Ctrl-C again to exit \xB7 Ctrl-D also quits \xB7 ${E==="stop-all"?"current executor and this launch's owned API will stop gracefully":E==="stop-api"?"executor keeps running; this launch's owned API will stop":"terminal UI exits; local API and executor keep running"}`);return}if(Te.ctrl&&Se==="d"){kn();return}if(TQ(Se,Te.ctrl,Te.meta)){as(ct.value);return}if(V&&ce(!1),Ie){let at=Ie.kind==="daemons"||Ie.kind==="artifacts"||Ie.kind==="backlog",Zt=Ie.kind==="daemons"?Xa(is(Ie.data??[]),Ie.query??""):[],cr=Ie.kind==="backlog"?Ie.all?$?.backlog??[]:sp($?.backlog??[],!1):[];if(Te.escape||Se==="q")et(null);else if(Ie.kind==="daemons"&&Se==="n")et(null),As();else if(Ie.kind==="daemons"&&Se==="/")et(null),De(lA("/daemons ")),W(0);else if(at&&(Te.downArrow||Se==="j")){let Yt=Ie.kind==="daemons"?Zt.length:Ie.kind==="backlog"?cr.length:Array.isArray(Ie.data)?Ie.data.length:0;et(rn=>rn&&{...rn,selection:el(rn.selection??0,Yt,1)})}else if(at&&(Te.upArrow||Se==="k")){let Yt=Ie.kind==="daemons"?Zt.length:Ie.kind==="backlog"?cr.length:Array.isArray(Ie.data)?Ie.data.length:0;et(rn=>rn&&{...rn,selection:el(rn.selection??0,Yt,-1)})}else if(at&&Te.return)if(Ie.kind==="daemons"){let Yt=Zt[Ie.selection??0];Yt&&Xr(Yt)}else if(Ie.kind==="artifacts"){let rn=(Ie.data??[])[Ie.selection??0];rn?.exists?ke("artifact",{path:rn.path}):rn&&(et(null),fe(`artifact is declared but missing: ${rn.path}`))}else{let Yt=cr[Ie.selection??0];Yt&&ke("task",{itemId:Yt.id})}else Te.return?et(null):Te.downArrow||Se==="j"?et(Yt=>Yt&&{...Yt,page:(Yt.page??0)+1}):(Te.upArrow||Se==="k")&&et(Yt=>Yt&&{...Yt,page:Math.max(0,(Yt.page??0)-1)});return}let Ut=Vd(ct.value),dr=Ut.length>0;if(Te.escape&&Wn.current&&!dr){Ai();return}if(Te.escape){dr&&De(aA);return}if(dr){if(Te.upArrow){W(Zt=>(Zt-1+Ut.length)%Ut.length);return}if(Te.downArrow){W(Zt=>(Zt+1)%Ut.length);return}let at=Ut[Math.min(N,Ut.length-1)];if(Te.tab){De(lA(qd(at))),W(0);return}if(Te.return){let Zt=ct.value.trim(),cr=Zt.toLowerCase()===at.name.toLowerCase()||(at.aliases??[]).some(Yt=>Yt.toLowerCase()===Zt.toLowerCase());if(!cr&&at.arg)De(lA(qd(at))),W(0);else{let Yt=cr?Zt:at.name;De(aA),W(0),se(rn=>qm(rn,Yt)),po(Yt)}return}}if(Te.return){_s();return}if(Te.leftArrow){De(Ya);return}if(Te.rightArrow){De(Va);return}if(Te.upArrow){let at=hy(ve,ct.value);se(at.h),De(lA(at.value));return}if(Te.downArrow){let at=Cy(ve);se(at.h),De(lA(at.value));return}if(Te.ctrl&&Se==="a"){De(Kd);return}if(Te.ctrl&&Se==="e"){De(Jd);return}if(Te.ctrl&&Se==="b"){De(Ya);return}if(Te.ctrl&&Se==="f"){De(Va);return}if(Te.ctrl&&Se==="w"){De(Ru);return}if(Te.ctrl&&Se==="u"){De(Fu);return}if(Te.ctrl&&Se==="k"){De(bu);return}if(Te.backspace||Te.delete){De(_u),se(at=>at.pos===0?at:{...at,pos:0});return}if(Se==="?"&&ct.value===""){ke("help");return}Se&&!Te.ctrl&&!Te.meta&&(De(at=>uA(at,Se)),se(at=>at.pos===0?at:{...at,pos:0}))});let Fi=Vd(ct.value),Qo=Fi.length>0&&!Pe&&!ft&&!Ie,EA=_t?["manager"]:[],ls=BQ($?.roles??[],X),Ho=(Xt||"handling your message").replace(/^Manager\s*·\s*/i,"").replace(/[.…]+$/u,""),Nn=_t?DQ(ls,"manager",Ho,Math.max(0,(Date.now()-Ss)/1e3)):ls,vo=$?Oy({...$,roles:Nn},X):null,Rs=$?.partial?($.diagnostics??[]).map(Se=>`${Se.section}: ${Se.message}`).join(" \xB7 "):"",wr=$?.observability?.slo.status==="degraded"?$.observability.slo.violations.join(" \xB7 "):"",us=he?`snapshot refresh failed \xB7 ${he}`:$?.partial?`snapshot partial \xB7 ${Rs||"backend reported incomplete state"}`:wr?`SLO degraded \xB7 ${wr}`:ue&&!ge?`event stream reconnecting \xB7 ${ue}`:"";return(0,En.jsxs)(Qe,{flexDirection:"column",paddingX:1,children:[(0,En.jsx)(ky,{width:R.columns}),Qo?null:(0,En.jsx)(gQ,{alert:BI(X)}),tt?(0,En.jsx)(KQ,{card:tt,selection:Ye,note:ut,busy:vt,error:Br}):Pe?(0,En.jsx)(NQ,{state:Pe,width:R.columns}):ft?(0,En.jsx)(op,{draft:ft}):(0,En.jsxs)(En.Fragment,{children:[vo&&!Qo&&!Ie?(0,En.jsx)(FQ,{view:vo,width:R.columns,height:R.rows,busy:_t,spentUsd:$?.global_spend_usd,spendStatus:$?.global_spend_status,globalDailyCapUsd:$?.daemon.global_daily_cap_usd,requestUsage:$?.request_usage}):null,(0,En.jsx)(Yy,{events:X,width:R.columns,mode:"all",liveMessageId:Wn.current?.messageId,collapsed:Qo||!!Ie,showIdle:!vo,showReasoning:Ce}),Ie?(0,En.jsx)(wQ,{panel:Ie,snap:$,events:X,viewportRows:R.rows,viewportColumns:R.columns,activeProject:O}):(0,En.jsxs)(En.Fragment,{children:[_t&&!Qo&&(0,En.jsx)(fQ,{tick:Uo,phase:Xt,heartbeat:or,quietS:ir,steps:tn,width:R.columns,elapsedS:Math.max(0,Math.floor((Date.now()-Ss)/1e3))}),(0,En.jsxs)(Qe,{flexDirection:"column",flexShrink:0,children:[(0,En.jsx)(oQ,{items:Fi,selected:Math.min(N,Fi.length-1),maxVisible:nQ(R.rows)}),(0,En.jsx)(tQ,{edit:ct,width:R.columns,rowsBelow:Qo?0:1})]}),Qo?null:(0,En.jsx)(iQ,{notice:ae,health:us,width:R.columns})]})]})]})}import{execFile as VQ}from"node:child_process";import{mkdir as $b,readFile as qQ,writeFile as Xb,rename as Zb,unlink as kP}from"node:fs/promises";import{homedir as e1}from"node:os";import{dirname as t1,join as jQ,resolve as r1}from"node:path";function cp(e){let t=e.trim().toLowerCase();if(t==="localhost"||t==="::1")return!0;let r=t.split(".").map(Number);return r.length===4&&r[0]===127&&r.every(i=>Number.isInteger(i)&&i>=0&&i<=255)}function zQ(e,t,r=process.env){if(!cp(e))return;let i=r.ARGUS_SKILL_HOME?.trim(),s=r.HOME?.trim()||e1(),a=i?r1(i):jQ(s,".argus-skill"),u=e.toLowerCase().replace(/[^a-z0-9._-]+/g,"_");return jQ(a,"runtime",`webapi-${u}-${t}.owner.json`)}async function n1(e){let t=!1;try{process.kill(e,0),t=!0}catch{return{alive:!1,argv:[]}}try{let i=(await qQ(`/proc/${e}/cmdline`)).toString("utf8").split("\0").filter(Boolean);return{alive:t,argv:i}}catch{return{alive:!1,argv:[]}}}async function o1(e){try{process.kill(e,0)}catch{return{alive:!1,argv:[]}}return new Promise(t=>{VQ("/bin/ps",["-ww","-p",String(e),"-o","command="],{encoding:"utf-8"},(r,i)=>{let s=r?"":i.trim();t({alive:!!s,argv:[],commandLine:s||void 0})})})}async function i1(e){try{process.kill(e,0)}catch{return{alive:!1,argv:[]}}let t=["$ErrorActionPreference = 'Stop'","[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)",`$process = Get-CimInstance Win32_Process -Filter "ProcessId = ${e}"`,"if ($null -eq $process) { exit 3 }","[PSCustomObject]@{ commandLine = [string]$process.CommandLine } | ConvertTo-Json -Compress"].join("; ");return new Promise(r=>{VQ("powershell.exe",["-NoProfile","-NonInteractive","-Command",t],{encoding:"utf-8",windowsHide:!0},(i,s)=>{if(i){r({alive:!1,argv:[]});return}try{let a=JSON.parse(s.trim()),u=typeof a.commandLine=="string"?a.commandLine.trim():"";r({alive:!!u,argv:[],commandLine:u||void 0})}catch{r({alive:!1,argv:[]})}})})}function $Q(e,t=process.platform){return t==="win32"?i1(e):t==="darwin"?o1(e):n1(e)}function vI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function QI(e,t,r){return new RegExp(`(?:^|\\s)["']?${vI(t)}["']?(?=\\s|$)`,r?"i":"").test(e)}function YQ(e,t,r,i){return new RegExp(`(?:^|\\s)${vI(t)}\\s+["']?${vI(r)}["']?(?=\\s|$)`,i?"i":"").test(e)}async function fp(e,t){await $b(t1(e),{recursive:!0,mode:448});let r=`${e}.tmp.${process.pid}`;await Xb(r,JSON.stringify(t),{encoding:"utf-8",mode:384}),await Zb(r,e)}async function wI(e){let{pid:t,host:r,port:i,backendBin:s}=e,a=e.platform??process.platform,u=e.inspect??(R=>$Q(R,a)),E=a==="win32",I=(R,O)=>E?R.toLowerCase()===O.toLowerCase():R===O;if(!Number.isInteger(t)||t<=0)return!1;let{alive:C,argv:y,commandLine:D}=await u(t);if(!C)return!1;if(y.length>0){let R=ne=>y.findIndex(oe=>I(oe,ne));if(R(s)===-1||R("--web")===-1)return!1;let O=R("--web-port");if(O===-1||!I(y[O+1]??"",String(i)))return!1;let G=R("--web-host");return!(G!==-1&&!I(y[G+1]??"",r))}return!(!D||!QI(D,s,E)||!QI(D,"--web",E)||!YQ(D,"--web-port",String(i),E)||QI(D,"--web-host",E)&&!YQ(D,"--web-host",r,E))}async function SI(e){return await wI({pid:e.pid,host:e.host,port:e.port,backendBin:e.backendBin,inspect:e.inspect,platform:e.platform})?(await fp(e.path,{schema:1,pid:e.pid,...e.rootPid===void 0?{}:{rootPid:e.rootPid},host:e.host,port:e.port,backendBin:e.backendBin,startedAt:e.startedAt}),!0):!1}async function gp(e){let{path:t,host:r,port:i,backendBin:s}=e,a=e.platform??process.platform,u=e.inspect??(E=>$Q(E,a));try{let E=await qQ(t,"utf-8"),I=JSON.parse(E);if(I.schema!==1)return null;let C=I.pid;if(typeof C!="number"||!Number.isInteger(C)||C<=0||I.rootPid!==void 0&&(typeof I.rootPid!="number"||!Number.isInteger(I.rootPid)||I.rootPid<=0)||I.host!==r||I.port!==i||I.backendBin!==s||!await wI({pid:C,host:r,port:i,backendBin:s,inspect:u,platform:a}))return null;if(I.rootPid!==void 0&&I.rootPid!==C&&!await wI({pid:I.rootPid,host:r,port:i,backendBin:s,inspect:u,platform:a})){let{rootPid:y,...D}=I;return D}return I}catch{return null}}function XQ(e,t){let r=e?.trim()||"detach";if(r==="detach"||r==="stop-api"||r==="stop-all")return r;throw new Error(`${t} must be detach, stop-api, or stop-all; got ${r}`)}function tl(e,t,r){let i=e[t+1];if(!i||i.startsWith("-"))throw new Error(`${r} requires a value`);return i}function ZQ(e){let t={host:process.env.ARGUS_TUI_HOST??"127.0.0.1",port:Number(process.env.ARGUS_TUI_PORT??8799),project:process.env.ARGUS_TUI_PROJECT,resume:!1,resumeAll:!1,token:process.env.ARGUS_SKILL_WEB_TOKEN,ownerFile:void 0,once:!1,json:!1,count:5,help:!1,web:!1,noOpen:!1,objective:"",forceNew:!1,exitPolicy:XQ(process.env.ARGUS_TUI_EXIT_POLICY,"ARGUS_TUI_EXIT_POLICY")};for(let r=0;r65535)throw new Error(`--port must be between 1 and 65535; got ${t.port}`);if(!Number.isInteger(t.count)||t.count<1)throw new Error(`--count must be a positive integer; got ${t.count}`);return t.ownerFile=process.env.ARGUS_TUI_API_OWNER_FILE?.trim()||zQ(t.host,t.port),t}var e0=`argus \u2014 the terminal cockpit for the argus-skill autonomous-research daemon +`).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"")}function TQ(e,t){let r=/(?:\u001b)?\[200~/.test(e),i=/(?:\u001b)?\[201~/.test(e),s=Array.from(e).length>1;if(!(t||r||i||s))return{handled:!1,active:t,text:e,pasted:!1};let u=qF(e);return t&&!e&&(u=` +`),{handled:!0,active:i?!1:t||r,text:u,pasted:r||i||t||s}}var to=Le(Pt(),1);function LQ(e,t,r){return r.ctrl&&(t==="c"||t==="d")?"exit":r.escape?"dismiss":e.busy?null:r.downArrow||t==="j"?"next":r.upArrow||t==="k"?"previous":r.return?"replace":null}var OQ=(e,t)=>e.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`;function MQ({state:e,width:t}){let r=Math.max(20,t-12);return(0,to.jsxs)(ye,{flexDirection:"column",borderStyle:"round",borderColor:Ie.warning,paddingX:2,marginTop:1,children:[(0,to.jsx)(N,{bold:!0,color:Ie.warning,children:`Concurrent work limit reached \xB7 ${e.activeCount}/${e.limit}`}),(0,to.jsx)(N,{dimColor:!0,children:"Choose one running session to park. Its files, backlog, checkpoints, skills, and wiki stay saved."}),(0,to.jsx)(ye,{flexDirection:"column",marginTop:1,children:e.running.map((i,s)=>{let a=s===e.selection,u=i.label||i.display_name||i.id,E=i.activity||i.current_task||i.continuous_objective||"standing by";return(0,to.jsxs)(ye,{flexDirection:"column",children:[(0,to.jsxs)(ye,{children:[(0,to.jsx)(N,{color:a?Ie.accent:"gray",children:a?"\u203A ":" "}),(0,to.jsx)(N,{color:i.daemon_alive?Ie.success:"gray",children:i.daemon_alive?"\u25CF ":"\u25CB "}),(0,to.jsx)(N,{bold:a,color:a?Ie.accent:void 0,children:OQ(u,Math.max(12,r-24))}),(0,to.jsx)(N,{dimColor:!0,children:` ${i.id} pid ${i.daemon_pid??"\u2014"}`})]}),(0,to.jsx)(N,{dimColor:!0,children:` ${OQ(E,r)}`})]},i.id)})}),(0,to.jsx)(ye,{marginTop:1,children:e.error?(0,to.jsx)(N,{color:Ie.error,children:e.error}):e.busy?(0,to.jsx)(N,{color:Ie.accent,children:"Parking selected session and starting queued work\u2026"}):(0,to.jsx)(N,{dimColor:!0,children:"\u2191/\u2193 select \xB7 Enter park & replace \xB7 Esc leave new work queued"})})]})}function PQ(e,t=!1,r=!1){return(t||r)&&e.toLowerCase()==="r"}var Hn=e=>String(e??"").trim(),zF=/^[a-z][a-z -]+ requires an operator-owned decision before continuing\.?$/i,$F=e=>{let t=Hn(e);return zF.test(t)?"":t},UQ=(e,t)=>{let r=/[\u3400-\u9fff]/.test(`${e} +${t}`);return{id:"custom",label:r?"\u81EA\u5DF1\u8F93\u5165":"Write my own answer",description:r?"\u76F4\u63A5\u544A\u8BC9 Argus \u4F60\u7684\u51B3\u5B9A\u3002":"Tell Argus your decision directly.",requires_note:!0}};function GQ(e,t){let r=[...e,...t],i=[],s=new Set;for(let a of r){let u=Hn(a.id),E=a.operator_decision;if(E&&typeof E=="object"&&!Array.isArray(E)){let y=E,D=Hn(y.id);if(!D||s.has(D)||Hn(y.status)!=="pending")continue;s.add(D);let O=Hn(y.options_source)==="agent"&&Array.isArray(y.options)?y.options.filter(G=>!!Hn(G?.id)&&!!Hn(G?.label)).map(G=>({...G,requires_note:!1})):[];O.push(UQ(Hn(y.title),Hn(y.question))),i.push({id:D,item_id:Hn(y.item_id)||u,revision:Number(y.revision??1),status:"pending",title:Hn(y.title)||Hn(a.title)||"Decision required",reason:$F(y.reason),question:Hn(y.question)||Hn(a.pending_question),evidence:Array.isArray(y.evidence)?y.evidence.filter(G=>Hn(G?.label)!=="Acceptance check"):[],options:O,options_source:O.length?"agent":"none",selected_option:"",note:""});continue}let I=Hn(a.pending_question??a.question??a.text);if(!u||!I)continue;let h=`legacy-${u}`;s.has(h)||(s.add(h),i.push({id:h,item_id:u,revision:1,status:"pending",title:Hn(a.title??a.objective)||"Blocked task",reason:"",question:I,evidence:[],options:[UQ(Hn(a.title??a.objective),I)],options_source:"none",selected_option:"",note:"",legacy:!0}))}return i}var Mo=Le(jt(),1);function XF(e){let t=[];for(let r of e){let i=String(r.text??"").trim();if(!i)continue;let s=r.role==="operator"?"ui.operator":r.role==="argus"?"ui.argus":"";s&&t.push({type:s,text:i,...typeof r.ts=="number"?{ts:r.ts}:{}})}return t}function HQ(e,t,r=400){let i=XF(t),s=new Map;for(let E of e){let I=String(E.type??"");if(I!=="ui.operator"&&I!=="ui.argus")continue;let h=`${I}\0${String(E.text??"")}`;s.set(h,(s.get(h)??0)+1)}let a=new Array(i.length).fill(!0);for(let E=i.length-1;E>=0;E-=1){let I=i[E],h=`${String(I.type??"")}\0${String(I.text??"")}`,y=s.get(h)??0;y>0&&(a[E]=!1,s.set(h,y-1))}let u=i.filter((E,I)=>a[I]).reduce((E,I)=>lp(E,I,Number.MAX_SAFE_INTEGER),[...e]).sort((E,I)=>Number(E.ts??0)-Number(I.ts??0));return u.length>r?u.slice(u.length-r):u}var wI=400,ZF=50;function WQ(e,t){let[r,i]=(0,Mo.useState)(null),[s,a]=(0,Mo.useState)([]),[u,E]=(0,Mo.useState)(!1),[I,h]=(0,Mo.useState)(""),[y,D]=(0,Mo.useState)(""),R=(0,Mo.useRef)(null),O=(0,Mo.useRef)(!0);(0,Mo.useEffect)(()=>{a([]),i(null),E(!1),h(""),D("")},[t]),(0,Mo.useEffect)(()=>{O.current=!0;let oe=!0,$,Z=1e3,q,X=[],fe=()=>{if(q=void 0,!oe||X.length===0)return;let xe=X;X=[],a(de=>xe.reduce((ft,Ye)=>lp(ft,Ye,wI),de))},Be=xe=>{oe&&(X.push(xe),q||(q=setTimeout(fe,ZF)))},Ae=()=>{!oe||!O.current||(R.current=e.connectStream({replay:60,onOpen:()=>{oe&&(Z=1e3,E(!0),D(""))},onEvent:Be,onClose:xe=>{if(oe){if(fe(),E(!1),!xe.retryable){D(`event stream closed (${xe.code}): ${xe.reason}`);return}O.current&&($=setTimeout(Ae,Z),Z=Math.min(Z*2,1e4))}},onError:xe=>{oe&&D(xe.message||"event stream unavailable")}}))};return Ae(),()=>{oe=!1,$&&clearTimeout($),q&&clearTimeout(q),X=[],R.current?.close()}},[e]),(0,Mo.useEffect)(()=>{let oe=!0;return e.getTranscript(wI).then($=>{oe&&a(Z=>HQ(Z,$,wI))},()=>{}),()=>{oe=!1}},[e]),(0,Mo.useEffect)(()=>{let oe=!0,$=!1,Z,q=async()=>{if($)return;$=!0;let fe=new AbortController;Z=fe;try{let Be=await e.snapshot(1,fe.signal);oe&&(i(Ae=>Ae&&JSON.stringify(Ae)===JSON.stringify(Be)?Ae:Be),h(""))}catch(Be){oe&&h(Be.message||"snapshot refresh failed")}finally{$=!1,Z===fe&&(Z=void 0)}};q();let X=setInterval(q,5e3);return()=>{oe=!1,Z?.abort(),clearInterval(X)}},[e]);let G=()=>{R.current?.close()};return{snap:r,setSnap:i,events:s,setEvents:a,connected:u,snapshotError:I,streamError:y,wsRef:R,closeStream:G,shutdown:()=>{O.current=!1,G()}}}var Po=Le(jt(),1);var e1=1e3;function KQ({api:e,projectRef:t,setEvents:r,setNotice:i,captureAdmission:s}){let[a,u]=(0,Po.useState)(!1),[E,I]=(0,Po.useState)(""),[h,y]=(0,Po.useState)(!1),[D,R]=(0,Po.useState)(0),[O,G]=(0,Po.useState)([]),[ne,oe]=(0,Po.useState)(0),[$,Z]=(0,Po.useState)(0),q=(0,Po.useRef)(null),X=(0,Po.useRef)(0),fe=()=>{let xe=!!q.current;return X.current+=1,q.current?.controller.abort(),q.current=null,u(!1),I(""),y(!1),R(0),G([]),oe(0),xe},Be=()=>{fe()?i("stopped waiting \xB7 server-side work may still finish in the project timeline"):i("no Manager reply is currently in flight")};return(0,Po.useEffect)(()=>()=>{X.current+=1,q.current?.controller.abort(),q.current=null},[]),(0,Po.useEffect)(()=>{if(!a)return;let xe=setInterval(()=>Z(de=>de+1),e1);return()=>clearInterval(xe)},[a]),{pending:a,phase:E,phaseHeartbeat:h,phaseQuietS:D,steps:O,startedAt:ne,tick:$,managerRequestRef:q,cancelManagerTurn:fe,stopWaiting:Be,submitFreeText:async xe=>{if(q.current){i("Argus is still working \xB7 wait or switch daemons to cancel");return}let de=t.current,ft=++X.current,Ye=new AbortController;q.current={id:ft,project:de,controller:Ye,messageId:""};let we=()=>{let Oe=q.current;return!!(Oe&&Oe.id===ft&&Oe.project===de&&t.current===de&&!Ye.signal.aborted)},ie=`argus-${Date.now()}`;r(Oe=>[...Oe,{type:"ui.operator",text:xe,ts:Date.now()/1e3,event_id:`local-${de}-${ft}-operator`,message_id:`local-${ft}-operator`,local_request_id:ft,local_optimistic:!0}]),I(""),G([]),oe(Date.now()),Z(0),u(!0),i("");let k=(Oe,gt=ie,at="auto")=>{we()&&r(Ge=>we()?[...Ge,{type:"ui.argus",text:Oe,message_id:gt,fragment_mode:at,ts:Date.now()/1e3}]:Ge)},H=[],se=!1,ge=()=>{if(se||!we())return;se=!0;let Oe=pQ(gQ(H));Oe&&r(gt=>we()?[...gt,{type:"ui.activity",text:Oe,ts:Date.now()/1e3}]:gt)},Ee=!1,Ze=null;try{try{await e.messageStream(xe,{onPhase:(Oe,gt,at)=>{we()&&(I(Oe),y(at.heartbeat),R(at.quietS),H=fQ(H,{label:Oe,role:gt,kind:at.kind,detail:at.detail,heartbeat:at.heartbeat,quietS:at.quietS}),G(H))},onDelta:(Oe,gt,at)=>{if(!we())return;Ee=!0,ge(),I(""),y(!1),R(0);let Ge=gt||ie,it=q.current;it?.id===ft&&(it.messageId=Ge),k(Oe,Ge,at==="append"||at==="snapshot"?at:"auto")},onDone:Oe=>{we()&&(ge(),Oe.kind==="task"?(s(Oe.daemon,de,!!Oe.continuous),Ee||k(zm(Oe))):Ee||k(Oe.reply||"[Manager reply unavailable] No task was dispatched."))},onError:Oe=>{we()&&(Ze=Oe)}},Ye.signal)}catch(Oe){we()&&(Ze=Oe)}if(!we())return;if(Ze&&!Ee)try{let Oe=await e.message(xe,Ye.signal);if(!we())return;Oe.kind==="chat"&&Oe.reply?k(Oe.reply):Oe.kind==="task"?(s(Oe.daemon,de,!!Oe.continuous),k(zm(Oe))):k(Oe.reply||"(no response)")}catch(Oe){we()&&k(`(couldn\u2019t reach Argus: ${Oe.message})`)}}finally{q.current?.id===ft&&(ge(),q.current=null,u(!1),y(!1),R(0),G([]))}}}}var JQ=Le(jt(),1);function jQ(e,t){let[r,i]=(0,JQ.useState)(null);return{panel:r,setPanel:i,openPanel:(a,u={})=>{let E=!["help","backlog","events"].includes(a);if(i({kind:a,page:0,...u,loading:E}),!E)return;let h={status:()=>e.getStatus(),doctor:()=>e.getDoctor(),journal:()=>e.getJournal(20),config:()=>e.getConfig(),identity:()=>e.getIdentity(),daemons:()=>e.listProjects(),artifacts:()=>e.getArtifacts(),artifact:()=>e.getArtifact(String(u.path??"")),task:()=>e.getBacklogItem(String(u.itemId??""))}[a];h&&h().then(y=>i(D=>{if(!D||D.kind!==a)return D;let R=D.selection??0;if(a==="daemons"){let G=Za(is(y),String(u.query??"")).findIndex(ne=>ne.id===t);R=G>=0?G:0}return{...D,loading:!1,data:y,selection:R}}),y=>i(D=>D&&D.kind===a?{...D,loading:!1,error:y.message}:D))}}}function YQ(e,t){let r=nI(e);if(!r)return;if(!r.cmd){let E=oI(r.name);t.setNotice(E?`unknown ${r.name} \u2014 did you mean ${E}?`:`unknown command ${r.name} \u2014 /help`);return}let i=E=>()=>t.setNotice(E),s=E=>t.setNotice(`error: ${E.message}`),a=E=>t.setNotice(`usage: ${E}`),u=E=>t.setEvents(I=>[...I,{type:"ui.argus",text:E,message_id:`local-${Date.now()}`,ts:Date.now()/1e3}]);switch(r.cmd.name){case"/help":t.openPanel("help");break;case"/status":t.openPanel("status");break;case"/roles":t.openPanel("config");break;case"/doctor":t.openPanel("doctor");break;case"/identity":if(!r.rest)t.openPanel("identity");else if(r.rest.toLowerCase().startsWith("set ")){let E=r.rest.slice(4).trim();E?t.api.setIdentity(E).then(i("identity updated"),s):a("/identity set ")}else a("/identity [set ]");break;case"/journal":t.openPanel("journal");break;case"/backlog":t.openPanel("backlog",{all:r.rest.trim()==="all",selection:0});break;case"/daemons":t.openPanel("daemons",{query:r.rest});break;case"/artifacts":t.openPanel("artifacts");break;case"/artifact":r.rest?t.openPanel("artifact",{path:r.rest}):a("/artifact ");break;case"/events":t.openPanel("events",{...rI(r.rest)});break;case"/find":r.rest?t.openPanel("events",{filter:"all",query:r.rest}):a("/find ");break;case"/item":r.rest?t.openPanel("task",{itemId:r.rest}):a("/item ");break;case"/resume":case"/attach":t.switchProject(r.rest);break;case"/rename":if(!r.rest){a("/rename ");break}t.api.renameProject(r.rest).then(E=>{t.setSnap(I=>I&&I.session.id===E.sid?{...I,session:{...I.session,display_name:E.name}}:I),t.projectRef.current===E.sid&&t.setNotice(`renamed conversation to ${E.name}`)},s);break;case"/clear":t.setEvents([]),t.setNotice("feed cleared");break;case"/run":t.setPanel(null),t.setNotice("already following the live daemon feed");break;case"/reconnect":t.setNotice("reconnecting\u2026"),t.closeStream();break;case"/cancel":t.stopWaiting();break;case"/abort":t.api.abortMission("operator used /abort").then(E=>t.setNotice(E.message),s);break;case"/quit":t.quit();break;case"/task":r.rest?t.api.postTask(r.rest).then(E=>t.setNotice(`queued ${E.id}`),s):a("/task ");break;case"/plan":r.rest?t.api.previewPlan(r.rest).then(E=>{if(E.error){u(`Planner could not draft a plan: ${E.error}`);return}let I=["Planner preview (nothing queued):"];E.steps.forEach((h,y)=>{I.push(`${y+1}. ${h.title}${h.detail?` \u2014 ${h.detail}`:""}`)}),E.notes.length&&I.push(`Notes: ${E.notes.join("; ")}`),I.push("Use /task to queue it."),u(I.join(` +`))},s):a("/plan ");break;case"/nudge":r.rest?t.api.postNudge(r.rest).then(i("nudge sent"),s):a("/nudge ");break;case"/rewrite":r.rest?t.rewriteDraft(r.rest):a("/rewrite \u2014 or press Ctrl+R to rewrite what you already typed");break;case"/note":r.rest?t.api.postNote(r.rest).then(i("note added"),s):a("/note ");break;case"/done":r.rest?t.api.disposeBacklog(r.rest,"done").then(i(`done ${r.rest}`),s):a("/done ");break;case"/skip":r.rest?t.api.disposeBacklog(r.rest,"skip").then(i(`skipped ${r.rest}`),s):a("/skip ");break;case"/stop":r.rest?t.api.stopBacklog(r.rest).then(i(`stopped ${r.rest}`),s):a("/stop ");break;case"/new":t.openNewDaemon(r.rest);break;case"/backend":r.rest?t.api.setConfig("backend",r.rest).then(()=>t.setNotice(`backend set to ${r.rest}`),s):t.openPanel("config");break;case"/config":{if(!r.rest){t.openPanel("config");break}let E=r.rest.split(/\s+/).filter(Boolean),I=E.find(y=>{let D=y.indexOf("=");return D<=0||D===y.length-1});if(I){t.setNotice(`expected key=value, got ${I}`);break}let h=E.map(y=>{let D=y.indexOf("=");return t.api.setConfig(y.slice(0,D),y.slice(D+1))});Promise.all(h).then(()=>t.setNotice(`updated ${h.length} setting(s)`),s);break}case"/reset":t.api.resetManager().then(i("Manager context reset"),s);break;case"/skills":t.api.skills(r.rest||"ls").then(u,s);break;default:t.setNotice(`${r.cmd.name} not yet wired`)}}var yo=Le(Pt(),1);function VQ({card:e,selection:t,note:r,busy:i,error:s}){let a=e.options[t],u=e.options.length===0;return(0,yo.jsxs)(ye,{flexDirection:"column",borderStyle:"round",borderColor:Ie.warning,paddingX:1,marginTop:1,children:[(0,yo.jsx)(N,{color:Ie.warning,bold:!0,children:"ACTION REQUIRED"}),(0,yo.jsx)(N,{bold:!0,wrap:"wrap",children:e.title}),(0,yo.jsx)(ye,{marginTop:1,children:(0,yo.jsx)(N,{wrap:"wrap",children:e.question})}),e.options.length?(0,yo.jsx)(ye,{flexDirection:"column",marginTop:1,children:e.options.map((E,I)=>(0,yo.jsxs)(N,{color:I===t?Ie.accent:void 0,wrap:"wrap",children:[I===t?"\u203A ":" ",I+1,". ",E.label,E.description&&E.description!==e.question?` \u2014 ${E.description}`:""]},E.id))}):null,u||a?.requires_note?(0,yo.jsxs)(ye,{marginTop:1,children:[(0,yo.jsx)(N,{color:Ie.accent,children:"Your response \u203A "}),(0,yo.jsx)(N,{children:r.value}),i?null:(0,yo.jsx)(N,{inverse:!0,children:" "})]}):null,s?(0,yo.jsx)(N,{color:Ie.error,wrap:"wrap",children:s}):null,(0,yo.jsx)(N,{dimColor:!0,children:i?"Sending your answer\u2026":u?"Type your answer \xB7 Enter send":"\u2191/\u2193 or number select \xB7 Enter confirm \xB7 typing selects an option that accepts guidance"})]})}var En=Le(Pt(),1);function fp(e,t,r){return!e?.admission_required||!e.running_daemons?.length?null:{targetProject:t,running:e.running_daemons,limit:e.limit??e.running_daemons.length,activeCount:e.active_count??e.running_daemons.length,selection:0,resumeContinuous:r,busy:!1,error:""}}function qQ({host:e,port:t,token:r,project:i,initialNotice:s="",initialAdmission:a,initialResumeContinuous:u=!1,exitPolicy:E="detach",onProjectChange:I,trackDaemonCreation:h=y=>y}){let{exit:y}=sA(),{stdout:D}=AA(),R=Lu(),[O,G]=(0,gr.useState)(i),ne=(0,gr.useRef)(O);ne.current=O;let oe=(0,gr.useMemo)(()=>new ns({host:e,port:t,project:O,token:r}),[e,t,O,r]),{snap:$,setSnap:Z,events:q,setEvents:X,connected:fe,snapshotError:Be,streamError:Ae,closeStream:xe,shutdown:de}=WQ(oe,O),[ft,Ye]=(0,gr.useState)(aA),[we,ie]=(0,gr.useState)(Dy),[k,H]=(0,gr.useState)(0),[se,ge]=(0,gr.useState)(s),{panel:Ee,setPanel:Ze,openPanel:Oe}=jQ(oe,O),[gt,at]=(0,gr.useState)(null),[Ge,it]=(0,gr.useState)(()=>fp(a,i,u)),[J,ce]=(0,gr.useState)(!1),[he]=(0,gr.useState)(FQ),et=(0,gr.useMemo)(()=>GQ($?.pending_questions??[],($?.backlog??[]).map(ve=>({...ve})))[0]??null,[$?.backlog,$?.pending_questions]),[je,Qt]=(0,gr.useState)(0),[ct,mt]=(0,gr.useState)(aA),[wt,Je]=(0,gr.useState)(!1),[Br,Ar]=(0,gr.useState)("");(0,gr.useEffect)(()=>{H(0)},[ft.value]),(0,gr.useEffect)(()=>{Qt(0),mt(aA),Je(!1),Ar("")},[et?.id]);let yr=(0,gr.useRef)(!1),Ur=(0,gr.useRef)(!0),K=(0,gr.useRef)(0),le=(0,gr.useRef)(!1),tt=(0,gr.useRef)(!1);(0,gr.useEffect)(()=>(Ur.current=!0,()=>{Ur.current=!1}),[]),(0,gr.useEffect)(()=>{if(D.isTTY)return D.write("\x1B[?2004h"),()=>{D.write("\x1B[?2004l")}},[D]);let pt=(ve,Ne,ze)=>{let Ut=fp(ve,Ne,ze);Ut&&(K.current=0,it(Ut))};(0,gr.useEffect)(()=>{let ve=$?.daemon_admission;Ge||!ve||ve.requested_at<=K.current||it(fp(ve,ve.target_sid||O,ve.resume_continuous))},[O,Ge,$?.daemon_admission]);let bt=async()=>{if(!Ge||Ge.busy)return;let ve=Ge.running[Ge.selection];if(ve){it(Ne=>Ne&&{...Ne,busy:!0,error:""});try{let ze=await new ns({host:e,port:t,project:Ge.targetProject,token:r}).replaceDaemon(ve.id,Ge.resumeContinuous,$?.daemon_commands?.revision);if(ze.rc!==0){let Ut=fp(ze,Ge.targetProject,Ge.resumeContinuous);it(Ut??{...Ge,busy:!1,error:ze.error||"could not replace the selected session"});return}K.current=Date.now()/1e3,it(null),ge(`parked ${ve.label||ve.id} \xB7 queued work started`)}catch(Ne){it(ze=>ze&&{...ze,busy:!1,error:Ne.message})}}},{pending:_t,phase:Xt,phaseHeartbeat:or,phaseQuietS:ir,steps:tn,startedAt:Ss,tick:Uo,managerRequestRef:Wn,cancelManagerTurn:xn,stopWaiting:Ai,submitFreeText:ai}=KQ({api:oe,projectRef:ne,setEvents:X,setNotice:ge,captureAdmission:pt}),Go=ve=>ve===ne.current?!1:(xn(),ne.current=ve,G(ve),I?.(ve),it(null),K.current=0,!0),kn=()=>{Ur.current=!1,xn(),de(),y()},li=async ve=>{let Ne=tI(ve);if(Ne.kind==="list"){Oe("daemons");return}let ze=Ne.query;try{let Ut=await oe.listProjects(),dr=Ut.find(lt=>lt.id===ze)||Ut.find(lt=>lt.id.startsWith(ze))||Ut.find(lt=>(lt.label||"").toLowerCase().includes(ze.toLowerCase()))||Za(Ut,ze)[0];if(!dr){ge(`no project matching "${ze}" \u2014 /daemons to list`);return}if(dr.id===O){ge(`already on ${dr.id}`);return}Go(dr.id),ge(`switched to ${dr.label||dr.id}`)}catch(Ut){ge(`error: ${Ut.message}`)}},Xr=ve=>{if(Ze(null),ve.id===O){ge(`already on ${ve.label||ve.id}`);return}Go(ve.id),ge(`switched to ${ve.label||ve.id}`)},As=(ve="")=>{Ze(null),ce(!1),ge(""),at(Sf(ve))},ro=async()=>{if(!gt||gt.busy)return;if(yr.current){at(ze=>ze&&{...ze,error:"a daemon is already being created"});return}let{objective:ve,name:Ne}=Ou(gt);yr.current=!0,at(ze=>ze&&{...ze,busy:!0,error:""});try{let ze=await h(oe.createDaemon(ve,Ne));if(!Ur.current)return;Ze(null),at(null),Go(ze.sid),pt(ze.start,ze.sid,!!ve),ge(ze.start?.admission_required?`created ${ze.sid} \xB7 choose running work to park`:ze.spawned?`created ${ze.sid} \xB7 campaign started`:`created ${ze.sid} \xB7 message Argus when ready`)}catch(ze){if(!Ur.current)return;at(Ut=>Ut&&{...Ut,busy:!1,error:ze.message||"daemon creation failed"})}finally{yr.current=!1}},as=ve=>{let Ne=(ve||"").trim();if(!Ne){ge("nothing to rewrite \xB7 type a prompt first");return}tt.current||(tt.current=!0,ge("Manager is rewriting your prompt\u2026"),oe.rewritePrompt(Ne).then(ze=>{if(tt.current=!1,ze.error||!ze.rewritten.trim()){ge(`rewrite failed \xB7 ${ze.error||"empty rewrite"} \xB7 your prompt is unchanged`);return}Ye(lA(ze.rewritten));let Ut=["Rewrote your prompt (not sent \u2014 edit it, then Enter):","",`was: ${Ne}`];ze.changes.length&&Ut.push("","made explicit:",...ze.changes.map(dr=>` - ${dr}`)),ze.questions.length&&Ut.push("","Manager asks (answer these, or they stay unspecified):",...ze.questions.map(dr=>` ? ${dr}`)),X(dr=>[...dr,{type:"ui.activity",text:Ut.join(` +`),ts:Date.now()/1e3}]),ge("prompt rewritten \xB7 review it, then Enter to send")},ze=>{tt.current=!1,ge(`rewrite failed \xB7 ${ze.message} \xB7 your prompt is unchanged`)}))},po=ve=>{YQ(ve,{api:oe,openPanel:Oe,setPanel:Ze,setEvents:X,setNotice:ge,setSnap:Z,projectRef:ne,closeStream:xe,stopWaiting:Ai,quit:kn,switchProject:li,openNewDaemon:As,rewriteDraft:as})},_s=()=>{let ve=ft.value.trim();if(ve){if(!wf(ve)&&Wn.current){ge("Argus is still working \xB7 wait or switch daemons to cancel");return}Ye(aA),H(0),ie(Ne=>$m(Ne,ve)),wf(ve)?po(ve):ai(ve)}},ui=async()=>{if(!et||wt)return;let ve=et.options.length===0,Ne=et.options[je],ze=ct.value.trim();if((ve||Ne?.requires_note)&&!ze){Ar("Type the requested answer before confirming.");return}if(!(!ve&&!Ne)){Je(!0),Ar("");try{let Ut=et.legacy?await oe.answerPending(et.item_id,ze):await oe.resolveDecision(et.id,ve?"custom":Ne.id,ze);if(Ut.resolved===!1){Ar(String(Ut.reply||"A more specific answer is required."));return}ge(String(Ut.reply||"Your answer was delivered to the team.")),Z(await oe.snapshot())}catch(Ut){Ar(Ut.message)}finally{Je(!1)}}};rs((ve,Ne)=>{let ze=TQ(ve,le.current);if(ze.handled){if(le.current=ze.active,et&&ze.text){let lt=et.options.length===0,Zt=et.options.findIndex(cr=>cr.requires_note);(lt||Zt>=0)&&(Zt>=0&&Qt(Zt),mt(cr=>uA(cr,ze.text)));return}if(ze.text&&!Ee){if(Ge)return;if(gt){let lt=_f(gt,ze.text,{});at(lt.draft)}else Ye(lt=>uA(lt,ze.text)),ie(lt=>lt.pos===0?lt:{...lt,pos:0});ze.pasted&&ze.text.length>20&&ge(`pasted ${Array.from(ze.text).length} chars \xB7 Enter to send`)}return}if(et){if(Ne.ctrl&&(ve==="c"||ve==="d")){kn();return}if(wt)return;if(et.options.length===0){Ne.return?ui():Ne.leftArrow?mt(Va):Ne.rightArrow?mt(qa):Ne.backspace||Ne.delete?mt(Ru):Ne.ctrl&&ve==="w"?mt(bu):Ne.ctrl&&ve==="u"?mt(Fu):Ne.ctrl&&ve==="k"?mt(xu):ve&&!Ne.ctrl&&!Ne.meta&&mt(cr=>uA(cr,ve)),Ar("");return}if(Ne.downArrow){Qt(cr=>tl(cr,et.options.length,1));return}if(Ne.upArrow){Qt(cr=>tl(cr,et.options.length,-1));return}if(Ne.return){ui();return}if(et.options[je]?.requires_note){Ne.leftArrow?mt(Va):Ne.rightArrow?mt(qa):Ne.backspace||Ne.delete?mt(Ru):Ne.ctrl&&ve==="w"?mt(bu):Ne.ctrl&&ve==="u"?mt(Fu):Ne.ctrl&&ve==="k"?mt(xu):ve&&!Ne.ctrl&&!Ne.meta&&mt(cr=>uA(cr,ve)),Ar("");return}if(/^[1-9]$/.test(ve)){let cr=Number(ve)-1;crYt.requires_note);cr>=0&&(Qt(cr),mt(Yt=>uA(Yt,ve)),Ar(""))}return}if(Ge){let lt=LQ(Ge,ve,Ne);lt==="exit"?kn():lt==="dismiss"?(K.current=Date.now()/1e3,it(null),ge("new work remains queued")):lt==="next"?it(Zt=>Zt&&{...Zt,selection:tl(Zt.selection,Zt.running.length,1)}):lt==="previous"?it(Zt=>Zt&&{...Zt,selection:tl(Zt.selection,Zt.running.length,-1)}):lt==="replace"&&bt();return}if(gt){if(Ne.ctrl&&ve==="d"){kn();return}if(Ne.ctrl&&ve==="c"){gt.busy||at(null);return}let lt=_f(gt,ve,Ne);lt.intent==="submit"?ro():lt.intent==="cancel"?at(null):lt.draft!==gt&&at(lt.draft);return}if(Ne.ctrl&&ve==="c"){if(J){kn();return}ce(!0),ge(`Ctrl-C again to exit \xB7 Ctrl-D also quits \xB7 ${E==="stop-all"?"current executor and this launch's owned API will stop gracefully":E==="stop-api"?"executor keeps running; this launch's owned API will stop":"terminal UI exits; local API and executor keep running"}`);return}if(Ne.ctrl&&ve==="d"){kn();return}if(PQ(ve,Ne.ctrl,Ne.meta)){as(ft.value);return}if(J&&ce(!1),Ee){let lt=Ee.kind==="daemons"||Ee.kind==="artifacts"||Ee.kind==="backlog",Zt=Ee.kind==="daemons"?Za(is(Ee.data??[]),Ee.query??""):[],cr=Ee.kind==="backlog"?Ee.all?$?.backlog??[]:ap($?.backlog??[],!1):[];if(Ne.escape||ve==="q")Ze(null);else if(Ee.kind==="daemons"&&ve==="n")Ze(null),As();else if(Ee.kind==="daemons"&&ve==="/")Ze(null),Ye(lA("/daemons ")),H(0);else if(lt&&(Ne.downArrow||ve==="j")){let Yt=Ee.kind==="daemons"?Zt.length:Ee.kind==="backlog"?cr.length:Array.isArray(Ee.data)?Ee.data.length:0;Ze(rn=>rn&&{...rn,selection:tl(rn.selection??0,Yt,1)})}else if(lt&&(Ne.upArrow||ve==="k")){let Yt=Ee.kind==="daemons"?Zt.length:Ee.kind==="backlog"?cr.length:Array.isArray(Ee.data)?Ee.data.length:0;Ze(rn=>rn&&{...rn,selection:tl(rn.selection??0,Yt,-1)})}else if(lt&&Ne.return)if(Ee.kind==="daemons"){let Yt=Zt[Ee.selection??0];Yt&&Xr(Yt)}else if(Ee.kind==="artifacts"){let rn=(Ee.data??[])[Ee.selection??0];rn?.exists?Oe("artifact",{path:rn.path}):rn&&(Ze(null),ge(`artifact is declared but missing: ${rn.path}`))}else{let Yt=cr[Ee.selection??0];Yt&&Oe("task",{itemId:Yt.id})}else Ne.return?Ze(null):Ne.downArrow||ve==="j"?Ze(Yt=>Yt&&{...Yt,page:(Yt.page??0)+1}):(Ne.upArrow||ve==="k")&&Ze(Yt=>Yt&&{...Yt,page:Math.max(0,(Yt.page??0)-1)});return}let Ut=zd(ft.value),dr=Ut.length>0;if(Ne.escape&&Wn.current&&!dr){Ai();return}if(Ne.escape){dr&&Ye(aA);return}if(dr){if(Ne.upArrow){H(Zt=>(Zt-1+Ut.length)%Ut.length);return}if(Ne.downArrow){H(Zt=>(Zt+1)%Ut.length);return}let lt=Ut[Math.min(k,Ut.length-1)];if(Ne.tab){Ye(lA($d(lt))),H(0);return}if(Ne.return){let Zt=ft.value.trim(),cr=Zt.toLowerCase()===lt.name.toLowerCase()||(lt.aliases??[]).some(Yt=>Yt.toLowerCase()===Zt.toLowerCase());if(!cr&<.arg)Ye(lA($d(lt))),H(0);else{let Yt=cr?Zt:lt.name;Ye(aA),H(0),ie(rn=>$m(rn,Yt)),po(Yt)}return}}if(Ne.return){_s();return}if(Ne.leftArrow){Ye(Va);return}if(Ne.rightArrow){Ye(qa);return}if(Ne.upArrow){let lt=yy(we,ft.value);ie(lt.h),Ye(lA(lt.value));return}if(Ne.downArrow){let lt=Qy(we);ie(lt.h),Ye(lA(lt.value));return}if(Ne.ctrl&&ve==="a"){Ye(jd);return}if(Ne.ctrl&&ve==="e"){Ye(Yd);return}if(Ne.ctrl&&ve==="b"){Ye(Va);return}if(Ne.ctrl&&ve==="f"){Ye(qa);return}if(Ne.ctrl&&ve==="w"){Ye(bu);return}if(Ne.ctrl&&ve==="u"){Ye(Fu);return}if(Ne.ctrl&&ve==="k"){Ye(xu);return}if(Ne.backspace||Ne.delete){Ye(Ru),ie(lt=>lt.pos===0?lt:{...lt,pos:0});return}if(ve==="?"&&ft.value===""){Oe("help");return}ve&&!Ne.ctrl&&!Ne.meta&&(Ye(lt=>uA(lt,ve)),ie(lt=>lt.pos===0?lt:{...lt,pos:0}))});let bi=zd(ft.value),Qo=bi.length>0&&!Ge&&!gt&&!Ee,EA=_t?["manager"]:[],ls=wQ($?.roles??[],q),Ho=(Xt||"handling your message").replace(/^Manager\s*·\s*/i,"").replace(/[.…]+$/u,""),Nn=_t?vQ(ls,"manager",Ho,Math.max(0,(Date.now()-Ss)/1e3)):ls,wo=$?Uy({...$,roles:Nn},q):null,Rs=$?.partial?($.diagnostics??[]).map(ve=>`${ve.section}: ${ve.message}`).join(" \xB7 "):"",vr=$?.observability?.slo.status==="degraded"?$.observability.slo.violations.join(" \xB7 "):"",us=Be?`snapshot refresh failed \xB7 ${Be}`:$?.partial?`snapshot partial \xB7 ${Rs||"backend reported incomplete state"}`:vr?`SLO degraded \xB7 ${vr}`:Ae&&!fe?`event stream reconnecting \xB7 ${Ae}`:"";return(0,En.jsxs)(ye,{flexDirection:"column",paddingX:1,children:[(0,En.jsx)(Ly,{width:R.columns}),Qo?null:(0,En.jsx)(mQ,{alert:yI(q)}),et?(0,En.jsx)(VQ,{card:et,selection:je,note:ct,busy:wt,error:Br}):Ge?(0,En.jsx)(MQ,{state:Ge,width:R.columns}):gt?(0,En.jsx)(sp,{draft:gt}):(0,En.jsxs)(En.Fragment,{children:[wo&&!Qo&&!Ee?(0,En.jsx)(NQ,{view:wo,width:R.columns,height:R.rows,busy:_t,spentUsd:$?.global_spend_usd,spendStatus:$?.global_spend_status,globalDailyCapUsd:$?.daemon.global_daily_cap_usd,requestUsage:$?.request_usage}):null,(0,En.jsx)($y,{events:q,width:R.columns,mode:"all",liveMessageId:Wn.current?.messageId,collapsed:Qo||!!Ee,showIdle:!wo,showReasoning:he}),Ee?(0,En.jsx)(bQ,{panel:Ee,snap:$,events:q,viewportRows:R.rows,viewportColumns:R.columns,activeProject:O}):(0,En.jsxs)(En.Fragment,{children:[_t&&!Qo&&(0,En.jsx)(EQ,{tick:Uo,phase:Xt,heartbeat:or,quietS:ir,steps:tn,width:R.columns,elapsedS:Math.max(0,Math.floor((Date.now()-Ss)/1e3))}),(0,En.jsxs)(ye,{flexDirection:"column",flexShrink:0,children:[(0,En.jsx)(aQ,{items:bi,selected:Math.min(k,bi.length-1),maxVisible:AQ(R.rows)}),(0,En.jsx)(iQ,{edit:ft,width:R.columns,rowsBelow:Qo?0:1})]}),Qo?null:(0,En.jsx)(lQ,{notice:se,health:us,width:R.columns})]})]})]})}import{execFile as XQ}from"node:child_process";import{mkdir as t1,readFile as ZQ,writeFile as r1,rename as n1,unlink as GP}from"node:fs/promises";import{homedir as o1}from"node:os";import{dirname as i1,join as zQ,resolve as s1}from"node:path";function ZA(e){let t=e.trim().toLowerCase();if(t==="localhost"||t==="::1")return!0;let r=t.split(".").map(Number);return r.length===4&&r[0]===127&&r.every(i=>Number.isInteger(i)&&i>=0&&i<=255)}function RI(e,t,r=process.env){if(!ZA(e))return;let i=r.ARGUS_SKILL_HOME?.trim(),s=r.HOME?.trim()||o1(),a=i?s1(i):zQ(s,".argus-skill"),u=e.toLowerCase().replace(/[^a-z0-9._-]+/g,"_");return zQ(a,"runtime",`webapi-${u}-${t}.owner.json`)}async function A1(e){let t=!1;try{process.kill(e,0),t=!0}catch{return{alive:!1,argv:[]}}try{let i=(await ZQ(`/proc/${e}/cmdline`)).toString("utf8").split("\0").filter(Boolean);return{alive:t,argv:i}}catch{return{alive:!1,argv:[]}}}async function a1(e){try{process.kill(e,0)}catch{return{alive:!1,argv:[]}}return new Promise(t=>{XQ("/bin/ps",["-ww","-p",String(e),"-o","command="],{encoding:"utf-8"},(r,i)=>{let s=r?"":i.trim();t({alive:!!s,argv:[],commandLine:s||void 0})})})}async function l1(e){try{process.kill(e,0)}catch{return{alive:!1,argv:[]}}let t=["$ErrorActionPreference = 'Stop'","[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)",`$process = Get-CimInstance Win32_Process -Filter "ProcessId = ${e}"`,"if ($null -eq $process) { exit 3 }","[PSCustomObject]@{ commandLine = [string]$process.CommandLine } | ConvertTo-Json -Compress"].join("; ");return new Promise(r=>{XQ("powershell.exe",["-NoProfile","-NonInteractive","-Command",t],{encoding:"utf-8",windowsHide:!0},(i,s)=>{if(i){r({alive:!1,argv:[]});return}try{let a=JSON.parse(s.trim()),u=typeof a.commandLine=="string"?a.commandLine.trim():"";r({alive:!!u,argv:[],commandLine:u||void 0})}catch{r({alive:!1,argv:[]})}})})}function e0(e,t=process.platform){return t==="win32"?l1(e):t==="darwin"?a1(e):A1(e)}function SI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vI(e,t,r){return new RegExp(`(?:^|\\s)["']?${SI(t)}["']?(?=\\s|$)`,r?"i":"").test(e)}function $Q(e,t,r,i){return new RegExp(`(?:^|\\s)${SI(t)}\\s+["']?${SI(r)}["']?(?=\\s|$)`,i?"i":"").test(e)}async function gp(e,t){await t1(i1(e),{recursive:!0,mode:448});let r=`${e}.tmp.${process.pid}`;await r1(r,JSON.stringify(t),{encoding:"utf-8",mode:384}),await n1(r,e)}async function _I(e){let{pid:t,host:r,port:i,backendBin:s}=e,a=e.platform??process.platform,u=e.inspect??(R=>e0(R,a)),E=a==="win32",I=(R,O)=>E?R.toLowerCase()===O.toLowerCase():R===O;if(!Number.isInteger(t)||t<=0)return!1;let{alive:h,argv:y,commandLine:D}=await u(t);if(!h)return!1;if(y.length>0){let R=ne=>y.findIndex(oe=>I(oe,ne));if(R(s)===-1||R("--web")===-1)return!1;let O=R("--web-port");if(O===-1||!I(y[O+1]??"",String(i)))return!1;let G=R("--web-host");return!(G!==-1&&!I(y[G+1]??"",r))}return!(!D||!vI(D,s,E)||!vI(D,"--web",E)||!$Q(D,"--web-port",String(i),E)||vI(D,"--web-host",E)&&!$Q(D,"--web-host",r,E))}async function bI(e){return await _I({pid:e.pid,host:e.host,port:e.port,backendBin:e.backendBin,inspect:e.inspect,platform:e.platform})?(await gp(e.path,{schema:1,pid:e.pid,...e.rootPid===void 0?{}:{rootPid:e.rootPid},host:e.host,port:e.port,backendBin:e.backendBin,startedAt:e.startedAt}),!0):!1}async function dp(e){let{path:t,host:r,port:i,backendBin:s}=e,a=e.platform??process.platform,u=e.inspect??(E=>e0(E,a));try{let E=await ZQ(t,"utf-8"),I=JSON.parse(E);if(I.schema!==1)return null;let h=I.pid;if(typeof h!="number"||!Number.isInteger(h)||h<=0||I.rootPid!==void 0&&(typeof I.rootPid!="number"||!Number.isInteger(I.rootPid)||I.rootPid<=0)||I.host!==r||I.port!==i||I.backendBin!==s||!await _I({pid:h,host:r,port:i,backendBin:s,inspect:u,platform:a}))return null;if(I.rootPid!==void 0&&I.rootPid!==h&&!await _I({pid:I.rootPid,host:r,port:i,backendBin:s,inspect:u,platform:a})){let{rootPid:y,...D}=I;return D}return I}catch{return null}}function t0(e,t){let r=e?.trim()||"detach";if(r==="detach"||r==="stop-api"||r==="stop-all")return r;throw new Error(`${t} must be detach, stop-api, or stop-all; got ${r}`)}function rl(e,t,r){let i=e[t+1];if(!i||i.startsWith("-"))throw new Error(`${r} requires a value`);return i}function r0(e,t={}){let r=t.env??process.env,i=t.platform??process.platform,s=r.ARGUS_TUI_PORT,a=r.ARGUS_TUI_API_OWNER_FILE?.trim(),u={host:r.ARGUS_TUI_HOST??"127.0.0.1",port:Number(s??8799),portExplicit:s!==void 0,project:r.ARGUS_TUI_PROJECT,resume:!1,resumeAll:!1,token:r.ARGUS_SKILL_WEB_TOKEN,ownerFile:void 0,once:!1,json:!1,count:5,help:!1,web:!1,openWebWithCli:i==="win32",noOpen:!1,objective:"",forceNew:!1,exitPolicy:t0(r.ARGUS_TUI_EXIT_POLICY,"ARGUS_TUI_EXIT_POLICY"),ownerFileExplicit:!!a};for(let E=0;E65535)throw new Error(`--port must be between 1 and 65535; got ${u.port}`);if(!Number.isInteger(u.count)||u.count<1)throw new Error(`--count must be a positive integer; got ${u.count}`);return u.ownerFile=a||RI(u.host,u.port),u}function n0(e,t){return{...e,port:t,ownerFile:e.ownerFileExplicit?e.ownerFile:RI(e.host,t)}}var o0=`argus \u2014 the terminal cockpit for the argus-skill autonomous-research daemon Usage: argus resume [SID] [--all] argus [--resume [SID]] [--host H] [--port P] [--project SID] [--token T] @@ -163,10 +163,13 @@ Usage: argus resume [SID] [--all] Every launch compares the local source identity with the running backend. It auto-starts a missing backend and safely replaces an outdated backend only when -process ownership is proven; unrelated port occupants are never signalled. A +process ownership is proven; unrelated port occupants are never signalled. +Without an explicit port, Argus reuses a compatible backend or selects the +first available port starting at 8799. A plain interactive launch reattaches to a live executor from this directory, or creates a fresh idle session when none is running. argus resume shows conversations from this directory; add --all for every account session. +On Windows, a plain interactive launch also opens the Web UI. The terminal UI, local API server, and per-session executor are separate processes. Ctrl-D (or Ctrl-C twice in the live view) exits only this UI by @@ -175,7 +178,8 @@ policy when this invocation should also perform graceful cleanup. Options: --host H API host (default 127.0.0.1, env ARGUS_TUI_HOST) - --port P API port (default 8799, env ARGUS_TUI_PORT) + --port P pin the API port (otherwise first available from 8799; + env ARGUS_TUI_PORT) --project SID project/session id (interactive recovers; --once is strict) -r, --resume open the local resume picker; an optional SID resumes directly --continue compatibility alias for the local resume picker @@ -183,7 +187,7 @@ Options: --new force a fresh session instead of reattaching to local live work --token T bearer token if the API requires one (env ARGUS_SKILL_WEB_TOKEN) --web ensure the Web UI backend is running, then open it in a browser - --no-open with --web, print the URL without launching a local browser + --no-open do not launch a browser (including the Windows interactive default) --objective X create and immediately start a fresh campaign with objective X --exit-policy P detach (default), stop-api, or stop-all stop-api stops only an API safely owned by this invocation; @@ -191,18 +195,18 @@ Options: (env ARGUS_TUI_EXIT_POLICY) --once --json connect, print a JSON snapshot+events sample, exit 0 (CI/headless) --count N events to collect in --once mode (default 5) -`;var Lu=Me(jt(),1);var rl=Me(Pt(),1);function t0({createDaemon:e,onCreated:t}){let{exit:r}=sA(),i=Ou(),[s,a]=(0,Lu.useState)(()=>wf("","objective")),u=(0,Lu.useRef)(!0);(0,Lu.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let E=async()=>{if(s.busy)return;let{objective:I,name:C}=Tu(s);a(y=>({...y,busy:!0,error:""}));try{let y=await e(I,C);u.current&&t(y)}catch(y){if(!u.current)return;a(D=>({...D,busy:!1,error:y.message||"daemon creation failed"}))}};return rs((I,C)=>{if(C.ctrl&&(I==="c"||I==="d")){u.current=!1,r();return}let y=Sf(s,I,C);y.intent==="submit"?E():y.intent==="cancel"?a(wf("","objective")):y.draft!==s&&a(y.draft)}),(0,rl.jsxs)(Qe,{flexDirection:"column",paddingX:1,width:i.columns,children:[(0,rl.jsxs)(Qe,{children:[(0,rl.jsx)(fA,{}),(0,rl.jsx)(k,{color:Sy,dimColor:!0,children:` ${Hy}`})]}),(0,rl.jsx)(op,{draft:s,title:"No daemons yet \u2014 open your first one",cancelHint:"Esc clear \xB7 Ctrl-C quit UI"})]})}var dp=Me(jt(),1);var go=Me(Pt(),1);function r0({projects:e,scopeLabel:t,onSelect:r}){let{exit:i}=sA(),s=Ou(),a=(0,dp.useMemo)(()=>is(e),[e]),[u,E]=(0,dp.useState)(0),I=Math.max(4,Math.min(12,s.rows-8)),C=Math.floor(u/I),y=a.slice(C*I,(C+1)*I);return rs((D,R)=>{if(R.escape||R.ctrl&&(D==="c"||D==="d")){i();return}if(R.upArrow||D==="k"){E(O=>Math.max(0,O-1));return}if(R.downArrow||D==="j"){E(O=>Math.min(a.length-1,O+1));return}if(R.pageUp){E(O=>Math.max(0,O-I));return}if(R.pageDown){E(O=>Math.min(a.length-1,O+I));return}R.return&&a[u]&&r(a[u])}),(0,go.jsxs)(Qe,{flexDirection:"column",paddingX:1,width:s.columns,children:[(0,go.jsx)(fA,{}),(0,go.jsxs)(Qe,{marginTop:1,marginBottom:1,children:[(0,go.jsx)(k,{bold:!0,children:"Resume a conversation"}),(0,go.jsx)(k,{dimColor:!0,children:` ${t} \xB7 ${a.length} project${a.length===1?"":"s"}`})]}),a.length===0?(0,go.jsx)(k,{dimColor:!0,children:"No conversations in this directory. Run argus resume --all to find legacy or other-directory sessions."}):y.map((D,R)=>{let G=C*I+R===u,ne=D.label||D.display_name||D.id;return(0,go.jsxs)(Qe,{children:[(0,go.jsx)(k,{color:G?me.accent:"gray",children:G?"\u203A ":" "}),(0,go.jsx)(k,{color:D.daemon_alive?me.success:"gray",children:D.daemon_alive?"\u25CF ":"\u25CB "}),(0,go.jsx)(k,{bold:G,color:G?me.accent:void 0,children:ne.slice(0,Math.max(12,s.columns-28))}),(0,go.jsx)(k,{dimColor:!0,children:` ${D.id.slice(0,12)}`})]},D.id)}),(0,go.jsx)(Qe,{marginTop:1,children:(0,go.jsx)(k,{dimColor:!0,children:`\u2191/\u2193 select \xB7 PgUp/PgDn page \xB7 Enter resume \xB7 Esc quit${a.length>I?` \xB7 page ${C+1}/${Math.ceil(a.length/I)}`:""}`})}),(0,go.jsx)(k,{dimColor:!0,children:"Exit closes this UI; the API and existing executors keep running."})]})}var Mu=Me(jt(),1);var _I=[" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\u256E"," \u2502 \u2502\u2502"," \u2502 \u25C9 argus-skill \xB7 Autonomous Research Lab \u2502\u2502"," \u2502 \u2502\u2502"," \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\u2502"," \u2502"],n0=[" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\u256E"," \u2502 \u25C9 argus-skill \u2502\u2502"," \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\u2502"," \u2502"],RI=["#3b6fd4","#4d86e0","#5f9deb","#72b4f0","#89dceb","#cba6f7","#e6b450"];var s1=Math.max(..._I.map(e=>[...e].length));function FI(e){return e>=s1?_I:n0}var Rf=Me(Pt(),1);function u1({line:e,row:t,frame:r,dim:i}){return(0,Rf.jsx)(k,{dimColor:i,children:[...e].map((s,a)=>(0,Rf.jsx)(k,{color:RI[(Math.floor(a/7)+t+r)%RI.length],children:s},a))})}function i0({onDone:e}){let{stdout:t}=AA(),r=FI(t.columns??80),[i,s]=(0,Mu.useState)(0),a=(0,Mu.useRef)(!1),u=()=>{a.current||(a.current=!0,e())};rs(u),(0,Mu.useEffect)(()=>{let D=setInterval(()=>{s(R=>R<21?R+1:(clearInterval(D),setTimeout(u,120),R))},80);return()=>clearInterval(D)},[]);let E=Math.max(0,i-17+1),I=E<=1?0:Math.min(r.length,(E-1)*2),C=Math.floor(I/2),y=r.length-Math.ceil(I/2);return(0,Rf.jsx)(Qe,{flexDirection:"column",paddingX:1,children:r.map((D,R)=>(0,Rf.jsx)(u1,{line:R>=C&&R0},R))})}function pp({active:e,onExit:t}){let{exit:r}=sA();return rs((i,s)=>{s.ctrl&&(i==="c"||i==="d")&&(t?.(),r())},{isActive:e}),null}import{spawn as s0}from"node:child_process";import{existsSync as c1}from"node:fs";import{dirname as f1,resolve as xI}from"node:path";import{fileURLToPath as g1}from"node:url";function Ff(){if(process.env.ARGUS_SKILL_BIN)return process.env.ARGUS_SKILL_BIN;let e=f1(g1(import.meta.url)),t=xI(e,"..","..",".."),r=d1(t);return c1(r)?r:"argus-skill"}function d1(e,t=process.platform){return t==="win32"?xI(e,".venv","Scripts","argus-skill.exe"):xI(e,".venv","bin","argus-skill")}function p1(e=process.env){let t=e.ARGUS_TUI_LOCAL_SOURCE_DIGEST?.trim();return{releaseId:e.ARGUS_TUI_LOCAL_RELEASE_ID?.trim()||Gd,sourceDigest:t||void 0}}async function l0(e,t,r){try{let i=r?{Authorization:`Bearer ${r}`}:{};return await zA(`http://${e}:${t}/api/meta`,{headers:i},1200,async s=>{if(!s.ok)return{state:"incompatible",message:s.status===404?"service does not expose /api/meta; it is an older Argus checkout or another process":`GET /api/meta returned HTTP ${s.status}`};let a;try{a=await s.json()}catch(E){if(!(E instanceof SyntaxError))throw E;return{state:"incompatible",message:"backend returned malformed /api/meta JSON"}}let u=Jm(a,p1());return!u.compatible||!u.meta?{state:"incompatible",message:u.reason,meta:u.meta}:{state:"compatible",message:uy(u.meta),warning:u.warning,meta:u.meta}})}catch(i){return{state:"unreachable",message:i instanceof Error?i.message:String(i)}}}function u0(e){let t=new Set;return r=>{let i=r.trim();!i||t.has(i)||(t.add(i),e(i))}}async function kI(e,t){let r=e.filter(a=>a.daemon_upgrade_pending===!0||a.daemon_alive&&a.daemon_protocol_compatible===!1&&a.daemon_source_owned===!0).map(a=>a.id),i=await Promise.allSettled(r.map(a=>t(a))),s=i.map(a=>a.status==="fulfilled"&&a.value.scheduled===!0);return{outdated:r,scheduled:r.filter((a,u)=>s[u]),skipped:r.filter((a,u)=>i[u].status==="fulfilled"&&!s[u]),failed:r.filter((a,u)=>i[u].status==="rejected")}}function bI(e,t){let{spawned:r,prefix:i,onWarning:s,spawnedApi:a}=t;return e.warning&&s?.(e.warning),{reachable:!0,spawned:r,message:`${i} \xB7 ${e.message}`,warning:e.warning,...a?{spawnedApi:a}:{}}}function A0(e){return e?.trim()?{...process.env,ARGUS_SKILL_WEB_TOKEN:e.trim()}:process.env}function a0(e,t,r,i,s){return{schema:1,pid:e.meta?.runtime.pid??t,rootPid:t,host:r,port:i,backendBin:s,startedAt:e.meta?.runtime.started_at||new Date().toISOString()}}function ZA(e,t){let r=0,i=[],s=e.filter(a=>typeof a=="number"&&Number.isInteger(a)&&a>0);for(let a of new Set(s))try{t(a,"SIGTERM"),r+=1}catch(u){i.push(u instanceof Error?u:new Error(String(u)))}return{delivered:r,errors:i}}function E1(e,t){return e.schema===t.schema&&e.pid===t.pid&&e.rootPid===t.rootPid&&e.host===t.host&&e.port===t.port&&e.backendBin===t.backendBin&&e.startedAt===t.startedAt}async function c0(e){let t=e.result.spawnedApi;if(!e.result.spawned||!t)return{stopped:!1,message:"API was not safely owned by this invocation"};let r=t.ownership;if(!cp(r.host))return{stopped:!1,message:"refused to stop a non-local API endpoint"};let s=await(e.dependencies?.readOwnedApi??(()=>gp({path:t.ownerFile,host:r.host,port:r.port,backendBin:r.backendBin})))(t);if(!s||!E1(s,r))return{stopped:!1,message:"API ownership changed; no process was signalled"};let u=await(e.dependencies?.probeApi??(()=>l0(r.host,r.port,e.token)))(t);if(!u.meta||u.meta.runtime.pid!==r.pid||u.meta.runtime.started_at!==r.startedAt)return{stopped:!1,message:"API runtime identity changed; no process was signalled"};let E=e.dependencies?.signal??((C,y)=>{process.kill(C,y)}),I=ZA([r.pid,r.rootPid],E);return I.errors.length>0?{stopped:I.delivered>0,message:`API cleanup signalled ${I.delivered} process(es); ${I.errors[0].message}`}:{stopped:I.delivered>0,message:`stopped owned API process tree (${I.delivered} process${I.delivered===1?"":"es"})`}}async function Ep(e){let{host:t,port:r,token:i,autostart:s=!0,ownerFile:a,onStatus:u,onWarning:E,dependencies:I}=e,C=I?.probeApi??(()=>l0(t,r,i)),y=I?.sleep??(J=>new Promise(X=>setTimeout(X,J))),D=cp(t);u?.("checking local and running versions\u2026");let R=await C();if(R.state==="compatible"){if(a&&D&&R.meta){let J=Ff();if(!((await(I?.readOwnedApi??(()=>gp({path:a,host:t,port:r,backendBin:J})))())?.pid===R.meta.runtime.pid)){let he={schema:1,pid:R.meta.runtime.pid,host:t,port:r,backendBin:J,startedAt:R.meta.runtime.started_at||new Date().toISOString()},ue=I?.claimApiOwnership??((Le,pe)=>SI({path:Le,...pe}));try{await ue(a,he)||E?.("local API is compatible but ownership could not be verified; automatic upgrade is disabled for this process")}catch(Le){E?.(`could not record local API ownership: ${Le.message}`)}}}return bI(R,{spawned:!1,prefix:"api up",onWarning:E})}if(R.state==="incompatible"){if(u?.("version mismatch; verifying safe restart ownership\u2026"),!a)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ${R.message}. Stop that WebAPI or choose another port.`};if(!D)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ${R.message}. Stop that WebAPI or choose another port.`};let J=Ff(),X=I?.readOwnedApi??(()=>gp({path:a,host:t,port:r,backendBin:J})),Z=I?.signal??((De,ve)=>{process.kill(De,ve)}),ge=I?.writeOwnershipRecord??((De,ve)=>fp(De,ve)),he=await X();if(he&&R.meta&&he.pid!==R.meta.runtime.pid&&(he=null),!he&&R.meta){let De={schema:1,pid:R.meta.runtime.pid,host:t,port:r,backendBin:J,startedAt:R.meta.runtime.started_at||new Date().toISOString()},ve=I?.claimApiOwnership??((se,N)=>SI({path:se,...N}));try{await ve(a,De)&&(he=De)}catch{}}if(!he)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ${R.message} \u2014 ownership could not be proven`};u?.("restarting outdated owned backend\u2026");let ue=!1,Le=ZA([he.pid,he.rootPid],Z);if(Le.delivered===0&&Le.errors.length>0)if((await C()).state==="unreachable")ue=!0;else return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: could not signal owned pid ${he.pid} (${Le.errors[0].message})`};u?.("waiting for stale backend to shut down\u2026");for(let De=0;!ue&&De<32;De++)if(await y(250),(await C()).state==="unreachable"){ue=!0;break}if(!ue)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: graceful shutdown timed out after SIGTERM`};let pe=I?.spawnApi??(async()=>{let De=s0(J,["--web","--web-host",t,"--web-port",String(r)],{detached:!0,stdio:"ignore",windowsHide:!0,env:A0(i)});return De.unref(),{pid:De.pid}});u?.("starting backend api\u2026");let ct=await pe();for(let De=0;De<20;De++){await y(500);let ve=await C();if(ve.state==="compatible"){let se=a0(ve,ct.pid,t,r,J);try{await ge(a,se)}catch(N){return ZA([se.pid,se.rootPid],Z),{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ownership write failed after spawn (${N.message}); sent SIGTERM to spawned process tree`}}return bI(ve,{spawned:!0,prefix:"api started",onWarning:E,spawnedApi:{ownerFile:a,ownership:se}})}if(ve.state==="incompatible")return ZA([ct.pid],Z),{reachable:!1,spawned:!0,message:`port ${r} is occupied by an incompatible Argus API: ${ve.message}`};u?.(`starting backend api\u2026 ${De+1}`)}return ZA([ct.pid],Z),{reachable:!1,spawned:!0,message:`started backend but it did not come online at ${t}:${r}`}}if(!s||!D)return{reachable:!1,spawned:!1,message:`no API at ${t}:${r} \u2014 start it with: argus-skill --web --web-port ${r}`};u?.("starting backend api\u2026");let O=Ff(),G=I?.spawnApi??(async()=>{let J=s0(O,["--web","--web-host",t,"--web-port",String(r)],{detached:!0,stdio:"ignore",windowsHide:!0,env:A0(i)});return J.unref(),{pid:J.pid}}),ne=I?.signal??((J,X)=>{process.kill(J,X)}),oe=I?.writeOwnershipRecord??((J,X)=>fp(J,X)),$;try{$=(await G()).pid}catch(J){return{reachable:!1,spawned:!1,message:`could not launch '${O} --web' (${J.message}). Set ARGUS_SKILL_BIN or start it yourself: argus-skill --web --web-port ${r}`}}for(let J=0;J<20;J++){await y(500);let X=await C();if(X.state==="compatible"){let Z;if(a){let ge=a0(X,$,t,r,O);try{await oe(a,ge)}catch(he){return ZA([ge.pid,ge.rootPid],ne),{reachable:!1,spawned:!1,message:`could not write ownership record (${he.message}); sent SIGTERM to spawned process tree`}}Z={ownerFile:a,ownership:ge}}return bI(X,{spawned:!0,prefix:"api started",onWarning:E,spawnedApi:Z})}if(X.state==="incompatible")return ZA([$],ne),{reachable:!1,spawned:!0,message:`port ${r} is occupied by an incompatible Argus API: ${X.message}`};u?.(`starting backend api\u2026 ${J+1}`)}return ZA([$],ne),{reachable:!1,spawned:!0,message:`started '${O} --web' but it did not come online at ${t}:${r}`}}function NI(e,t){return mQ(e,t)}function f0(e,t=!1){let r=e?.trim()||"";return r?{kind:"resume",project:r}:t?{kind:"pick"}:{kind:"fresh"}}function g0(e,t){return is(ip(e,t).filter(r=>r.daemon_alive))}import{execFileSync as m1,spawn as I1}from"node:child_process";function d0(e,t,r){try{let i=m1(e,["--pair-plan","--web-host",t,"--web-port",String(r)],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}),s=JSON.parse(i);return typeof s?.url!="string"||!s.url?null:{token:typeof s.token=="string"?s.token:"",url:s.url,banner:typeof s.banner=="string"?s.banner:"",pairing:s.pairing===!0}}catch{return null}}function p0(e,t){if(!t?.trim())return e;let r=new URL(e);return r.searchParams.set("project",t.trim()),r.toString()}function E0(e,t,r,i){let s=e==="0.0.0.0"||e==="::"||e==="::0"?"127.0.0.1":e,a=new URL(`http://${s}:${t}/`);return r?.trim()&&a.searchParams.set("project",r.trim()),i?.trim()&&a.searchParams.set("token",i.trim()),a.toString()}function h1(e,t=process.platform,r=process.env){return t==="darwin"?{command:"open",args:[e]}:t==="win32"?{command:"cmd",args:["/c","start","",e]}:t==="linux"&&r.VSCODE_IPC_HOOK_CLI?{command:"code",args:["--open-url",e]}:t==="linux"&&(r.DISPLAY||r.WAYLAND_DISPLAY)?{command:"xdg-open",args:[e]}:null}function m0(e){let t=h1(e);if(!t)return!1;try{return I1(t.command,t.args,{detached:!0,stdio:"ignore"}).unref(),!0}catch{return!1}}var mp=class{opts;ensurePromise=null;acceptedResult=null;currentSid=null;pendingDaemonCreations=new Set;cleanupPromise=null;constructor(t){this.opts=t}trackEnsure(t){this.ensurePromise=t}acceptEnsureResult(t){this.acceptedResult=t}setCurrentProject(t){this.currentSid=t?.trim()||null}trackDaemonCreation(t){let r=t.then(i=>(this.setCurrentProject(i.sid),i));return this.pendingDaemonCreations.add(r),r.finally(()=>{this.pendingDaemonCreations.delete(r)}).catch(()=>{}),r}cleanup(){return this.cleanupPromise||(this.cleanupPromise=this.performCleanup()),this.cleanupPromise}async performCleanup(){let t={daemonStopped:!1,apiStopped:!1,warnings:[]},r=null;if(this.ensurePromise)try{r=await this.ensurePromise}catch(a){t.warnings.push(`backend startup cleanup could not inspect its result: ${a.message}`)}for(;this.pendingDaemonCreations.size>0;)await Promise.allSettled([...this.pendingDaemonCreations]);if(this.opts.policy==="stop-all"&&this.currentSid)try{await(this.opts.dependencies?.stopDaemon??(async u=>{await new ns({host:this.opts.host,port:this.opts.port,project:u,token:this.opts.token}).stopDaemon()}))(this.currentSid),t.daemonStopped=!0}catch(a){t.warnings.push(`could not gracefully stop executor ${this.currentSid}: ${a.message}`)}let i=!!(r?.spawnedApi&&this.acceptedResult!==r),s=this.opts.policy==="stop-api"||this.opts.policy==="stop-all";if(r?.spawnedApi&&(i||s))try{let u=await(this.opts.dependencies?.cleanupApi??(E=>c0({result:E,token:this.opts.token})))(r);t.apiStopped=u.stopped,u.stopped||t.warnings.push(u.message)}catch(a){t.warnings.push(`could not safely stop owned API: ${a.message}`)}return t}};function C1(e){if(!Number.isInteger(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function I0(e={}){let t=e.platform??process.platform,r=e.parentPid??process.ppid;if(t!=="win32"||!Number.isInteger(r)||r<=0)return null;let i=e.isProcessAlive??C1,s=e.onParentExit??(()=>process.exit(0)),u=(e.setIntervalFn??setInterval)(()=>{i(r)||s()},e.pollMs??1e3);return u.unref?.(),u}var Cr=Me(Pt(),1);function B1({note:e}){let[t,r]=(0,bn.useState)(0);return(0,bn.useEffect)(()=>{let i=setInterval(()=>r(s=>(s+1)%xu.length),90);return()=>clearInterval(i)},[]),(0,Cr.jsxs)(Qe,{flexDirection:"column",paddingX:1,children:[(0,Cr.jsx)(fA,{}),(0,Cr.jsxs)(Qe,{marginTop:1,children:[(0,Cr.jsxs)(k,{color:me.accent,children:[xu[t]," "]}),(0,Cr.jsx)(k,{dimColor:!0,children:e})]}),(0,Cr.jsx)(k,{dimColor:!0,children:"Ctrl-C or Ctrl-D exits this UI; API/executors are separate."})]})}function D1({args:e,animate:t,lifecycle:r}){let[i,s]=(0,bn.useState)(t?"splash":"connecting"),[a,u]=(0,bn.useState)(null),[E,I]=(0,bn.useState)([]),C=process.cwd(),[y,D]=(0,bn.useState)(""),[R,O]=(0,bn.useState)(),[G,ne]=(0,bn.useState)(!1),[oe,$]=(0,bn.useState)("starting backend\u2026"),[J,X]=(0,bn.useState)(""),Z=(0,bn.useRef)(!t),ge=(0,bn.useRef)(!1),he=(0,bn.useRef)("connecting"),ue=(0,bn.useMemo)(()=>new ns({host:e.host,port:e.port,project:"_",token:e.token}),[e.host,e.port,e.token]);(0,bn.useEffect)(()=>{let De=!1,ve=()=>De||ge.current;return(async()=>{let se=Ep({host:e.host,port:e.port,token:e.token,ownerFile:e.ownerFile,onStatus:W=>!ve()&&$(W),onWarning:W=>{ve()||D(`warning: ${W}`)}});r.trackEnsure(se);let N=await se;if(!ve()){if(r.acceptEnsureResult(N),!N.reachable){X(N.message),s("error");return}$("connecting\u2026");try{let W=await ue.listProjects();if(ve())return;let ae=await kI(W,Ze=>ue.scheduleDaemonUpgrade(Ze));if(ve())return;ae.scheduled.length>0&&D(Ze=>[Ze,`${ae.scheduled.length} outdated daemon(s) will upgrade at the next mission boundary`].filter(Boolean).join(" \xB7 ")),ae.failed.length>0&&D(Ze=>[Ze,`warning: could not schedule ${ae.failed.length} daemon upgrade(s)`].filter(Boolean).join(" \xB7 "));let fe=f0(e.project,e.resume),Ie=fe.kind==="resume"?NI(W,fe.project):null,et=fe.kind==="fresh"&&!e.forceNew&&!e.objective.trim()?g0(W,C):[],ke=et[0]??null,ft=fe.kind==="fresh"&&!ke?await r.trackDaemonCreation(ue.createDaemon(e.objective)):null,pt=fe.kind==="pick"?ip(W,C,e.resumeAll):[],Pe=ft?.sid??ke?.id??Ie?.id??null;if(ve())return;if(I(pt),Pe&&(u(Pe),r.setCurrentProject(Pe)),ft){O(ft.start),ne(!!ft.objective);let Ze=ft.start?.admission_required?`created ${ft.sid} \xB7 choose running work to park`:`created ${ft.sid} \xB7 message Argus when ready`;D(V=>[V,Ze].filter(Boolean).join(" \xB7 "))}else if(ke){let Ze=ke.label||ke.display_name||ke.id,V=et.length>1?`found ${et.length} live sessions for this folder \xB7 resumed ${Ze}`:`resumed running session ${Ze} \xB7 reused its existing executor`;D(ce=>[ce,V].filter(Boolean).join(" \xB7 "))}else if(Ie?.recovered&&Pe){let Ze=`requested ${Ie.requested} not found \xB7 attached to ${Pe}`;D(V=>[V,Ze].filter(Boolean).join(" \xB7 "))}he.current=Pe?"live":fe.kind==="pick"?"picker":"empty",Z.current&&s(he.current)}catch(W){ve()||(X(W.message),s("error"))}}})(),()=>{De=!0}},[e.forceNew,e.host,e.objective,e.port,e.project,e.resume,e.resumeAll,e.token,ue,C,r]);let Le=()=>{ge.current||(Z.current=!0,s(he.current))},pe=De=>{he.current="live",u(De.sid),r.setCurrentProject(De.sid),O(De.start),ne(!!De.objective);let ve=De.spawned?`created ${De.sid} \xB7 campaign started`:`created ${De.sid} \xB7 message Argus when ready`;D(se=>[se,ve].filter(Boolean).join(" \xB7 ")),s("live")},ct=De=>{he.current="live",u(De.id),r.setCurrentProject(De.id);let ve=`resumed ${De.label||De.id}`;D(se=>[se,ve].filter(Boolean).join(" \xB7 ")),s("live")};return i==="error"?(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(pp,{active:!0,onExit:()=>{ge.current=!0}}),(0,Cr.jsxs)(Qe,{flexDirection:"column",paddingX:1,children:[(0,Cr.jsx)(fA,{}),(0,Cr.jsx)(k,{color:me.error,children:`argus: ${J}`}),(0,Cr.jsx)(k,{dimColor:!0,children:"Ctrl-C or Ctrl-D exits this terminal UI."})]})]}):i==="splash"?(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(pp,{active:!0,onExit:()=>{ge.current=!0}}),(0,Cr.jsx)(i0,{onDone:Le})]}):i==="picker"?(0,Cr.jsx)(r0,{projects:E,scopeLabel:e.resumeAll?"all account sessions":C,onSelect:De=>{ct(De)}}):i==="empty"?(0,Cr.jsx)(t0,{createDaemon:(De,ve)=>r.trackDaemonCreation(ue.createDaemon(De,ve)),onCreated:pe}):i==="live"&&a?(0,Cr.jsx)(JQ,{host:e.host,port:e.port,token:e.token,project:a,initialNotice:y,initialAdmission:R,initialResumeContinuous:G,exitPolicy:e.exitPolicy,onProjectChange:De=>r.setCurrentProject(De),trackDaemonCreation:De=>r.trackDaemonCreation(De)}):(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(pp,{active:!0,onExit:()=>{ge.current=!0}}),(0,Cr.jsx)(B1,{note:oe})]})}async function y1(){I0();let e=ZQ(process.argv.slice(2));if(e.help){process.stdout.write(e0);return}if(e.web){let a=d0(Ff(),e.host,e.port),u=e.token||a?.token||void 0,E=await Ep({host:e.host,port:e.port,token:u,ownerFile:e.ownerFile,onStatus:y=>process.stderr.write(`${y} -`),onWarning:y=>process.stderr.write(`argus: warning: ${y} -`)});if(!E.reachable){process.stderr.write(`argus: ${E.message} -`),process.exitCode=2;return}let I=a?p0(a.url,e.project):E0(e.host,e.port,e.project,u),C=!e.noOpen&&m0(I);a?.pairing&&a.banner?process.stdout.write(`${a.banner} -`):process.stdout.write(`${C?"Opened":"Argus Web UI"}: ${I} -`),!C&&!e.noOpen&&process.stdout.write(`No desktop browser detected; open the URL locally or forward this port over SSH. -`);return}if(e.once){let a=u0(C=>process.stderr.write(`argus: warning: ${C} -`)),u=await Ep({host:e.host,port:e.port,token:e.token,ownerFile:e.ownerFile,onWarning:a});if(!u.reachable){process.stderr.write(`argus: ${u.message} -`),process.exitCode=2;return}let E=new ns({host:e.host,port:e.port,project:"_",token:e.token,onCompatibilityWarning:a}),I;try{let C=await E.listProjects();await kI(C,D=>E.scheduleDaemonUpgrade(D));let y=NI(C,e.project);if(y.recovered)throw new Error(`project "${y.requested}" not found`);if(!y.id)throw new Error("no projects found");I=y.id}catch(C){process.stderr.write(`argus: ${C.message} -`),process.exit(2);return}await Q1(new ns({host:e.host,port:e.port,project:I,token:e.token}),e.count);return}let t=!!process.stdout.isTTY&&!process.env.NO_COLOR&&!process.env.CI,r=$y(process.stdout),i=new mp({host:e.host,port:e.port,token:e.token,policy:e.exitPolicy}),s=Um((0,Cr.jsx)(qy,{controller:r.controller,children:(0,Cr.jsx)(D1,{args:e,animate:t,lifecycle:i})}),{exitOnCtrlC:!1,stdout:r.stdout});try{await s.waitUntilExit()}finally{r.dispose();let a=await i.cleanup();for(let u of a.warnings)process.stderr.write(`argus: warning: ${u} -`)}}async function Q1(e,t){let r=await e.snapshot(),i=[];await new Promise(a=>{let u=()=>{E.close(),a()},E=e.connectStream({replay:t,onEvent:I=>{i.push(String(I.type??"event")),i.length>=t&&u()},onError:()=>u()});setTimeout(u,4e3)});let s={project:e.project,daemon_alive:r.daemon.alive,roles:r.roles.map(a=>`${a.role}:${a.active?"active":"idle"}`),backlog:r.backlog.length,mission_summary:r.mission_view?.mission.summary??"",events:i};process.stdout.write(JSON.stringify(s,null,2)+` -`),process.exit(0)}y1().catch(e=>{let t=e instanceof Error?e.message:String(e);process.stderr.write(`argus: ${t} +`;var Mu=Le(jt(),1);var nl=Le(Pt(),1);function i0({createDaemon:e,onCreated:t}){let{exit:r}=sA(),i=Lu(),[s,a]=(0,Mu.useState)(()=>Sf("","objective")),u=(0,Mu.useRef)(!0);(0,Mu.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let E=async()=>{if(s.busy)return;let{objective:I,name:h}=Ou(s);a(y=>({...y,busy:!0,error:""}));try{let y=await e(I,h);u.current&&t(y)}catch(y){if(!u.current)return;a(D=>({...D,busy:!1,error:y.message||"daemon creation failed"}))}};return rs((I,h)=>{if(h.ctrl&&(I==="c"||I==="d")){u.current=!1,r();return}let y=_f(s,I,h);y.intent==="submit"?E():y.intent==="cancel"?a(Sf("","objective")):y.draft!==s&&a(y.draft)}),(0,nl.jsxs)(ye,{flexDirection:"column",paddingX:1,width:i.columns,children:[(0,nl.jsxs)(ye,{children:[(0,nl.jsx)(fA,{}),(0,nl.jsx)(N,{color:Fy,dimColor:!0,children:` ${jy}`})]}),(0,nl.jsx)(sp,{draft:s,title:"No daemons yet \u2014 open your first one",cancelHint:"Esc clear \xB7 Ctrl-C quit UI"})]})}var pp=Le(jt(),1);var go=Le(Pt(),1);function s0({projects:e,scopeLabel:t,onSelect:r}){let{exit:i}=sA(),s=Lu(),a=(0,pp.useMemo)(()=>is(e),[e]),[u,E]=(0,pp.useState)(0),I=Math.max(4,Math.min(12,s.rows-8)),h=Math.floor(u/I),y=a.slice(h*I,(h+1)*I);return rs((D,R)=>{if(R.escape||R.ctrl&&(D==="c"||D==="d")){i();return}if(R.upArrow||D==="k"){E(O=>Math.max(0,O-1));return}if(R.downArrow||D==="j"){E(O=>Math.min(a.length-1,O+1));return}if(R.pageUp){E(O=>Math.max(0,O-I));return}if(R.pageDown){E(O=>Math.min(a.length-1,O+I));return}R.return&&a[u]&&r(a[u])}),(0,go.jsxs)(ye,{flexDirection:"column",paddingX:1,width:s.columns,children:[(0,go.jsx)(fA,{}),(0,go.jsxs)(ye,{marginTop:1,marginBottom:1,children:[(0,go.jsx)(N,{bold:!0,children:"Resume a conversation"}),(0,go.jsx)(N,{dimColor:!0,children:` ${t} \xB7 ${a.length} project${a.length===1?"":"s"}`})]}),a.length===0?(0,go.jsx)(N,{dimColor:!0,children:"No conversations in this directory. Run argus resume --all to find legacy or other-directory sessions."}):y.map((D,R)=>{let G=h*I+R===u,ne=D.label||D.display_name||D.id;return(0,go.jsxs)(ye,{children:[(0,go.jsx)(N,{color:G?Ie.accent:"gray",children:G?"\u203A ":" "}),(0,go.jsx)(N,{color:D.daemon_alive?Ie.success:"gray",children:D.daemon_alive?"\u25CF ":"\u25CB "}),(0,go.jsx)(N,{bold:G,color:G?Ie.accent:void 0,children:ne.slice(0,Math.max(12,s.columns-28))}),(0,go.jsx)(N,{dimColor:!0,children:` ${D.id.slice(0,12)}`})]},D.id)}),(0,go.jsx)(ye,{marginTop:1,children:(0,go.jsx)(N,{dimColor:!0,children:`\u2191/\u2193 select \xB7 PgUp/PgDn page \xB7 Enter resume \xB7 Esc quit${a.length>I?` \xB7 page ${h+1}/${Math.ceil(a.length/I)}`:""}`})}),(0,go.jsx)(N,{dimColor:!0,children:"Exit closes this UI; the API and existing executors keep running."})]})}var Pu=Le(jt(),1);var FI=[" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\u256E"," \u2502 \u2502\u2502"," \u2502 \u25C9 argus-skill \xB7 Autonomous Research Lab \u2502\u2502"," \u2502 \u2502\u2502"," \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\u2502"," \u2502"],A0=[" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\u256E"," \u2502 \u25C9 argus-skill \u2502\u2502"," \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\u2502"," \u2502"],xI=["#3b6fd4","#4d86e0","#5f9deb","#72b4f0","#89dceb","#cba6f7","#e6b450"];var u1=Math.max(...FI.map(e=>[...e].length));function kI(e){return e>=u1?FI:A0}var bf=Le(Pt(),1);function d1({line:e,row:t,frame:r,dim:i}){return(0,bf.jsx)(N,{dimColor:i,children:[...e].map((s,a)=>(0,bf.jsx)(N,{color:xI[(Math.floor(a/7)+t+r)%xI.length],children:s},a))})}function l0({onDone:e}){let{stdout:t}=AA(),r=kI(t.columns??80),[i,s]=(0,Pu.useState)(0),a=(0,Pu.useRef)(!1),u=()=>{a.current||(a.current=!0,e())};rs(u),(0,Pu.useEffect)(()=>{let D=setInterval(()=>{s(R=>R<21?R+1:(clearInterval(D),setTimeout(u,120),R))},80);return()=>clearInterval(D)},[]);let E=Math.max(0,i-17+1),I=E<=1?0:Math.min(r.length,(E-1)*2),h=Math.floor(I/2),y=r.length-Math.ceil(I/2);return(0,bf.jsx)(ye,{flexDirection:"column",paddingX:1,children:r.map((D,R)=>(0,bf.jsx)(d1,{line:R>=h&&R0},R))})}function Ep({active:e,onExit:t}){let{exit:r}=sA();return rs((i,s)=>{s.ctrl&&(i==="c"||i==="d")&&(t?.(),r())},{isActive:e}),null}import{spawn as p1}from"node:child_process";import{existsSync as E1}from"node:fs";import{dirname as m1,resolve as NI}from"node:path";import{fileURLToPath as I1}from"node:url";function xf(){if(process.env.ARGUS_SKILL_BIN)return process.env.ARGUS_SKILL_BIN;let e=m1(I1(import.meta.url)),t=NI(e,"..","..",".."),r=h1(t);return E1(r)?r:"argus-skill"}function h1(e,t=process.platform){return t==="win32"?NI(e,".venv","Scripts","argus-skill.exe"):NI(e,".venv","bin","argus-skill")}function u0(e=process.platform){return e==="win32"?60:20}function c0(e=process.platform){return Date.now()+(e==="win32"?3e4:1e4)}function f0(e,t,r,i){let s=p1(e,["--web","--web-host",t,"--web-port",String(r)],{detached:!0,stdio:"ignore",windowsHide:!0,env:B1(i)}),a=new Promise(u=>{s.once("exit",E=>u(E)),s.once("error",()=>u(-1))});return s.unref(),{pid:s.pid,exited:a}}async function g0(e,t){if(!e.exited){await t(500);return}return Promise.race([t(500).then(()=>{}),e.exited])}function C1(e=process.env){let t=e.ARGUS_TUI_LOCAL_SOURCE_DIGEST?.trim();return{releaseId:e.ARGUS_TUI_LOCAL_RELEASE_ID?.trim()||Wd,sourceDigest:t||void 0}}async function mp(e,t,r){try{let i=r?{Authorization:`Bearer ${r}`}:{};return await zA(`http://${e}:${t}/api/meta`,{headers:i},1200,async s=>{if(!s.ok)return{state:"incompatible",message:s.status===404?"service does not expose /api/meta; it is an older Argus checkout or another process":`GET /api/meta returned HTTP ${s.status}`};let a;try{a=await s.json()}catch(E){if(!(E instanceof SyntaxError))throw E;return{state:"incompatible",message:"backend returned malformed /api/meta JSON"}}let u=Ym(a,C1());return!u.compatible||!u.meta?{state:"incompatible",message:u.reason,meta:u.meta}:{state:"compatible",message:dy(u.meta),warning:u.warning,meta:u.meta}})}catch(i){return{state:"unreachable",message:i instanceof Error?i.message:String(i)}}}function p0(e){let t=new Set;return r=>{let i=r.trim();!i||t.has(i)||(t.add(i),e(i))}}async function TI(e,t){let r=e.filter(a=>a.daemon_upgrade_pending===!0||a.daemon_alive&&a.daemon_protocol_compatible===!1&&a.daemon_source_owned===!0).map(a=>a.id),i=await Promise.allSettled(r.map(a=>t(a))),s=i.map(a=>a.status==="fulfilled"&&a.value.scheduled===!0);return{outdated:r,scheduled:r.filter((a,u)=>s[u]),skipped:r.filter((a,u)=>i[u].status==="fulfilled"&&!s[u]),failed:r.filter((a,u)=>i[u].status==="rejected")}}function Ff(e,t){let{spawned:r,prefix:i,onWarning:s,spawnedApi:a}=t;return e.warning&&s?.(e.warning),{reachable:!0,spawned:r,message:`${i} \xB7 ${e.message}`,warning:e.warning,...a?{spawnedApi:a}:{}}}function B1(e){return e?.trim()?{...process.env,ARGUS_SKILL_WEB_TOKEN:e.trim()}:process.env}function d0(e,t,r,i,s){return{schema:1,pid:e.meta?.runtime.pid??t,rootPid:t,host:r,port:i,backendBin:s,startedAt:e.meta?.runtime.started_at||new Date().toISOString()}}function ea(e,t){let r=0,i=[],s=e.filter(a=>typeof a=="number"&&Number.isInteger(a)&&a>0);for(let a of new Set(s))try{t(a,"SIGTERM"),r+=1}catch(u){i.push(u instanceof Error?u:new Error(String(u)))}return{delivered:r,errors:i}}function D1(e,t){return e.schema===t.schema&&e.pid===t.pid&&e.rootPid===t.rootPid&&e.host===t.host&&e.port===t.port&&e.backendBin===t.backendBin&&e.startedAt===t.startedAt}async function E0(e){let t=e.result.spawnedApi;if(!e.result.spawned||!t)return{stopped:!1,message:"API was not safely owned by this invocation"};let r=t.ownership;if(!ZA(r.host))return{stopped:!1,message:"refused to stop a non-local API endpoint"};let s=await(e.dependencies?.readOwnedApi??(()=>dp({path:t.ownerFile,host:r.host,port:r.port,backendBin:r.backendBin})))(t);if(!s||!D1(s,r))return{stopped:!1,message:"API ownership changed; no process was signalled"};let u=await(e.dependencies?.probeApi??(()=>mp(r.host,r.port,e.token)))(t);if(!u.meta||u.meta.runtime.pid!==r.pid||u.meta.runtime.started_at!==r.startedAt)return{stopped:!1,message:"API runtime identity changed; no process was signalled"};let E=e.dependencies?.signal??((h,y)=>{process.kill(h,y)}),I=ea([r.pid,r.rootPid],E);return I.errors.length>0?{stopped:I.delivered>0,message:`API cleanup signalled ${I.delivered} process(es); ${I.errors[0].message}`}:{stopped:I.delivered>0,message:`stopped owned API process tree (${I.delivered} process${I.delivered===1?"":"es"})`}}async function Ip(e){let{host:t,port:r,token:i,autostart:s=!0,ownerFile:a,onStatus:u,onWarning:E,dependencies:I}=e,h=I?.probeApi??(()=>mp(t,r,i)),y=I?.sleep??(q=>new Promise(X=>setTimeout(X,q))),D=ZA(t);u?.("checking local and running versions\u2026");let R=await h();if(R.state==="compatible"){if(a&&D&&R.meta){let q=xf();if(!((await(I?.readOwnedApi??(()=>dp({path:a,host:t,port:r,backendBin:q})))())?.pid===R.meta.runtime.pid)){let Ae={schema:1,pid:R.meta.runtime.pid,host:t,port:r,backendBin:q,startedAt:R.meta.runtime.started_at||new Date().toISOString()},xe=I?.claimApiOwnership??((de,ft)=>bI({path:de,...ft}));try{await xe(a,Ae)||E?.("local API is compatible but ownership could not be verified; automatic upgrade is disabled for this process")}catch(de){E?.(`could not record local API ownership: ${de.message}`)}}}return Ff(R,{spawned:!1,prefix:"api up",onWarning:E})}if(R.state==="incompatible"){if(u?.("version mismatch; verifying safe restart ownership\u2026"),!a)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ${R.message}. Stop that WebAPI or choose another port.`};if(!D)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ${R.message}. Stop that WebAPI or choose another port.`};let q=xf(),X=I?.readOwnedApi??(()=>dp({path:a,host:t,port:r,backendBin:q})),fe=I?.signal??((ie,k)=>{process.kill(ie,k)}),Be=I?.writeOwnershipRecord??((ie,k)=>gp(ie,k)),Ae=await X();if(Ae&&R.meta&&Ae.pid!==R.meta.runtime.pid&&(Ae=null),!Ae&&R.meta){let ie={schema:1,pid:R.meta.runtime.pid,host:t,port:r,backendBin:q,startedAt:R.meta.runtime.started_at||new Date().toISOString()},k=I?.claimApiOwnership??((H,se)=>bI({path:H,...se}));try{await k(a,ie)&&(Ae=ie)}catch{}}if(!Ae)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: ${R.message} \u2014 ownership could not be proven`};u?.("restarting outdated owned backend\u2026");let xe=!1,de=ea([Ae.pid,Ae.rootPid],fe);if(de.delivered===0&&de.errors.length>0)if((await h()).state==="unreachable")xe=!0;else return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: could not signal owned pid ${Ae.pid} (${de.errors[0].message})`};u?.("waiting for stale backend to shut down\u2026");for(let ie=0;!xe&&ie<32;ie++)if(await y(250),(await h()).state==="unreachable"){xe=!0;break}if(!xe)return{reachable:!1,spawned:!1,message:`incompatible Argus API at ${t}:${r}: graceful shutdown timed out after SIGTERM`};let ft=I?.spawnApi??(async()=>f0(q,t,r,i));u?.("starting backend api\u2026");let Ye=await ft(),we=c0();for(let ie=0;ief0(O,t,r,i)),ne=I?.signal??((q,X)=>{process.kill(q,X)}),oe=I?.writeOwnershipRecord??((q,X)=>gp(q,X)),$;try{$=await G()}catch(q){return{reachable:!1,spawned:!1,message:`could not launch '${O} --web' (${q.message}). Set ARGUS_SKILL_BIN or start it yourself: argus-skill --web --web-port ${r}`}}let Z=c0();for(let q=0;qr.daemon_alive))}import{execFileSync as y1,spawn as Q1}from"node:child_process";function h0(e,t,r){try{let i=y1(e,["--pair-plan","--web-host",t,"--web-port",String(r)],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}),s=JSON.parse(i);return typeof s?.url!="string"||!s.url?null:{token:typeof s.token=="string"?s.token:"",url:s.url,banner:typeof s.banner=="string"?s.banner:"",pairing:s.pairing===!0}}catch{return null}}function C0(e,t){if(!t?.trim())return e;let r=new URL(e);return r.searchParams.set("project",t.trim()),r.toString()}function LI(e,t,r,i){let s=e==="0.0.0.0"||e==="::"||e==="::0"?"127.0.0.1":e,a=new URL(`http://${s}:${t}/`);return r?.trim()&&a.searchParams.set("project",r.trim()),i?.trim()&&a.searchParams.set("token",i.trim()),a.toString()}function w1(e,t=process.platform,r=process.env){return t==="darwin"?{command:"open",args:[e]}:t==="win32"?{command:"cmd",args:["/c","start","",e]}:t==="linux"&&r.VSCODE_IPC_HOOK_CLI?{command:"code",args:["--open-url",e]}:t==="linux"&&(r.DISPLAY||r.WAYLAND_DISPLAY)?{command:"xdg-open",args:[e]}:null}function MI(e){let t=w1(e);if(!t)return!1;try{return Q1(t.command,t.args,{detached:!0,stdio:"ignore"}).unref(),!0}catch{return!1}}var hp=class{opts;ensurePromise=null;acceptedResult=null;currentSid=null;pendingDaemonCreations=new Set;cleanupPromise=null;constructor(t){this.opts=t}trackEnsure(t){this.ensurePromise=t}acceptEnsureResult(t){this.acceptedResult=t}setCurrentProject(t){this.currentSid=t?.trim()||null}trackDaemonCreation(t){let r=t.then(i=>(this.setCurrentProject(i.sid),i));return this.pendingDaemonCreations.add(r),r.finally(()=>{this.pendingDaemonCreations.delete(r)}).catch(()=>{}),r}cleanup(){return this.cleanupPromise||(this.cleanupPromise=this.performCleanup()),this.cleanupPromise}async performCleanup(){let t={daemonStopped:!1,apiStopped:!1,warnings:[]},r=null;if(this.ensurePromise)try{r=await this.ensurePromise}catch(a){t.warnings.push(`backend startup cleanup could not inspect its result: ${a.message}`)}for(;this.pendingDaemonCreations.size>0;)await Promise.allSettled([...this.pendingDaemonCreations]);if(this.opts.policy==="stop-all"&&this.currentSid)try{await(this.opts.dependencies?.stopDaemon??(async u=>{await new ns({host:this.opts.host,port:this.opts.port,project:u,token:this.opts.token}).stopDaemon()}))(this.currentSid),t.daemonStopped=!0}catch(a){t.warnings.push(`could not gracefully stop executor ${this.currentSid}: ${a.message}`)}let i=!!(r?.spawnedApi&&this.acceptedResult!==r),s=this.opts.policy==="stop-api"||this.opts.policy==="stop-all";if(r?.spawnedApi&&(i||s))try{let u=await(this.opts.dependencies?.cleanupApi??(E=>E0({result:E,token:this.opts.token})))(r);t.apiStopped=u.stopped,u.stopped||t.warnings.push(u.message)}catch(a){t.warnings.push(`could not safely stop owned API: ${a.message}`)}return t}};function v1(e){if(!Number.isInteger(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function B0(e={}){let t=e.platform??process.platform,r=e.parentPid??process.ppid;if(t!=="win32"||!Number.isInteger(r)||r<=0)return null;let i=e.isProcessAlive??v1,s=e.onParentExit??(()=>process.exit(0)),u=(e.setIntervalFn??setInterval)(()=>{i(r)||s()},e.pollMs??1e3);return u.unref?.(),u}import{createServer as S1}from"node:net";async function _1(e,t){return new Promise((r,i)=>{let s=S1();s.unref(),s.once("error",a=>{a.code==="EADDRINUSE"||a.code==="EACCES"?r(!1):i(a)}),s.listen({host:e,port:t,exclusive:!0},()=>{s.close(a=>{a?i(a):r(!0)})})})}async function D0(e,t={}){if(e.explicit)return e.preferredPort;let r=t.probe??mp,i=t.available??_1,s=await r(e.host,e.preferredPort,e.token);if(s.state==="compatible"||s.state==="incompatible"&&s.meta)return e.preferredPort;let a=e.host.trim().toLowerCase();if(!(ZA(a)||a==="0.0.0.0"||a==="::"||a==="::0"))return e.preferredPort;let E=e.maxAttempts??20;for(let I=0;I65535)break;if(await i(e.host,h)||h!==e.preferredPort&&(await r(e.host,h,e.token)).state==="compatible")return h}throw new Error(`no available API port found from ${e.preferredPort} after ${E} attempts; pass --port to choose one explicitly`)}var Cr=Le(Pt(),1);function R1({note:e}){let[t,r]=(0,wn.useState)(0);return(0,wn.useEffect)(()=>{let i=setInterval(()=>r(s=>(s+1)%ku.length),90);return()=>clearInterval(i)},[]),(0,Cr.jsxs)(ye,{flexDirection:"column",paddingX:1,children:[(0,Cr.jsx)(fA,{}),(0,Cr.jsxs)(ye,{marginTop:1,children:[(0,Cr.jsxs)(N,{color:Ie.accent,children:[ku[t]," "]}),(0,Cr.jsx)(N,{dimColor:!0,children:e})]}),(0,Cr.jsx)(N,{dimColor:!0,children:"Ctrl-C or Ctrl-D exits this UI; API/executors are separate."})]})}function b1({args:e,animate:t,lifecycle:r}){let[i,s]=(0,wn.useState)(t?"splash":"connecting"),[a,u]=(0,wn.useState)(null),[E,I]=(0,wn.useState)([]),h=process.cwd(),[y,D]=(0,wn.useState)(""),[R,O]=(0,wn.useState)(),[G,ne]=(0,wn.useState)(!1),[oe,$]=(0,wn.useState)("starting backend\u2026"),[Z,q]=(0,wn.useState)(""),X=(0,wn.useRef)(!t),fe=(0,wn.useRef)(!1),Be=(0,wn.useRef)(!1),Ae=(0,wn.useRef)("connecting"),xe=(0,wn.useMemo)(()=>new ns({host:e.host,port:e.port,project:"_",token:e.token}),[e.host,e.port,e.token]);(0,wn.useEffect)(()=>{let we=!1,ie=()=>we||fe.current;return(async()=>{let k=Ip({host:e.host,port:e.port,token:e.token,ownerFile:e.ownerFile,onStatus:se=>!ie()&&$(se),onWarning:se=>{ie()||D(`warning: ${se}`)}});r.trackEnsure(k);let H=await k;if(!ie()){if(r.acceptEnsureResult(H),!H.reachable){q(H.message),s("error");return}e.openWebWithCli&&!e.noOpen&&!Be.current&&(Be.current=!0,MI(LI(e.host,e.port,e.project,e.token))),$("connecting\u2026");try{let se=await xe.listProjects();if(ie())return;let ge=await TI(se,J=>xe.scheduleDaemonUpgrade(J));if(ie())return;ge.scheduled.length>0&&D(J=>[J,`${ge.scheduled.length} outdated daemon(s) will upgrade at the next mission boundary`].filter(Boolean).join(" \xB7 ")),ge.failed.length>0&&D(J=>[J,`warning: could not schedule ${ge.failed.length} daemon upgrade(s)`].filter(Boolean).join(" \xB7 "));let Ee=m0(e.project,e.resume),Ze=Ee.kind==="resume"?OI(se,Ee.project):null,Oe=Ee.kind==="fresh"&&!e.forceNew&&!e.objective.trim()?I0(se,h):[],gt=Oe[0]??null,at=Ee.kind==="fresh"&&!gt?await r.trackDaemonCreation(xe.createDaemon(e.objective)):null,Ge=Ee.kind==="pick"?Ap(se,h,e.resumeAll):[],it=at?.sid??gt?.id??Ze?.id??null;if(ie())return;if(I(Ge),it&&(u(it),r.setCurrentProject(it)),at){O(at.start),ne(!!at.objective);let J=at.start?.admission_required?`created ${at.sid} \xB7 choose running work to park`:`created ${at.sid} \xB7 message Argus when ready`;D(ce=>[ce,J].filter(Boolean).join(" \xB7 "))}else if(gt){let J=gt.label||gt.display_name||gt.id,ce=Oe.length>1?`found ${Oe.length} live sessions for this folder \xB7 resumed ${J}`:`resumed running session ${J} \xB7 reused its existing executor`;D(he=>[he,ce].filter(Boolean).join(" \xB7 "))}else if(Ze?.recovered&&it){let J=`requested ${Ze.requested} not found \xB7 attached to ${it}`;D(ce=>[ce,J].filter(Boolean).join(" \xB7 "))}Ae.current=it?"live":Ee.kind==="pick"?"picker":"empty",X.current&&s(Ae.current)}catch(se){ie()||(q(se.message),s("error"))}}})(),()=>{we=!0}},[e.forceNew,e.host,e.noOpen,e.objective,e.openWebWithCli,e.port,e.project,e.resume,e.resumeAll,e.token,xe,h,r]);let de=()=>{fe.current||(X.current=!0,s(Ae.current))},ft=we=>{Ae.current="live",u(we.sid),r.setCurrentProject(we.sid),O(we.start),ne(!!we.objective);let ie=we.spawned?`created ${we.sid} \xB7 campaign started`:`created ${we.sid} \xB7 message Argus when ready`;D(k=>[k,ie].filter(Boolean).join(" \xB7 ")),s("live")},Ye=we=>{Ae.current="live",u(we.id),r.setCurrentProject(we.id);let ie=`resumed ${we.label||we.id}`;D(k=>[k,ie].filter(Boolean).join(" \xB7 ")),s("live")};return i==="error"?(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(Ep,{active:!0,onExit:()=>{fe.current=!0}}),(0,Cr.jsxs)(ye,{flexDirection:"column",paddingX:1,children:[(0,Cr.jsx)(fA,{}),(0,Cr.jsx)(N,{color:Ie.error,children:`argus: ${Z}`}),(0,Cr.jsx)(N,{dimColor:!0,children:"Ctrl-C or Ctrl-D exits this terminal UI."})]})]}):i==="splash"?(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(Ep,{active:!0,onExit:()=>{fe.current=!0}}),(0,Cr.jsx)(l0,{onDone:de})]}):i==="picker"?(0,Cr.jsx)(s0,{projects:E,scopeLabel:e.resumeAll?"all account sessions":h,onSelect:we=>{Ye(we)}}):i==="empty"?(0,Cr.jsx)(i0,{createDaemon:(we,ie)=>r.trackDaemonCreation(xe.createDaemon(we,ie)),onCreated:ft}):i==="live"&&a?(0,Cr.jsx)(qQ,{host:e.host,port:e.port,token:e.token,project:a,initialNotice:y,initialAdmission:R,initialResumeContinuous:G,exitPolicy:e.exitPolicy,onProjectChange:we=>r.setCurrentProject(we),trackDaemonCreation:we=>r.trackDaemonCreation(we)}):(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(Ep,{active:!0,onExit:()=>{fe.current=!0}}),(0,Cr.jsx)(R1,{note:oe})]})}async function F1(){B0();let e=r0(process.argv.slice(2));if(e.help){process.stdout.write(o0);return}let t=await D0({host:e.host,preferredPort:e.port,token:e.token,explicit:e.portExplicit});if(t!==e.port&&(e=n0(e,t)),e.web){let u=ZA(e.host)?null:h0(xf(),e.host,e.port),E=e.token||u?.token||void 0,I=await Ip({host:e.host,port:e.port,token:E,ownerFile:e.ownerFile,onStatus:D=>process.stderr.write(`${D} +`),onWarning:D=>process.stderr.write(`argus: warning: ${D} +`)});if(!I.reachable){process.stderr.write(`argus: ${I.message} +`),process.exitCode=2;return}let h=u?C0(u.url,e.project):LI(e.host,e.port,e.project,E),y=!e.noOpen&&MI(h);u?.pairing&&u.banner?process.stdout.write(`${u.banner} +`):process.stdout.write(`${y?"Opened":"Argus Web UI"}: ${h} +`),!y&&!e.noOpen&&process.stdout.write(`No desktop browser detected; open the URL locally or forward this port over SSH. +`);return}if(e.once){let u=p0(y=>process.stderr.write(`argus: warning: ${y} +`)),E=await Ip({host:e.host,port:e.port,token:e.token,ownerFile:e.ownerFile,onWarning:u});if(!E.reachable){process.stderr.write(`argus: ${E.message} +`),process.exitCode=2;return}let I=new ns({host:e.host,port:e.port,project:"_",token:e.token,onCompatibilityWarning:u}),h;try{let y=await I.listProjects();await TI(y,R=>I.scheduleDaemonUpgrade(R));let D=OI(y,e.project);if(D.recovered)throw new Error(`project "${D.requested}" not found`);if(!D.id)throw new Error("no projects found");h=D.id}catch(y){process.stderr.write(`argus: ${y.message} +`),process.exit(2);return}await x1(new ns({host:e.host,port:e.port,project:h,token:e.token}),e.count);return}let r=!!process.stdout.isTTY&&!process.env.NO_COLOR&&!process.env.CI,i=tQ(process.stdout),s=new hp({host:e.host,port:e.port,token:e.token,policy:e.exitPolicy}),a=Hm((0,Cr.jsx)(Zy,{controller:i.controller,children:(0,Cr.jsx)(b1,{args:e,animate:r,lifecycle:s})}),{exitOnCtrlC:!1,stdout:i.stdout});try{await a.waitUntilExit()}finally{i.dispose();let u=await s.cleanup();for(let E of u.warnings)process.stderr.write(`argus: warning: ${E} +`)}}async function x1(e,t){let r=await e.snapshot(),i=[];await new Promise(a=>{let u=()=>{E.close(),a()},E=e.connectStream({replay:t,onEvent:I=>{i.push(String(I.type??"event")),i.length>=t&&u()},onError:()=>u()});setTimeout(u,4e3)});let s={project:e.project,daemon_alive:r.daemon.alive,roles:r.roles.map(a=>`${a.role}:${a.active?"active":"idle"}`),backlog:r.backlog.length,mission_summary:r.mission_view?.mission.summary??"",events:i};process.stdout.write(JSON.stringify(s,null,2)+` +`),process.exit(0)}F1().catch(e=>{let t=e instanceof Error?e.message:String(e);process.stderr.write(`argus: ${t} `),process.exit(1)}); /*! Bundled license information: diff --git a/frontend/tui/src/args.ts b/frontend/tui/src/args.ts index 350f076e..421382fc 100644 --- a/frontend/tui/src/args.ts +++ b/frontend/tui/src/args.ts @@ -3,6 +3,7 @@ import { defaultApiOwnershipPath } from './apiOwnership.js'; export interface Args { host: string; port: number; + portExplicit: boolean; project?: string; resume: boolean; resumeAll: boolean; @@ -13,10 +14,12 @@ export interface Args { count: number; help: boolean; web: boolean; + openWebWithCli: boolean; noOpen: boolean; objective: string; forceNew: boolean; exitPolicy: ExitPolicy; + ownerFileExplicit: boolean; } export type ExitPolicy = 'detach' | 'stop-api' | 'stop-all'; @@ -37,25 +40,37 @@ function valueAfter(argv: string[], index: number, option: string): string { return value; } +export interface ParseArgsRuntime { + env?: NodeJS.ProcessEnv; + platform?: NodeJS.Platform; +} + /** Parse both the native Ink flags and the retained argus-skill compatibility flags. */ -export function parseArgs(argv: string[]): Args { +export function parseArgs(argv: string[], runtime: ParseArgsRuntime = {}): Args { + const env = runtime.env ?? process.env; + const platform = runtime.platform ?? process.platform; + const envPort = env.ARGUS_TUI_PORT; + const ownerFile = env.ARGUS_TUI_API_OWNER_FILE?.trim(); const args: Args = { - host: process.env.ARGUS_TUI_HOST ?? '127.0.0.1', - port: Number(process.env.ARGUS_TUI_PORT ?? 8799), - project: process.env.ARGUS_TUI_PROJECT, + host: env.ARGUS_TUI_HOST ?? '127.0.0.1', + port: Number(envPort ?? 8799), + portExplicit: envPort !== undefined, + project: env.ARGUS_TUI_PROJECT, resume: false, resumeAll: false, - token: process.env.ARGUS_SKILL_WEB_TOKEN, + token: env.ARGUS_SKILL_WEB_TOKEN, ownerFile: undefined, once: false, json: false, count: 5, help: false, web: false, + openWebWithCli: platform === 'win32', noOpen: false, objective: '', forceNew: false, - exitPolicy: exitPolicy(process.env.ARGUS_TUI_EXIT_POLICY, 'ARGUS_TUI_EXIT_POLICY'), + exitPolicy: exitPolicy(env.ARGUS_TUI_EXIT_POLICY, 'ARGUS_TUI_EXIT_POLICY'), + ownerFileExplicit: Boolean(ownerFile), }; for (let i = 0; i < argv.length; i++) { @@ -65,6 +80,7 @@ export function parseArgs(argv: string[]): Args { i += 1; } else if (arg === '--port') { args.port = Number(valueAfter(argv, i, arg)); + args.portExplicit = true; i += 1; } else if (arg === '--project') { args.project = valueAfter(argv, i, arg); @@ -113,11 +129,21 @@ export function parseArgs(argv: string[]): Args { if (!Number.isInteger(args.count) || args.count < 1) { throw new Error(`--count must be a positive integer; got ${args.count}`); } - args.ownerFile = process.env.ARGUS_TUI_API_OWNER_FILE?.trim() + args.ownerFile = ownerFile || defaultApiOwnershipPath(args.host, args.port); return args; } +export function withSelectedPort(args: Args, port: number): Args { + return { + ...args, + port, + ownerFile: args.ownerFileExplicit + ? args.ownerFile + : defaultApiOwnershipPath(args.host, port), + }; +} + export const HELP = `argus — the terminal cockpit for the argus-skill autonomous-research daemon Usage: argus resume [SID] [--all] @@ -128,10 +154,13 @@ Usage: argus resume [SID] [--all] Every launch compares the local source identity with the running backend. It auto-starts a missing backend and safely replaces an outdated backend only when -process ownership is proven; unrelated port occupants are never signalled. A +process ownership is proven; unrelated port occupants are never signalled. +Without an explicit port, Argus reuses a compatible backend or selects the +first available port starting at 8799. A plain interactive launch reattaches to a live executor from this directory, or creates a fresh idle session when none is running. argus resume shows conversations from this directory; add --all for every account session. +On Windows, a plain interactive launch also opens the Web UI. The terminal UI, local API server, and per-session executor are separate processes. Ctrl-D (or Ctrl-C twice in the live view) exits only this UI by @@ -140,7 +169,8 @@ policy when this invocation should also perform graceful cleanup. Options: --host H API host (default 127.0.0.1, env ARGUS_TUI_HOST) - --port P API port (default 8799, env ARGUS_TUI_PORT) + --port P pin the API port (otherwise first available from 8799; + env ARGUS_TUI_PORT) --project SID project/session id (interactive recovers; --once is strict) -r, --resume open the local resume picker; an optional SID resumes directly --continue compatibility alias for the local resume picker @@ -148,7 +178,7 @@ Options: --new force a fresh session instead of reattaching to local live work --token T bearer token if the API requires one (env ARGUS_SKILL_WEB_TOKEN) --web ensure the Web UI backend is running, then open it in a browser - --no-open with --web, print the URL without launching a local browser + --no-open do not launch a browser (including the Windows interactive default) --objective X create and immediately start a fresh campaign with objective X --exit-policy P detach (default), stop-api, or stop-all stop-api stops only an API safely owned by this invocation; diff --git a/frontend/tui/src/cli.tsx b/frontend/tui/src/cli.tsx index 1dddf304..bf0ad9e0 100644 --- a/frontend/tui/src/cli.tsx +++ b/frontend/tui/src/cli.tsx @@ -7,7 +7,8 @@ import { type ProjectRow, } from './api.js'; import { App } from './App.js'; -import { HELP, parseArgs, type Args } from './args.js'; +import { isLocalApiHost } from './apiOwnership.js'; +import { HELP, parseArgs, withSelectedPort, type Args } from './args.js'; import { FirstRun } from './components/FirstRun.js'; import { ResumePicker } from './components/ResumePicker.js'; import { Splash } from './components/Splash.js'; @@ -30,6 +31,7 @@ import { openWebBrowser, resolvePairing, webUiUrl, withProject } from './webLaun import { createImeCursorOutput, ImeCursorProvider } from './imeCursor.js'; import { InteractiveExitLifecycle } from './exitLifecycle.js'; import { installParentExitGuard } from './parentExitGuard.js'; +import { selectApiPort } from './portSelection.js'; /** A small spinner shown if the animation finishes before the API is reachable. */ function Connecting({ note }: { note: string }) { @@ -79,6 +81,7 @@ function Boot({ const [err, setErr] = useState(''); const splashDone = useRef(!animate); const exitRequested = useRef(false); + const webOpened = useRef(false); const destination = useRef<'connecting' | 'picker' | 'empty' | 'live'>('connecting'); const base = useMemo( () => new ApiClient({ host: args.host, port: args.port, project: '_', token: args.token }), @@ -108,6 +111,10 @@ function Boot({ setPhase('error'); return; } + if (args.openWebWithCli && !args.noOpen && !webOpened.current) { + webOpened.current = true; + openWebBrowser(webUiUrl(args.host, args.port, args.project, args.token)); + } setNote('connecting…'); try { const availableProjects = await base.listProjects(); @@ -181,7 +188,7 @@ function Boot({ return () => { cancelled = true; }; - }, [args.forceNew, args.host, args.objective, args.port, args.project, args.resume, args.resumeAll, args.token, base, launchCwd, lifecycle]); + }, [args.forceNew, args.host, args.noOpen, args.objective, args.openWebWithCli, args.port, args.project, args.resume, args.resumeAll, args.token, base, launchCwd, lifecycle]); const onSplashDone = () => { if (exitRequested.current) return; @@ -272,16 +279,26 @@ function Boot({ async function main() { installParentExitGuard(); - const args = parseArgs(process.argv.slice(2)); + let args = parseArgs(process.argv.slice(2)); if (args.help) { process.stdout.write(HELP); return; } + const selectedPort = await selectApiPort({ + host: args.host, + preferredPort: args.port, + token: args.token, + explicit: args.portExplicit, + }); + if (selectedPort !== args.port) args = withSelectedPort(args, selectedPort); + if (args.web) { // Resolve pairing before starting the backend: on a non-loopback bind the // token may be minted here, and the backend has to be started with it. - const plan = resolvePairing(resolveBin(), args.host, args.port); + const plan = isLocalApiHost(args.host) + ? null + : resolvePairing(resolveBin(), args.host, args.port); const token = args.token || plan?.token || undefined; const result = await ensureApi({ host: args.host, diff --git a/frontend/tui/src/ensureApi.ts b/frontend/tui/src/ensureApi.ts index 8082cdc3..e9e8bfbe 100644 --- a/frontend/tui/src/ensureApi.ts +++ b/frontend/tui/src/ensureApi.ts @@ -58,6 +58,48 @@ export interface ApiProbeResult { meta?: ApiMeta; } +function startupPollAttempts(platform: NodeJS.Platform = process.platform): number { + return platform === 'win32' ? 60 : 20; +} + +function startupPollDeadline(platform: NodeJS.Platform = process.platform): number { + return Date.now() + (platform === 'win32' ? 30_000 : 10_000); +} + +interface SpawnedApiProcess { + pid: number; + exited?: Promise; +} + +function spawnDetachedApi(bin: string, host: string, port: number, token?: string): SpawnedApiProcess { + const child = spawn(bin, ['--web', '--web-host', host, '--web-port', String(port)], { + detached: true, + stdio: 'ignore', + windowsHide: true, + env: spawnEnv(token), + }); + const exited = new Promise((resolveExit) => { + child.once('exit', (code) => resolveExit(code)); + child.once('error', () => resolveExit(-1)); + }); + child.unref(); + return { pid: child.pid!, exited }; +} + +async function waitForStartupPoll( + spawned: SpawnedApiProcess, + sleep: (ms: number) => Promise, +): Promise { + if (!spawned.exited) { + await sleep(500); + return undefined; + } + return Promise.race([ + sleep(500).then(() => undefined), + spawned.exited, + ]); +} + function localRuntimeExpectation( env: NodeJS.ProcessEnv = process.env, ): ApiRuntimeExpectation { @@ -340,7 +382,7 @@ export async function ensureApi(opts: { readOwnedApi?: () => Promise; claimApiOwnership?: (path: string, record: ApiOwnershipRecord) => Promise; signal?: (pid: number, signal: NodeJS.Signals) => void; - spawnApi?: () => Promise<{ pid: number }>; + spawnApi?: () => Promise; writeOwnershipRecord?: (path: string, record: ApiOwnershipRecord) => Promise; sleep?: (ms: number) => Promise; }; @@ -496,23 +538,34 @@ export async function ensureApi(opts: { } // Spawn replacement backend. - const doSpawn = deps?.spawnApi ?? (async () => { - const child = spawn(bin, ['--web', '--web-host', host, '--web-port', String(port)], { - detached: true, - stdio: 'ignore', - windowsHide: true, - env: spawnEnv(token), - }); - child.unref(); - return { pid: child.pid! }; - }); + const doSpawn = deps?.spawnApi ?? (async () => spawnDetachedApi(bin, host, port, token)); onStatus?.('starting backend api…'); const spawned = await doSpawn(); // Poll for the new backend to come online. - for (let i = 0; i < 20; i++) { - await doSleep(500); + const replacementDeadline = startupPollDeadline(); + for ( + let i = 0; + i < startupPollAttempts() && Date.now() < replacementDeadline; + i++ + ) { + const exitCode = await waitForStartupPoll(spawned, doSleep); + if (exitCode !== undefined) { + const competing = await doProbe(); + if (competing.state === 'compatible') { + return compatibleResult(competing, { + spawned: false, + prefix: 'api up', + onWarning, + }); + } + return { + reachable: false, + spawned: true, + message: `replacement backend exited before becoming ready (exit ${exitCode ?? 'unknown'})`, + }; + } const probe = await doProbe(); if (probe.state === 'compatible') { const ownership = spawnedOwnershipRecord(probe, spawned.pid, host, port, bin); @@ -565,16 +618,8 @@ export async function ensureApi(opts: { onStatus?.('starting backend api…'); const bin = resolveBin(); - const doNormalSpawn = deps?.spawnApi ?? (async () => { - const child = spawn(bin, ['--web', '--web-host', host, '--web-port', String(port)], { - detached: true, - stdio: 'ignore', - windowsHide: true, - env: spawnEnv(token), - }); - child.unref(); - return { pid: child.pid! }; - }); + const doNormalSpawn = deps?.spawnApi ?? + (async () => spawnDetachedApi(bin, host, port, token)); const doNormalSignal = deps?.signal ?? ((pid: number, sig: NodeJS.Signals) => { process.kill(pid, sig); @@ -582,10 +627,9 @@ export async function ensureApi(opts: { const doNormalWriteOwnership = deps?.writeOwnershipRecord ?? ((p: string, r: ApiOwnershipRecord) => writeOwnershipRecordImpl(p, r)); - let spawnedPid: number; + let spawned: SpawnedApiProcess; try { - const spawned = await doNormalSpawn(); - spawnedPid = spawned.pid; + spawned = await doNormalSpawn(); } catch (err) { return { reachable: false, @@ -596,13 +640,33 @@ export async function ensureApi(opts: { }; } - for (let i = 0; i < 20; i++) { - await doSleep(500); + const startupDeadline = startupPollDeadline(); + for ( + let i = 0; + i < startupPollAttempts() && Date.now() < startupDeadline; + i++ + ) { + const exitCode = await waitForStartupPoll(spawned, doSleep); + if (exitCode !== undefined) { + const competing = await doProbe(); + if (competing.state === 'compatible') { + return compatibleResult(competing, { + spawned: false, + prefix: 'api up', + onWarning, + }); + } + return { + reachable: false, + spawned: true, + message: `backend exited before becoming ready (exit ${exitCode ?? 'unknown'})`, + }; + } const probe = await doProbe(); if (probe.state === 'compatible') { let spawnedApi: SpawnedApiReceipt | undefined; if (ownerFile) { - const ownership = spawnedOwnershipRecord(probe, spawnedPid, host, port, bin); + const ownership = spawnedOwnershipRecord(probe, spawned.pid, host, port, bin); try { await doNormalWriteOwnership(ownerFile, ownership); } catch (writeErr) { @@ -625,7 +689,7 @@ export async function ensureApi(opts: { }); } if (probe.state === 'incompatible') { - sendSigterm([spawnedPid], doNormalSignal); + sendSigterm([spawned.pid], doNormalSignal); return { reachable: false, spawned: true, @@ -634,7 +698,7 @@ export async function ensureApi(opts: { } onStatus?.(`starting backend api… ${i + 1}`); } - sendSigterm([spawnedPid], doNormalSignal); + sendSigterm([spawned.pid], doNormalSignal); return { reachable: false, spawned: true, diff --git a/frontend/tui/src/portSelection.ts b/frontend/tui/src/portSelection.ts new file mode 100644 index 00000000..b9eac8b5 --- /dev/null +++ b/frontend/tui/src/portSelection.ts @@ -0,0 +1,72 @@ +import { createServer } from 'node:net'; + +import { isLocalApiHost } from './apiOwnership.js'; +import { probeApi, type ApiProbeResult } from './ensureApi.js'; + +export interface SelectApiPortOptions { + host: string; + preferredPort: number; + token?: string; + explicit: boolean; + maxAttempts?: number; +} + +export interface SelectApiPortDeps { + probe?: (host: string, port: number, token?: string) => Promise; + available?: (host: string, port: number) => Promise; +} + +export async function isPortAvailable(host: string, port: number): Promise { + return new Promise((resolve, reject) => { + const server = createServer(); + server.unref(); + server.once('error', (error: NodeJS.ErrnoException) => { + if (error.code === 'EADDRINUSE' || error.code === 'EACCES') resolve(false); + else reject(error); + }); + server.listen({ host, port, exclusive: true }, () => { + server.close((error) => { + if (error) reject(error); + else resolve(true); + }); + }); + }); +} + +/** + * Reuse the preferred port when it already hosts a compatible Argus API. + * Otherwise, avoid stale or unrelated listeners by selecting the first port + * this process can bind. + */ +export async function selectApiPort( + options: SelectApiPortOptions, + deps: SelectApiPortDeps = {}, +): Promise { + if (options.explicit) return options.preferredPort; + + const probe = deps.probe ?? probeApi; + const available = deps.available ?? isPortAvailable; + const preferredProbe = await probe(options.host, options.preferredPort, options.token); + if (preferredProbe.state === 'compatible') return options.preferredPort; + if (preferredProbe.state === 'incompatible' && preferredProbe.meta) { + return options.preferredPort; + } + const host = options.host.trim().toLowerCase(); + const localBind = isLocalApiHost(host) || host === '0.0.0.0' || host === '::' || host === '::0'; + if (!localBind) return options.preferredPort; + + const attempts = options.maxAttempts ?? 20; + for (let offset = 0; offset < attempts; offset += 1) { + const port = options.preferredPort + offset; + if (port > 65_535) break; + if (await available(options.host, port)) return port; + if (port !== options.preferredPort) { + const candidateProbe = await probe(options.host, port, options.token); + if (candidateProbe.state === 'compatible') return port; + } + } + throw new Error( + `no available API port found from ${options.preferredPort} ` + + `after ${attempts} attempts; pass --port to choose one explicitly`, + ); +} diff --git a/frontend/tui/test/args.test.ts b/frontend/tui/test/args.test.ts index af110eba..7a1214a2 100644 --- a/frontend/tui/test/args.test.ts +++ b/frontend/tui/test/args.test.ts @@ -4,7 +4,7 @@ import { join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import test from 'node:test'; -import { parseArgs } from '../src/args.js'; +import { parseArgs, withSelectedPort } from '../src/args.js'; test('legacy resume flags map onto the Ink project selection model', () => { assert.equal(parseArgs(['--resume', 's-paper']).project, 's-paper'); @@ -65,6 +65,26 @@ test('value flags reject missing and invalid values early', () => { assert.throws(() => parseArgs(['--count', '1.5']), /positive integer/); }); +test('Windows interactive launches open Web by default and allow opting out', () => { + const windows = parseArgs([], { env: {}, platform: 'win32' }); + assert.equal(windows.openWebWithCli, true); + assert.equal(windows.noOpen, false); + assert.equal(parseArgs(['--no-open'], { env: {}, platform: 'win32' }).noOpen, true); + assert.equal(parseArgs([], { env: {}, platform: 'linux' }).openWebWithCli, false); +}); + +test('ports are auto-selected unless pinned by CLI or environment', () => { + const automatic = parseArgs([], { env: {}, platform: 'linux' }); + assert.equal(automatic.port, 8799); + assert.equal(automatic.portExplicit, false); + assert.equal(parseArgs(['--port', '8800'], { env: {} }).portExplicit, true); + assert.equal(parseArgs([], { env: { ARGUS_TUI_PORT: '8801' } }).portExplicit, true); + + const moved = withSelectedPort(automatic, 8802); + assert.equal(moved.port, 8802); + assert.match(moved.ownerFile ?? '', /webapi-127\.0\.0\.1-8802\.owner\.json$/); +}); + test('invalid CLI arguments print one actionable line without a bundle stack', () => { const cli = fileURLToPath(new URL('../src/cli.tsx', import.meta.url)); const result = spawnSync( diff --git a/frontend/tui/test/portSelection.test.ts b/frontend/tui/test/portSelection.test.ts new file mode 100644 index 00000000..3f67a297 --- /dev/null +++ b/frontend/tui/test/portSelection.test.ts @@ -0,0 +1,122 @@ +import assert from 'node:assert/strict'; +import test from 'node:test'; + +import { selectApiPort } from '../src/portSelection.js'; +import type { ApiProbeResult } from '../src/ensureApi.js'; + +const unreachable: ApiProbeResult = { + state: 'unreachable', + message: 'connect refused', +}; + +test('an explicit port is returned without probing or binding', async () => { + let called = false; + const port = await selectApiPort( + { host: '127.0.0.1', preferredPort: 9000, explicit: true }, + { + probe: async () => { + called = true; + return unreachable; + }, + available: async () => { + called = true; + return false; + }, + }, + ); + assert.equal(port, 9000); + assert.equal(called, false); +}); + +test('a compatible preferred backend is reused', async () => { + const port = await selectApiPort( + { host: '127.0.0.1', preferredPort: 8799, explicit: false }, + { + probe: async () => ({ state: 'compatible', message: 'ready' }), + available: async () => { + throw new Error('availability should not be checked'); + }, + }, + ); + assert.equal(port, 8799); +}); + +test('an outdated Argus backend stays on the preferred port for safe replacement', async () => { + const port = await selectApiPort( + { host: '127.0.0.1', preferredPort: 8799, explicit: false }, + { + probe: async () => ({ + state: 'incompatible', + message: 'release mismatch', + meta: {} as ApiProbeResult['meta'], + }), + available: async () => { + throw new Error('availability should not be checked'); + }, + }, + ); + assert.equal(port, 8799); +}); + +test('a remote host keeps its requested port without attempting a local bind', async () => { + let bound = false; + const port = await selectApiPort( + { host: 'api.example.com', preferredPort: 8799, explicit: false }, + { + probe: async () => unreachable, + available: async () => { + bound = true; + return true; + }, + }, + ); + assert.equal(port, 8799); + assert.equal(bound, false); +}); + +test('an occupied incompatible preferred port advances to the first available port', async () => { + const checked: number[] = []; + const port = await selectApiPort( + { host: '127.0.0.1', preferredPort: 8799, explicit: false }, + { + probe: async () => ({ state: 'incompatible', message: 'wrong service' }), + available: async (_host, candidate) => { + checked.push(candidate); + return candidate === 8801; + }, + }, + ); + assert.equal(port, 8801); + assert.deepEqual(checked, [8799, 8800, 8801]); +}); + +test('port selection reuses a compatible Argus backend on a later port', async () => { + const probes: number[] = []; + const port = await selectApiPort( + { host: '127.0.0.1', preferredPort: 8799, explicit: false }, + { + probe: async (_host, candidate) => { + probes.push(candidate); + return candidate === 8800 + ? { state: 'compatible', message: 'ready' } + : { state: 'incompatible', message: 'wrong service' }; + }, + available: async () => false, + }, + ); + assert.equal(port, 8800); + assert.deepEqual(probes, [8799, 8800]); +}); + +test('port selection fails with an actionable bounded-search error', async () => { + await assert.rejects( + selectApiPort( + { host: '127.0.0.1', preferredPort: 8799, explicit: false, maxAttempts: 2 }, + { + probe: async () => unreachable, + available: async () => false, + }, + ), + /no available API port found from 8799 after 2 attempts/, + ); +}); diff --git a/frontend/tui/test/protocol.test.ts b/frontend/tui/test/protocol.test.ts index eb04c5ba..214b7b63 100644 --- a/frontend/tui/test/protocol.test.ts +++ b/frontend/tui/test/protocol.test.ts @@ -714,6 +714,37 @@ test('normal autostart records listener and launcher PIDs after the runtime hand }); }); +test('normal autostart fails immediately when the spawned backend exits', async () => { + const result = await ensureApi({ + host: '127.0.0.1', + port: 8899, + dependencies: { + probeApi: async () => unreachableProbe, + spawnApi: async () => ({ pid: 7777, exited: Promise.resolve(7) }), + sleep: async () => new Promise(() => undefined), + }, + }); + + assert.equal(result.reachable, false); + assert.equal(result.spawned, true); + assert.match(result.message, /exited before becoming ready \(exit 7\)/); +}); + +test('normal autostart accepts a competing compatible backend after bind loss', async () => { + const result = await ensureApi({ + host: '127.0.0.1', + port: 8899, + dependencies: { + probeApi: probeSequence(unreachableProbe, currentProbeWithPid(8888)), + spawnApi: async () => ({ pid: 7777, exited: Promise.resolve(1) }), + sleep: async () => new Promise(() => undefined), + }, + }); + + assert.equal(result.reachable, true); + assert.equal(result.spawned, false); +}); + test('spawn cleanup verifies and signals both Windows listener and launcher PIDs', async () => { const ownership: ApiOwnershipRecord = { schema: 1, diff --git a/frontend/web/dist/assets/ResearchWorkbenchPanel-BOPEGTC6.js b/frontend/web/dist/assets/ResearchWorkbenchPanel-DpQaJ9Sz.js similarity index 99% rename from frontend/web/dist/assets/ResearchWorkbenchPanel-BOPEGTC6.js rename to frontend/web/dist/assets/ResearchWorkbenchPanel-DpQaJ9Sz.js index 90091065..08dac08c 100644 --- a/frontend/web/dist/assets/ResearchWorkbenchPanel-BOPEGTC6.js +++ b/frontend/web/dist/assets/ResearchWorkbenchPanel-DpQaJ9Sz.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-Dzq_asqX.js","assets/index-DYvAJ_cb.js","assets/rolldown-runtime-hePW80VL.js","assets/icons-BgG77X6K.js","assets/query-DOc9YWJi.js","assets/markdown-BdostSiP.js","assets/index-BsbGxZOe.css"])))=>i.map(i=>d[i]); -import{r as e}from"./rolldown-runtime-hePW80VL.js";import{D as t,E as n}from"./icons-BgG77X6K.js";import{i as r,n as i,t as a}from"./query-DOc9YWJi.js";import{n as o,t as s}from"./markdown-BdostSiP.js";import{a as c,i as l,n as u,o as d,r as f,t as p}from"./index-DYvAJ_cb.js";var m=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),h=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),g={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`},_=e(t()),v=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...g,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:h(`lucide`,i),...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),y=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(v,{ref:i,iconNode:t,className:h(`lucide-${m(e)}`,n),...r}));return n.displayName=`${e}`,n},b=y(`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`}]]),x=y(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),S=y(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),C=y(`AudioLines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),w=y(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),T=y(`Calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),E=y(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),D=y(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ee=y(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),O=y(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),k=y(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),A=y(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),j=y(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),M=y(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),N=y(`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`}]]),te=y(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),P=y(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),ne=y(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),re=y(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),F=y(`FileSearch2`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),ie=y(`FileSearch`,[[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3`,key:`ms7g94`}],[`path`,{d:`m9 18-1.5-1.5`,key:`1j6qii`}],[`circle`,{cx:`5`,cy:`14`,r:`3`,key:`ufru5t`}]]),I=y(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),L=y(`FileUp`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),ae=y(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),oe=y(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),se=y(`FlaskConical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),ce=y(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),le=y(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),ue=y(`FolderSearch`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),de=y(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),fe=y(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),pe=y(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),me=y(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),he=y(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ge=y(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),_e=y(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),ve=y(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ye=y(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),be=y(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),xe=y(`ListFilter`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M10 18h4`,key:`1ulq68`}]]),Se=y(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ce=y(`LockKeyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),we=y(`Megaphone`,[[`path`,{d:`m3 11 18-5v12L3 14v-3z`,key:`n962bs`}],[`path`,{d:`M11.6 16.8a3 3 0 1 1-5.8-1.6`,key:`1yl0tm`}]]),Te=y(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),Ee=y(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),De=y(`PackageCheck`,[[`path`,{d:`m16 16 2 2 4-4`,key:`gfu2re`}],[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),Oe=y(`Paperclip`,[[`path`,{d:`M13.234 20.252 21 12.3`,key:`1cbrk9`}],[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486`,key:`1pkts6`}]]),ke=y(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),Ae=y(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),je=y(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Me=y(`Presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),Ne=y(`Radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]),Pe=y(`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`}]]),Fe=y(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Ie=y(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Le=y(`Scale`,[[`path`,{d:`m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`7g6ntu`}],[`path`,{d:`m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`ijws7r`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2`,key:`3gwbw2`}]]),Re=y(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),ze=y(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Be=y(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),R=y(`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`}]]),z=y(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Ve=y(`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`}]]),He=y(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Ue=y(`Table2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),We=y(`Target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Ge=y(`TimerReset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]),Ke=y(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),qe=y(`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`}]]),Je=y(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),Ye=y(`UserRound`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Xe=y(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),Ze=y(`Watch`,[[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`polyline`,{points:`12 10 12 12 13 13`,key:`19dquz`}],[`path`,{d:`m16.13 7.66-.81-4.05a2 2 0 0 0-2-1.61h-2.68a2 2 0 0 0-2 1.61l-.78 4.05`,key:`18k57s`}],[`path`,{d:`m7.88 16.36.8 4a2 2 0 0 0 2 1.61h2.72a2 2 0 0 0 2-1.61l.81-4.05`,key:`16ny36`}]]),Qe=y(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),$e=y(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),et=y(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),tt=12e3;function nt(e=!1){let t={...f()};return e&&(t[`Content-Type`]=`application/json`),t}async function B(e,t={}){await c();let n={...t,headers:{...nt(!!t.body),...t.headers??{}},cache:`no-store`},r=String(t.method??`GET`).toUpperCase(),i=async n=>{if(!n.ok){let r=await n.text().catch(()=>``),i=r;try{i=JSON.parse(r).detail??r}catch{}throw Error(i||`${t.method??`GET`} ${e} failed (${n.status})`)}return await n.json()};return r===`GET`?d(e,n,tt,i):i(await fetch(e,n))}var V=(e,t=``)=>`/api/projects/${encodeURIComponent(e)}${t}`,rt=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`;function it(e){let t=e.replaceAll(`\r +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-Dvbq7GvP.js","assets/index-zS7B6Urk.js","assets/rolldown-runtime-hePW80VL.js","assets/icons-BgG77X6K.js","assets/query-DOc9YWJi.js","assets/markdown-BdostSiP.js","assets/index-BsbGxZOe.css"])))=>i.map(i=>d[i]); +import{r as e}from"./rolldown-runtime-hePW80VL.js";import{D as t,E as n}from"./icons-BgG77X6K.js";import{i as r,n as i,t as a}from"./query-DOc9YWJi.js";import{n as o,t as s}from"./markdown-BdostSiP.js";import{a as c,i as l,n as u,o as d,r as f,t as p}from"./index-zS7B6Urk.js";var m=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),h=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),g={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`},_=e(t()),v=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...g,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:h(`lucide`,i),...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),y=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(v,{ref:i,iconNode:t,className:h(`lucide-${m(e)}`,n),...r}));return n.displayName=`${e}`,n},b=y(`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`}]]),x=y(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),S=y(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),C=y(`AudioLines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),w=y(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),T=y(`Calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),E=y(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),D=y(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ee=y(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),O=y(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),k=y(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),A=y(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),j=y(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),M=y(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),N=y(`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`}]]),te=y(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),P=y(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),ne=y(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),re=y(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),F=y(`FileSearch2`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),ie=y(`FileSearch`,[[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3`,key:`ms7g94`}],[`path`,{d:`m9 18-1.5-1.5`,key:`1j6qii`}],[`circle`,{cx:`5`,cy:`14`,r:`3`,key:`ufru5t`}]]),I=y(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),L=y(`FileUp`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),ae=y(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),oe=y(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),se=y(`FlaskConical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),ce=y(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),le=y(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),ue=y(`FolderSearch`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),de=y(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),fe=y(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),pe=y(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),me=y(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),he=y(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ge=y(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),_e=y(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),ve=y(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ye=y(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),be=y(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),xe=y(`ListFilter`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M10 18h4`,key:`1ulq68`}]]),Se=y(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ce=y(`LockKeyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),we=y(`Megaphone`,[[`path`,{d:`m3 11 18-5v12L3 14v-3z`,key:`n962bs`}],[`path`,{d:`M11.6 16.8a3 3 0 1 1-5.8-1.6`,key:`1yl0tm`}]]),Te=y(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),Ee=y(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),De=y(`PackageCheck`,[[`path`,{d:`m16 16 2 2 4-4`,key:`gfu2re`}],[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),Oe=y(`Paperclip`,[[`path`,{d:`M13.234 20.252 21 12.3`,key:`1cbrk9`}],[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486`,key:`1pkts6`}]]),ke=y(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),Ae=y(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),je=y(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Me=y(`Presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),Ne=y(`Radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]),Pe=y(`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`}]]),Fe=y(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Ie=y(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Le=y(`Scale`,[[`path`,{d:`m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`7g6ntu`}],[`path`,{d:`m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z`,key:`ijws7r`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}],[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2`,key:`3gwbw2`}]]),Re=y(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),ze=y(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Be=y(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),R=y(`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`}]]),z=y(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Ve=y(`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`}]]),He=y(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Ue=y(`Table2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),We=y(`Target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Ge=y(`TimerReset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]),Ke=y(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),qe=y(`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`}]]),Je=y(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),Ye=y(`UserRound`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Xe=y(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),Ze=y(`Watch`,[[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`polyline`,{points:`12 10 12 12 13 13`,key:`19dquz`}],[`path`,{d:`m16.13 7.66-.81-4.05a2 2 0 0 0-2-1.61h-2.68a2 2 0 0 0-2 1.61l-.78 4.05`,key:`18k57s`}],[`path`,{d:`m7.88 16.36.8 4a2 2 0 0 0 2 1.61h2.72a2 2 0 0 0 2-1.61l.81-4.05`,key:`16ny36`}]]),Qe=y(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),$e=y(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),et=y(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),tt=12e3;function nt(e=!1){let t={...f()};return e&&(t[`Content-Type`]=`application/json`),t}async function B(e,t={}){await c();let n={...t,headers:{...nt(!!t.body),...t.headers??{}},cache:`no-store`},r=String(t.method??`GET`).toUpperCase(),i=async n=>{if(!n.ok){let r=await n.text().catch(()=>``),i=r;try{i=JSON.parse(r).detail??r}catch{}throw Error(i||`${t.method??`GET`} ${e} failed (${n.status})`)}return await n.json()};return r===`GET`?d(e,n,tt,i):i(await fetch(e,n))}var V=(e,t=``)=>`/api/projects/${encodeURIComponent(e)}${t}`,rt=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`;function it(e){let t=e.replaceAll(`\r `,` `).split(` @@ -11,7 +11,7 @@ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{D as t,E as n}from"./i `):`Not configured`}),(0,J.jsx)(`i`,{className:x.remotes.length?`ok`:`missing`,children:x.remotes.length?(0,J.jsx)(E,{size:12}):(0,J.jsx)(et,{size:12})})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`dt`,{children:[(0,J.jsx)(pe,{size:13}),`Upstream`]}),(0,J.jsxs)(`dd`,{children:[x.upstream||`Not configured`,x.upstream?` · ahead ${x.ahead}, behind ${x.behind}`:``]}),(0,J.jsx)(`i`,{className:x.upstream?`ok`:`missing`,children:x.upstream?(0,J.jsx)(E,{size:12}):(0,J.jsx)(et,{size:12})})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`dt`,{children:[(0,J.jsx)(Ye,{size:13}),`Commit identity`]}),(0,J.jsx)(`dd`,{children:x.identity.name&&x.identity.email?`${x.identity.name} <${x.identity.email}>`:`Not configured`}),(0,J.jsx)(`i`,{className:x.identity.valid?`ok`:`missing`,children:x.identity.valid?(0,J.jsx)(E,{size:12}):(0,J.jsx)(et,{size:12})})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`dt`,{children:[(0,J.jsx)(me,{size:13}),`GitHub CLI`]}),(0,J.jsx)(`dd`,{children:x.github.authenticated?`${x.github.login} · ${x.github.protocol}`:`Not authenticated`}),(0,J.jsx)(`i`,{className:x.github.authenticated?`ok`:`missing`,children:x.github.authenticated?(0,J.jsx)(E,{size:12}):(0,J.jsx)(et,{size:12})})]})]}),(0,J.jsx)(`p`,{children:x.publish_ready?`Repository is ready for an explicitly approved push.`:`Configure the missing items before publishing. No credentials are shown in this UI.`})]}):(0,J.jsx)(X,{icon:pe,title:`Not a Git repository`})})]}),(0,J.jsxs)(`section`,{className:`vscode-terminal`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(`strong`,{children:`ARGUS ACTIVITY`}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(Ve,{size:13}),`read-only`]})]}),(0,J.jsx)(`div`,{children:v.length?v.map((e,t)=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(`time`,{children:W(e.ts)}),(0,J.jsx)(`b`,{className:`terminal-role terminal-role--${ut(e)}`,children:ut(e)}),(0,J.jsx)(`span`,{children:`›`}),(0,J.jsx)(`code`,{children:q(e,800)||K(e)})]},`${e.ts}-${t}`)):(0,J.jsx)(`p`,{children:`$ waiting for Argus activity`})})]}),(0,J.jsxs)(`footer`,{className:`vscode-statusbar`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(pe,{size:12}),x?.branch||`no branch`]}),(0,J.jsx)(`span`,{children:m.isError?`Workspace error`:m.isFetching?`Workspace syncing`:m.data?.truncated?`Tree truncated`:`Workspace synced`}),(0,J.jsx)(`span`,{children:x?.github.authenticated?`GitHub: ${x.github.login}`:`GitHub: offline`}),(0,J.jsx)(`span`,{children:`UTF-8`}),(0,J.jsx)(`span`,{children:o.split(`.`).at(-1)?.toUpperCase()||`Plain Text`})]})]})]})}var Gt=2e5,Kt=5,qt=e=>`argus-v2-inbox:${e}`,Jt=e=>{try{let t=JSON.parse(localStorage.getItem(qt(e))??`[]`);return Array.isArray(t)?t:[]}catch{return[]}},Yt=(e,t)=>({id:crypto.randomUUID(),title:e,source:t,raw:``,prompt:``,changes:[],questions:[],createdAt:Date.now(),updatedAt:Date.now()});function Xt(e,t){let n=[...e.matchAll(/^#{1,3}\s+(.+)\n([\s\S]*?)(?=^#{1,3}\s+|$)/gm)],r=e=>/目标|objective|question/i.test(e)?We:/约束|constraint|boundary|non-goal/i.test(e)?be:/文献|evidence|source|paper/i.test(e)?ye:ve,i=n.map(e=>({title:e[1].trim(),body:e[2].trim(),icon:r(e[1])})).filter(e=>e.body);if(i.length)return i.slice(0,8);let a=e.split(/\n\s*\n/).map(e=>e.trim()).filter(Boolean),o=[];a[0]&&o.push({title:`研究目标与背景`,body:a[0],icon:We});let s=e.split(` `).filter(e=>/不得|不要|必须|约束|only|must|do not|without/i.test(e)).join(` `);return s&&o.push({title:`约束与边界`,body:s,icon:be}),t.length&&o.push({title:`仍需确认`,body:t.map(e=>`- ${e}`).join(` -`),icon:ve}),o}function Zt(e){let{text:t}=Q(),[n,r]=(0,_.useState)(()=>Jt(e.sid)),[i,a]=(0,_.useState)(()=>Jt(e.sid)[0]?.id??``),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(0),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`current`),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),w=_t(e.sid,e.refresh);(0,_.useEffect)(()=>{let t=Jt(e.sid);r(t),a(t[0]?.id??``),l([]),d(0)},[e.sid]),(0,_.useEffect)(()=>{try{localStorage.setItem(qt(e.sid),JSON.stringify(n)),h(``)}catch{h(`本机草稿存储空间不足;请缩短文本或删除旧草稿。`)}},[n,e.sid]);let T=n.find(e=>e.id===i)??null,D=(0,_.useMemo)(()=>Xt(T?.prompt??``,T?.questions??[]),[T?.prompt,T?.questions]),O=e=>T&&r(t=>t.map(t=>t.id===T.id?{...t,...e,updatedAt:Date.now()}:t)),k=()=>{let e=Yt(t(`新的科研输入`,`New research input`),t(`导师 / 组会 / 灵感`,`Advisor / meeting / idea`));r(t=>[e,...t]),a(e.id)},A=()=>{if(!T||!confirm(t(`删除“${T.title}”?`,`Delete “${T.title}”?`)))return;let e=n.filter(e=>e.id!==T.id);r(e),a(e[0]?.id??``)},j=T?`这是科研收信箱的预处理步骤,只分析输入并回复,不创建后台任务、不修改项目。请读取下面的零散内容和附件,提取知识点并生成第一版可直接交给 Argus 的研究 Prompt。必须保留事实来源和不确定性,不得虚构论文、实验或结论;使用以下 Markdown 结构:\n## 研究目标\n## 已知背景与知识点\n## 约束与非目标\n## 文献与证据线索\n## 建议任务与验收方式\n## 待确认问题\n\n标题:${T.title}\n来源:${T.source}\n\n原始内容:\n${T.raw}`:``,M=async e=>{let t=/\.(txt|md|markdown|json|csv|ya?ml|log|tex)$/i,n=/\.(pdf|png|jpe?g|webp|wav|mp3|m4a|ogg)$/i,r=e.filter(e=>!t.test(e.name)&&!n.test(e.name));if(r.length){p(`不支持的附件:${r.map(e=>e.name).join(`、`)}`);return}let i=e.find(e=>e.size>10485760);if(i){p(`${i.name} 超过单文件 10 MB 限制`);return}if(c.length+u+e.length>Kt){p(`每次分析最多导入 ${Kt} 个文件`);return}let a=e.filter(e=>t.test(e.name)),o=a.find(e=>e.size>1048576);if(o){p(`${o.name} 超过本机文本导入 1 MB 限制;请改为摘要或拆分文件`);return}let s=e.filter(e=>n.test(e.name)),f=[...c,...s];if(f.reduce((e,t)=>e+t.size,0)>26214400){p(`附件总大小超过 25 MB`);return}let m=await Promise.all(a.map(async e=>`\n\n--- 文件:${e.name} ---\n${await e.text()}`)),h=`${T?.raw??``}${m.join(``)}`.trim();if(h.length>Gt){p(`原始输入超过 ${Gt.toLocaleString()} 字符限制,请拆分或摘要`);return}m.length&&(O({raw:h}),d(e=>e+a.length)),l(f),p(``)},N=async()=>{if(!(!T||!T.raw.trim()&&!c.length)){s(!0),p(``);try{if(c.length){let e=await w.run(j,c),t=String(e?.reply||w.output||``).trim();if(!t)throw Error(`Argus 没有返回可用的知识提取结果`);O({prompt:t,changes:[`分析了 ${c.length} 个附件和原始输入`],questions:[]}),l([])}else{let t=await H.rewritePrompt(e.sid,j);if(t.error)throw Error(t.error);O({prompt:t.rewritten,changes:t.changes,questions:t.questions})}}catch(e){p(e instanceof Error?e.message:String(e))}finally{s(!1)}}},te=async()=>{if(T?.prompt.trim()){if(g===`new`){if(!y.trim()||!confirm(t(`确认用当前 Prompt 创建一个新的 Argus 项目?`,`Create a new Argus project with this prompt?`)))return;try{let e=await H.createDaemon(T.prompt,y,x);O({sentAt:Date.now()}),window.location.hash=`project/${e.sid}/overview`}catch(e){p(e instanceof Error?e.message:String(e))}return}confirm(t(`确认把这份第一版 Prompt 发送给当前 Argus 项目?`,`Send this first prompt to the current Argus project?`))&&await w.run(T.prompt)&&O({sentAt:Date.now()})}},P=T?.sentAt?4:T?.prompt?3:T?.raw||c.length?2:1;return(0,J.jsxs)(`div`,{className:`ros-page inbox-v2`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`RESEARCH INBOX`}),(0,J.jsx)(`h1`,{children:t(`从零散输入开始研究`,`Start research from rough input`)}),(0,J.jsx)(`p`,{children:t(`把消息、会议记录、文件或灵感交给 AI,提取知识点并形成第一版 Argus Prompt。`,`Give AI messages, meeting notes, files, or ideas to extract knowledge and create a first Argus prompt.`)})]}),(0,J.jsxs)(Y,{tone:`neutral`,children:[(0,J.jsx)(Ie,{size:12}),t(`本机自动保存`,`Saved locally`)]})]}),(0,J.jsx)(`div`,{className:`intake-steps`,children:[[t(`收集原始内容`,`Collect input`),Te],[t(`AI 提取知识`,`Extract knowledge`),Xe],[t(`形成 Argus Prompt`,`Build Argus prompt`),I],[t(`创建 / 发送项目`,`Create / send project`),ze]].map(([e,t],n)=>(0,J.jsxs)(`div`,{className:P>n?`is-done`:P===n+1?`is-active`:``,children:[(0,J.jsx)(`span`,{children:P>n+1?(0,J.jsx)(E,{size:14}):(0,J.jsx)(t,{size:15})}),(0,J.jsx)(`strong`,{children:String(e)}),n<3?(0,J.jsx)(ee,{size:14}):null]},String(e)))}),(0,J.jsxs)(`div`,{className:`inbox-v2__layout`,children:[(0,J.jsxs)(`aside`,{className:`ros-card inbox-sources`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`INBOX`}),(0,J.jsx)(`h2`,{children:t(`科研输入`,`Research input`)})]}),(0,J.jsx)(`button`,{className:`icon-button`,type:`button`,onClick:k,"aria-label":t(`新增输入`,`Add input`),children:(0,J.jsx)(je,{size:15})})]}),(0,J.jsx)(`div`,{children:n.length?n.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:T?.id===e.id?`is-active`:``,onClick:()=>a(e.id),children:[(0,J.jsx)(`span`,{className:`inbox-item-icon`,children:e.sentAt?(0,J.jsx)(E,{size:14}):e.prompt?(0,J.jsx)(z,{size:14}):(0,J.jsx)(_e,{size:14})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.title}),(0,J.jsxs)(`small`,{children:[e.source,` · `,ct(e.updatedAt/1e3)]})]})]},e.id)):(0,J.jsx)(X,{icon:_e,title:t(`暂无输入`,`No input yet`),description:t(`新增一条导师消息、组会笔记或研究灵感。`,`Add an advisor message, meeting note, or research idea.`)})})]}),(0,J.jsxs)(`main`,{className:`ros-card inbox-input`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`RAW MATERIAL`}),(0,J.jsx)(`h2`,{children:t(`原始内容与附件`,`Raw content and attachments`)})]}),T?(0,J.jsx)(`button`,{className:`icon-button`,type:`button`,onClick:A,"aria-label":t(`删除`,`Delete`),children:(0,J.jsx)(Ke,{size:14})}):null]}),T?(0,J.jsxs)(`div`,{className:`inbox-input__form`,children:[(0,J.jsxs)(`div`,{className:`form-grid`,children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:t(`标题`,`Title`)}),(0,J.jsx)(`input`,{value:T.title,onChange:e=>O({title:e.target.value})})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:t(`来源`,`Source`)}),(0,J.jsx)(`input`,{value:T.source,onChange:e=>O({source:e.target.value})})]})]}),(0,J.jsxs)(`label`,{className:`field field--grow`,children:[(0,J.jsx)(`span`,{children:t(`零散消息、笔记或转写文本`,`Rough messages, notes, or transcripts`)}),(0,J.jsx)(`textarea`,{maxLength:Gt,value:T.raw,onChange:e=>O({raw:e.target.value}),placeholder:t(`不需要先整理,直接粘贴原始内容。AI 会区分目标、事实、约束、文献线索、待办和疑问…`,`Paste raw content directly. AI will separate goals, facts, constraints, evidence leads, tasks, and questions…`)})]}),c.length?(0,J.jsx)(`div`,{className:`inbox-attachment-list`,children:c.map((e,t)=>(0,J.jsxs)(`span`,{children:[e.type.startsWith(`audio/`)?(0,J.jsx)(C,{size:14}):e.type.startsWith(`image/`)?(0,J.jsx)(ge,{size:14}):(0,J.jsx)(I,{size:14}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsxs)(`small`,{children:[(e.size/1024/1024).toFixed(1),` MB · 仅在本次分析上传`]})]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>l(e=>e.filter((e,n)=>n!==t)),children:(0,J.jsx)(et,{size:13})})]},`${e.name}-${t}`))}):null,(0,J.jsxs)(`div`,{className:`inbox-upload-types`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(I,{size:14}),`PDF / `,t(`文本`,`text`)]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(ge,{size:14}),t(`图片`,`images`)]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(C,{size:14}),t(`语音`,`audio`)]}),(0,J.jsx)(`p`,{children:t(`语音会交给 Argus 和已配置工具处理,不把“上传成功”冒充“已完成转写”。`,`Audio is handed to Argus and configured tools; an upload is never presented as a completed transcript.`)})]}),(0,J.jsxs)(`div`,{className:`inbox-input__actions`,children:[(0,J.jsxs)(`label`,{className:`button button--secondary file-button`,children:[(0,J.jsx)(Je,{size:14}),t(`添加文件`,`Add files`),(0,J.jsx)(`input`,{type:`file`,multiple:!0,accept:`.txt,.md,.markdown,.json,.csv,.yaml,.yml,.log,.tex,.pdf,.png,.jpg,.jpeg,.webp,.wav,.mp3,.m4a,.ogg`,onChange:e=>void M(Array.from(e.target.files??[]))})]}),(0,J.jsxs)(`button`,{className:`button button--primary`,type:`button`,disabled:!T.raw.trim()&&!c.length||o||w.busy,onClick:()=>void N(),children:[o||w.busy?(0,J.jsx)(z,{size:14}):(0,J.jsx)(Xe,{size:14}),o||w.busy?w.phase||t(`AI 正在分析`,`AI is analyzing`):t(`分析内容并生成 Prompt`,`Analyze and generate prompt`)]})]}),f?(0,J.jsx)(`div`,{className:`inline-error`,children:f}):null,m?(0,J.jsx)(`div`,{className:`inline-error`,children:m}):null]}):(0,J.jsx)(X,{icon:_e,title:t(`选择或新增一条科研输入`,`Select or add research input`)})]}),(0,J.jsxs)(`aside`,{className:`inbox-output`,children:[(0,J.jsxs)(`section`,{className:`ros-card knowledge-panel`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`KNOWLEDGE EXTRACTION`}),(0,J.jsx)(`h2`,{children:t(`AI 提取的知识点`,`AI-extracted knowledge`)})]}),D.length?(0,J.jsxs)(Y,{tone:`success`,children:[D.length,` `,t(`组`,`groups`)]}):null]}),D.length?(0,J.jsx)(`div`,{className:`knowledge-grid`,children:D.map(e=>{let t=e.icon;return(0,J.jsxs)(`article`,{children:[(0,J.jsx)(`span`,{children:(0,J.jsx)(t,{size:15})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.title}),(0,J.jsx)(Z,{children:e.body})]})]},e.title)})}):(0,J.jsx)(X,{icon:ve,title:t(`等待 AI 提取`,`Waiting for AI extraction`),description:t(`结果会明确区分目标、知识点、约束、证据线索和待确认问题。`,`The result separates goals, knowledge, constraints, evidence leads, and open questions.`)})]}),(0,J.jsxs)(`section`,{className:`ros-card first-prompt`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`FIRST ARGUS PROMPT`}),(0,J.jsx)(`h2`,{children:t(`第一版 Argus Prompt`,`First Argus prompt`)})]}),T?.prompt?(0,J.jsx)(Y,{tone:`info`,children:t(`可编辑`,`Editable`)}):null]}),T?.prompt?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`textarea`,{value:T.prompt,onChange:e=>O({prompt:e.target.value})}),(0,J.jsxs)(`div`,{className:`dispatch-mode`,children:[(0,J.jsx)(`button`,{type:`button`,className:g===`current`?`is-active`:``,onClick:()=>v(`current`),children:t(`发送当前项目`,`Send to current project`)}),(0,J.jsx)(`button`,{type:`button`,className:g===`new`?`is-active`:``,onClick:()=>v(`new`),children:t(`创建新项目`,`Create new project`)})]}),g===`new`?(0,J.jsxs)(`div`,{className:`new-project-fields`,children:[(0,J.jsx)(`input`,{value:y,onChange:e=>b(e.target.value),placeholder:t(`新项目名称`,`New project name`)}),(0,J.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),placeholder:t(`工作目录(可选,留空自动创建)`,`Workdir (optional; blank creates one)`)})]}):null,(0,J.jsxs)(`button`,{className:`button button--primary button--full`,type:`button`,disabled:w.busy,onClick:()=>void te(),children:[(0,J.jsx)(ze,{size:14}),w.busy?w.phase||t(`正在发送`,`Sending`):g===`new`?t(`用此 Prompt 创建 Argus 项目`,`Create Argus project with this prompt`):t(`确认并发送给当前 Argus`,`Confirm and send to current Argus`)]}),w.output?(0,J.jsx)(`div`,{className:`manager-mini-result`,children:(0,J.jsx)(Z,{children:w.output})}):null]}):(0,J.jsx)(X,{icon:I,title:t(`尚未生成 Prompt`,`No prompt generated`),description:t(`AI 提取后会在这里生成第一版 Prompt,你可以先修改再发送。`,`The first prompt appears here after extraction and can be edited before sending.`)})]})]})]})]})}function Qt({paper:e,selected:t,onClick:n}){let{text:r}=Q();return(0,J.jsxs)(`button`,{type:`button`,className:`paper-card ${t?`is-selected`:``}`,onClick:n,children:[(0,J.jsxs)(`div`,{className:`paper-card__meta`,children:[(0,J.jsx)(Y,{tone:e.evidenceStatus===`verified_artifact`?`success`:e.evidenceStatus===`metadata`?`info`:`warn`,children:e.evidenceStatus===`verified_artifact`?r(`原文文件已验证`,`Source verified`):e.evidenceStatus===`metadata`?r(`仅元数据`,`Metadata only`):r(`待核验`,`Needs verification`)}),(0,J.jsxs)(`span`,{className:`paper-card__year`,children:[e.year||`—`,e.venue?` · ${e.venue}`:``]})]}),(0,J.jsx)(`h3`,{children:e.title}),e.authors.length?(0,J.jsxs)(`p`,{className:`paper-card__authors`,children:[e.authors.slice(0,4).join(`, `),e.authors.length>4?` et al.`:``]}):null,(0,J.jsx)(`p`,{className:`paper-card__summary`,children:e.relevance||e.abstract||r(`该记录尚未写入项目相关性摘要。`,`No project-relevance summary has been recorded.`)}),(0,J.jsxs)(`div`,{className:`paper-card__footer`,children:[(0,J.jsx)(`code`,{children:e.sourcePath}),(0,J.jsx)(`span`,{children:r(`查看详情`,`View details`)})]})]})}function $t(e){let{text:t}=Q(),n=Vt(e.sid,`literature`),r=n.active?.path||``,a=i({queryKey:[`workspace-literature`,e.sid,n.workspaceId],queryFn:({signal:t})=>$.literature(e.sid,n.workspaceId,t),enabled:!!n.workspaceId,refetchInterval:15e3}),[o,s]=(0,_.useState)(`all`),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),m=_t(e.sid,async()=>{await e.refresh(),await a.refetch()}),h=a.data?.papers??[],g=Math.max(0,...h.map(e=>e.year??0)),v=(0,_.useMemo)(()=>h.filter(e=>{if(o===`recent`&&(e.year??0)e.id===u)??v[0]??null,b=(0,_.useMemo)(()=>e.events.filter(e=>/paper|arxiv|doi|literature|search|citation|http/i.test(`${e.type} ${e.kind} ${q(e,2e3)}`)).slice(-30).reverse(),[e.events]),x=async()=>{f.trim()&&await m.run(`请为当前项目执行新的文献调研:${f}\n\n要求读取原始论文或官方仓库,把结构化记录追加到项目的 literature grounding/audit 文件中,包括标题、作者、年份、URL、与当前项目关系、最近工作威胁和仍待全文核验项。完成后文献中心应能从工作目录直接读取这些记录。`)};return(0,J.jsxs)(`div`,{className:`ros-page literature-v2`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`LITERATURE CENTER`}),(0,J.jsx)(`h1`,{children:t(`文献中心`,`Literature center`)}),(0,J.jsx)(`p`,{children:t(`直接读取 Argus 工作目录中的论文清单、文献审计和实时检索轨迹,不再依赖手工注册 artifacts。`,`Read paper inventories, literature audits, and live retrieval traces directly from the Argus workdir.`)})]}),(0,J.jsxs)(`div`,{className:`header-badges`,children:[(0,J.jsxs)(Y,{tone:`success`,children:[(0,J.jsx)(w,{size:12}),h.length,` `,t(`篇论文`,`papers`)]}),(0,J.jsxs)(Y,{tone:`neutral`,children:[a.data?.sourceFiles.length??0,` `,t(`个证据文件`,`evidence files`)]})]})]}),(0,J.jsxs)(`section`,{className:`literature-stats`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--blue`,children:(0,J.jsx)(w,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`论文记录`,`Paper records`),(0,J.jsx)(`strong`,{children:h.length})]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--green`,children:(0,J.jsx)(ie,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`原文文件已验证`,`Verified sources`),(0,J.jsx)(`strong`,{children:h.filter(e=>e.evidenceStatus===`verified_artifact`).length})]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--amber`,children:(0,J.jsx)(T,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`最近工作`,`Recent work`),(0,J.jsx)(`strong`,{children:h.filter(e=>(e.year??0)>=g-1).length})]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--violet`,children:(0,J.jsx)(ue,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`扫描项目文件`,`Scanned files`),(0,J.jsx)(`strong`,{children:a.data?.scannedFiles??0})]})]})]}),(0,J.jsxs)(`div`,{className:`literature-v2__layout`,children:[(0,J.jsxs)(`aside`,{className:`literature-v2__sidebar ros-card`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`LIBRARY`}),(0,J.jsx)(`h2`,{children:t(`项目文献库`,`Project library`)})]})}),(0,J.jsxs)(`label`,{className:`search-field search-field--block`,children:[(0,J.jsx)(Re,{size:14}),(0,J.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`搜索标题、作者、主题`,`Search title, author, or topic`)})]}),(0,J.jsx)(`nav`,{className:`library-tabs`,children:[[`all`,t(`全部论文`,`All papers`),h.length],[`recent`,t(`最近工作`,`Recent work`),h.filter(e=>(e.year??0)>=g-1).length],[`read`,t(`已验证原文`,`Verified sources`),h.filter(e=>e.evidenceStatus===`verified_artifact`).length],[`sources`,t(`证据文件`,`Evidence files`),a.data?.sourceFiles.length??0]].map(([e,t,n])=>(0,J.jsxs)(`button`,{type:`button`,className:o===e?`is-active`:``,onClick:()=>s(e),children:[(0,J.jsx)(`span`,{children:t}),(0,J.jsx)(`small`,{children:n})]},e))}),(0,J.jsxs)(`div`,{className:`literature-source-note`,children:[(0,J.jsx)(re,{size:15}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:t(`实时来源`,`Live source`)}),(0,J.jsx)(`p`,{title:r,children:r})]})]})]}),(0,J.jsxs)(`main`,{className:`literature-v2__main`,children:[(0,J.jsxs)(`div`,{className:`literature-list-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:o===`recent`?t(`最近工作`,`Recent work`):o===`read`?t(`已验证原文文件`,`Verified source files`):o===`sources`?t(`文献证据文件`,`Literature evidence files`):t(`全部论文`,`All papers`)}),(0,J.jsx)(`p`,{children:o===`recent`?t(`按项目中最新年份 ${g||`—`} 自动筛选`,`Filtered by the latest project year: ${g||`—`}`):t(`Argus 写入工作目录后约 5 秒内自动更新`,`Updates shortly after Argus writes to the workdir`)})]}),a.isError?(0,J.jsx)(Y,{tone:`danger`,children:t(`同步失败`,`Sync failed`)}):a.isFetching?(0,J.jsx)(Y,{tone:`live`,dot:!0,children:t(`同步中`,`Syncing`)}):(0,J.jsx)(Y,{tone:`success`,children:t(`已同步`,`Synced`)})]}),a.isError?(0,J.jsx)(`div`,{className:`inline-error`,children:a.error.message}):null,o===`sources`?(0,J.jsx)(`div`,{className:`source-file-grid`,children:a.data?.sourceFiles.map(e=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(re,{size:17}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]}),(0,J.jsx)(`time`,{children:ct(e.mtime)})]},e.path))}):v.length?(0,J.jsx)(`div`,{className:`paper-grid`,children:v.map(e=>(0,J.jsx)(Qt,{paper:e,selected:y?.id===e.id,onClick:()=>d(e.id)},e.id))}):(0,J.jsx)(X,{icon:w,title:t(`此筛选下暂无论文`,`No papers match this filter`),description:t(`Argus 完成检索并写入 LITERATURE_GROUNDING.json 后会自动出现。`,`Papers appear after Argus writes LITERATURE_GROUNDING.json.`)})]}),(0,J.jsxs)(`aside`,{className:`literature-v2__detail`,children:[(0,J.jsx)(`section`,{className:`ros-card paper-detail`,children:y?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`paper-detail__top`,children:[(0,J.jsx)(Y,{tone:y.evidenceStatus===`verified_artifact`?`success`:y.evidenceStatus===`metadata`?`info`:`warn`,children:y.evidenceStatus===`verified_artifact`?`verified artifact`:y.evidenceStatus}),(0,J.jsxs)(`span`,{children:[y.year||`—`,y.venue?` · ${y.venue}`:``]})]}),(0,J.jsx)(`h2`,{children:y.title}),y.authors.length?(0,J.jsx)(`p`,{className:`paper-detail__authors`,children:y.authors.join(`, `)}):null,(0,J.jsxs)(`div`,{className:`paper-detail__body`,children:[(0,J.jsx)(`h3`,{children:t(`与当前项目的关系`,`Relationship to this project`)}),(0,J.jsx)(Z,{children:y.relevance||y.abstract||t(`尚未写入摘要。`,`No summary recorded.`)}),y.abstract&&y.relevance?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`h3`,{children:t(`摘要`,`Abstract`)}),(0,J.jsx)(`p`,{children:y.abstract})]}):null]}),(0,J.jsxs)(`div`,{className:`paper-detail__source`,children:[(0,J.jsx)(`span`,{children:t(`证据文件`,`Evidence file`)}),(0,J.jsx)(`code`,{children:y.sourcePath})]}),y.url?(0,J.jsxs)(`a`,{className:`button button--secondary button--full`,href:y.url,target:`_blank`,rel:`noreferrer`,children:[t(`打开原始来源`,`Open source`),` `,(0,J.jsx)(N,{size:14})]}):null]}):(0,J.jsx)(X,{icon:w,title:t(`选择一篇论文`,`Select a paper`)})}),(0,J.jsxs)(`section`,{className:`ros-card retrieval-panel`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`ARGUS RETRIEVAL`}),(0,J.jsx)(`h2`,{children:t(`最近检索`,`Recent retrieval`)})]}),(0,J.jsx)(Y,{tone:e.connected?`live`:`warn`,dot:!0,children:e.connected?`Live`:`Polling`})]}),(0,J.jsxs)(`div`,{children:[(a.data?.searchFiles??[]).slice(0,8).map(e=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(ie,{size:13}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]}),(0,J.jsx)(`time`,{children:W(e.mtime)})]},e.path)),!a.data?.searchFiles.length&&b.slice(0,8).map((e,t)=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(ie,{size:13}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:K(e)}),(0,J.jsx)(`code`,{children:q(e,100)})]}),(0,J.jsx)(`time`,{children:W(e.ts)})]},`${e.ts}-${t}`))]})]}),(0,J.jsxs)(`section`,{className:`ros-card literature-ask`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`NEW SEARCH`}),(0,J.jsx)(`h2`,{children:t(`让 Argus 调研新工作`,`Ask Argus to research new work`)})]})}),(0,J.jsx)(`textarea`,{rows:3,value:f,onChange:e=>p(e.target.value),placeholder:t(`例如:检索 2025–2026 年与当前方法最接近的直接竞争工作…`,`Example: find the closest competing work from 2025–2026…`)}),(0,J.jsxs)(`button`,{className:`button button--primary button--full`,type:`button`,disabled:!f.trim()||m.busy,onClick:()=>void x(),children:[(0,J.jsx)(z,{size:14}),m.busy?m.phase||t(`检索中`,`Researching`):t(`发起文献调研`,`Start literature research`)]}),m.output?(0,J.jsx)(`div`,{className:`manager-mini-result`,children:(0,J.jsx)(Z,{children:m.output})}):null]})]})]})]})}var en=`/assets/pdf.worker.min-CHFwMXne.mjs`;function tn(e){return[`.png`,`.jpg`,`.jpeg`,`.webp`,`.svg`].includes(e.extension)}function nn(e){return[`.csv`,`.tsv`].includes(e.extension)}function rn(e){return[`.tex`,`.md`].includes(e.extension)}function an({src:e,name:t}){let{text:n}=Q(),r=(0,_.useRef)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(1),[c,l]=(0,_.useState)(1.25),[u,d]=(0,_.useState)(``),[f,m]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let t=!0,n=null;a(null),s(1),d(``),m(!1);let r=localStorage.getItem(`argus_web_token`);return Promise.all([fetch(e,{headers:r?{Authorization:`Bearer ${r}`}:{}}).then(e=>{if(!e.ok)throw Error(`PDF request failed (${e.status})`);return e.arrayBuffer()}),p(()=>import(`./pdf-Dzq_asqX.js`),__vite__mapDeps([0,1,2,3,4,5,6]))]).then(([e,r])=>{if(t)return r.GlobalWorkerOptions.workerSrc=en,n=r.getDocument({data:e}),n.promise}).then(e=>{t&&e&&a(e)}).catch(e=>{t&&d(e instanceof Error?e.message:String(e))}),()=>{t=!1,n?.destroy()}},[e]),(0,_.useEffect)(()=>{if(!i||!r.current)return;m(!1);let e=!1,t=null;return i.getPage(o).then(n=>{if(e||!r.current)return;let i=n.getViewport({scale:c}),a=r.current,o=a.getContext(`2d`);if(!o)return;let s=Math.min(window.devicePixelRatio||1,2);return a.width=Math.floor(i.width*s),a.height=Math.floor(i.height*s),a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,t=n.render({canvas:a,canvasContext:o,viewport:i,transform:s===1?void 0:[s,0,0,s,0,0]}),t.promise.then(()=>{e||m(!0)})}).catch(t=>{e||d(t instanceof Error?t.message:String(t))}),()=>{e=!0,t?.cancel()}},[i,o,c]),(0,J.jsxs)(`div`,{className:`pdf-canvas-viewer`,children:[(0,J.jsxs)(`div`,{className:`pdf-canvas-toolbar`,children:[(0,J.jsx)(`strong`,{children:t}),(0,J.jsxs)(`span`,{children:[n(`第`,`Page`),` `,o,` / `,i?.numPages??`…`]}),(0,J.jsx)(`button`,{type:`button`,disabled:o<=1,onClick:()=>s(e=>e-1),children:n(`上一页`,`Previous`)}),(0,J.jsx)(`button`,{type:`button`,disabled:!i||o>=i.numPages,onClick:()=>s(e=>e+1),children:n(`下一页`,`Next`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>l(e=>Math.max(.75,e-.15)),children:`−`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>l(e=>Math.min(2,e+.15)),children:`+`})]}),u?(0,J.jsx)(`div`,{className:`inline-error`,children:u}):null,(0,J.jsx)(`div`,{className:`pdf-canvas-scroll`,children:(0,J.jsx)(`canvas`,{ref:r,"data-rendered":f?`true`:`false`})})]})}function on({sid:e,workspaceId:t,entry:n}){let{text:r}=Q(),a=i({queryKey:[`paper-source-file`,e,t,n?.path,n?.mtime],queryFn:({signal:r})=>$.file(e,t,n.path,r),enabled:!!(n&&t),refetchInterval:8e3});return n?a.isError?(0,J.jsx)(X,{icon:I,title:r(`源文件暂时无法读取`,`Source file unavailable`),description:a.error.message}):n.extension===`.md`&&a.data?(0,J.jsx)(`div`,{className:`paper-markdown-preview`,children:(0,J.jsx)(Z,{children:a.data.content})}):(0,J.jsxs)(`div`,{className:`latex-source`,children:[(0,J.jsx)(`div`,{className:`latex-line-numbers`,children:(a.data?.content??``).split(` +`),icon:ve}),o}function Zt(e){let{text:t}=Q(),[n,r]=(0,_.useState)(()=>Jt(e.sid)),[i,a]=(0,_.useState)(()=>Jt(e.sid)[0]?.id??``),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(0),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`current`),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),w=_t(e.sid,e.refresh);(0,_.useEffect)(()=>{let t=Jt(e.sid);r(t),a(t[0]?.id??``),l([]),d(0)},[e.sid]),(0,_.useEffect)(()=>{try{localStorage.setItem(qt(e.sid),JSON.stringify(n)),h(``)}catch{h(`本机草稿存储空间不足;请缩短文本或删除旧草稿。`)}},[n,e.sid]);let T=n.find(e=>e.id===i)??null,D=(0,_.useMemo)(()=>Xt(T?.prompt??``,T?.questions??[]),[T?.prompt,T?.questions]),O=e=>T&&r(t=>t.map(t=>t.id===T.id?{...t,...e,updatedAt:Date.now()}:t)),k=()=>{let e=Yt(t(`新的科研输入`,`New research input`),t(`导师 / 组会 / 灵感`,`Advisor / meeting / idea`));r(t=>[e,...t]),a(e.id)},A=()=>{if(!T||!confirm(t(`删除“${T.title}”?`,`Delete “${T.title}”?`)))return;let e=n.filter(e=>e.id!==T.id);r(e),a(e[0]?.id??``)},j=T?`这是科研收信箱的预处理步骤,只分析输入并回复,不创建后台任务、不修改项目。请读取下面的零散内容和附件,提取知识点并生成第一版可直接交给 Argus 的研究 Prompt。必须保留事实来源和不确定性,不得虚构论文、实验或结论;使用以下 Markdown 结构:\n## 研究目标\n## 已知背景与知识点\n## 约束与非目标\n## 文献与证据线索\n## 建议任务与验收方式\n## 待确认问题\n\n标题:${T.title}\n来源:${T.source}\n\n原始内容:\n${T.raw}`:``,M=async e=>{let t=/\.(txt|md|markdown|json|csv|ya?ml|log|tex)$/i,n=/\.(pdf|png|jpe?g|webp|wav|mp3|m4a|ogg)$/i,r=e.filter(e=>!t.test(e.name)&&!n.test(e.name));if(r.length){p(`不支持的附件:${r.map(e=>e.name).join(`、`)}`);return}let i=e.find(e=>e.size>10485760);if(i){p(`${i.name} 超过单文件 10 MB 限制`);return}if(c.length+u+e.length>Kt){p(`每次分析最多导入 ${Kt} 个文件`);return}let a=e.filter(e=>t.test(e.name)),o=a.find(e=>e.size>1048576);if(o){p(`${o.name} 超过本机文本导入 1 MB 限制;请改为摘要或拆分文件`);return}let s=e.filter(e=>n.test(e.name)),f=[...c,...s];if(f.reduce((e,t)=>e+t.size,0)>26214400){p(`附件总大小超过 25 MB`);return}let m=await Promise.all(a.map(async e=>`\n\n--- 文件:${e.name} ---\n${await e.text()}`)),h=`${T?.raw??``}${m.join(``)}`.trim();if(h.length>Gt){p(`原始输入超过 ${Gt.toLocaleString()} 字符限制,请拆分或摘要`);return}m.length&&(O({raw:h}),d(e=>e+a.length)),l(f),p(``)},N=async()=>{if(!(!T||!T.raw.trim()&&!c.length)){s(!0),p(``);try{if(c.length){let e=await w.run(j,c),t=String(e?.reply||w.output||``).trim();if(!t)throw Error(`Argus 没有返回可用的知识提取结果`);O({prompt:t,changes:[`分析了 ${c.length} 个附件和原始输入`],questions:[]}),l([])}else{let t=await H.rewritePrompt(e.sid,j);if(t.error)throw Error(t.error);O({prompt:t.rewritten,changes:t.changes,questions:t.questions})}}catch(e){p(e instanceof Error?e.message:String(e))}finally{s(!1)}}},te=async()=>{if(T?.prompt.trim()){if(g===`new`){if(!y.trim()||!confirm(t(`确认用当前 Prompt 创建一个新的 Argus 项目?`,`Create a new Argus project with this prompt?`)))return;try{let e=await H.createDaemon(T.prompt,y,x);O({sentAt:Date.now()}),window.location.hash=`project/${e.sid}/overview`}catch(e){p(e instanceof Error?e.message:String(e))}return}confirm(t(`确认把这份第一版 Prompt 发送给当前 Argus 项目?`,`Send this first prompt to the current Argus project?`))&&await w.run(T.prompt)&&O({sentAt:Date.now()})}},P=T?.sentAt?4:T?.prompt?3:T?.raw||c.length?2:1;return(0,J.jsxs)(`div`,{className:`ros-page inbox-v2`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`RESEARCH INBOX`}),(0,J.jsx)(`h1`,{children:t(`从零散输入开始研究`,`Start research from rough input`)}),(0,J.jsx)(`p`,{children:t(`把消息、会议记录、文件或灵感交给 AI,提取知识点并形成第一版 Argus Prompt。`,`Give AI messages, meeting notes, files, or ideas to extract knowledge and create a first Argus prompt.`)})]}),(0,J.jsxs)(Y,{tone:`neutral`,children:[(0,J.jsx)(Ie,{size:12}),t(`本机自动保存`,`Saved locally`)]})]}),(0,J.jsx)(`div`,{className:`intake-steps`,children:[[t(`收集原始内容`,`Collect input`),Te],[t(`AI 提取知识`,`Extract knowledge`),Xe],[t(`形成 Argus Prompt`,`Build Argus prompt`),I],[t(`创建 / 发送项目`,`Create / send project`),ze]].map(([e,t],n)=>(0,J.jsxs)(`div`,{className:P>n?`is-done`:P===n+1?`is-active`:``,children:[(0,J.jsx)(`span`,{children:P>n+1?(0,J.jsx)(E,{size:14}):(0,J.jsx)(t,{size:15})}),(0,J.jsx)(`strong`,{children:String(e)}),n<3?(0,J.jsx)(ee,{size:14}):null]},String(e)))}),(0,J.jsxs)(`div`,{className:`inbox-v2__layout`,children:[(0,J.jsxs)(`aside`,{className:`ros-card inbox-sources`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`INBOX`}),(0,J.jsx)(`h2`,{children:t(`科研输入`,`Research input`)})]}),(0,J.jsx)(`button`,{className:`icon-button`,type:`button`,onClick:k,"aria-label":t(`新增输入`,`Add input`),children:(0,J.jsx)(je,{size:15})})]}),(0,J.jsx)(`div`,{children:n.length?n.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:T?.id===e.id?`is-active`:``,onClick:()=>a(e.id),children:[(0,J.jsx)(`span`,{className:`inbox-item-icon`,children:e.sentAt?(0,J.jsx)(E,{size:14}):e.prompt?(0,J.jsx)(z,{size:14}):(0,J.jsx)(_e,{size:14})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.title}),(0,J.jsxs)(`small`,{children:[e.source,` · `,ct(e.updatedAt/1e3)]})]})]},e.id)):(0,J.jsx)(X,{icon:_e,title:t(`暂无输入`,`No input yet`),description:t(`新增一条导师消息、组会笔记或研究灵感。`,`Add an advisor message, meeting note, or research idea.`)})})]}),(0,J.jsxs)(`main`,{className:`ros-card inbox-input`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`RAW MATERIAL`}),(0,J.jsx)(`h2`,{children:t(`原始内容与附件`,`Raw content and attachments`)})]}),T?(0,J.jsx)(`button`,{className:`icon-button`,type:`button`,onClick:A,"aria-label":t(`删除`,`Delete`),children:(0,J.jsx)(Ke,{size:14})}):null]}),T?(0,J.jsxs)(`div`,{className:`inbox-input__form`,children:[(0,J.jsxs)(`div`,{className:`form-grid`,children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:t(`标题`,`Title`)}),(0,J.jsx)(`input`,{value:T.title,onChange:e=>O({title:e.target.value})})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:t(`来源`,`Source`)}),(0,J.jsx)(`input`,{value:T.source,onChange:e=>O({source:e.target.value})})]})]}),(0,J.jsxs)(`label`,{className:`field field--grow`,children:[(0,J.jsx)(`span`,{children:t(`零散消息、笔记或转写文本`,`Rough messages, notes, or transcripts`)}),(0,J.jsx)(`textarea`,{maxLength:Gt,value:T.raw,onChange:e=>O({raw:e.target.value}),placeholder:t(`不需要先整理,直接粘贴原始内容。AI 会区分目标、事实、约束、文献线索、待办和疑问…`,`Paste raw content directly. AI will separate goals, facts, constraints, evidence leads, tasks, and questions…`)})]}),c.length?(0,J.jsx)(`div`,{className:`inbox-attachment-list`,children:c.map((e,t)=>(0,J.jsxs)(`span`,{children:[e.type.startsWith(`audio/`)?(0,J.jsx)(C,{size:14}):e.type.startsWith(`image/`)?(0,J.jsx)(ge,{size:14}):(0,J.jsx)(I,{size:14}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsxs)(`small`,{children:[(e.size/1024/1024).toFixed(1),` MB · 仅在本次分析上传`]})]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>l(e=>e.filter((e,n)=>n!==t)),children:(0,J.jsx)(et,{size:13})})]},`${e.name}-${t}`))}):null,(0,J.jsxs)(`div`,{className:`inbox-upload-types`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(I,{size:14}),`PDF / `,t(`文本`,`text`)]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(ge,{size:14}),t(`图片`,`images`)]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(C,{size:14}),t(`语音`,`audio`)]}),(0,J.jsx)(`p`,{children:t(`语音会交给 Argus 和已配置工具处理,不把“上传成功”冒充“已完成转写”。`,`Audio is handed to Argus and configured tools; an upload is never presented as a completed transcript.`)})]}),(0,J.jsxs)(`div`,{className:`inbox-input__actions`,children:[(0,J.jsxs)(`label`,{className:`button button--secondary file-button`,children:[(0,J.jsx)(Je,{size:14}),t(`添加文件`,`Add files`),(0,J.jsx)(`input`,{type:`file`,multiple:!0,accept:`.txt,.md,.markdown,.json,.csv,.yaml,.yml,.log,.tex,.pdf,.png,.jpg,.jpeg,.webp,.wav,.mp3,.m4a,.ogg`,onChange:e=>void M(Array.from(e.target.files??[]))})]}),(0,J.jsxs)(`button`,{className:`button button--primary`,type:`button`,disabled:!T.raw.trim()&&!c.length||o||w.busy,onClick:()=>void N(),children:[o||w.busy?(0,J.jsx)(z,{size:14}):(0,J.jsx)(Xe,{size:14}),o||w.busy?w.phase||t(`AI 正在分析`,`AI is analyzing`):t(`分析内容并生成 Prompt`,`Analyze and generate prompt`)]})]}),f?(0,J.jsx)(`div`,{className:`inline-error`,children:f}):null,m?(0,J.jsx)(`div`,{className:`inline-error`,children:m}):null]}):(0,J.jsx)(X,{icon:_e,title:t(`选择或新增一条科研输入`,`Select or add research input`)})]}),(0,J.jsxs)(`aside`,{className:`inbox-output`,children:[(0,J.jsxs)(`section`,{className:`ros-card knowledge-panel`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`KNOWLEDGE EXTRACTION`}),(0,J.jsx)(`h2`,{children:t(`AI 提取的知识点`,`AI-extracted knowledge`)})]}),D.length?(0,J.jsxs)(Y,{tone:`success`,children:[D.length,` `,t(`组`,`groups`)]}):null]}),D.length?(0,J.jsx)(`div`,{className:`knowledge-grid`,children:D.map(e=>{let t=e.icon;return(0,J.jsxs)(`article`,{children:[(0,J.jsx)(`span`,{children:(0,J.jsx)(t,{size:15})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.title}),(0,J.jsx)(Z,{children:e.body})]})]},e.title)})}):(0,J.jsx)(X,{icon:ve,title:t(`等待 AI 提取`,`Waiting for AI extraction`),description:t(`结果会明确区分目标、知识点、约束、证据线索和待确认问题。`,`The result separates goals, knowledge, constraints, evidence leads, and open questions.`)})]}),(0,J.jsxs)(`section`,{className:`ros-card first-prompt`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`FIRST ARGUS PROMPT`}),(0,J.jsx)(`h2`,{children:t(`第一版 Argus Prompt`,`First Argus prompt`)})]}),T?.prompt?(0,J.jsx)(Y,{tone:`info`,children:t(`可编辑`,`Editable`)}):null]}),T?.prompt?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`textarea`,{value:T.prompt,onChange:e=>O({prompt:e.target.value})}),(0,J.jsxs)(`div`,{className:`dispatch-mode`,children:[(0,J.jsx)(`button`,{type:`button`,className:g===`current`?`is-active`:``,onClick:()=>v(`current`),children:t(`发送当前项目`,`Send to current project`)}),(0,J.jsx)(`button`,{type:`button`,className:g===`new`?`is-active`:``,onClick:()=>v(`new`),children:t(`创建新项目`,`Create new project`)})]}),g===`new`?(0,J.jsxs)(`div`,{className:`new-project-fields`,children:[(0,J.jsx)(`input`,{value:y,onChange:e=>b(e.target.value),placeholder:t(`新项目名称`,`New project name`)}),(0,J.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),placeholder:t(`工作目录(可选,留空自动创建)`,`Workdir (optional; blank creates one)`)})]}):null,(0,J.jsxs)(`button`,{className:`button button--primary button--full`,type:`button`,disabled:w.busy,onClick:()=>void te(),children:[(0,J.jsx)(ze,{size:14}),w.busy?w.phase||t(`正在发送`,`Sending`):g===`new`?t(`用此 Prompt 创建 Argus 项目`,`Create Argus project with this prompt`):t(`确认并发送给当前 Argus`,`Confirm and send to current Argus`)]}),w.output?(0,J.jsx)(`div`,{className:`manager-mini-result`,children:(0,J.jsx)(Z,{children:w.output})}):null]}):(0,J.jsx)(X,{icon:I,title:t(`尚未生成 Prompt`,`No prompt generated`),description:t(`AI 提取后会在这里生成第一版 Prompt,你可以先修改再发送。`,`The first prompt appears here after extraction and can be edited before sending.`)})]})]})]})]})}function Qt({paper:e,selected:t,onClick:n}){let{text:r}=Q();return(0,J.jsxs)(`button`,{type:`button`,className:`paper-card ${t?`is-selected`:``}`,onClick:n,children:[(0,J.jsxs)(`div`,{className:`paper-card__meta`,children:[(0,J.jsx)(Y,{tone:e.evidenceStatus===`verified_artifact`?`success`:e.evidenceStatus===`metadata`?`info`:`warn`,children:e.evidenceStatus===`verified_artifact`?r(`原文文件已验证`,`Source verified`):e.evidenceStatus===`metadata`?r(`仅元数据`,`Metadata only`):r(`待核验`,`Needs verification`)}),(0,J.jsxs)(`span`,{className:`paper-card__year`,children:[e.year||`—`,e.venue?` · ${e.venue}`:``]})]}),(0,J.jsx)(`h3`,{children:e.title}),e.authors.length?(0,J.jsxs)(`p`,{className:`paper-card__authors`,children:[e.authors.slice(0,4).join(`, `),e.authors.length>4?` et al.`:``]}):null,(0,J.jsx)(`p`,{className:`paper-card__summary`,children:e.relevance||e.abstract||r(`该记录尚未写入项目相关性摘要。`,`No project-relevance summary has been recorded.`)}),(0,J.jsxs)(`div`,{className:`paper-card__footer`,children:[(0,J.jsx)(`code`,{children:e.sourcePath}),(0,J.jsx)(`span`,{children:r(`查看详情`,`View details`)})]})]})}function $t(e){let{text:t}=Q(),n=Vt(e.sid,`literature`),r=n.active?.path||``,a=i({queryKey:[`workspace-literature`,e.sid,n.workspaceId],queryFn:({signal:t})=>$.literature(e.sid,n.workspaceId,t),enabled:!!n.workspaceId,refetchInterval:15e3}),[o,s]=(0,_.useState)(`all`),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),m=_t(e.sid,async()=>{await e.refresh(),await a.refetch()}),h=a.data?.papers??[],g=Math.max(0,...h.map(e=>e.year??0)),v=(0,_.useMemo)(()=>h.filter(e=>{if(o===`recent`&&(e.year??0)e.id===u)??v[0]??null,b=(0,_.useMemo)(()=>e.events.filter(e=>/paper|arxiv|doi|literature|search|citation|http/i.test(`${e.type} ${e.kind} ${q(e,2e3)}`)).slice(-30).reverse(),[e.events]),x=async()=>{f.trim()&&await m.run(`请为当前项目执行新的文献调研:${f}\n\n要求读取原始论文或官方仓库,把结构化记录追加到项目的 literature grounding/audit 文件中,包括标题、作者、年份、URL、与当前项目关系、最近工作威胁和仍待全文核验项。完成后文献中心应能从工作目录直接读取这些记录。`)};return(0,J.jsxs)(`div`,{className:`ros-page literature-v2`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`LITERATURE CENTER`}),(0,J.jsx)(`h1`,{children:t(`文献中心`,`Literature center`)}),(0,J.jsx)(`p`,{children:t(`直接读取 Argus 工作目录中的论文清单、文献审计和实时检索轨迹,不再依赖手工注册 artifacts。`,`Read paper inventories, literature audits, and live retrieval traces directly from the Argus workdir.`)})]}),(0,J.jsxs)(`div`,{className:`header-badges`,children:[(0,J.jsxs)(Y,{tone:`success`,children:[(0,J.jsx)(w,{size:12}),h.length,` `,t(`篇论文`,`papers`)]}),(0,J.jsxs)(Y,{tone:`neutral`,children:[a.data?.sourceFiles.length??0,` `,t(`个证据文件`,`evidence files`)]})]})]}),(0,J.jsxs)(`section`,{className:`literature-stats`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--blue`,children:(0,J.jsx)(w,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`论文记录`,`Paper records`),(0,J.jsx)(`strong`,{children:h.length})]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--green`,children:(0,J.jsx)(ie,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`原文文件已验证`,`Verified sources`),(0,J.jsx)(`strong`,{children:h.filter(e=>e.evidenceStatus===`verified_artifact`).length})]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--amber`,children:(0,J.jsx)(T,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`最近工作`,`Recent work`),(0,J.jsx)(`strong`,{children:h.filter(e=>(e.year??0)>=g-1).length})]})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`stat-icon stat-icon--violet`,children:(0,J.jsx)(ue,{size:18})}),(0,J.jsxs)(`p`,{children:[t(`扫描项目文件`,`Scanned files`),(0,J.jsx)(`strong`,{children:a.data?.scannedFiles??0})]})]})]}),(0,J.jsxs)(`div`,{className:`literature-v2__layout`,children:[(0,J.jsxs)(`aside`,{className:`literature-v2__sidebar ros-card`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`LIBRARY`}),(0,J.jsx)(`h2`,{children:t(`项目文献库`,`Project library`)})]})}),(0,J.jsxs)(`label`,{className:`search-field search-field--block`,children:[(0,J.jsx)(Re,{size:14}),(0,J.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`搜索标题、作者、主题`,`Search title, author, or topic`)})]}),(0,J.jsx)(`nav`,{className:`library-tabs`,children:[[`all`,t(`全部论文`,`All papers`),h.length],[`recent`,t(`最近工作`,`Recent work`),h.filter(e=>(e.year??0)>=g-1).length],[`read`,t(`已验证原文`,`Verified sources`),h.filter(e=>e.evidenceStatus===`verified_artifact`).length],[`sources`,t(`证据文件`,`Evidence files`),a.data?.sourceFiles.length??0]].map(([e,t,n])=>(0,J.jsxs)(`button`,{type:`button`,className:o===e?`is-active`:``,onClick:()=>s(e),children:[(0,J.jsx)(`span`,{children:t}),(0,J.jsx)(`small`,{children:n})]},e))}),(0,J.jsxs)(`div`,{className:`literature-source-note`,children:[(0,J.jsx)(re,{size:15}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:t(`实时来源`,`Live source`)}),(0,J.jsx)(`p`,{title:r,children:r})]})]})]}),(0,J.jsxs)(`main`,{className:`literature-v2__main`,children:[(0,J.jsxs)(`div`,{className:`literature-list-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:o===`recent`?t(`最近工作`,`Recent work`):o===`read`?t(`已验证原文文件`,`Verified source files`):o===`sources`?t(`文献证据文件`,`Literature evidence files`):t(`全部论文`,`All papers`)}),(0,J.jsx)(`p`,{children:o===`recent`?t(`按项目中最新年份 ${g||`—`} 自动筛选`,`Filtered by the latest project year: ${g||`—`}`):t(`Argus 写入工作目录后约 5 秒内自动更新`,`Updates shortly after Argus writes to the workdir`)})]}),a.isError?(0,J.jsx)(Y,{tone:`danger`,children:t(`同步失败`,`Sync failed`)}):a.isFetching?(0,J.jsx)(Y,{tone:`live`,dot:!0,children:t(`同步中`,`Syncing`)}):(0,J.jsx)(Y,{tone:`success`,children:t(`已同步`,`Synced`)})]}),a.isError?(0,J.jsx)(`div`,{className:`inline-error`,children:a.error.message}):null,o===`sources`?(0,J.jsx)(`div`,{className:`source-file-grid`,children:a.data?.sourceFiles.map(e=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(re,{size:17}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]}),(0,J.jsx)(`time`,{children:ct(e.mtime)})]},e.path))}):v.length?(0,J.jsx)(`div`,{className:`paper-grid`,children:v.map(e=>(0,J.jsx)(Qt,{paper:e,selected:y?.id===e.id,onClick:()=>d(e.id)},e.id))}):(0,J.jsx)(X,{icon:w,title:t(`此筛选下暂无论文`,`No papers match this filter`),description:t(`Argus 完成检索并写入 LITERATURE_GROUNDING.json 后会自动出现。`,`Papers appear after Argus writes LITERATURE_GROUNDING.json.`)})]}),(0,J.jsxs)(`aside`,{className:`literature-v2__detail`,children:[(0,J.jsx)(`section`,{className:`ros-card paper-detail`,children:y?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`paper-detail__top`,children:[(0,J.jsx)(Y,{tone:y.evidenceStatus===`verified_artifact`?`success`:y.evidenceStatus===`metadata`?`info`:`warn`,children:y.evidenceStatus===`verified_artifact`?`verified artifact`:y.evidenceStatus}),(0,J.jsxs)(`span`,{children:[y.year||`—`,y.venue?` · ${y.venue}`:``]})]}),(0,J.jsx)(`h2`,{children:y.title}),y.authors.length?(0,J.jsx)(`p`,{className:`paper-detail__authors`,children:y.authors.join(`, `)}):null,(0,J.jsxs)(`div`,{className:`paper-detail__body`,children:[(0,J.jsx)(`h3`,{children:t(`与当前项目的关系`,`Relationship to this project`)}),(0,J.jsx)(Z,{children:y.relevance||y.abstract||t(`尚未写入摘要。`,`No summary recorded.`)}),y.abstract&&y.relevance?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`h3`,{children:t(`摘要`,`Abstract`)}),(0,J.jsx)(`p`,{children:y.abstract})]}):null]}),(0,J.jsxs)(`div`,{className:`paper-detail__source`,children:[(0,J.jsx)(`span`,{children:t(`证据文件`,`Evidence file`)}),(0,J.jsx)(`code`,{children:y.sourcePath})]}),y.url?(0,J.jsxs)(`a`,{className:`button button--secondary button--full`,href:y.url,target:`_blank`,rel:`noreferrer`,children:[t(`打开原始来源`,`Open source`),` `,(0,J.jsx)(N,{size:14})]}):null]}):(0,J.jsx)(X,{icon:w,title:t(`选择一篇论文`,`Select a paper`)})}),(0,J.jsxs)(`section`,{className:`ros-card retrieval-panel`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`ARGUS RETRIEVAL`}),(0,J.jsx)(`h2`,{children:t(`最近检索`,`Recent retrieval`)})]}),(0,J.jsx)(Y,{tone:e.connected?`live`:`warn`,dot:!0,children:e.connected?`Live`:`Polling`})]}),(0,J.jsxs)(`div`,{children:[(a.data?.searchFiles??[]).slice(0,8).map(e=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(ie,{size:13}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]}),(0,J.jsx)(`time`,{children:W(e.mtime)})]},e.path)),!a.data?.searchFiles.length&&b.slice(0,8).map((e,t)=>(0,J.jsxs)(`article`,{children:[(0,J.jsx)(ie,{size:13}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:K(e)}),(0,J.jsx)(`code`,{children:q(e,100)})]}),(0,J.jsx)(`time`,{children:W(e.ts)})]},`${e.ts}-${t}`))]})]}),(0,J.jsxs)(`section`,{className:`ros-card literature-ask`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`NEW SEARCH`}),(0,J.jsx)(`h2`,{children:t(`让 Argus 调研新工作`,`Ask Argus to research new work`)})]})}),(0,J.jsx)(`textarea`,{rows:3,value:f,onChange:e=>p(e.target.value),placeholder:t(`例如:检索 2025–2026 年与当前方法最接近的直接竞争工作…`,`Example: find the closest competing work from 2025–2026…`)}),(0,J.jsxs)(`button`,{className:`button button--primary button--full`,type:`button`,disabled:!f.trim()||m.busy,onClick:()=>void x(),children:[(0,J.jsx)(z,{size:14}),m.busy?m.phase||t(`检索中`,`Researching`):t(`发起文献调研`,`Start literature research`)]}),m.output?(0,J.jsx)(`div`,{className:`manager-mini-result`,children:(0,J.jsx)(Z,{children:m.output})}):null]})]})]})]})}var en=`/assets/pdf.worker.min-CHFwMXne.mjs`;function tn(e){return[`.png`,`.jpg`,`.jpeg`,`.webp`,`.svg`].includes(e.extension)}function nn(e){return[`.csv`,`.tsv`].includes(e.extension)}function rn(e){return[`.tex`,`.md`].includes(e.extension)}function an({src:e,name:t}){let{text:n}=Q(),r=(0,_.useRef)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(1),[c,l]=(0,_.useState)(1.25),[u,d]=(0,_.useState)(``),[f,m]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let t=!0,n=null;a(null),s(1),d(``),m(!1);let r=localStorage.getItem(`argus_web_token`);return Promise.all([fetch(e,{headers:r?{Authorization:`Bearer ${r}`}:{}}).then(e=>{if(!e.ok)throw Error(`PDF request failed (${e.status})`);return e.arrayBuffer()}),p(()=>import(`./pdf-Dvbq7GvP.js`),__vite__mapDeps([0,1,2,3,4,5,6]))]).then(([e,r])=>{if(t)return r.GlobalWorkerOptions.workerSrc=en,n=r.getDocument({data:e}),n.promise}).then(e=>{t&&e&&a(e)}).catch(e=>{t&&d(e instanceof Error?e.message:String(e))}),()=>{t=!1,n?.destroy()}},[e]),(0,_.useEffect)(()=>{if(!i||!r.current)return;m(!1);let e=!1,t=null;return i.getPage(o).then(n=>{if(e||!r.current)return;let i=n.getViewport({scale:c}),a=r.current,o=a.getContext(`2d`);if(!o)return;let s=Math.min(window.devicePixelRatio||1,2);return a.width=Math.floor(i.width*s),a.height=Math.floor(i.height*s),a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,t=n.render({canvas:a,canvasContext:o,viewport:i,transform:s===1?void 0:[s,0,0,s,0,0]}),t.promise.then(()=>{e||m(!0)})}).catch(t=>{e||d(t instanceof Error?t.message:String(t))}),()=>{e=!0,t?.cancel()}},[i,o,c]),(0,J.jsxs)(`div`,{className:`pdf-canvas-viewer`,children:[(0,J.jsxs)(`div`,{className:`pdf-canvas-toolbar`,children:[(0,J.jsx)(`strong`,{children:t}),(0,J.jsxs)(`span`,{children:[n(`第`,`Page`),` `,o,` / `,i?.numPages??`…`]}),(0,J.jsx)(`button`,{type:`button`,disabled:o<=1,onClick:()=>s(e=>e-1),children:n(`上一页`,`Previous`)}),(0,J.jsx)(`button`,{type:`button`,disabled:!i||o>=i.numPages,onClick:()=>s(e=>e+1),children:n(`下一页`,`Next`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>l(e=>Math.max(.75,e-.15)),children:`−`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>l(e=>Math.min(2,e+.15)),children:`+`})]}),u?(0,J.jsx)(`div`,{className:`inline-error`,children:u}):null,(0,J.jsx)(`div`,{className:`pdf-canvas-scroll`,children:(0,J.jsx)(`canvas`,{ref:r,"data-rendered":f?`true`:`false`})})]})}function on({sid:e,workspaceId:t,entry:n}){let{text:r}=Q(),a=i({queryKey:[`paper-source-file`,e,t,n?.path,n?.mtime],queryFn:({signal:r})=>$.file(e,t,n.path,r),enabled:!!(n&&t),refetchInterval:8e3});return n?a.isError?(0,J.jsx)(X,{icon:I,title:r(`源文件暂时无法读取`,`Source file unavailable`),description:a.error.message}):n.extension===`.md`&&a.data?(0,J.jsx)(`div`,{className:`paper-markdown-preview`,children:(0,J.jsx)(Z,{children:a.data.content})}):(0,J.jsxs)(`div`,{className:`latex-source`,children:[(0,J.jsx)(`div`,{className:`latex-line-numbers`,children:(a.data?.content??``).split(` `).map((e,t)=>(0,J.jsx)(`span`,{children:t+1},t))}),(0,J.jsx)(`pre`,{children:a.data?.content||`Loading…`})]}):(0,J.jsx)(X,{icon:I,title:r(`等待 Argus 写入论文源文件`,`Waiting for Argus to write a paper source`),description:r(`paper/ 或 technical_report/ 中出现 .tex / .md 后会自动加入。`,`.tex and .md files under paper/ or technical_report/ appear automatically.`)})}function sn({sid:e,workspaceId:t,entry:n}){let r=Bt(e,t,n.path);return(0,J.jsxs)(`figure`,{children:[r.url?(0,J.jsx)(`img`,{src:r.url,alt:n.name}):(0,J.jsx)(`div`,{className:`figure-loading`,children:r.error||`Loading…`}),(0,J.jsx)(`figcaption`,{children:n.name})]})}function cn(e){let{text:t}=Q(),n=Vt(e.sid,`paper`),r=n.workspaceId,a=n.active?.path||``,o=i({queryKey:[`paper-workspace-tree`,e.sid,r],queryFn:({signal:t})=>$.tree(e.sid,r,t),enabled:!!r,refetchInterval:1e4}),s=(0,_.useMemo)(()=>Rt(o.data?.entries??[]),[o.data?.entries]),c=s.filter(rn),l=s.filter(e=>e.extension===`.bib`),u=s.filter(e=>e.extension===`.pdf`),d=s.filter(e=>tn(e)||nn(e)),[f,p]=(0,_.useState)(``),m=[...c,...l].find(e=>e.path===f)??c[0]??l[0]??null,[h,g]=(0,_.useState)(`pdf`),[v,y]=(0,_.useState)(``),b=u.find(e=>/(?:^|\/)(?:argus-technical-report|main|paper|manuscript)\.pdf$/i.test(e.path))??u[0],x=u.find(e=>e.path===v)??b??null;return(0,J.jsxs)(`div`,{className:`ros-page paper-v3`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`PAPER WORKSPACE`}),(0,J.jsx)(`h1`,{children:t(`LaTeX 论文工作区`,`LaTeX paper workspace`)}),(0,J.jsx)(`p`,{children:t(`论文源文件、编译 PDF、图表和 BibTeX 与真实项目目录保持同步。`,`Keep paper sources, compiled PDFs, figures, and BibTeX synchronized with the real project directory.`)})]}),(0,J.jsxs)(`div`,{className:`header-badges`,children:[(0,J.jsxs)(Y,{tone:o.isError?`danger`:o.isFetching?`live`:`success`,dot:!0,children:[(0,J.jsx)(Ze,{size:12}),o.isError?t(`同步失败`,`Sync failed`):o.isFetching?t(`同步中`,`Syncing`):t(`自动同步`,`Auto sync`)]}),(0,J.jsxs)(Y,{tone:u.length?`success`:`neutral`,children:[u.length,` PDF`]}),(0,J.jsxs)(Y,{tone:`neutral`,children:[d.length,` `,t(`图表`,`figures`)]})]})]}),(0,J.jsxs)(`div`,{className:`paper-root-bar ros-card`,children:[(0,J.jsx)(le,{size:16}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`APPROVED PAPER WORKSPACE`}),(0,J.jsx)(`select`,{"aria-label":t(`选择论文工作区`,`Select paper workspace`),value:r,onChange:e=>{n.setWorkspaceId(e.target.value),p(``),y(``)},children:n.profiles.data?.profiles.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,J.jsx)(`code`,{children:a})]}),o.isError?(0,J.jsx)(Y,{tone:`danger`,children:`Error`}):o.isFetching?(0,J.jsx)(Y,{tone:`live`,dot:!0,children:`Scanning`}):(0,J.jsx)(Y,{tone:`success`,children:`Synced`}),(0,J.jsx)(`button`,{className:`icon-button`,type:`button`,onClick:()=>void o.refetch(),"aria-label":t(`刷新论文工作区`,`Refresh paper workspace`),children:(0,J.jsx)(Pe,{size:14})})]}),(0,J.jsxs)(`div`,{className:`paper-v3__shell`,children:[(0,J.jsxs)(`aside`,{className:`paper-v3__sources ros-card`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`LATEX PROJECT`}),(0,J.jsx)(`h2`,{children:t(`论文文件`,`Paper files`)})]}),(0,J.jsx)(Y,{tone:`neutral`,children:c.length+l.length})]}),(0,J.jsxs)(`div`,{className:`paper-source-group`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(I,{size:13}),`MANUSCRIPT`]}),c.length?c.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:m?.path===e.path?`is-active`:``,onClick:()=>p(e.path),children:[(0,J.jsx)(I,{size:14}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]}),(0,J.jsx)(`small`,{children:lt(e.size)})]},e.path)):(0,J.jsx)(`p`,{children:`等待 .tex / .md`})]}),(0,J.jsxs)(`div`,{className:`paper-source-group`,children:[(0,J.jsxs)(`h3`,{children:[(0,J.jsx)(w,{size:13}),`BIBTEX`]}),l.length?l.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>p(e.path),children:[(0,J.jsx)(w,{size:14}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]})]},e.path)):(0,J.jsx)(`p`,{children:t(`等待 references.bib`,`Waiting for references.bib`)})]}),(0,J.jsxs)(`footer`,{children:[(0,J.jsx)(`span`,{children:t(`监听`,`Watching`)}),(0,J.jsx)(`code`,{children:a})]})]}),(0,J.jsxs)(`main`,{className:`paper-v3__source ros-card`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:m?.name||t(`源文件编辑器`,`Source editor`)}),(0,J.jsx)(`code`,{children:m?.path||a})]}),m?(0,J.jsxs)(`span`,{children:[t(`更新于`,`Updated`),` `,ct(m.mtime)]}):null]}),(0,J.jsx)(`div`,{children:(0,J.jsx)(on,{sid:e.sid,workspaceId:r,entry:m})}),(0,J.jsxs)(`footer`,{children:[(0,J.jsx)(`span`,{children:m?.extension.replace(`.`,``).toUpperCase()||`WAITING`}),(0,J.jsx)(`span`,{children:m?lt(m.size):t(`Argus 写入后自动出现`,`Appears after Argus writes it`)})]})]}),(0,J.jsxs)(`aside`,{className:`paper-v3__outputs ros-card`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`BUILD OUTPUT`}),(0,J.jsx)(`h2`,{children:t(`可视化产出`,`Visual outputs`)})]}),o.isError?(0,J.jsx)(Y,{tone:`danger`,children:`Error`}):o.isFetching?(0,J.jsx)(Y,{tone:`live`,dot:!0,children:`Scanning`}):(0,J.jsx)(Y,{tone:`success`,children:`Synced`})]}),(0,J.jsxs)(`nav`,{children:[(0,J.jsxs)(`button`,{type:`button`,className:h===`pdf`?`is-active`:``,onClick:()=>g(`pdf`),children:[(0,J.jsx)(I,{size:14}),`PDF `,(0,J.jsx)(`small`,{children:u.length})]}),(0,J.jsxs)(`button`,{type:`button`,className:h===`figures`?`is-active`:``,onClick:()=>g(`figures`),children:[(0,J.jsx)(ne,{size:14}),t(`图表`,`Figures`),` `,(0,J.jsx)(`small`,{children:d.length})]}),(0,J.jsxs)(`button`,{type:`button`,className:h===`references`?`is-active`:``,onClick:()=>g(`references`),children:[(0,J.jsx)(w,{size:14}),t(`引用`,`References`),` `,(0,J.jsx)(`small`,{children:l.length})]})]}),(0,J.jsxs)(`div`,{className:`paper-output-surface`,children:[h===`pdf`?x?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`pdf-switcher`,children:u.map(e=>(0,J.jsx)(`button`,{type:`button`,className:x.path===e.path?`is-active`:``,onClick:()=>y(e.path),children:e.name},e.path))}),(0,J.jsx)(an,{src:$.rawUrl(e.sid,r,x.path),name:x.name})]}):(0,J.jsx)(X,{icon:I,title:t(`尚无编译 PDF`,`No compiled PDF`),description:t(`Argus 或 LaTeX 流程生成 PDF 后会直接在这里可视化。`,`PDFs generated by Argus or the LaTeX pipeline appear here.`)}):null,h===`figures`?d.length?(0,J.jsx)(`div`,{className:`paper-figure-grid`,children:d.map(t=>tn(t)?(0,J.jsx)(sn,{sid:e.sid,workspaceId:r,entry:t},t.path):(0,J.jsxs)(`article`,{children:[(0,J.jsx)(Ue,{size:22}),(0,J.jsx)(`strong`,{children:t.name}),(0,J.jsx)(`code`,{children:t.path})]},t.path))}):(0,J.jsx)(X,{icon:ne,title:t(`尚无图表产出`,`No figure outputs`)}):null,h===`references`?l.length?(0,J.jsx)(`div`,{className:`paper-reference-list`,children:l.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{p(e.path)},children:[(0,J.jsx)(w,{size:15}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`code`,{children:e.path})]})]},e.path))}):(0,J.jsx)(X,{icon:w,title:t(`尚无 BibTeX`,`No BibTeX`)}):null]}),(0,J.jsxs)(`footer`,{children:[(0,J.jsx)(`span`,{children:u.length?`PDF build detected`:`Waiting for LaTeX build`}),(0,J.jsxs)(`span`,{children:[s.length,` tracked assets`]})]})]})]})]})}var ln=[{id:`experiments`,zh:`实验进程`,en:`Experiments`,zhDesc:`实时查看 Argus 运行位置、DAG、角色交接和停止原因。`,enDesc:`Track Argus execution, DAG progress, role handoffs, and stop reasons.`,icon:se,color:`blue`},{id:`copilot`,zh:`Research Copilot`,en:`Research Copilot`,zhDesc:`保留原版 Argus 对话、Prompt 优化和工具轨迹。`,enDesc:`Chat with Argus, refine prompts, and inspect tool activity.`,icon:Ee,color:`violet`},{id:`literature`,zh:`文献中心`,en:`Literature`,zhDesc:`汇总已读论文、最近工作、检索记录和文献证据。`,enDesc:`Review papers, related work, retrieval history, and evidence.`,icon:w,color:`indigo`},{id:`inbox`,zh:`科研收信箱`,en:`Research Inbox`,zhDesc:`从零散输入抽取知识点并形成第一版 Argus Prompt。`,enDesc:`Turn rough notes into structured knowledge and an Argus prompt.`,icon:_e,color:`rose`},{id:`ide`,zh:`AI IDE`,en:`AI IDE`,zhDesc:`连接真实服务器目录,查看代码、Git 和 Argus 活动。`,enDesc:`Browse server files, Git state, and Argus activity.`,icon:j,color:`emerald`},{id:`paper`,zh:`论文工作区`,en:`Paper Workspace`,zhDesc:`自动发现 Argus 新写入的文稿、BibTeX、图表和 PDF。`,enDesc:`Discover manuscripts, BibTeX, figures, and PDFs from the workspace.`,icon:I,color:`amber`},{id:`reviewer`,zh:`模拟审稿`,en:`Reviewer`,zhDesc:`区分每轮过程审稿与项目完成后的最终投稿前审稿。`,enDesc:`Separate round-level review from final pre-submission review.`,icon:R,color:`slate`},{id:`release`,zh:`成果发布`,en:`Release`,zhDesc:`规划 GitHub 仓库、学术海报和项目宣传页。`,enDesc:`Plan a GitHub repository, academic poster, and project page.`,icon:we,color:`rose`}];function un(e){let{text:t}=Q(),n=e.snapshot.mission_view,r=n?.active_role||e.status?.active_role||`idle`;return(0,J.jsxs)(`div`,{className:`overview-page`,children:[(0,J.jsxs)(`section`,{className:`overview-hero`,children:[(0,J.jsxs)(`div`,{className:`overview-hero__copy`,children:[(0,J.jsxs)(`div`,{className:`overview-hero__badges`,children:[(0,J.jsx)(Y,{tone:e.snapshot.daemon.alive?`live`:`neutral`,dot:!0,children:e.snapshot.daemon.alive?t(`Argus 正在运行`,`Argus running`):t(`Argus 已停止`,`Argus stopped`)}),(0,J.jsx)(Y,{tone:G(n?.stage.id),children:n?.stage.label||t(`未分阶段`,`Unstaged`)})]}),(0,J.jsx)(`h1`,{children:e.snapshot.session.display_name||e.project.label}),(0,J.jsx)(`p`,{children:n?.mission.objective||e.status?.continuous?.objective||e.project.objective||t(`尚未设置研究目标。`,`No research objective has been set.`)}),(0,J.jsx)(`code`,{children:e.snapshot.session.workdir||e.snapshot.session.launch_cwd})]}),(0,J.jsxs)(`div`,{className:`overview-hero__stats`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:t(`当前角色`,`Active role`)}),(0,J.jsx)(`strong`,{children:r}),(0,J.jsx)(`small`,{children:e.snapshot.roles.find(e=>e.active)?.label||`waiting`})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:t(`研究阶段`,`Research stage`)}),(0,J.jsx)(`strong`,{children:n?.stage.label||`—`}),(0,J.jsx)(`small`,{children:n?.mission.status||`idle`})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:t(`累计运行`,`Elapsed`)}),(0,J.jsx)(`strong`,{children:st(n?.mission.campaign_elapsed_seconds||e.snapshot.daemon.uptime_seconds)}),(0,J.jsx)(`small`,{children:n?.round.current?`Round ${n.round.current}/${n.round.max||`—`}`:t(`暂无轮次`,`No round`)})]})]})]}),(0,J.jsx)(`div`,{className:`overview-section-heading`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:t(`项目工作区`,`Project workspace`)}),(0,J.jsx)(`p`,{children:t(`所有模块共享同一个 Argus 项目、工作目录和实时事件流。`,`All modules share the same Argus project, workdir, and live event stream.`)})]})}),(0,J.jsx)(`section`,{className:`module-grid`,children:ln.map(n=>{let r=n.icon;return(0,J.jsxs)(`button`,{className:`module-card`,type:`button`,onClick:()=>e.navigate(n.id),children:[(0,J.jsx)(`span`,{className:`module-card__icon module-card__icon--${n.color}`,children:(0,J.jsx)(r,{size:20})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{children:t(n.zh,n.en)}),(0,J.jsx)(`p`,{children:t(n.zhDesc,n.enDesc)})]}),(0,J.jsx)(x,{size:16})]},n.id)})}),(0,J.jsxs)(`section`,{className:`overview-lower`,children:[(0,J.jsx)(ft,{eyebrow:`CURRENT MISSION`,title:t(`当前任务`,`Current mission`),children:(0,J.jsxs)(`div`,{className:`overview-mission`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(Ge,{size:18}),(0,J.jsx)(`span`,{children:n?.mission.status||`idle`})]}),(0,J.jsx)(`h3`,{children:n?.mission.title||e.project.current_task||t(`等待新任务`,`Waiting for a new task`)}),(0,J.jsx)(`p`,{children:n?.mission.summary||n?.frontier.summary||n?.review.reason||t(`Argus 的下一步和 Reviewer 边界会在这里同步。`,`Argus next steps and reviewer boundaries appear here.`)}),(0,J.jsxs)(`button`,{className:`button button--secondary`,type:`button`,onClick:()=>e.navigate(`experiments`),children:[t(`查看完整实验进程`,`View experiment progress`),` `,(0,J.jsx)(x,{size:14})]})]})}),(0,J.jsx)(ft,{eyebrow:`RECENT ACTIVITY`,title:t(`最近活动`,`Recent activity`),bodyClassName:`panel__body--flush`,children:(0,J.jsx)(mt,{events:e.events,limit:7,dense:!0})})]})]})}var dn=[`ICLR`,`NeurIPS`,`ICML`,`TMLR`,`ACL`,`EMNLP`,`NAACL`,`CVPR`,`ICCV`,`ECCV`,`AAAI`,`KDD`,`Nature Machine Intelligence`,`JMLR`,`IEEE TPAMI`,`__custom__`],fn=[`Novelty`,`Technical soundness`,`Experimental rigor`,`Baseline fairness`,`Statistical validity`,`Reproducibility`,`Writing clarity`,`Ethics / limitations`,`Artifact availability`],pn=`请特别检查 train/dev/test 泄漏、baseline 是否公平,以及 novelty claim 是否被现有直接工作覆盖。`,mn=`Pay special attention to train/dev/test leakage, baseline fairness, and whether direct prior work covers the novelty claim.`;function hn({mode:e,reviewerActive:t,hasReport:n}){let{text:r}=Q(),i=e===`process`?[[r(`Engineer 执行`,`Engineer execution`),r(`代码、实验与证据`,`Code, experiments, and evidence`),j],[r(`Reviewer 检查`,`Reviewer check`),r(`独立核验当前轮次`,`Independent round verification`),R],[r(`形成 Verdict`,`Produce verdict`),`done / continue / blocked`,Le],[r(`回流下一轮`,`Return to next round`),r(`修复任务进入 backlog`,`Repair tasks enter the backlog`),Fe]]:[[r(`选择最终稿`,`Select final draft`),r(`LaTeX / PDF 与证据包`,`LaTeX / PDF and evidence package`),I],[r(`独立最终审稿`,`Independent final review`),r(`按目标 venue 全面检查`,`Full target-venue review`),R],[r(`生成审稿报告`,`Generate review report`),r(`评分、问题与置信度`,`Scores, issues, and confidence`),F],[r(`修改清单`,`Revision checklist`),r(`投稿前人工确认`,`Human confirmation before submission`),be]];return(0,J.jsx)(`div`,{className:`review-flow`,children:i.map(([e,r,a],o)=>(0,J.jsxs)(`div`,{className:t&&o===1||n&&o>=2?`is-active`:o===0?`is-done`:``,children:[(0,J.jsx)(`span`,{children:o+1}),(0,J.jsx)(a,{size:17}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e}),(0,J.jsx)(`small`,{children:r})]}),o(o?.role_work??[]).filter(e=>e.role===`reviewer`).filter(e=>/review|verdict|decision|completion|handoff/i.test(`${e.kind} ${e.title}`)).sort((e,t)=>t.ts-e.ts),[o?.role_work]),c=(0,_.useMemo)(()=>e.events.filter(e=>/review/.test(String(e.type??``))||/review/.test(String(e.agent_layer??e.actor??``))),[e.events]),[l,u]=(0,_.useState)(``),d=s.find(e=>e.id===l)??s[0]??null,f=Vt(e.sid,`review`),p=i({queryKey:[`review-workspace-tree`,e.sid,f.workspaceId],queryFn:({signal:t})=>$.tree(e.sid,f.workspaceId,t),enabled:!!f.workspaceId,refetchInterval:12e3}),m=(p.data?.entries??[]).filter(e=>e.type===`file`&&!/final[_-]?review[_-]?request/i.test(e.path)&&/final[_-]?review|final[_-]?.*verdict|submission[_-]?review/i.test(e.path)).filter(e=>[`.md`,`.txt`,`.json`].includes(e.extension)).sort((e,t)=>t.mtime-e.mtime),h=(p.data?.entries??[]).filter(e=>e.type===`file`&&[`.tex`,`.md`,`.pdf`].includes(e.extension)&&/(?:^|\/)(paper|manuscript|technical_report)(?:\/|$)/i.test(e.path)).sort((e,t)=>t.mtime-e.mtime),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(``),x=m.find(e=>e.path===y)??m[0]??null,S=i({queryKey:[`final-review-file`,e.sid,f.workspaceId,x?.path,x?.mtime],queryFn:({signal:t})=>$.file(e.sid,f.workspaceId,x.path,t),enabled:!!(x&&f.workspaceId),refetchInterval:12e3}),[C,w]=(0,_.useState)(`ICLR`),[T,E]=(0,_.useState)(``),[D,ee]=(0,_.useState)(`conference`),[k,A]=(0,_.useState)(`strict`),[j,M]=(0,_.useState)([`Novelty`,`Technical soundness`,`Experimental rigor`,`Baseline fairness`,`Reproducibility`]),[N,te]=(0,_.useState)(()=>t===`zh-CN`?pn:mn),[P,ne]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(``),[I,L]=(0,_.useState)(``),ae=o?.review,oe=o?.roles.find(e=>e.role===`reviewer`)||e.snapshot.roles.find(e=>e.role===`reviewer`);(0,_.useEffect)(()=>{te(e=>e===pn||e===mn?t===`zh-CN`?pn:mn:e)},[t]);let se=async()=>{let t=C===`__custom__`?T.trim():C;if(!(!t||!N.trim()||!confirm(n(`确认在项目完成后按 ${t} 标准发起独立最终审稿?`,`Start an independent final review using ${t} standards?`)))){ne(!0),ie(``),L(``);try{let r=await H.createFinalReview(e.sid,{venue:t,venue_type:D,strictness:k,manuscript_path:g,emphasis:j,scope:N});L(n(`最终审稿已进入 Argus 队列 · ${r.manifest_path}`,`Final review queued in Argus · ${r.manifest_path}`)),await Promise.all([e.refresh(),p.refetch()])}catch(e){ie(e instanceof Error?e.message:String(e))}finally{ne(!1)}}};return(0,J.jsxs)(`div`,{className:`ros-page reviewer-v2`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`REVIEWER ARENA`}),(0,J.jsx)(`h1`,{children:n(`模拟审稿`,`Reviewer arena`)}),(0,J.jsx)(`p`,{children:n(`过程审稿用于每轮 Engineer ⇄ Reviewer 纠偏;最终审稿用于论文完成后的投稿前独立检查。`,`Process review corrects each Engineer ⇄ Reviewer round; final review is an independent pre-submission check.`)})]}),(0,J.jsx)(Y,{tone:oe?.status?G(oe.status):`neutral`,dot:oe?.status===`active`,children:oe?.status||`waiting`})]}),(0,J.jsxs)(`div`,{className:`review-mode-tabs`,children:[(0,J.jsxs)(`button`,{type:`button`,className:r===`process`?`is-active`:``,onClick:()=>a(`process`),children:[(0,J.jsx)(he,{size:16}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:n(`过程审稿`,`Process review`)}),(0,J.jsx)(`small`,{children:n(`Argus 每轮执行中的 Reviewer 反馈`,`Reviewer feedback during each Argus round`)})]}),(0,J.jsx)(Y,{tone:`neutral`,children:s.length})]}),(0,J.jsxs)(`button`,{type:`button`,className:r===`final`?`is-active`:``,onClick:()=>a(`final`),children:[(0,J.jsx)(Le,{size:16}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:n(`最终审稿`,`Final review`)}),(0,J.jsx)(`small`,{children:n(`项目完成后的独立投稿前审稿`,`Independent pre-submission review`)})]}),(0,J.jsx)(Y,{tone:`neutral`,children:m.length})]})]}),r===`process`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(hn,{mode:`process`,reviewerActive:oe?.status===`active`,hasReport:!!ae?.status}),(0,J.jsxs)(`div`,{className:`process-review-layout`,children:[(0,J.jsxs)(`aside`,{className:`ros-card review-rounds`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`ENGINEER ⇄ REVIEWER`}),(0,J.jsx)(`h2`,{children:n(`过程审稿轮次`,`Process review rounds`)})]})}),(0,J.jsx)(`div`,{children:s.length?s.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:d?.id===e.id?`is-active`:``,onClick:()=>u(e.id),children:[(0,J.jsx)(`span`,{className:`review-state review-state--${G(e.status)}`,children:(0,J.jsx)(R,{size:14})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.title}),(0,J.jsxs)(`small`,{children:[ct(e.ts),` · `,e.status||e.kind]})]})]},e.id)):(0,J.jsx)(X,{icon:R,title:n(`暂无过程审稿`,`No process reviews yet`)})})]}),(0,J.jsxs)(`main`,{className:`ros-card process-report`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`ROUND VERDICT`}),(0,J.jsx)(`h2`,{children:d?.title||n(`选择一轮 Reviewer 反馈`,`Select reviewer feedback`)})]}),d?(0,J.jsx)(Y,{tone:G(d.status),children:d.status}):null]}),d?(0,J.jsxs)(`article`,{children:[(0,J.jsxs)(`div`,{className:`process-report__meta`,children:[(0,J.jsxs)(`span`,{children:[`Round `,d.round_index??`—`]}),(0,J.jsx)(`time`,{children:ct(d.ts)})]}),(0,J.jsx)(Z,{children:d.detail||n(`该轮没有留下可展示报告。`,`This round has no displayable report.`)})]}):(0,J.jsx)(X,{icon:F,title:n(`选择左侧过程审稿`,`Select a process review`)})]}),(0,J.jsxs)(`aside`,{className:`ros-card review-live`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`LIVE REVIEW EVENTS`}),(0,J.jsx)(`h2`,{children:n(`Reviewer 实时轨迹`,`Live reviewer activity`)})]}),(0,J.jsx)(Y,{tone:e.connected?`live`:`warn`,dot:!0,children:e.connected?`Live`:`Polling`})]}),(0,J.jsx)(mt,{events:c,limit:24,dense:!0})]}),(0,J.jsxs)(`section`,{className:`process-verdict-card`,children:[(0,J.jsx)(`span`,{className:`process-verdict-card__icon process-verdict-card__icon--${G(ae?.status)}`,children:G(ae?.status)===`success`?(0,J.jsx)(O,{size:21}):(0,J.jsx)(qe,{size:21})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:n(`当前过程 Verdict`,`Current process verdict`)}),(0,J.jsx)(`strong`,{children:ae?.status||`Awaiting review`}),(0,J.jsx)(`p`,{children:ae?.reason||n(`Reviewer 完成下一轮后会写入判断和行动要求。`,`The Reviewer will record a decision and required actions after the next round.`)})]})]})]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(hn,{mode:`final`,reviewerActive:P,hasReport:!!(x||I)}),(0,J.jsxs)(`div`,{className:`final-review-layout`,children:[(0,J.jsxs)(`aside`,{className:`ros-card final-review-files`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`FINAL REPORTS`}),(0,J.jsx)(`h2`,{children:n(`最终审稿报告`,`Final review reports`)})]})}),(0,J.jsx)(`div`,{children:m.length?m.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:x?.path===e.path?`is-active`:``,onClick:()=>b(e.path),children:[(0,J.jsx)(F,{size:14}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.name}),(0,J.jsx)(`small`,{children:ct(e.mtime)})]})]},e.path)):(0,J.jsx)(X,{icon:F,title:n(`还没有最终审稿报告`,`No final review report yet`),description:n(`完成论文后可从右侧发起。`,`Start one from the form after the paper is complete.`)})})]}),(0,J.jsxs)(`main`,{className:`ros-card final-review-report`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`INDEPENDENT REVIEW`}),(0,J.jsx)(`h2`,{children:x?.name||n(`投稿前最终审稿`,`Pre-submission final review`)})]}),x?(0,J.jsx)(Y,{tone:`success`,children:`Saved report`}):null]}),S.data?(0,J.jsx)(`article`,{children:(0,J.jsx)(Z,{children:S.data.content})}):I?(0,J.jsxs)(`article`,{className:`final-review-receipt`,children:[(0,J.jsx)(Y,{tone:`success`,children:`Queued`}),(0,J.jsx)(`p`,{children:I}),(0,J.jsx)(`small`,{children:n(`Argus 将生成结构化最终审稿报告;可在过程事件和任务路线查看执行状态。`,`Argus will generate a structured final review report; execution remains visible in events and the task route.`)})]}):(0,J.jsx)(X,{icon:Le,title:n(`项目完成后再发起最终审稿`,`Start final review after project completion`),description:n(`最终 Reviewer 会读取完整稿件、实验、文献与过程审稿记录。`,`The final Reviewer reads the full manuscript, experiments, literature, and process-review history.`)})]}),(0,J.jsxs)(`aside`,{className:`ros-card final-review-form`,children:[(0,J.jsx)(`header`,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:`NEW FINAL REVIEW`}),(0,J.jsx)(`h2`,{children:n(`发起独立最终审稿`,`Start independent final review`)})]})}),(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`label`,{className:`field`,children:[(0,J.jsx)(`span`,{children:n(`选择最终稿`,`Select final manuscript`)}),(0,J.jsxs)(`select`,{value:g,onChange:e=>v(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:n(`自动选择最新稿件`,`Automatically select latest`)}),h.map(e=>(0,J.jsx)(`option`,{value:e.path,children:e.path},e.path))]})]}),(0,J.jsxs)(`div`,{className:`review-form-row`,children:[(0,J.jsxs)(`label`,{className:`field`,children:[(0,J.jsx)(`span`,{children:n(`Venue 类型`,`Venue type`)}),(0,J.jsxs)(`select`,{value:D,onChange:e=>ee(e.target.value),children:[(0,J.jsx)(`option`,{value:`conference`,children:`Conference`}),(0,J.jsx)(`option`,{value:`journal`,children:`Journal`}),(0,J.jsx)(`option`,{value:`workshop`,children:`Workshop`})]})]}),(0,J.jsxs)(`label`,{className:`field`,children:[(0,J.jsx)(`span`,{children:n(`审稿严格度`,`Review strictness`)}),(0,J.jsxs)(`select`,{value:k,onChange:e=>A(e.target.value),children:[(0,J.jsx)(`option`,{value:`preflight`,children:n(`快速预检`,`Quick preflight`)}),(0,J.jsx)(`option`,{value:`standard`,children:n(`标准审稿`,`Standard review`)}),(0,J.jsx)(`option`,{value:`strict`,children:n(`严格模拟审稿`,`Strict simulated review`)}),(0,J.jsx)(`option`,{value:`red-team`,children:`Red Team / Desk Reject`})]})]})]}),(0,J.jsxs)(`label`,{className:`field`,children:[(0,J.jsx)(`span`,{children:n(`目标会议 / 期刊`,`Target venue`)}),(0,J.jsx)(`select`,{value:C,onChange:e=>w(e.target.value),children:dn.map(e=>(0,J.jsx)(`option`,{value:e,children:e===`__custom__`?n(`其他 / 自定义…`,`Other / custom…`):e},e))})]}),C===`__custom__`?(0,J.jsxs)(`label`,{className:`field`,children:[(0,J.jsx)(`span`,{children:n(`自定义 Venue 名称`,`Custom venue name`)}),(0,J.jsx)(`input`,{value:T,onChange:e=>E(e.target.value),placeholder:n(`例如:Nature Machine Intelligence / CHI Workshop`,`Example: Nature Machine Intelligence / CHI Workshop`)})]}):null,(0,J.jsxs)(`fieldset`,{className:`review-emphasis`,children:[(0,J.jsx)(`legend`,{children:n(`重点审查维度`,`Review emphasis`)}),fn.map(e=>(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:j.includes(e),onChange:()=>M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}),(0,J.jsx)(`span`,{children:e})]},e))]}),(0,J.jsxs)(`label`,{className:`field`,children:[(0,J.jsx)(`span`,{children:n(`特别强调`,`Special emphasis`)}),(0,J.jsx)(`textarea`,{rows:5,value:N,onChange:e=>te(e.target.value),placeholder:n(`写明你最希望 Reviewer 严格检查的问题…`,`Describe what the Reviewer should scrutinize most…`)})]}),(0,J.jsxs)(`div`,{className:`final-review-warning`,children:[(0,J.jsx)(qe,{size:15}),(0,J.jsx)(`p`,{children:n(`这是完成阶段的独立 Reviewer,不替代正式同行评审,也不会自动投稿。`,`This independent completion-stage Reviewer does not replace peer review and never submits automatically.`)})]}),(0,J.jsxs)(`button`,{className:`button button--primary button--full`,type:`button`,disabled:P||!N.trim()||C===`__custom__`&&!T.trim(),onClick:()=>void se(),children:[P?(0,J.jsx)(z,{size:14}):(0,J.jsx)(ze,{size:14}),P?n(`正在创建审稿任务`,`Creating review task`):n(`开始最终审稿`,`Start final review`)]}),re?(0,J.jsx)(`div`,{className:`inline-error`,children:re}):null]})]})]})]})]})}var _n=[{icon:me,title:`GitHub Repository`,zhDetail:`README、LICENSE、CITATION.cff、环境文件、Secret Scan 与人工确认后的仓库创建。`,enDetail:`Prepare README, LICENSE, CITATION.cff, environment files, secret scanning, and an approved repository.`,zhItems:[`选择账户与可见性`,`生成发布清单`,`预览 Git diff`,`人工批准后 push`],enItems:[`Choose account and visibility`,`Generate release manifest`,`Preview Git diff`,`Push after approval`]},{icon:Me,title:`Academic Poster`,zhDetail:`从最终稿、图表和结果中生成可审阅的学术海报。`,enDetail:`Generate a reviewable academic poster from the final paper, figures, and results.`,zhItems:[`A0/A1 与横竖版`,`机构 Logo 与主题`,`图表布局`,`PDF / PNG / SVG`],enItems:[`A0/A1 portrait or landscape`,`Institution logo and theme`,`Figure layout`,`PDF / PNG / SVG`]},{icon:M,title:`Project Page`,zhDetail:`生成论文项目宣传页和可部署的静态站点。`,enDetail:`Generate a paper project page and deployable static site.`,zhItems:[`方法与结果展示`,`交互式图表`,`Paper / Code / Model`,`预览后部署`],enItems:[`Methods and results`,`Interactive charts`,`Paper / Code / Model`,`Deploy after preview`]}];function vn(e){let{text:t}=Q();return(0,J.jsxs)(`div`,{className:`ros-page release-page`,children:[(0,J.jsxs)(`header`,{className:`ros-page-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`RESULTS RELEASE`}),(0,J.jsx)(`h1`,{children:t(`成果发布`,`Results release`)}),(0,J.jsx)(`p`,{children:t(`未来用于把研究工作整理成 GitHub 仓库、学术海报和项目宣传页。当前只展示规划,不执行发布。`,`Plan a GitHub repository, academic poster, and project page. This view does not publish anything yet.`)})]}),(0,J.jsx)(Y,{tone:`warn`,children:t(`敬请期待`,`Planned`)})]}),(0,J.jsxs)(`section`,{className:`release-hero`,children:[(0,J.jsx)(`span`,{children:(0,J.jsx)(z,{size:28})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`eyebrow`,children:`PLANNED WORKSPACE`}),(0,J.jsx)(`h2`,{children:t(`从研究产物到可审核的公开成果`,`From research artifacts to reviewable public outputs`)}),(0,J.jsx)(`p`,{children:t(`后续将调用受审计的 AI Agent 基于真实工作区生成发布补丁和视觉资产,但任何外部创建、push 或部署都需要人工批准。`,`Audited agents will generate release patches and visual assets from the real workspace, while every external create, push, or deploy requires approval.`)})]})]}),(0,J.jsx)(`div`,{className:`release-module-grid`,children:_n.map(e=>{let n=e.icon,r=t(e.zhItems.join(` `),e.enItems.join(` `)).split(` diff --git a/frontend/web/dist/assets/index-DYvAJ_cb.js b/frontend/web/dist/assets/index-DYvAJ_cb.js deleted file mode 100644 index a2b22d8b..00000000 --- a/frontend/web/dist/assets/index-DYvAJ_cb.js +++ /dev/null @@ -1,30 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/motion-sqs9Ax-g.js","assets/rolldown-runtime-hePW80VL.js","assets/ResearchWorkbenchPanel-BOPEGTC6.js","assets/icons-BgG77X6K.js","assets/query-DOc9YWJi.js","assets/markdown-BdostSiP.js","assets/ResearchWorkbenchPanel-Bxi8TjKE.css"])))=>i.map(i=>d[i]); -import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{C as n,D as r,E as i,S as a,T as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as ee,x as te,y as E}from"./icons-BgG77X6K.js";import{_ as ne,a as re,c as ie,d as ae,f as D,g as O,h as oe,i as se,l as ce,m as k,n as le,o as A,p as ue,r as de,s as fe,t as j,u as pe,v as me,y as he}from"./query-DOc9YWJi.js";import{n as ge,t as _e}from"./markdown-BdostSiP.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ve=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,ae(x);else{var t=n(l);t!==null&&D(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&D(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,ee=-1;function te(){return!(e.unstable_now()-eee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,D(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ae(x))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ye=t(((e,t)=>{t.exports=ve()})),be=t((e=>{var t=r(),n=ye();function i(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function m(e){return u.call(p,e)?!0:u.call(f,e)?!1:d.test(e)?p[e]=!0:(f[e]=!0,!1)}function h(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function g(e,t,n,r){if(t==null||h(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var v={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){v[e]=new _(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];v[t]=new _(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){v[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){v[e]=new _(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){v[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){v[e]=new _(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){v[e]=new _(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){v[e]=new _(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){v[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new _(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,t,n,r){var i=v.hasOwnProperty(t)?v[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` -`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?A(e):``}function fe(e){switch(e.tag){case 5:return A(e.type);case 16:return A(`Lazy`);case 13:return A(`Suspense`);case 19:return A(`SuspenseList`);case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return``}}function j(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case w:return`Portal`;case te:return`Profiler`;case ee:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ne:return(e.displayName||`Context`)+`.Consumer`;case E:return(e._context.displayName||`Context`)+`.Provider`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return j(t);case 8:return t===ee?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function me(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ge(e){var t=he(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _e(e){e._valueTracker||=ge(e)}function ve(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=he(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function be(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function xe(e,t){var n=t.checked;return k({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Se(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=me(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function Ce(e,t){t=t.checked,t!=null&&x(e,`checked`,t,!1)}function we(e,t){Ce(e,t);var n=me(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Ee(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Ee(e,t.type,me(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Te(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Ee(e,t,n){(t!==`number`||be(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var M=Array.isArray;function De(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ie(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Le={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Re=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Le).forEach(function(e){Re.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Le[t]=Le[e]})});function ze(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Le.hasOwnProperty(e)&&Le[e]?(``+t).trim():t+`px`}function Be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=ze(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ve=k({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function He(e,t){if(t){if(Ve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(i(62))}}function Ue(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var We=null;function Ge(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ke=null,qe=null,N=null;function Je(e){if(e=Pi(e)){if(typeof Ke!=`function`)throw Error(i(280));var t=e.stateNode;t&&(t=Ii(t),Ke(e.stateNode,e.type,t))}}function Ye(e){qe?N?N.push(e):N=[e]:qe=e}function Xe(){if(qe){var e=qe,t=N;if(N=qe=null,Je(e),t)for(e=0;e>>=0,e===0?32:31-(Et(e)/Dt|0)|0}var kt=64,At=4194304;function jt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=jt(a))):r=jt(s)}else o=n&~i,o===0?a!==0&&(r=jt(a)):r=jt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Rt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function zt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Xn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!W&&tr(e,t)?(e=xn(),bn=yn=U=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(){for(var e=window,t=be();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=be(e.document)}return t}function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function K(e){var t=Ar(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kr(n.ownerDocument.documentElement,n)){if(r!==null&&jr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Or(n,a);var o=Or(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==be(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=si(Pr,`onSelect`),0Ri||(e.current=Li[Ri],Li[Ri]=null,Ri--)}function X(e,t){Ri++,Li[Ri]=e.current,e.current=t}var Bi={},Vi=zi(Bi),Hi=zi(!1),Ui=Bi;function Wi(e,t){var n=e.type.contextTypes;if(!n)return Bi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Gi(e){return e=e.childContextTypes,e!=null}function Ki(){Y(Hi),Y(Vi)}function qi(e,t,n){if(Vi.current!==Bi)throw Error(i(168));X(Vi,t),X(Hi,n)}function Ji(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!=`function`)return n;for(var a in r=r.getChildContext(),r)if(!(a in t))throw Error(i(108,pe(e)||`Unknown`,a));return k({},n,r)}function Yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Ui=Vi.current,X(Vi,e),X(Hi,Hi.current),!0}function Xi(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=Ji(e,t,Ui),r.__reactInternalMemoizedMergedChildContext=e,Y(Hi),Y(Vi),X(Vi,e)):Y(Hi),X(Hi,n)}var Zi=null,Qi=!1,$i=!1;function ea(e){Zi===null?Zi=[e]:Zi.push(e)}function ta(e){Qi=!0,ea(e)}function na(){if(!$i&&Zi!==null){$i=!0;var e=0,t=V;try{var n=Zi;for(V=1;e>=o,i-=o,ua=1<<32-Tt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Z&&fa(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Z&&fa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Z&&fa(a,g),u}for(h=r(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Z&&fa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===T&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case C:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===T){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===O&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===T?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case w:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case O:return l=i._init,_(e,r,l(i._payload),o)}if(M(i))return h(e,r,i,o);if(ce(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=zi(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Y(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e){if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(i(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e}return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=k({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{V=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=bo,a=jo();if(Z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vc===null)throw Error(i(349));yo&30||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,r,o,e),[e]),r.flags|=2048,Wo(9,zo.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(Z){var n=da,r=ua;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof r.is==`string`?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n===`select`&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Di]=t,e[Oi]=r,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ue(n,r),n){case`dialog`:J(`cancel`,e),J(`close`,e),a=r;break;case`iframe`:case`object`:case`embed`:J(`load`,e),a=r;break;case`video`:case`audio`:for(a=0;ael&&(t.flags|=128,r=!0,ac(s,!1),t.lanes=4194304)}}else{if(!r){if(e=mo(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Z)return oc(t),null}else 2*B()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,r=!0,ac(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=B(),t.sibling=null,n=po.current,X(po,r?n&1|2:n&1),t);case 22:case 23:return wl(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function cc(e,t){switch(ha(t),t.tag){case 1:return Gi(t.type)&&Ki(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Y(Hi),Y(Vi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Y(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(hi=pn,e=Ar(),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},pn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[Oi],delete t[Ai],delete t[ji],delete t[Mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mi));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount==`function`)try{Ct.onCommitFiberUnmount(St,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?Ci(e.parentNode,n):e.nodeType===1&&Ci(e,n),dn(e)):Ci(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var r=0;ra&&(a=s),r&=~o}if(r=a,r=B()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Lc(r/1960))-r,10e?16:e,ol===null)var r=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(i(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lB()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=At,At<<=1,!(At&130023424)&&(At=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(Rt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}r!==null&&r.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Hi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}}else Ms=!1,Z&&t.flags&1048576&&pa(t,oa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$s(e,t),e=t.pendingProps;var a=Wi(t,Vi.current);Ha(t,n),a=ko(null,t,r,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gi(r)?(o=!0,Yi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,r,e,n),t=Vs(null,t,r,!0,o,n)):(t.tag=0,Z&&o&&ma(t),Ns(null,t,a,n),t=t.child),t;case 16:r=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=Jl(r),e=hs(r,e),a){case 0:t=zs(null,t,r,e,n);break a;case 1:t=Bs(null,t,r,e,n);break a;case 11:t=Ps(null,t,r,e,n);break a;case 14:t=Fs(null,t,r,hs(r.type,e),n);break a}throw Error(i(306,r,``))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),zs(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),Bs(e,t,r,a,n);case 3:a:{if(Hs(t),e===null)throw Error(i(387));r=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(i(423)),t),t=Us(e,t,r,n,a);break a}if(r!==a){a=Ss(Error(i(424)),t),t=Us(e,t,r,n,a);break a}for(_a=wi(t.stateNode.containerInfo.firstChild),ga=t,Z=!0,va=null,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ea(),r===a){t=ec(e,t,n);break a}Ns(e,t,r,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),r=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,_i(r,a)?s=null:o!==null&&_i(r,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):Ns(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),Ps(e,t,r,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,X(Fa,r._currentValue),r._currentValue=s,o!==null){if(Tr(o.value,s)){if(o.children===a.children&&!Hi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(i(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Ha(t,n),a=Ua(a),r=r(a),t.flags|=1,Ns(e,t,r,n),t.child;case 14:return r=t.type,a=hs(r,t.pendingProps),a=hs(r.type,a),Fs(e,t,r,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),$s(e,t),t.tag=1,Gi(r)?(e=!0,Yi(t)):e=!1,Ha(t,n),ys(t,r,a),xs(t,r,a,n),Vs(null,t,r,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(i(156,t.tag))};function Wl(e,t){return ft(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===re)return 11;if(e===D)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,r,a,o){var s=2;if(r=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case T:return Zl(n.children,a,o,t);case ee:s=8,a|=8;break;case te:return e=Kl(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=Kl(13,n,t,a),e.elementType=ie,e.lanes=o,e;case ae:return e=Kl(19,n,t,a),e.elementType=ae,e.lanes=o,e;case oe:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case E:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}throw Error(i(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=oe,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lt(0),this.expirationTimes=Lt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=be()})),Se=t((e=>{var t=xe();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),Ce=class extends he{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new re({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=we(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=we(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=we(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=we(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ie.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>D(t,e))}findAll(e={}){return this.getAll().filter(t=>D(e,t))}notify(e){ie.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ie.batch(()=>Promise.all(e.map(e=>e.continue().catch(k))))}};function we(e){return e.options.scope?.id}var Te=class extends he{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ae(r,t),a=this.get(i);return a||(a=new A({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ie.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ue(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ue(e,t)):t}notify(e){ie.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ie.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ie.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ee=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Te,this.#t=e.mutationCache||new Ce,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=me.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=fe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(O(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ce(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ie.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ie.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ie.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ie.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(k).catch(k)}invalidateQueries(e,t={}){return ie.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ie.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(k)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(k)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(k).catch(k)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(k).catch(k)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return fe.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(pe(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{oe(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(pe(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{oe(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ae(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===ne&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},M=e(r(),1),De=e(Se(),1),Oe=class extends Error{status;method;path;constructor(e,t,n,r){super(e),this.name=`ApiError`,this.status=t,this.method=n,this.path=r}};function ke(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;try{let t=JSON.parse(e);for(let e of[`detail`,`error`,`message`]){let n=t[e];if(typeof n==`string`&&n.trim())return n.trim();if(Array.isArray(n)){let e=n.map(e=>e&&typeof e==`object`?String(e.msg??``):``).filter(Boolean);if(e.length)return e.join(`; `)}}}catch{}return t.startsWith(`typeof e==`string`):[],o=Ie(r?.major),s=Ie(r?.minor);if(!n||!r||!i)return{compatible:!1,reason:`malformed /api/meta response`};if(typeof i.source_root!=`string`||Ie(i.pid)===null||typeof i.package_version!=`string`||typeof i.release_id!=`string`)return{compatible:!1,reason:`malformed /api/meta runtime identity`};if(n.service!==`argus-skill-webapi`)return{compatible:!1,reason:`unexpected service ${String(n.service||`unknown`)}`};let c=e;if(r.name!==Ne.name||o!==Ne.major)return{compatible:!1,reason:`protocol ${String(r.name||`unknown`)}/${String(o)} is incompatible with client ${Ne.name}/${Ne.major}`,meta:c};if(s===null||s!a.includes(e));if(l.length>0)return{compatible:!1,reason:`missing capabilities: ${l.join(`, `)}`,meta:c};if(i.source_root_matches_config===!1)return{compatible:!1,reason:`backend loaded source ${String(i.source_root)} but ARGUS_SKILL_SOURCE_ROOT points to ${String(i.configured_source_root)}`,meta:c};if(i.release_id!==t.releaseId)return{compatible:!1,reason:`backend release ${String(i.release_id)} does not match client release ${t.releaseId}`,meta:c};if(t.sourceDigest){if(typeof i.runtime_source_digest!=`string`||!i.runtime_source_digest)return{compatible:!1,reason:`backend process does not report the source digest required by this local checkout`,meta:c};if(i.runtime_source_digest!==t.sourceDigest)return{compatible:!1,reason:`backend process source ${String(i.runtime_source_digest).slice(0,16)} does not match local source ${t.sourceDigest.slice(0,16)}`,meta:c}}return{compatible:!0,reason:``,warning:i.release_matches_source===!1?`backend source differs from its prebuilt release artifacts; pull a complete published revision and reinstall`:void 0,meta:c}}function Re(e,t){let n=Le(e);if(!n.compatible||!n.meta)throw Error(`incompatible Argus API: ${n.reason}`);return n.warning&&t?.(n.warning),n.meta}function ze(e){let t=Fe(e),n=Fe(t?.daemon);if(!t||t.schema_version!==7)throw Error(`incompatible snapshot schema: expected 7, got ${String(t?.schema_version??`missing`)}`);if(!n)throw Error(`invalid snapshot: daemon section is missing`);let r=[`global_daily_cap_usd`,`read_status`,`read_error`,`protocol_compatible`,`protocol_error`].filter(e=>!Object.hasOwn(n,e));if(r.length>0)throw Error(`invalid snapshot: daemon fields missing: ${r.join(`, `)}`);let i=[`spend_usd`,`spend_status`,`usage_summary`,`request_usage`,`cost_control`,`daemon_commands`,`observability`,`mission_view`,`partial`,`diagnostics`].filter(e=>!Object.hasOwn(t,e));if(i.length>0)throw Error(`invalid snapshot: fields missing: ${i.join(`, `)}`);if(!Array.isArray(t.diagnostics))throw Error(`invalid snapshot: diagnostics must be an array`);return e}var Be=`argus_web_token`,Ve=null;function He(){let e;try{e=new URLSearchParams(window.location.search)}catch{return}let t=e.get(`token`);if(t){Ve=t;try{localStorage.setItem(Be,t)}catch{}try{e.delete(`token`);let t=e.toString();window.history.replaceState(null,``,`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`)}catch{}}}var Ue=()=>{if(Ve)return Ve;try{return new URLSearchParams(window.location.search).get(`token`)||localStorage.getItem(Be)}catch{return null}};function We(){let e=Ue();return e?{Authorization:`Bearer ${e}`}:{}}function Ge(){return Ue()??``}var Ke=8e3,qe=12e3,N=class extends Error{constructor(){super(`This browser is not paired with Argus. Reopen it from Argus Desktop or use a fresh pairing link.`),this.name=`PairingRequiredError`}},Je=class extends Error{method;path;constructor(e,t,n=`could not reach the local Argus service`){super(`${e.toUpperCase()} ${t} ${n}. Make sure Argus Desktop is running, then retry.`),this.name=`LocalArgusUnavailableError`,this.method=e.toUpperCase(),this.path=t}};function Ye(e){return e instanceof N||!!(e&&typeof e==`object`&&Number(e.status)===401)}function Xe(e){return Ye(e)||e instanceof Je}async function P(e,t){try{return await fetch(e,t)}catch(n){throw t.signal?.aborted?n:new Je(String(t.method??`GET`),e)}}async function Ze(e,t,n,r){let i=new AbortController,a=t.signal??void 0,o=!1,s=()=>{};if(a){let e=()=>i.abort(a.reason);a.aborted?e():(a.addEventListener(`abort`,e,{once:!0}),s=()=>a.removeEventListener(`abort`,e))}let c,l=(async()=>await r(await P(e,{...t,signal:i.signal})))(),u=new Promise((e,t)=>{c=setTimeout(()=>{o=!0;let e=Error(`request timed out after ${n}ms`);i.abort(e),t(e)},n)});try{return await Promise.race([l,u])}catch(r){if(o){let r=Math.round(n/1e3);throw new Je(String(t.method??`GET`),e,`timed out after ${r}s because the local Argus service did not respond`)}throw r}finally{c&&clearTimeout(c),s()}}async function Qe(e,t,n){return Ze(e,{headers:We(),signal:t},n??qe,async t=>(await je(t,`GET`,e),await t.json()))}async function F(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`,...We()},body:t===void 0?void 0:JSON.stringify(t),signal:n});return await je(r,`POST`,e),await r.json()}async function $e(e,t,n){let r=await fetch(e,{method:`POST`,headers:We(),body:t,signal:n});return await je(r,`POST`,e),await r.json()}function et(e){let t=e&&typeof e==`object`?e:{},n=String(t.command_status??``);if(Number(t.rc??0)!==0||n===`failed`||n===`rejected`)throw Error(String(t.error||`daemon command ${n||`failed`}`));return e}async function tt(e,t,n){let r=await fetch(t,{method:e,headers:{"Content-Type":`application/json`,...We()},body:n===void 0?void 0:JSON.stringify(n)});return await je(r,e,t),await r.json()}async function nt(e,t){let n=await fetch(e,{headers:We(),signal:t});return await je(n,`GET`,e),n.blob()}var I=(e,t=``)=>`/api/projects/${encodeURIComponent(e)}${t}`,L=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`,rt;function it(e){return!!(e&&typeof e==`object`&&`aborted`in e&&typeof e.aborted==`boolean`)}function at(e,t){return t?.length?{text:e,attachments:t}:{text:e}}function ot(){if(!rt){let e=(async()=>{let e=`/api/meta`,t=await Ze(e,{headers:We()},Ke,async t=>{if(t.status===404)throw Error(`incompatible Argus API: service does not expose /api/meta`);return await je(t,`GET`,e),Re(await t.json(),e=>console.warn(`Argus API compatibility warning: ${e}`))});if(t.authentication?.required&&!t.authentication.authenticated)throw new N;return t})();rt=e,e.catch(t=>{rt===e&&!(t instanceof N)&&(rt=void 0)})}return rt}function st(e){let t=[],n;for(;(n=e.indexOf(` - -`))>=0;){let r=e.slice(0,n);e=e.slice(n+2);for(let e of r.split(` -`)){let n=e.trim();if(n.startsWith(`data:`))try{t.push(JSON.parse(n.slice(5).trim()))}catch{}}}return{frames:t,rest:e}}var R={meta:ot,projectIndex:async()=>(await ot(),Qe(`/api/projects`,void 0,qe)),listProjects:async()=>(await ot(),Qe(`/api/projects`,void 0,qe).then(e=>e.projects)),projectCosts:async e=>(await ot(),Qe(`/api/projects/costs`,e)),createDaemon:async(e,t=``,n=``,r)=>{let i=`/api/daemons`,a={objective:e,name:t,workdir:n,command_id:L(),expected_revision:r},o=()=>fetch(i,{method:`POST`,headers:{"Content-Type":`application/json`,...We()},body:JSON.stringify(a),cache:`no-store`}),s=await o();return s.status===400&&/Invalid HTTP request received/i.test(await s.clone().text())&&(s=await o()),await je(s,`POST`,i),et(await s.json())},updateProject:(e,t)=>tt(`PATCH`,I(e),{name:t}),deleteProject:e=>tt(`DELETE`,I(e)),snapshot:async(e,t)=>(await ot(),ze(await Qe(I(e,`/snapshot?compact=true&events_limit=1`),t,qe))),status:(e,t)=>Qe(I(e,`/status`),t),journal:(e,t=20,n)=>Qe(I(e,`/journal?n=${t}`),n).then(e=>e.journal),doctor:(e,t)=>Qe(I(e,`/doctor`),t),config:(e,t)=>Qe(I(e,`/config`),t),identity:(e,t)=>Qe(I(e,`/identity`),t).then(e=>e.identity),transcript:(e,t=30,n)=>Qe(I(e,`/transcript?n=${t}`),n).then(e=>e.turns),events:(e,t=80,n)=>Qe(I(e,`/events?limit=${t}&view=ui`),n).then(e=>e.events),backlogItem:(e,t,n)=>Qe(I(e,`/backlog/${encodeURIComponent(t)}`),n).then(e=>e.item),artifacts:(e,t)=>Qe(I(e,`/artifacts`),t).then(e=>e.artifacts),artifact:(e,t,n)=>Qe(I(e,`/artifact?${new URLSearchParams({path:t})}`),n),artifactBlob:(e,t,n=!1,r)=>{let i=new URLSearchParams({path:t});return n&&i.set(`download`,`true`),nt(I(e,`/artifact/raw?${i}`),r)},gitDiff:(e,t)=>Qe(I(e,`/git-diff`),t),metrics:e=>Qe(`/api/metrics`,e),trash:(e=``,t=100,n=0,r)=>Qe(`/api/trash?${new URLSearchParams({query:e,limit:String(t),offset:String(n)})}`,r),restoreTrash:e=>F(`/api/trash/${encodeURIComponent(e)}/restore`),addTask:(e,t)=>F(I(e,`/tasks`),{text:t}).then(e=>e.item),abortMission:(e,t)=>F(I(e,`/mission/abort`),{reason:t}),answerPending:(e,t,n)=>F(I(e,`/backlog/${encodeURIComponent(t)}/answer`),{text:n}),resolveDecision:(e,t,n,r)=>F(I(e,`/decisions/${encodeURIComponent(t)}/resolve`),{option_id:n,note:r}),uploadAttachments:async(e,t,n)=>{await ot();let r=new FormData;return t.forEach(e=>r.append(`files`,e,e.name)),$e(I(e,`/attachments`),r,n)},message:(e,t,n)=>{let r=it(n)?n:n?.signal,i=it(n)?void 0:n?.attachments;return F(I(e,`/message`),at(t,i),r)},messageStream:async(e,t,n,r)=>{let i=it(r)?r:r?.signal,a=it(r)?void 0:r?.attachments,o=await fetch(I(e,`/message/stream`),{method:`POST`,headers:{"Content-Type":`application/json`,...We()},body:JSON.stringify(at(t,a)),signal:i});if(await je(o,`POST`,I(e,`/message/stream`)),!o.body)throw Error(`Manager stream returned no response body`);let s=!1,c=e=>{if(!i?.aborted){if(e.type===`phase`){let t=Number(e.quiet_s??0);n.onPhase?.(String(e.label??``),String(e.role??`manager`),{heartbeat:e.heartbeat===!0,quietS:Number.isFinite(t)?t:0,kind:String(e.kind??``),detail:String(e.detail??``)})}else e.type===`delta`?n.onDelta?.(String(e.text??``),String(e.message_id??``),String(e.fragment_mode??`auto`)):e.type===`done`?(s=!0,n.onDone?.(e.result??{})):e.type===`error`&&(s=!0,n.onError?.(Error(String(e.error??`stream error`))))}},l=o.body.getReader(),u=new TextDecoder,d=``;for(;;){let{done:e,value:t}=await l.read();if(e)break;d+=u.decode(t,{stream:!0});let n=st(d);d=n.rest,n.frames.forEach(c)}if(!i?.aborted&&(st(d+` - -`).frames.forEach(c),!s))throw Error(`Manager stream ended before a terminal event`)},nudge:(e,t)=>F(I(e,`/nudge`),{text:t}),note:(e,t)=>F(I(e,`/note`),{text:t}),previewPlan:(e,t)=>F(I(e,`/plan`),{text:t}),rewritePrompt:(e,t)=>F(I(e,`/prompt/rewrite`),{text:t}),setConfig:(e,t,n)=>F(I(e,`/config/set`),{name:t,value:n}),setBudgets:(e,t)=>F(I(e,`/config/budget`),{values:t}),setIdentity:(e,t)=>F(I(e,`/identity`),{text:t}),resetManager:e=>F(I(e,`/reset`)),skills:(e,t=`ls`)=>F(I(e,`/skills`),{args:t}).then(e=>e.text),setLaunchCwd:(e,t)=>F(I(e,`/launch-cwd`),{launch_cwd:t}),setWorkdir:(e,t)=>F(I(e,`/workdir`),{workdir:t}),disposeBacklog:(e,t,n)=>F(I(e,`/backlog/${encodeURIComponent(t)}/dispose`),{op:n}),stopBacklog:(e,t)=>F(I(e,`/backlog/${encodeURIComponent(t)}/stop`)),setContinuous:(e,t,n=``)=>F(I(e,`/continuous`),{enabled:t,objective:n}),startDaemon:(e,t)=>F(I(e,`/daemon/start`),{command_id:L(),expected_revision:t}).then(et),stopDaemon:(e,t=!1,n)=>F(I(e,`/daemon/stop`),{drain:t,command_id:L(),expected_revision:n}).then(et),replaceDaemon:(e,t,n=!1,r)=>F(I(e,`/daemon/replace`),{victim_sid:t,resume_continuous:n,command_id:L(),expected_revision:r}).then(et),upgradeDaemon:(e,t)=>F(I(e,`/daemon/upgrade`),{command_id:L(),expected_revision:t}).then(et)},ct=new Set([4401,4404]);function lt(e,t,n={}){let r=window.location.protocol===`https:`?`wss:`:`ws:`,i=new URLSearchParams;n.replay!=null&&i.set(`replay`,String(n.replay)),i.set(`view`,`ui`);let a=Ue();a&&i.set(`token`,a);let o=`${r}//${window.location.host}${I(e,`/stream`)}?${i}`,s=null,c=!1,l,u=()=>{c||(s=new WebSocket(o),s.onopen=()=>n.onOpen?.(),s.onmessage=e=>{try{let n=JSON.parse(e.data);n&&typeof n==`object`&&t(n)}catch{}},s.onclose=e=>{let t=!ct.has(e.code);n.onClose?.({code:e.code,reason:e.reason,retryable:t}),!c&&t&&(l=setTimeout(u,1e3))},s.onerror=()=>s?.close())};return u(),()=>{c=!0,l&&clearTimeout(l),s?.close()}}var z={accent:`rgb(var(--spectral-gold))`,success:`#7fa386`,error:`#c77b72`,warning:`rgb(var(--spectral-gold))`,info:`rgb(var(--spectral-blue))`,ink:`rgb(var(--ink))`,inkDim:`rgb(var(--ink-dim))`,inkFaint:`rgb(var(--ink-faint))`,role:{manager:`rgb(var(--role-manager))`,planner:`rgb(var(--role-planner))`,engineer:`rgb(var(--role-engineer))`,reviewer:`rgb(var(--role-reviewer))`}};function ut(e){switch(e){case`medium`:return z.inkDim;case`high`:return z.info;case`xhigh`:return z.accent;case`max`:return z.error;default:return z.inkFaint}}var dt=e=>String(e??``).trim(),ft=/^[a-z][a-z -]+ requires an operator-owned decision before continuing\.?$/i,pt=e=>{let t=dt(e);return ft.test(t)?``:t},mt=(e,t)=>{let n=/[\u3400-\u9fff]/.test(`${e}\n${t}`);return{id:`custom`,label:n?`自己输入`:`Write my own answer`,description:n?`直接告诉 Argus 你的决定。`:`Tell Argus your decision directly.`,requires_note:!0}};function ht(e,t){let n=[...e,...t],r=[],i=new Set;for(let e of n){let t=dt(e.id),n=e.operator_decision;if(n&&typeof n==`object`&&!Array.isArray(n)){let a=n,o=dt(a.id);if(!o||i.has(o)||dt(a.status)!==`pending`)continue;i.add(o);let s=dt(a.options_source)===`agent`&&Array.isArray(a.options)?a.options.filter(e=>!!dt(e?.id)&&!!dt(e?.label)).map(e=>({...e,requires_note:!1})):[];s.push(mt(dt(a.title),dt(a.question))),r.push({id:o,item_id:dt(a.item_id)||t,revision:Number(a.revision??1),status:`pending`,title:dt(a.title)||dt(e.title)||`Decision required`,reason:pt(a.reason),question:dt(a.question)||dt(e.pending_question),evidence:Array.isArray(a.evidence)?a.evidence.filter(e=>dt(e?.label)!==`Acceptance check`):[],options:s,options_source:s.length?`agent`:`none`,selected_option:``,note:``});continue}let a=dt(e.pending_question??e.question??e.text);if(!t||!a)continue;let o=`legacy-${t}`;i.has(o)||(i.add(o),r.push({id:o,item_id:t,revision:1,status:`pending`,title:dt(e.title??e.objective)||`Blocked task`,reason:``,question:a,evidence:[],options:[mt(dt(e.title??e.objective),a)],options_source:`none`,selected_option:``,note:``,legacy:!0}))}return r}var B={AGENT_IO_START:`agent.io.start`,AGENT_IO_STREAM:`agent.io.stream`,AGENT_IO_COMPLETE:`agent.io.complete`,AGENT_IO_ERROR:`agent.io.error`,USAGE_RECORDED:`usage.recorded`,PROVIDER_REQUEST_STARTED:`provider.request.started`,PROVIDER_REQUEST_COMPLETED:`provider.request.completed`,PROVIDER_REQUEST_DENIED:`provider.request.denied`,CODEX_UTIL_COMPLETED:`codex.util.completed`,SKILL_COST_COMPLETED:`skill.cost.completed`,BUDGET_RESERVATION_CREATED:`budget.reservation.created`,BUDGET_RESERVATION_DENIED:`budget.reservation.denied`,BUDGET_RESERVATION_SETTLED:`budget.reservation.settled`,BUDGET_RESERVATION_RELEASED:`budget.reservation.released`,BUDGET_UNPRICED_BLOCKED:`budget.unpriced.blocked`,LOOP_START:`loop.start`,LOOP_DONE:`loop.done`,ROUND_START:`round.start`,ROUND_MAIN_COMPLETED:`round.main.completed`,ROUND_REVIEW_STARTED:`round.review.started`,ROUND_REVIEW_DEFERRED:`round.review.deferred`,ROUND_REVIEW_COMPLETED:`round.review.completed`,ROUND_CHECKPOINT_RECORDED:`round.checkpoint.recorded`,ROUND_CHECKPOINT_FAILED:`round.checkpoint.failed`,ROUND_SECRET_REDACTED:`round.secret_redacted`,ROUND_ESCALATED:`round.escalated`,ROUND_STALL:`round.stall`,ROUND_REVIEWER_BACKEND_FAILURE:`round.reviewer_backend_failure`,ROLE_SESSION_TURN:`role.session.turn`,ENGINEER_PROGRESS:`engineer.progress`,ENGINEER_SELF_REVIEW_ACCEPTED:`engineer.self_review.accepted`,ENGINEER_SELF_REVIEW_REJECTED:`engineer.self_review.rejected`,ENGINEER_SKILL_MAINTENANCE_STARTED:`engineer.skill_maintenance.started`,ENGINEER_SKILL_MAINTENANCE_COMPLETED:`engineer.skill_maintenance.completed`,LIFE_STATUS:`life.status`,LIFE_PHASE_STARTED:`life.phase.started`,LIFE_MISSION_STARTED:`life.mission.started`,LIFE_MISSION_COMPLETED:`life.mission.completed`,LIFE_MISSION_FAILED:`life.mission.failed`,LIFE_MISSION_SKIPPED:`life.mission.skipped`,LIFE_MISSION_ORPHANED:`life.mission.orphaned`,LIFE_MISSION_REQUEUED:`life.mission.requeued`,LIFE_MANAGER_INTENT_STARTED:`life.manager.intent.started`,LIFE_MANAGER_INTENT_COMPLETED:`life.manager.intent.completed`,LIFE_MANAGER_INTENT_FAILED:`life.manager.intent.failed`,LIFE_MANAGER_STAGE_DECISION:`life.manager.stage_decision`,LIFE_MANAGER_PLAN_CHALLENGE_DECIDED:`life.manager.plan_challenge.decided`,LIFE_VERTICAL_RESOLVED:`life.vertical.resolved`,LIFE_PLANNER_START:`life.planner.start`,LIFE_PLANNER_TASK_ADDED:`life.planner.task_added`,LIFE_PLANNER_TASK_SKIPPED:`life.planner.task_skipped`,LIFE_PLANNER_VERDICT:`life.planner.verdict`,LIFE_PLANNER_WAITING:`life.planner.waiting`,LIFE_PLANNER_WAITING_WOKEN:`life.planner.waiting_woken`,LIFE_PLANNER_TERMINAL_IDLE:`life.planner.terminal_idle`,LIFE_PLANNER_VERIFICATION_PROBE:`life.planner.verification_probe`,LIFE_PLANNER_STALL_ESCALATION:`life.planner.stall_escalation`,LIFE_PLANNER_ERROR:`life.planner.error`,LIFE_PLAN_SIGNAL:`life.plan.signal`,LIFE_PLAN_REVISION_PROPOSED:`life.plan.revision.proposed`,LIFE_PLAN_REVISION_REJECTED:`life.plan.revision.rejected`,LIFE_PLAN_REVISION_COMMITTED:`life.plan.revision.committed`,LIFE_PLAN_NODE_SUPERSEDED:`life.plan.node.superseded`,LIFE_BUDGET_PAUSE:`life.budget.pause`,LIFE_LIFECYCLE_BLOCK:`life.lifecycle.block`,LIFE_LIFECYCLE_TRANSITION:`life.lifecycle.transition`,LIFE_INBOX_QUEUED:`life.inbox.queued`,LIFE_INBOX_DRAINED:`life.inbox.drained`,LIFE_OPERATOR_QUESTION_PENDING:`life.operator_question.pending`,LIFE_OPERATOR_QUESTION_ANSWERED:`life.operator_question.answered`,LIFE_DAEMON_IDLE_TIMEOUT:`life.daemon.idle_timeout`,PROJECT_COMPLETED:`project.completed`,PROJECT_COMPLETION_REFUSED:`project.completion_refused`,DAEMON_PARKED:`daemon.parked`,DAEMON_COMMAND_SUBMITTED:`daemon.command.submitted`,DAEMON_COMMAND_COMPLETED:`daemon.command.completed`,DAEMON_COMMAND_REJECTED:`daemon.command.rejected`,IDEA_SEARCH_STARTED:`idea.search.started`,IDEA_SEARCH_COMPLETED:`idea.search.completed`,IDEA_SEARCH_SKIPPED:`idea.search.skipped`,VENUE_RESEARCH_STARTED:`venue.research.started`,VENUE_RESEARCH_COMPLETED:`venue.research.completed`,RESEARCH_ACHIEVEMENT_CERTIFIED:`research.achievement.certified`,SKILL_LIBRARY_AVAILABLE:`skill.library.available`,SKILL_CREATED:`skill.created`,SKILL_UPDATED:`skill.updated`,SKILL_ARCHIVED:`skill.archived`,SKILL_OUTCOME:`skill.outcome`,SKILL_TRANSFER_STARTED:`skill.transfer.started`,SKILL_TRANSFER_COMPLETED:`skill.transfer.completed`,SKILL_SCIENTIST_STARTED:`skill.scientist.started`,SKILL_SCIENTIST_CREATED:`skill.scientist.created`,SKILL_SCIENTIST_ADAPTATION_STARTED:`skill.scientist.adaptation_started`,SKILL_SCIENTIST_ADAPTATION_CREATED:`skill.scientist.adaptation_created`,SKILL_TIDIED:`skill.tidied`,SKILL_COMPACTED:`skill.compacted`,SKILL_COMPACT_ERROR:`skill.compact.error`,SKILL_OP_ERROR:`skill.op.error`,SKILL_OP_REFUSED:`skill.op.refused`,SKILL_PROPOSAL_REJECTED:`skill.proposal.rejected`,SKILL_DISTILL_REJECTED:`skill.distill.rejected`,SKILL_REVISED:`skill.revised`,SKILL_USE_RECORDED:`skill.use.recorded`,SKILL_HISTORY_COMPRESSED:`skill.history.compressed`,SKILL_EVOLUTION_COMPLETED:`skill.evolution.completed`,WIKI_INITIALIZED:`wiki.initialized`,WIKI_INITIALIZATION_FAILED:`wiki.initialization.failed`,WIKI_HOOK_OK:`wiki.hook.ok`,WIKI_HOOK_WARNING:`wiki.hook.warning`,WIKI_COMPACTED:`wiki.compacted`,WIKI_COMPACT_ERROR:`wiki.compact.error`,WIKI_CREATED:`wiki.created`,WIKI_UPDATED:`wiki.updated`,WIKI_RETIRED:`wiki.retired`,WIKI_SOURCE_CREATED:`wiki.source.created`,WIKI_SOURCE_SKIPPED:`wiki.source.skipped`,WIKI_PROMOTION_PROMOTED:`wiki.promotion.promoted`,WIKI_PROMOTION_DEMOTED:`wiki.promotion.demoted`,WIKI_RETIRED_COMPRESSED:`wiki.retired.compressed`,WIKI_EVOLUTION_COMPLETED:`wiki.evolution.completed`,OPERATOR_ALERT:`operator_alert`},gt={"loop.started":B.LOOP_START,"loop.completed":B.LOOP_DONE,"round.started":B.ROUND_START,"mission.started":B.LIFE_MISSION_STARTED,"mission.completed":B.LIFE_MISSION_COMPLETED,"mission.error":B.LIFE_MISSION_FAILED};B.LOOP_START,B.LOOP_DONE,B.ROUND_START,B.ROUND_MAIN_COMPLETED,B.ROUND_REVIEW_DEFERRED,B.ROUND_REVIEW_COMPLETED,B.ROUND_CHECKPOINT_RECORDED,B.ROUND_CHECKPOINT_FAILED,B.ROUND_SECRET_REDACTED,B.ROUND_ESCALATED,B.ROUND_STALL,B.ROUND_REVIEWER_BACKEND_FAILURE,B.ENGINEER_SELF_REVIEW_ACCEPTED,B.ENGINEER_SELF_REVIEW_REJECTED,B.ENGINEER_SKILL_MAINTENANCE_STARTED,B.ENGINEER_SKILL_MAINTENANCE_COMPLETED,B.SKILL_LIBRARY_AVAILABLE,B.SKILL_CREATED,B.SKILL_UPDATED,B.SKILL_ARCHIVED,B.SKILL_OUTCOME,B.SKILL_TRANSFER_STARTED,B.SKILL_TRANSFER_COMPLETED,B.SKILL_SCIENTIST_STARTED,B.SKILL_SCIENTIST_CREATED,B.SKILL_SCIENTIST_ADAPTATION_STARTED,B.SKILL_SCIENTIST_ADAPTATION_CREATED,B.SKILL_TIDIED,B.SKILL_COMPACTED,B.SKILL_COMPACT_ERROR,B.SKILL_OP_ERROR,B.SKILL_OP_REFUSED,B.SKILL_PROPOSAL_REJECTED,B.SKILL_DISTILL_REJECTED,B.SKILL_REVISED,B.SKILL_USE_RECORDED,B.SKILL_HISTORY_COMPRESSED,B.SKILL_EVOLUTION_COMPLETED,B.WIKI_INITIALIZED,B.WIKI_INITIALIZATION_FAILED,B.WIKI_HOOK_OK,B.WIKI_HOOK_WARNING,B.WIKI_COMPACTED,B.WIKI_COMPACT_ERROR,B.WIKI_CREATED,B.WIKI_UPDATED,B.WIKI_RETIRED,B.WIKI_SOURCE_CREATED,B.WIKI_SOURCE_SKIPPED,B.WIKI_PROMOTION_PROMOTED,B.WIKI_PROMOTION_DEMOTED,B.WIKI_RETIRED_COMPRESSED,B.WIKI_EVOLUTION_COMPLETED,B.LIFE_MISSION_STARTED,B.LIFE_MISSION_COMPLETED,B.LIFE_MANAGER_INTENT_STARTED,B.LIFE_MANAGER_INTENT_COMPLETED,B.LIFE_MANAGER_INTENT_FAILED,B.LIFE_MANAGER_STAGE_DECISION,B.LIFE_MANAGER_PLAN_CHALLENGE_DECIDED,B.LIFE_VERTICAL_RESOLVED,B.LIFE_PLANNER_START,B.LIFE_PLANNER_TASK_ADDED,B.LIFE_PLANNER_TASK_SKIPPED,B.LIFE_PLANNER_VERDICT,B.LIFE_PLANNER_WAITING,B.LIFE_PLANNER_WAITING_WOKEN,B.LIFE_PLANNER_TERMINAL_IDLE,B.LIFE_PLANNER_VERIFICATION_PROBE,B.LIFE_PLANNER_STALL_ESCALATION,B.LIFE_PLAN_SIGNAL,B.LIFE_PLAN_REVISION_PROPOSED,B.LIFE_PLAN_REVISION_REJECTED,B.LIFE_PLAN_REVISION_COMMITTED,B.LIFE_PLAN_NODE_SUPERSEDED,B.LIFE_BUDGET_PAUSE,B.BUDGET_RESERVATION_DENIED,B.BUDGET_UNPRICED_BLOCKED,B.LIFE_LIFECYCLE_BLOCK,B.LIFE_LIFECYCLE_TRANSITION,B.PROVIDER_REQUEST_STARTED,B.PROVIDER_REQUEST_COMPLETED,B.PROVIDER_REQUEST_DENIED,B.LIFE_INBOX_QUEUED,B.LIFE_INBOX_DRAINED,B.LIFE_DAEMON_IDLE_TIMEOUT,B.PROJECT_COMPLETED,B.PROJECT_COMPLETION_REFUSED,B.DAEMON_PARKED,B.DAEMON_COMMAND_COMPLETED,B.DAEMON_COMMAND_REJECTED,B.IDEA_SEARCH_STARTED,B.IDEA_SEARCH_COMPLETED,B.IDEA_SEARCH_SKIPPED,B.VENUE_RESEARCH_STARTED,B.VENUE_RESEARCH_COMPLETED,B.RESEARCH_ACHIEVEMENT_CERTIFIED,B.OPERATOR_ALERT,B.AGENT_IO_START,B.AGENT_IO_COMPLETE,B.AGENT_IO_ERROR,B.PROVIDER_REQUEST_STARTED,B.PROVIDER_REQUEST_COMPLETED,B.PROVIDER_REQUEST_DENIED,B.USAGE_RECORDED;function _t(e){let t=String(e??``).trim();return gt[t]??t}function vt(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(vt).join(`,`)}]`;let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${vt(t[e])}`).join(`,`)}}`}function yt(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function bt(e){let t=e.event_id??e.id??e.seq??e._offset,n=String(e.type??`event`);return t!=null&&t!==``?`${n}-${String(t)}`:`${n}-${String(e.ts??e.time??``)}-${yt(vt(e))}`}function xt(e){return e.type===B.ENGINEER_PROGRESS&&e.kind===`reasoning`}function St(e){if(e.type!==B.ENGINEER_PROGRESS||![`assistant_message`,`agent_message`,`message`].includes(String(e.kind??``)))return!1;let t=String(e.agent_layer??e.actor??``);return String(e.text??``).trimStart().startsWith(`{`)?t===`reviewer`||t===`planner`:!1}var Ct=/^(?:MILESTONE_STATUS|OPERATOR_QUESTION|OPERATOR_OPTIONS)\s*=/i;function wt(e){return String(e??``).split(/\r?\n/).filter(e=>!Ct.test(e.trim())).join(` -`).trim()}function Tt(e){let t=String(e.fragment_mode??``);return t===`append`||t===`snapshot`?t:e.replace===!0?`snapshot`:`auto`}function Et(e,t){let n=Math.min(e.length,t.length);for(let r=n;r>=8;--r)if(e.endsWith(t.slice(0,r)))return r;return 0}function Dt(e,t,n=`auto`){let r=(e||``).trim(),i=(t||``).trim();if(!r)return i;if(!i)return r;if(n===`snapshot`)return i;if(r.includes(i))return r;if(n===`append`)return`${r}\n${i}`;if(i.includes(r))return i;let a=Et(r,i);return a?`${r}${i.slice(a)}`:`${r}\n${i}`}var Ot=[`all`,`attention`,`milestones`,`messages`],kt=new Set([B.LIFE_MISSION_STARTED,B.LIFE_MISSION_COMPLETED,B.LIFE_MISSION_FAILED,B.LOOP_START,B.LOOP_DONE,B.LIFE_PLANNER_VERDICT,`final.report.ready`,`pptx.report.ready`,`plan.completed`,B.LIFE_BUDGET_PAUSE,B.LIFE_LIFECYCLE_BLOCK]);function At(e,t,n=`all`,r=``){let i=_t(e.canonical_type??e.type),a=String(e.kind??``);if(n===`attention`&&![`warn`,`err`].includes(String(t.tone??``))&&e.operator_alert!==!0||n===`milestones`&&!(t.rule&&!i.startsWith(`ui.`))&&!kt.has(i)||n===`messages`&&t.tone!==`bright`&&![`assistant_message`,`agent_message`,`message`].includes(a)&&![`ui.operator`,`ui.argus`].includes(i))return!1;let o=r.trim().toLocaleLowerCase();return!o||[i,a,t.role,t.label,t.text,e.title,e.objective,e.text,e.summary,e.reason,e.error,e.status,e.action_summary,e.command,e.path,Array.isArray(e.tags)?e.tags.join(` `):e.tags].some(e=>String(e??``).toLocaleLowerCase().includes(o))}var jt=[{id:`status`,name:`/status`,argument:`none`,desc:`roles, queued work, journal, and health`,group:`Everyday`,kind:`panel`},{id:`roles`,name:`/roles`,argument:`none`,desc:`per-role backend / model / effort + live activity`,group:`Everyday`,kind:`panel`},{id:`journal`,name:`/journal`,arg:`[N]`,argument:`optional`,desc:`recent journal entries (default 10)`,group:`Everyday`,kind:`panel`},{id:`backlog`,name:`/backlog`,arg:`[all]`,argument:`optional`,desc:`pending tasks (all = incl. done/skipped)`,group:`Everyday`,kind:`panel`},{id:`artifacts`,name:`/artifacts`,argument:`none`,desc:`reviewer-approved result files (Enter previews)`,group:`Everyday`,kind:`panel`},{id:`artifact`,name:`/artifact`,arg:``,argument:`required`,desc:`preview one approved result file`,group:`Everyday`,kind:`panel`},{id:`events`,name:`/events`,arg:`[filter] [query]`,argument:`optional`,desc:`search feed: all / watch / milestones / messages`,group:`Everyday`,kind:`panel`},{id:`find`,name:`/find`,arg:``,argument:`required`,desc:`search the current event buffer`,group:`Everyday`,kind:`panel`},{id:`cancel`,name:`/cancel`,argument:`none`,desc:`stop waiting for the current Manager reply`,group:`Everyday`,kind:`local`},{id:`ask`,name:`/ask`,arg:``,argument:`required`,desc:`answer inline — no task queued, no Planner/Engineer/Reviewer`,aliases:[`/chat`],group:`Everyday`,kind:`action`},{id:`task`,name:`/task`,arg:``,argument:`required`,desc:`queue work directly`,aliases:[`/add`],group:`Task management`,kind:`action`},{id:`plan`,name:`/plan`,arg:``,argument:`required`,desc:`preview a Planner-authored execution plan`,group:`Task management`,kind:`action`},{id:`rewrite`,name:`/rewrite`,arg:`[text]`,argument:`optional`,desc:`let the Manager rewrite your prompt before sending`,aliases:[`/refine`],group:`Task management`,kind:`action`},{id:`nudge`,name:`/nudge`,arg:``,argument:`required`,desc:`inject guidance into the running mission`,aliases:[`/inject`,`/notify`],group:`Task management`,kind:`action`},{id:`abort`,name:`/abort`,argument:`none`,desc:`immediately stop the running mission`,group:`Task management`,kind:`action`},{id:`note`,name:`/note`,arg:``,argument:`required`,desc:`append a manual note to the timeline`,group:`Task management`,kind:`action`},{id:`done`,name:`/done`,arg:``,argument:`required`,desc:`mark a task done`,group:`Task management`,kind:`action`},{id:`skip`,name:`/skip`,arg:``,argument:`required`,desc:`skip a task`,aliases:[`/rm`],group:`Task management`,kind:`action`},{id:`stop`,name:`/stop`,arg:``,argument:`required`,desc:`stop a task's auto-iteration`,group:`Task management`,kind:`action`},{id:`item`,name:`/item`,arg:``,argument:`required`,desc:`inspect a full task contract`,group:`Task management`,kind:`panel`},{id:`run`,name:`/run`,argument:`none`,desc:`return to the always-live mission feed`,group:`Task management`,kind:`local`},{id:`new`,name:`/new`,arg:`[objective]`,argument:`optional`,desc:`review, create, and switch to a fresh conversation`,group:`Sessions & diagnostics`,kind:`action`},{id:`daemons`,name:`/daemons`,arg:`[query]`,argument:`optional`,desc:`find every session + switch or create`,group:`Sessions & diagnostics`,kind:`panel`},{id:`resume`,name:`/resume`,arg:`[list|]`,argument:`optional`,desc:`switch to another project/session`,group:`Sessions & diagnostics`,kind:`action`},{id:`attach`,name:`/attach`,arg:``,argument:`required`,desc:`follow another project (read the stream)`,group:`Sessions & diagnostics`,kind:`action`},{id:`rename`,name:`/rename`,arg:``,argument:`required`,desc:`rename the current conversation`,group:`Sessions & diagnostics`,kind:`action`},{id:`doctor`,name:`/doctor`,argument:`none`,desc:`diagnose 'why isn't anything running'`,group:`Sessions & diagnostics`,kind:`panel`},{id:`backend`,name:`/backend`,arg:`[codex|claude|copilot|opencode|pi|grok]`,argument:`optional`,desc:`view or change the shared runner backend`,group:`Configuration`,kind:`action`},{id:`config`,name:`/config`,arg:`[key=value …]`,argument:`optional`,desc:`view or change runtime settings`,group:`Configuration`,kind:`panel`},{id:`identity`,name:`/identity`,arg:`[set ]`,argument:`optional`,desc:`view or replace the operator identity card`,group:`Configuration`,kind:`panel`},{id:`reset`,name:`/reset`,argument:`none`,desc:`drop the warm Manager conversation context`,group:`Configuration`,kind:`action`},{id:`skills`,name:`/skills`,arg:`[ls|promote ]`,argument:`optional`,desc:`inspect or promote runtime skills`,group:`Configuration`,kind:`action`},{id:`clear`,name:`/clear`,argument:`none`,desc:`clear the event feed view`,group:`Other`,kind:`local`},{id:`reconnect`,name:`/reconnect`,argument:`none`,desc:`reconnect the live event stream`,group:`Other`,kind:`local`},{id:`help`,name:`/help`,argument:`none`,desc:`keys + full command reference`,aliases:[`/?`,`/commands`],group:`Other`,kind:`local`},{id:`quit`,name:`/quit`,argument:`none`,desc:`leave the cockpit (background work keeps running)`,aliases:[`/exit`,`/q`],group:`Other`,kind:`local`}];new Map(jt.map(e=>[e.id,e]));var Mt=new Map;for(let e of jt)for(let t of[e.name,...e.aliases??[]])Mt.set(t.toLowerCase(),e);function Nt(e){return e.argument===`required`}var Pt=/^\/[A-Za-z0-9_-]+$/;function Ft(e){if(!e.startsWith(`/`))return!1;let t=e.indexOf(` `),n=t===-1?e:e.slice(0,t);return Pt.test(n)}function It(e){return e.startsWith(`/`)&&!e.includes(` `)&&!e.slice(1).includes(`/`)}function Lt(e){if(!It(e))return[];let t=e.toLowerCase(),n=new Set,r=[];for(let e of jt)[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t))&&!n.has(e.name)&&(n.add(e.name),r.push(e));return r.sort((e,n)=>Number(Rt(n,t))-Number(Rt(e,t)))}function Rt(e,t){return[e.name,...e.aliases??[]].some(e=>e.toLowerCase()===t)}function zt(e){return e.arg?`${e.name} `:e.name}function Bt(e){let t=e.trim();if(!t)return{filter:`all`,query:``};let[n,...r]=t.split(/\s+/);return n.toLowerCase()===`watch`?{filter:`attention`,query:r.join(` `)}:Ot.includes(n.toLowerCase())?{filter:n.toLowerCase(),query:r.join(` `)}:{filter:`all`,query:t}}function V(e){if(!Ft(e))return null;let t=e.indexOf(` `),n=(t===-1?e:e.slice(0,t)).toLowerCase(),r=t===-1?``:e.slice(t+1).trim(),i=Mt.get(n)??null;return{cmd:i,name:i?i.name:n,rest:r}}function Vt(e){let t=e.toLowerCase(),n=null,r=0;for(let e of Mt.keys()){let i=Ht(t,e);i>r&&(r=i,n=Mt.get(e).name)}return r>=.6?n:null}function Ht(e,t){return 1-Ut(e,t)/(Math.max(e.length,t.length)||1)}function Ut(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},(e,t)=>[t,...Array(r).fill(0)]);for(let e=0;e<=r;e+=1)i[0][e]=e;for(let a=1;a<=n;a+=1)for(let n=1;n<=r;n+=1)i[a][n]=Math.min(i[a-1][n]+1,i[a][n-1]+1,i[a-1][n-1]+(e[a-1]===t[n-1]?0:1));return i[n][r]}function Wt(e){let t=(e.label||e.display_name||``).trim();return!!(t&&t!==e.id)}function Gt(e){return[...e].sort((e,t)=>{if(e.daemon_alive!==t.daemon_alive)return e.daemon_alive?-1:1;let n=Wt(e);return n===Wt(t)?(t.last_active||0)-(e.last_active||0):n?-1:1})}function Kt(e){return Gt(e)[0]}function qt(e,t){let n=t?.trim()||null;return n&&e.some(e=>e.id===n)?{id:n,requested:n,recovered:!1}:{id:Kt(e)?.id??null,requested:n,recovered:!!n}}function Jt(e,t,n){if(n){let e=t?.trim()||null;return{id:e,requested:e,recovered:!1}}return qt(e,t)}function Yt(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;let r=e.daemon_alive?`live running`:`stopped idle`,i=[e.id,e.label,e.display_name,e.objective,r].filter(Boolean).join(` `).toLowerCase();return n.every(e=>i.includes(e))}function Xt(e,t){return e.filter(e=>Yt(e,t))}var Zt=new Set([`done`,`success`,`completed`]),Qt=new Set([`research_incomplete`,`paused_no_breakthrough`,`exhausted_current_methods`]),$t=new Set([`no_progress`,`max_rounds`]),en=new Set([`blocked`,`infra_blocked`]),tn=new Set([`error`,`failed`,`supervisor_error`]),nn={completed:{glyph:`🎉`,tone:`ok`,missionStatus:`complete`},incomplete:{glyph:`◌`,tone:`warn`,missionStatus:`incomplete`},stalled:{glyph:`⏸`,tone:`warn`,missionStatus:`stalled`},blocked:{glyph:`⛔`,tone:`err`,missionStatus:`blocked`},failed:{glyph:`💥`,tone:`err`,missionStatus:`failed`},ended:{glyph:`■`,tone:`info`,missionStatus:`ended`}},rn={completed:`Task completed`,incomplete:`Mission incomplete`,stalled:`Mission stalled`,blocked:`Mission blocked`,failed:`Mission failed`,ended:`Mission ended`};function an(e){return String(e??``).trim().toLowerCase()}function on(e){let t=an(e);switch(t){case`completed`:case`incomplete`:case`stalled`:case`blocked`:case`failed`:case`ended`:return t;default:return null}}function sn(e){let t=an(e.status);return e.success===!0||Zt.has(t)?`completed`:Qt.has(t)?`incomplete`:$t.has(t)?`stalled`:en.has(t)?`blocked`:tn.has(t)?`failed`:`ended`}function cn(e){let t=e.outcome;if(t&&typeof t==`object`&&!Array.isArray(t)){let n=t;return{execution_status:an(n.execution_status)||sn(e),review_status:an(n.review_status)||`not_assessed`,stage_certification:an(n.stage_certification)||`not_assessed`,interruption_kind:an(n.interruption_kind)||`none`,resumable:n.resumable===!0}}return{execution_status:sn(e),review_status:`not_assessed`,stage_certification:`not_assessed`,interruption_kind:an(e.stop_kind)||`none`,resumable:e.resumable===!0}}function ln(e){return e?.execution_status?[`execution=${e.execution_status}`,e.review_status&&e.review_status!==`not_assessed`?`review=${e.review_status}`:``,e.stage_certification&&e.stage_certification!==`not_assessed`?`stage=${e.stage_certification}`:``,e.interruption_kind&&e.interruption_kind!==`none`?`interrupt=${e.interruption_kind}`:``,e.resumable?`resumable=yes`:``].filter(Boolean):[]}function un(e){let t=on(e.outcome_class)??sn(e),n=String(e.status??``).trim(),r=nn[t];return{outcomeClass:t,label:t===`completed`&&e.final_submission_certified===!0?`Submission certified`:t===`ended`&&n?`Mission ended · ${n}`:rn[t],glyph:r.glyph,tone:r.tone,missionStatus:r.missionStatus}}var dn=[`manager`,`planner`,`engineer`,`reviewer`],fn=new Set([`planner`,`engineer`,`reviewer`]),pn=new Set([`running`,`in_progress`,`claimed`]),H=(e,t)=>String(e[t]??``).trim(),mn=(e,t)=>{let n=Number(e[t]);return Number.isFinite(n)?n:null};function hn(e){let t=[e.route?e.route.toUpperCase():``,e.vertical,e.workflow_mode?e.workflow_mode.toUpperCase():``].filter(Boolean);return e.lifetime===`standing`?t.push(`STANDING · OPEN-ENDED`):e.lifetime===`bounded_increment`?t.push(`BOUNDED INCREMENT`):e.lifetime===`bounded`&&e.continuous?t.push(`BOUNDED · FINITE CONTINUOUS`):e.lifetime&&t.push(e.lifetime.toUpperCase()),t.join(` · `)}function gn(e){return JSON.parse(JSON.stringify(e))}function _n(){return{schema_version:5,bootstrapped:!1,mission:{id:``,title:``,objective:``,summary:``,status:`idle`,started_at:null,completed_at:null,elapsed_seconds:0,campaign_started_at:null,campaign_elapsed_seconds:0},stage:{id:``,label:``},routing:{route:``,vertical:``,workflow_mode:``,lifetime:``,continuous:!1,open_ended:!1},round:{current:0,max:0},active_role:``,roles:dn.map(e=>({role:e,status:`waiting`,label:`Waiting`,updated_at:0})),role_work:[],dag:[],timeline:[],artifacts:[],learned_skills:[],learned_wiki_pages:[],storage:{project_skill_dir:``,global_skill_dir:``,project_skill_count:0,global_skill_count:0,skill_history_compressed:0,wiki_retired_compressed:0,skill_history_bytes_saved:0,wiki_retired_bytes_saved:0,wiki_paths:[]},achievement:null,review:{status:``,reason:``,rejected_attempts:0},frontier:{change:``,summary:``,updated_at:0},outcome:{},last_event_ts:0,updated_at:0}}function vn(e,t,n,r){if(n==null||n===``)return;let i=e.findIndex(e=>e[t]===n);i>=0?e[i]={...e[i],...r}:e.push(r)}function U(e,t,n,r,i){if(!dn.includes(t))return;n===`active`&&fn.has(t)&&e.roles.forEach(e=>{fn.has(e.role)&&e.role!==t&&e.status===`active`&&Object.assign(e,{status:`done`,label:`Handed off`,updated_at:i})});let a={role:t,status:n,label:r,updated_at:i};vn(e.roles,`role`,t,a),n===`active`?e.active_role=t:e.active_role===t&&(e.active_role=``)}function yn(e,t,n,r,i=``,a=`neutral`){let o=bt(t);if(e.timeline.some(e=>e.id===o))return;let s={id:o,ts:Number(t.ts??Date.now()/1e3),type:_t(t.type),role:n,title:r.slice(0,180),detail:i.slice(0,500),tone:a};[`item_id`,`branch_id`].forEach(e=>{let n=H(t,e);n&&(s[e]=n)}),e.timeline=[...e.timeline,s].slice(-120)}function bn(e,t,n,r,i,a=``,o=``){if(!dn.includes(n))return;let s=H(t,`message_id`),c=s?`${n}:${s}`:bt(t),l=e.role_work.find(e=>e.id===c),u=l&&l.detail.length>a.length?l.detail:a,d={id:c,ts:Number(t.ts??Date.now()/1e3),role:n,kind:r,title:i.slice(0,240),detail:u.slice(0,4e3),status:o,item_id:H(t,`item_id`),mission_id:e.mission.id,mission_title:e.mission.title.slice(0,240),round_index:mn(t,`round_index`)},f=e.role_work.findIndex(e=>e.id===c);f>=0?e.role_work[f]=d:e.role_work.push(d);let p=new Set;dn.forEach(t=>{e.role_work.filter(e=>e.role===t).slice(-40).forEach(e=>p.add(e.id))}),e.role_work=e.role_work.filter(e=>p.has(e.id))}function xn(e){return e===`ok`?`success`:e===`err`?`error`:`info`}var Sn={agent_message:`Reporting progress`,assistant_message:`Reporting progress`,command_execution:`Running a command`,reasoning:`Reasoning`,tool_use:`Using a tool`,tool_result:`Inspecting tool output`,codex_idle:`Waiting for model output`};function Cn(e,t){let n=_t(t.type),r=Number(t.ts??Date.now()/1e3);if(e.last_event_ts=Math.max(e.last_event_ts,r),n===B.LIFE_MANAGER_INTENT_STARTED)e.mission.id=H(t,`item_id`)||H(t,`intent_id`),e.mission.title=H(t,`objective`).slice(0,240),e.mission.objective=H(t,`objective`),e.mission.status=`grounding`,U(e,`manager`,`active`,`Grounding project`,r),yn(e,t,`manager`,`Project grounding started`,H(t,`objective`)),bn(e,t,`manager`,`grounding`,`Grounding project`,H(t,`objective`),`active`);else if(n===B.LIFE_MANAGER_INTENT_COMPLETED){e.mission.id=H(t,`item_id`),e.mission.title=H(t,`objective`).slice(0,240),e.mission.objective=H(t,`objective`),e.mission.status=`framed`,e.routing.route=H(t,`route`)||e.routing.route||`team`,e.routing.vertical=H(t,`vertical`)||e.routing.vertical,e.routing.workflow_mode=H(t,`workflow_mode`)||e.routing.workflow_mode,e.routing.lifetime=H(t,`lifetime`)||e.routing.lifetime,`continuous`in t&&(e.routing.continuous=t.continuous===!0),`open_ended`in t&&(e.routing.open_ended=t.open_ended===!0);let n=H(t,`current_stage`),i=Array.isArray(t.stages)?t.stages:[];if(n)e.stage={id:n,label:n.replaceAll(`_`,` `)};else if(!e.stage.id&&i[0]){let t=String(i[0]);e.stage={id:t,label:t.replaceAll(`_`,` `)}}U(e,`manager`,`done`,`Goal framed`,r),yn(e,t,`manager`,`Goal framed`,H(t,`reason`),`success`),bn(e,t,`manager`,`decision`,`Goal framed`,H(t,`reason`)||H(t,`execution_task`),`done`)}else if(n===B.LIFE_MANAGER_INTENT_FAILED)e.mission.status=`failed`,U(e,`manager`,`error`,`Manager routing failed`,r),yn(e,t,`manager`,`Manager routing failed`,H(t,`error`)||H(t,`reason`),`error`),bn(e,t,`manager`,`grounding`,`Manager routing failed`,H(t,`error`)||H(t,`reason`),`error`);else if(n===B.LIFE_MANAGER_STAGE_DECISION){let n=H(t,`target_stage`)||H(t,`stage`)||H(t,`current_stage`);n&&(e.stage={id:n,label:n.replaceAll(`_`,` `)}),U(e,`manager`,`done`,n?`Stage · ${n}`:`Stage reviewed`,r),yn(e,t,`manager`,n?`Stage → ${n}`:`Stage reviewed`,H(t,`reason`)),bn(e,t,`manager`,`stage_decision`,n?`Stage → ${n}`:`Stage reviewed`,H(t,`reason`),H(t,`action`))}else if(n===B.LIFE_PLANNER_START)U(e,`planner`,`active`,`Planning next work`,r),bn(e,t,`planner`,`planning`,`Planning next work`,H(t,`objective`),`active`);else if(n===B.LIFE_PLANNER_TASK_ADDED){let n=H(t,`item_id`),i={id:n,title:H(t,`title`),objective:H(t,`objective`),status:`pending`,deps:Array.isArray(t.deps)?t.deps.map(String):[],branch_id:H(t,`branch_id`)||n,parent_branch_id:H(t,`parent_branch_id`)||null};vn(e.dag,`id`,n,i),U(e,`planner`,`done`,`Research branch added`,r),yn(e,t,`planner`,`Research branch added`,i.title,`info`),bn(e,t,`planner`,`task`,i.title||`Task added`,i.objective,`pending`)}else if(n===B.LIFE_PLANNER_VERDICT){let n=!!t.project_done,i=n?`Project reviewed`:`Planning complete`;U(e,`planner`,`done`,i,r),yn(e,t,`planner`,i,H(t,`reason`),n?`success`:`neutral`),bn(e,t,`planner`,`verdict`,i,H(t,`reason`),n?`done`:`planned`)}else if(n===B.LIFE_PLANNER_WAITING){U(e,`planner`,`waiting`,`Waiting on external work`,r);let n=H(t,`reason`)||H(t,`waiting_reason`);yn(e,t,`planner`,`Planner waiting`,n),bn(e,t,`planner`,`waiting`,`Planner waiting`,n,`waiting`)}else if(n===B.LIFE_MISSION_STARTED)e.review={status:``,reason:``,rejected_attempts:0},e.mission.campaign_started_at??=r,e.mission={...e.mission,id:H(t,`item_id`),title:H(t,`title`),objective:H(t,`objective`),summary:``,status:`working`,started_at:r,completed_at:null},U(e,`reviewer`,`waiting`,`Awaiting engineer handoff`,r),U(e,`engineer`,`active`,`Starting mission`,r),yn(e,t,`engineer`,`Mission started`,H(t,`title`),`info`),bn(e,t,`engineer`,`task`,H(t,`title`)||`Mission started`,H(t,`objective`),`active`);else if(n===B.ROUND_START)e.round={current:mn(t,`round_index`)??0,max:mn(t,`round_max`)??e.round.max},U(e,`engineer`,`active`,`Running round ${e.round.current}`,r),yn(e,t,`engineer`,`Round ${e.round.current} started`);else if(n===B.ENGINEER_PROGRESS){let n=H(t,`agent_layer`)||H(t,`actor`)||`engineer`,i=n===`main`?`engineer`:n,a=H(t,`kind`),o=Sn[a]??`Working`;U(e,i,`active`,o,r);let s=H(t,`action_summary`)||H(t,`text`);s&&!xt(t)&&!St(t)&&bn(e,t,i,a||`progress`,o,s,`active`),[`reasoning`,`assistant_message`,`agent_message`].includes(a)||yn(e,t,i,o,H(t,`action_summary`)||H(t,`text`))}else if(n===B.ROUND_MAIN_COMPLETED)U(e,`engineer`,`done`,`Engineer handoff ready`,r),bn(e,t,`engineer`,`handoff`,`Engineer handoff ready`,H(t,`text`)||H(t,`summary`),`done`);else if(n===B.ROUND_REVIEW_STARTED)U(e,`reviewer`,`active`,`Reviewing benchmark evidence`,r),bn(e,t,`reviewer`,`review`,`Review started`,``,`active`);else if(n===B.ROUND_REVIEW_DEFERRED){let n=H(t,`next_step`);U(e,`engineer`,`active`,`Continuing before review`,r),U(e,`reviewer`,`waiting`,`Review deferred for one round`,r),yn(e,t,`engineer`,`Continued before review`,n,`info`)}else if(n===B.ROUND_REVIEW_COMPLETED){let n=H(t,`status`),i=H(t,`reason`);e.review={status:n,reason:i,rejected_attempts:e.review.rejected_attempts+ +!![`continue`,`blocked`].includes(n)};let a=H(t,`frontier_change`);a&&(e.frontier={change:a,summary:H(t,`frontier_summary`),updated_at:r}),U(e,`reviewer`,n===`done`?`done`:`rejected`,n===`done`?`Accepted evidence`:`Requested another attempt`,r),yn(e,t,`reviewer`,n===`done`?`Evidence accepted`:`Attempt rejected`,i,n===`done`?`success`:`error`);let o=H(t,`next_action`);bn(e,t,`reviewer`,`verdict`,n===`done`?`Evidence accepted`:`Attempt rejected`,o?`${i}\n\nNext action: ${o}`:i,n)}else if([B.SKILL_CREATED,B.SKILL_UPDATED].includes(n)){let i=H(t,`skill_id`)||H(t,`name`);i&&(vn(e.learned_skills,`id`,i,{id:i,name:H(t,`name`),version:mn(t,`version`)??1,scope:H(t,`scope`),path:H(t,`path`),status:`active`,updated_at:r,mission_id:e.mission.id,mission_title:e.mission.title}),yn(e,t,`reviewer`,n===B.SKILL_CREATED?`Capability unlocked`:`Capability upgraded`,H(t,`name`),`skill`))}else if(n===B.SKILL_EVOLUTION_COMPLETED)e.storage.project_skill_dir=H(t,`project_skill_dir`)||e.storage.project_skill_dir,e.storage.global_skill_dir=H(t,`global_skill_dir`)||e.storage.global_skill_dir,e.storage.project_skill_count=mn(t,`project_skill_count`)??e.storage.project_skill_count,e.storage.global_skill_count=mn(t,`global_skill_count`)??e.storage.global_skill_count;else if(n===B.SKILL_HISTORY_COMPRESSED)e.storage.skill_history_compressed+=mn(t,`count`)??0,e.storage.skill_history_bytes_saved+=mn(t,`bytes_saved`)??0;else if(n===B.SKILL_TIDIED){let n=H(t,`name`);if(n){let i=e.learned_skills.find(e=>e.name===n),a={source_path:H(t,`path`),source_placement:H(t,`placement`),source_vertical:H(t,`vertical`),updated_at:r};i?Object.assign(i,a):vn(e.learned_skills,`id`,n,{id:n,name:n,version:1,scope:``,path:``,status:`active`,...a}),yn(e,t,`manager`,`Capability promoted to source`,n,`skill`)}}else if([B.WIKI_INITIALIZED,B.WIKI_EVOLUTION_COMPLETED].includes(n)){let n=[...(Array.isArray(t.paths)?t.paths:[]).map(e=>String(e)),H(t,`path`)].filter(Boolean);e.storage.wiki_paths=[...new Set([...e.storage.wiki_paths,...n])]}else if(n===B.WIKI_RETIRED_COMPRESSED)e.storage.wiki_retired_compressed+=mn(t,`count`)??0,e.storage.wiki_retired_bytes_saved+=mn(t,`bytes_saved`)??0;else if([B.WIKI_CREATED,B.WIKI_UPDATED].includes(n)){let i=H(t,`page_id`);i&&(vn(e.learned_wiki_pages,`id`,i,{id:i,title:H(t,`title`)||i,card_type:H(t,`card_type`),status:H(t,`status`)||`scratch`,path:H(t,`path`),updated_at:r}),yn(e,t,`reviewer`,n===B.WIKI_CREATED?`Knowledge captured`:`Knowledge refined`,H(t,`title`)||i,`skill`))}else if(n===B.WIKI_RETIRED){let n=H(t,`page_id`);if(n){let i=e.learned_wiki_pages.find(e=>e.id===n);i?Object.assign(i,{status:`retired`,updated_at:r}):vn(e.learned_wiki_pages,`id`,n,{id:n,title:n,card_type:H(t,`card_type`),status:`retired`,path:``,updated_at:r}),yn(e,t,`reviewer`,`Knowledge retired`,n,`error`)}}else if([B.WIKI_PROMOTION_PROMOTED,B.WIKI_PROMOTION_DEMOTED].includes(n)){let i=H(t,`page_id`);if(i){let a=e.learned_wiki_pages.find(e=>e.id===i);a?Object.assign(a,{status:H(t,`to_status`),updated_at:r}):vn(e.learned_wiki_pages,`id`,i,{id:i,title:i,card_type:H(t,`card_type`),status:H(t,`to_status`),path:``,updated_at:r});let o=n===B.WIKI_PROMOTION_PROMOTED;yn(e,t,`reviewer`,o?`Knowledge promoted`:`Knowledge demoted`,`${i} → ${H(t,`to_status`)}`,o?`success`:`neutral`)}}else if(n===B.RESEARCH_ACHIEVEMENT_CERTIFIED)e.achievement={id:H(t,`achievement_id`),title:H(t,`title`),goal:H(t,`goal`),summary:H(t,`summary`),rejected_attempts:e.review.rejected_attempts,skills_learned:e.learned_skills.filter(e=>e.status===`active`).length,artifacts:e.artifacts.length,elapsed_seconds:e.mission.elapsed_seconds,evidence:Array.isArray(t.evidence)?t.evidence.map(String):[],reviewer_certified:!0,certified_at:r};else if([B.LIFE_MISSION_COMPLETED,B.LIFE_MISSION_FAILED].includes(n)){let i=n===B.LIFE_MISSION_FAILED?un({...t,outcome_class:`failed`,status:H(t,`status`)||`failed`,success:!1}):un(t);e.mission.id=H(t,`item_id`)||e.mission.id,e.mission.title=H(t,`title`)||e.mission.title,e.mission.objective=H(t,`objective`)||e.mission.objective,e.mission.summary=H(t,`summary`),e.mission.status=i.missionStatus,e.mission.completed_at=r,e.outcome=cn(t),U(e,`engineer`,i.missionStatus===`complete`?`done`:i.missionStatus,i.label,r),yn(e,t,`engineer`,i.label,H(t,`summary`)||H(t,`title`)||H(t,`status`),xn(i.tone)),bn(e,t,`engineer`,`completion`,i.label,H(t,`summary`)||H(t,`title`)||H(t,`status`),i.missionStatus)}return e.updated_at=Date.now()/1e3,e}function wn(e,t,n){let r=t.backlog.find(e=>pn.has(e.status)),i=t.backlog.find(e=>e.status===`pending`),a=t.backlog.find(t=>t.id===e.mission.id),o=r??a,s=!!(r||i||t.continuous?.enabled||t.continuous?.done_reason||t.continuous?.done_at||e.mission.id||![``,`idle`].includes(e.mission.status));t.continuous?.enabled&&(e.routing.route=e.routing.route||`team`,e.routing.continuous=!0,e.routing.open_ended=t.continuous.open_ended===!0,e.routing.lifetime=e.routing.open_ended?`standing`:e.routing.lifetime||`bounded`);let c=o?.objective||o?.title||(t.continuous?.enabled?t.continuous.objective:``)||t.session.objective||(e.mission.id?``:i?.objective)||(e.mission.id?``:i?.title)||e.mission.objective;c&&(e.mission.objective=c,o?e.mission.title=(o.title||c.split(` -`)[0]).slice(0,240):e.mission.title||(e.mission.title=c.split(` -`)[0].slice(0,240))),r?(e.mission.id=r.id,e.mission.status=`working`,e.mission.started_at=e.mission.started_at??r.started_ts??null):a?a.status===`pending`&&(e.mission.status=`queued`):t.continuous?.done_reason||t.continuous?.done_at?e.mission.status=`complete`:i||t.continuous?.enabled?e.mission.status=`queued`:t.daemon.alive&&(e.mission.status=`idle`),t.roles.forEach(t=>{t.active?U(e,t.role,`active`,t.label||t.status||`Working`,Date.now()/1e3-(t.age_s??0)):s||U(e,t.role,`waiting`,`Waiting`,Date.now()/1e3);let n=e.roles.find(e=>e.role===t.role);n&&Object.assign(n,{backend:t.backend,model:t.model,effort:t.effort})});let l=t.roles.filter(e=>e.active);l.length?e.active_role=l[l.length-1].role:s||(e.active_role=``),t.backlog.forEach(t=>{let n={id:t.id,title:t.title,objective:t.objective,status:t.status,deps:t.deps??[],branch_id:t.id,parent_branch_id:t.deps?.[0]??null,acceptance_check:t.acceptance_check??``,plan_hypothesis:t.plan_hypothesis??``,goal_contribution:t.goal_contribution??``,expected_regressions:t.expected_regressions??``,decision_rule:t.decision_rule??``,non_goals:t.non_goals??[]};vn(e.dag,`id`,n.id,n)});let u=o?.outcome?.execution_status?o.outcome:e.mission.id?void 0:[...t.backlog].filter(e=>e.outcome?.execution_status).sort((e,t)=>Number(e.finished_ts??0)-Number(t.finished_ts??0)).at(-1)?.outcome;return!r&&u&&(e.outcome=cn({outcome:u,status:`done`,success:!0})),n.forEach(t=>{vn(e.artifacts,`path`,t.path,{id:t.path,path:t.path,title:t.name,kind:t.kind,why:t.why,exists:t.exists,source:t.source})}),s}function Tn(e,t,n,r){r||(t.roles.forEach(t=>{t.active||U(e,t.role,`waiting`,`Waiting`,Date.now()/1e3)}),e.active_role=``);let i=Date.now()/1e3,a=e.mission.campaign_started_at??t.session.created??e.mission.started_at;a&&(e.mission.campaign_started_at=a,e.mission.campaign_elapsed_seconds=Math.max(0,i-a)),e.mission.started_at&&e.mission.status===`working`?e.mission.elapsed_seconds=Math.max(0,i-e.mission.started_at):e.mission.started_at&&e.mission.completed_at&&(e.mission.elapsed_seconds=Math.max(0,e.mission.completed_at-e.mission.started_at)),e.achievement?.reviewer_certified&&(e.achievement.elapsed_seconds=e.mission.elapsed_seconds,e.achievement.rejected_attempts=e.review.rejected_attempts,e.achievement.skills_learned=e.learned_skills.filter(e=>e.status===`active`).length,e.achievement.artifacts=n.filter(e=>e.exists).length)}function En(e,t=[],n=[]){let r=e.mission_view?gn(e.mission_view):_n();r.storage??=_n().storage,r.storage.skill_history_compressed??=0,r.storage.wiki_retired_compressed??=0,r.storage.skill_history_bytes_saved??=0,r.storage.wiki_retired_bytes_saved??=0,r.learned_wiki_pages??=[],r.role_work??=[],r.outcome??={};let i=r.last_event_ts,a=wn(r,e,n);return t.filter(e=>e.ts==null||Number(e.ts)>i).sort((e,t)=>Number(e.ts??0)-Number(t.ts??0)).forEach(e=>Cn(r,e)),Tn(r,e,n,a),r}function Dn(e){return String(e||``).replace(/\\([*_`~])/g,`$1`).replace(/\\\\(?=[A-Za-z])/g,`\\`)}function On(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60);return n?`${n}h ${r}m`:r?`${r}m`:`${t}s`}var kn={[B.LIFE_LIFECYCLE_BLOCK]:`block`,[B.ROUND_REVIEWER_BACKEND_FAILURE]:`block`,[B.LIFE_BUDGET_PAUSE]:`warn`,[B.ROUND_STALL]:`warn`,[B.ROUND_ESCALATED]:`warn`,[B.LIFE_PLANNER_STALL_ESCALATION]:`warn`},An=new Set([B.BUDGET_RESERVATION_DENIED,B.BUDGET_UNPRICED_BLOCKED]),jn=new Set([B.LIFE_MISSION_STARTED,B.ROUND_MAIN_COMPLETED,B.LIFE_MISSION_COMPLETED,B.LOOP_DONE,B.ROUND_START,`ui.operator`]),Mn=new Set([B.BUDGET_RESERVATION_CREATED,B.PROVIDER_REQUEST_STARTED]);function Nn(e){let t=_t(e.canonical_type??e.type);if(e.event_validation?.status===`invalid`)return{tone:`warn`,text:`invalid event ${t||`unknown`}: ${e.event_validation.errors.join(`; `)}`};if(An.has(t))return{tone:`block`,kind:`budget`,text:`Budget exhausted or blocked — ${String(e.reason??e.text??t).trim()}`};let n=e.operator_alert===!0?`block`:kn[t];return n?{tone:n,text:String(e.text??e.reason??t).trim()}:null}function Pn(e){let t=null;for(let n of e){let e=_t(n.canonical_type??n.type),r=Nn(n);r?t=r:(t?.kind===`budget`&&Mn.has(e)||t&&t.kind!==`budget`&&jn.has(e))&&(t=null)}return t}var Fn=new Set([`done`,`completed`,`failed`,`skipped`]);function In(e){return Fn.has(e.status)}function Ln(e,t){return e.filter(e=>In(e)===t)}Math.max(...[` ╭───────────────────────────────────────────────────────────────────────────────────╮╮`,` │ ││`,` │ ◉ argus-skill · Autonomous Research Lab ││`,` │ ││`,` ╰───────────────────────────────────────────────────────────────────────────────────╯│`,` │`].map(e=>[...e].length));var Rn=[`turning it over`,`consulting a hundred eyes`,`reading the room`,`weighing it`,`thinking it through`,`cross-checking the evidence`,`running the numbers`,`sizing up the angles`,`following the thread`,`letting it settle`],zn=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function Bn(e,t,n=20){return e.length===0?``:e[Math.floor(t/n)%e.length]}function Vn(e){return zn[e%zn.length]}function Hn(e,t,n=!1,r=0){let i=`${Bn(Rn,t)}…`;if(n)return`${i} · Manager alive · ${Math.max(0,Math.floor(Number.isFinite(r)?r:0))}s quiet`;let a=e||i;return a.includes(`[SESSION HANDOFF`)?`Manager context refreshed · working on your message…`:a.replace(/^Manager\s*·\s*/i,``).slice(0,100)}var Un=()=>Date.now()/1e3;function Wn(e){return e.trim().replace(/[.…]+$/u,``).toLowerCase()}function Gn(e,t,n=Un()){let r=(t.label??``).trim();if(!r)return e;let i=t.heartbeat===!0,a=e.slice(),o=a[a.length-1];if(o&&!o.endedTs){if(Wn(o.label)===Wn(r)||i&&o.heartbeat)return a[a.length-1]={...o,label:r,detail:t.detail||o.detail,kind:t.kind||o.kind,heartbeat:i,endedTs:0},a;a[a.length-1]={...o,endedTs:n}}return a.push({id:`${a.length}:${r}:${n}`,role:(t.role||`manager`).trim()||`manager`,label:r,detail:(t.detail||``).trim(),kind:(t.kind||``).trim(),startedTs:n,endedTs:0,heartbeat:i}),a}function Kn(e,t=Un()){if(e.length===0)return[];let n=e.slice(),r=n[n.length-1];return r&&!r.endedTs&&(n[n.length-1]={...r,endedTs:t}),n}function qn(e,t=6){let n=Math.max(1,t);return e.length<=n?e:e.slice(e.length-n)}function Jn(e,t=Un()){let n=e.endedTs||t;return Math.max(0,n-e.startedTs)}function Yn(e){if(!Number.isFinite(e)||e<1)return``;if(e<60)return`${Math.floor(e)}s`;let t=Math.floor(e/60),n=Math.floor(e%60);return n?`${t}m${n}s`:`${t}m`}function Xn(e,t=!1,n=!1){return(t||n)&&e.toLowerCase()===`r`}function W(e,t){let n=(e||``).replace(/```[a-z]*\n?/gi,``).replace(/\[([^\]]+)\]\([^)]+\)/g,`[$1]`).trim();return n.length<=t?n:n.slice(0,t-1).trimEnd()+`…`}var Zn=e=>String(e??``).split(` -`)[0]?.trim()??``,G=(e,t)=>String(e[t]??``),Qn=e=>{let t=e,n=t.round_index??t.round;return typeof n==`string`||typeof n==`number`?n:`?`},$n={manager:`Manager`,planner:`Planner`,engineer:`Engineer`,reviewer:`Reviewer`,critic:`Critic`,system:`Argus`},er={manager:`Manager`,planner:`Planner`,engineer:`Engineer`,reviewer:`Reviewer`,critic:`Critic`,system:`Argus`},tr=e=>({bright:z.ink,dim:z.inkDim,accent:z.accent,ok:z.success,warn:z.warning,err:z.error,info:z.info})[e];function nr(e,t=`en`){let n=G(e,`type`),r=(e,n)=>t===`zh-CN`?n:e,i=e=>(t===`zh-CN`?er:$n)[e]||e;if(n===`ui.operator`){let t=wt(G(e,`text`));return t?{role:`operator`,label:r(`You`,`你`),glyph:`›`,text:t,tone:`bright`,rule:!0}:null}if(n===`ui.argus`){let t=G(e,`text`);return t?{role:`manager`,label:`Argus`,glyph:`◆`,text:t,tone:`bright`,rule:!0}:null}if(n===`engineer.progress`){let t=G(e,`kind`),n=G(e,`agent_layer`)||`engineer`,a=Zn(e.text??e.action_summary);if(t===`reasoning`){let t=W(G(e,`text`),280);return t?{role:n,label:i(n),glyph:`∴`,text:t,tone:`dim`,reasoning:!0}:null}if(t===`assistant_message`||t===`agent_message`||t===`message`){if(St(e))return null;let t=wt(G(e,`text`));return t?{role:n,label:i(n),glyph:`▌`,text:t,tone:`bright`}:null}if(t===`command_execution`){let t=G(e,`text`)||G(e,`command`)||G(e,`action_summary`);return t?{role:n,label:i(n),glyph:`▸ $`,text:t,tone:`dim`}:null}if(t===`file_change`){let t=G(e,`text`)||G(e,`action_summary`);return{role:n,label:i(n),glyph:`✎`,text:t||r(`(file change)`,`(文件变更)`),tone:`dim`}}if(t===`tool_use`){let t=G(e,`text`)||G(e,`action_summary`);return{role:n,label:i(n),glyph:`⚙`,text:t||r(`(tool)`,`(工具)`),tone:`dim`}}return a?{role:n,label:i(n),glyph:`▸`,text:W(a,160),tone:`dim`}:null}if(n===`life.manager.intent.started`)return{role:`manager`,label:`Manager`,glyph:`🧭`,text:r(`classifying request…`,`判断任务归属…`),tone:`info`};if(n===`life.manager.intent.completed`)return{role:`manager`,label:`Manager`,glyph:`🧭`,text:`→ ${hn({route:G(e,`route`)||`team`,vertical:G(e,`vertical`),workflow_mode:G(e,`workflow_mode`),lifetime:G(e,`lifetime`),continuous:e.continuous===!0,open_ended:e.open_ended===!0})||G(e,`kind`)||r(`resolved`,`已确定`)}`,tone:`info`};if(n===`life.manager.intent.failed`)return{role:`manager`,label:`Manager`,glyph:`⚠`,text:`${r(`routing failed`,`分流失败`)} ${W(G(e,`error`),140)}`,tone:`err`};if(n===`life.manager.stage_decision`){let t=G(e,`target_stage`)||G(e,`stage`)||G(e,`current_stage`);return{role:`manager`,label:`Manager`,glyph:`🧭`,text:`${G(e,`action`)}${t?` → ${t}`:``} ${W(G(e,`reason`),120)}`,tone:`info`}}if(n===`life.planner.start`)return{role:`planner`,label:`Planner`,glyph:`📋`,text:`${r(`planning`,`正在规划`)} ${W(G(e,`objective`),140)}`,tone:`accent`};if(n===`life.planner.verdict`)return G(e,`status`)===`done`||e.project_done===!0?{role:`planner`,label:`Planner`,glyph:`🏁`,text:r(`project done`,`项目已完成`),tone:`ok`}:{role:`planner`,label:`Planner`,glyph:`📋`,text:r(`queued ${G(e,`queued`)||G(e,`n`)||`next`} task(s)`,`已加入 ${G(e,`queued`)||G(e,`n`)||`下一`} 个任务`),tone:`accent`};if(n===`life.planner.task_added`)return{role:`planner`,label:`Planner`,glyph:`+`,text:`${r(`added`,`已添加`)} ${W(G(e,`title`)||G(e,`objective`),140)}`,tone:`accent`};if(n===`life.planner.task_skipped`)return{role:`planner`,label:`Planner`,glyph:`⏭`,text:`${r(`skipped duplicate`,`已跳过重复任务`)} ${W(G(e,`title`),120)}`,tone:`dim`};if(n===`life.planner.error`)return{role:`planner`,label:`Planner`,glyph:`⚠`,text:`${r(`planner error`,`Planner 错误`)} ${W(G(e,`error`)||G(e,`text`),140)}`,tone:`err`};if(n===`life.mission.started`||n===`mission.started`)return{role:`engineer`,label:`Engineer`,glyph:`🚀`,text:W(G(e,`title`)||G(e,`objective`)||G(e,`text`)||r(`mission started`,`任务已开始`),160),tone:`info`,rule:!0};if(n===`round.started`||n===`round.start`)return{role:`engineer`,label:`Engineer`,glyph:`──`,text:r(`round ${Qn(e)}`,`第 ${Qn(e)} 轮`),tone:`dim`,rule:!0};if(n===`life.phase.started`){let t=G(e,`label`)||G(e,`phase`);if(!t)return null;let n=G(e,`agent_layer`)||`engineer`;return{role:n,label:i(n),glyph:`🔄`,text:r(`entering ${t}`,`进入 ${t}`),tone:`info`}}if(n===`round.review.started`)return{role:`reviewer`,label:`Reviewer`,glyph:`🔄`,text:r(`review round ${Qn(e)}`,`审核第 ${Qn(e)} 轮`),tone:`info`};if(n===`round.review.deferred`)return{role:`engineer`,label:`Engineer`,glyph:`↪`,text:r(`continues before review · ${W(G(e,`next_step`),160)}`,`审核前继续执行 · ${W(G(e,`next_step`),160)}`),tone:`info`};if(n===`round.main.completed`)return{role:`engineer`,label:`Engineer`,glyph:`✅`,text:r(`round ${Qn(e)} completed`,`第 ${Qn(e)} 轮已完成`),tone:`info`};if(n===`round.review.completed`){let t=G(e,`status`),n=t===`done`?`ok`:t===`blocked`||t===`no_progress`?`err`:`warn`;return{role:`reviewer`,label:`Reviewer`,glyph:t===`done`?`✅`:t===`blocked`||t===`no_progress`?`⛔`:`↻`,text:`${t||`?`} · ${W(G(e,`reason`),160)}`,tone:n}}if(n===`life.iteration.critic`)return{role:`critic`,label:`Critic`,glyph:`👔`,text:`${G(e,`decision`)||``} ${W(G(e,`reason`),140)}`,tone:`info`};if(n===`life.iteration.continued`)return{role:`critic`,label:`Critic`,glyph:`🔁`,text:r(`queued next iteration`,`已加入下一轮迭代`),tone:`dim`};if(n===`life.mission.completed`||n===`mission.completed`||n===`loop.completed`){let t=un(e),n=W(G(e,`summary`),240);return{role:`engineer`,label:`Engineer`,glyph:t.glyph,text:n?`${t.label} · ${n}`:t.label,tone:t.tone,rule:!0}}if(n===`life.mission.failed`||n===`mission.error`)return{role:`engineer`,label:`Engineer`,glyph:`❌`,text:`${r(`mission failed`,`任务失败`)} ${W(G(e,`reason`)||G(e,`error`),140)}`,tone:`err`,rule:!0};if(n===`loop.start`)return{role:`engineer`,label:`Engineer`,glyph:`▶`,text:W(G(e,`text`)||G(e,`objective`),160),tone:`info`};if(n===`loop.done`)return{role:`engineer`,label:`Engineer`,glyph:`🏁`,text:`${r(`loop done`,`循环完成`)} ${W(G(e,`text`),120)}`,tone:`dim`};if(n===`life.inbox.queued`)return{role:`system`,label:r(`You`,`你`),glyph:`📥`,text:`${r(`nudge`,`追加指导`)} · ${W(G(e,`text`),160)}`,tone:`accent`};if(n===`final.report.ready`||n===`pptx.report.ready`)return{role:`system`,label:`Argus`,glyph:`📄`,text:r(`report ready`,`报告已就绪`),tone:`accent`};if(n===`plan.completed`)return{role:`planner`,label:`Planner`,glyph:`📋`,text:r(`plan completed`,`计划已完成`),tone:`accent`};if(n===`daemon.stopping`)return{role:`system`,label:r(`Daemon`,`守护进程`),glyph:`🛑`,text:r(`stopping`,`正在停止`),tone:`err`};if(n===`round.reviewer_backend_failure`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:r(`reviewer backend down — holding · ${W(G(e,`text`),150)}`,`Reviewer 后端不可用 — 已暂停 · ${W(G(e,`text`),150)}`),tone:`err`,rule:!0};if(n===`round.stall`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:W(G(e,`text`)||r(`no forward progress`,`没有取得进展`),170),tone:`warn`};if(n===`round.escalated`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:W(G(e,`text`)||r(`soft round limit — escalating external blockers`,`达到软轮次上限 — 正在升级外部阻塞`),170),tone:`warn`};if(n===`life.planner.stall_escalation`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:`${r(`planner stalled`,`Planner 停滞`)} — ${W(G(e,`reason`)||G(e,`text`),150)}`,tone:`warn`};if(n===`life.budget.pause`)return{role:`system`,label:r(`Watch`,`监控`),glyph:`⏸`,text:r(`budget cap reached — paused · ${W(G(e,`text`)||G(e,`reason`),140)}`,`已达到预算上限 — 已暂停 · ${W(G(e,`text`)||G(e,`reason`),140)}`),tone:`warn`};if(n===`budget.reservation.denied`)return{role:`system`,label:r(`Budget`,`预算`),glyph:`$`,text:`${r(`budget denied`,`预算申请被拒绝`)} — ${W(G(e,`reason`)||G(e,`text`),150)}`,tone:`err`,rule:!0};if(n===`budget.unpriced.blocked`)return{role:`system`,label:r(`Budget`,`预算`),glyph:`$`,text:`${r(`budget blocked by unresolved cost`,`预算因成本未确定而阻塞`)} — ${W(G(e,`reason`)||G(e,`text`),150)}`,tone:`err`,rule:!0};if(n===`life.lifecycle.block`)return null;if(n===`life.daemon.idle_timeout`)return{role:`system`,label:r(`Watch`,`监控`),glyph:`🟦`,text:W(G(e,`text`)||r(`idle timeout — standing by`,`空闲超时 — 正在待命`),150),tone:`dim`};if(n===`round.watchdog.restart_requested`)return{role:`system`,label:r(`Watch`,`监控`),glyph:`🔄`,text:r(`stall caught — restarting the round · ${W(G(e,`reason`),160)}`,`检测到停滞 — 正在重启本轮 · ${W(G(e,`reason`),160)}`),tone:`warn`};if(n===`engineer.failure_nudge`)return{role:`engineer`,label:`Engineer`,glyph:`⚠`,text:`${r(`repeated tool failure`,`工具重复失败`)} — ${W(G(e,`text`)||G(e,`reason`),160)}`,tone:`warn`};if(n===`mission.idle`)return{role:`system`,label:`Argus`,glyph:`🟦`,text:W(G(e,`text`)||r(`idle — awaiting the next mission`,`空闲 — 正在等待下一个任务`),160),tone:`dim`};if(e.operator_alert===!0){let t=W(G(e,`text`)||G(e,`reason`)||n,170);if(t)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:t,tone:`err`,rule:!0}}return null}function rr(e,t){return bt(e)}function ir(e,t,n){e.setQueryData([`snapshot`,t],e=>e&&{...e,session:{...e.session,display_name:n}}),e.setQueryData([`projects`],e=>e&&{...e,projects:e.projects.map(e=>e.id===t?{...e,display_name:n,label:n||e.objective||e.id}:e)})}var ar=15e3,or=5e3,sr=8e3,cr=1e4,lr=1e4;function ur(e,t){return!Ye(t)&&e<1}function dr(e){return!Ye(e)&&or}var fr=()=>le({queryKey:[`projects`],queryFn:R.projectIndex,refetchInterval:ar}),pr=()=>le({queryKey:[`project-costs`],queryFn:({signal:e})=>R.projectCosts(e),retry:ur,refetchInterval:e=>dr(e.state.error),refetchIntervalInBackground:!1}),mr=e=>le({queryKey:[`snapshot`,e],queryFn:({signal:t})=>R.snapshot(e,t),enabled:!!e,refetchInterval:sr}),hr=(e,t=30,n=!0)=>le({queryKey:[`journal`,e,t],queryFn:({signal:n})=>R.journal(e,t,n),enabled:!!e&&n,refetchInterval:n?8e3:!1}),gr=(e,t)=>le({queryKey:[`doctor`,e],queryFn:({signal:t})=>R.doctor(e,t),enabled:!!e&&t}),_r=(e,t)=>le({queryKey:[`config`,e],queryFn:({signal:t})=>R.config(e,t),enabled:!!e&&t}),vr=(e,t)=>le({queryKey:[`identity`,e],queryFn:({signal:t})=>R.identity(e,t),enabled:!!e&&t}),yr=(e,t,n=30)=>le({queryKey:[`transcript`,e,n],queryFn:({signal:t})=>R.transcript(e,n,t),enabled:!!e&&t}),br=(e,t=!0)=>le({queryKey:[`artifacts`,e],queryFn:({signal:t})=>R.artifacts(e,t),enabled:!!e&&t,refetchInterval:t?cr:!1}),xr=(e,t,n=null)=>le({queryKey:[`artifact`,e,t,n],queryFn:({signal:n})=>R.artifact(e,t,n),enabled:!!e&&!!t}),Sr=(e,t=!0)=>le({queryKey:[`git-diff`,e],queryFn:({signal:t})=>R.gitDiff(e,t),enabled:!!e&&t,refetchInterval:t?lr:!1}),Cr=(e,t)=>le({queryKey:[`backlog-item`,e,t],queryFn:({signal:n})=>R.backlogItem(e,t,n),enabled:!!e&&!!t});function wr(e,t){let n=se(),r=e=>{n.invalidateQueries({queryKey:[`snapshot`,e]}),n.invalidateQueries({queryKey:[`status`,e]}),n.invalidateQueries({queryKey:[`projects`]}),n.invalidateQueries({queryKey:[`backlog-item`,e]})},i=()=>r(e);return{addTask:j({mutationFn:t=>R.addTask(e,t),onSuccess:i}),nudge:j({mutationFn:t=>R.nudge(e,t)}),note:j({mutationFn:t=>R.note(e,t)}),startDaemon:j({mutationFn:()=>R.startDaemon(e,t),onSuccess:i}),stopDaemon:j({mutationFn:n=>R.stopDaemon(e,n,t),onSuccess:i}),updateProject:j({mutationFn:e=>R.updateProject(e.sid,e.name),onSuccess:e=>{ir(n,e.sid,e.name),r(e.sid)}}),deleteProject:j({mutationFn:()=>R.deleteProject(e),onSuccess:async()=>{let t=e;if(t){let e=e=>e.queryKey.some(e=>e===t);await n.cancelQueries({predicate:e}),n.removeQueries({predicate:e})}await n.invalidateQueries({queryKey:[`projects`]})}}),disposeBacklog:j({mutationFn:t=>R.disposeBacklog(e,t.id,t.op),onSuccess:i}),stopBacklog:j({mutationFn:t=>R.stopBacklog(e,t),onSuccess:i}),setContinuous:j({mutationFn:t=>R.setContinuous(e,t.enabled,t.objective??``),onSuccess:i})}}var Tr=2e3;function Er(e,t){if(t.kind===`reset`)return{sid:t.sid,events:[],seen:new Set};if(t.sid!==e.sid)return e;if(t.kind===`seed`){let n=new Set,r=[];[...t.events,...e.events].forEach((e,t)=>{let i=rr(e,t);n.has(i)||(n.add(i),r.push(e))});let i=r.slice(-2e3);return{sid:e.sid,events:i,seen:new Set(i.map((e,t)=>rr(e,t)))}}let n=rr(t.ev,e.events.length);if(e.seen.has(n))return e;let r=new Set(e.seen);r.add(n);let i=[...e.events,t.ev];return i.length>Tr&&i.splice(0,i.length-Tr).forEach((e,t)=>r.delete(rr(e,t))),{sid:e.sid,events:i,seen:r}}var Dr=new Set([`manager.live_view.updated`,`round.review.completed`,`life.mission.completed`]);function Or(e){for(let t=e.length-1;t>=0;--t){let n=e[t],r=String(n.type??``);if(Dr.has(r)||r===`engineer.progress`&&n.kind===`file_change`)return rr(n,t)}return``}var kr=new Set([`life.operator_question.pending`,`life.operator_question.answered`]);function Ar(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(kr.has(String(n.type??``)))return rr(n,t)}return``}function jr(e,t=0){let[n,r]=(0,M.useReducer)(Er,{sid:null,events:[],seen:new Set}),[i,a]=(0,M.useState)({sid:null,connected:!1}),o=(0,M.useRef)(e);return o.current=e,(0,M.useEffect)(()=>{if(r({kind:`reset`,sid:e}),a({sid:e,connected:!1}),!e)return;let t=!1,n=new AbortController;R.events(e,120,n.signal).then(n=>{!t&&o.current===e&&r({kind:`seed`,sid:e,events:n})}).catch(()=>{});let i=lt(e,n=>{!t&&o.current===e&&r({kind:`push`,sid:e,ev:n})},{replay:40,onOpen:()=>{!t&&o.current===e&&a({sid:e,connected:!0})},onClose:()=>{!t&&o.current===e&&a({sid:e,connected:!1})}});return()=>{t=!0,n.abort(),i()}},[e,t]),{events:n.sid===e?n.events:[],connected:i.sid===e&&i.connected}}var K=i();function Mr(e){return!Number.isFinite(e)||e<=0?`$0.00`:e>=100?`$${e.toFixed(0)}`:e>=10?`$${e.toFixed(1)}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(3)}`}function Nr({settledUsd:e,knownUsd:t=0,status:n=`empty`}){let r=typeof e==`number`&&Number.isFinite(e)?e:t,i=n===`partial`||n===`unpriced`;return`${Mr(Math.max(0,r||0))}${i?`+`:``}`}function Pr({settledUsd:e,knownUsd:t,status:n,calls:r=0,premiumRequests:i=0,live:a=!1,compact:o=!1}){let s=Nr({settledUsd:e,knownUsd:t,status:n}),c=[`Cumulative settled project spend`,`${r} model call${r===1?``:`s`}`,i>0?`${i.toFixed(1)} premium requests`:``,n&&n!==`empty`?`pricing: ${n}`:``].filter(Boolean).join(` · `);return(0,K.jsxs)(`span`,{title:c,"aria-label":`Project spend ${s}`,className:`inline-flex shrink-0 items-center rounded-full border border-gold/25 bg-gold/8 font-mono tabular-nums text-gold ${o?`h-6 gap-1 px-2 text-[10px]`:`h-5 gap-1 px-1.5 text-[9px]`}`,children:[a?(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 animate-pulse rounded-full bg-gold/80`}):null,(0,K.jsx)(`span`,{children:s})]})}var Fr=`argus.locale`,Ir={"language.english":`English`,"handshake.connecting":`Connecting to Argus backend`,"splash.starting":`Argus starting`,"rail.workbench":`Workbench`,"rail.sessionsShortcut":`Sessions · Ctrl/⌘ P`,"panel.backlog":`Backlog`,"panel.activity":`Activity`,"panel.journal":`Journal`,"panel.roles":`Roles`,"panel.project":`Project`,"panel.liveView":`Manager live project view`,"stream.jumpToLatest":`Jump to latest`,"newDaemon.workdirPlaceholder":`Blank → ~/.argus-skill/workspaces/`,"operations.resetManager":`Reset Manager context`,"language.chinese":`中文`,"language.switchTo":`Switch to {language}`,"common.loading":`Loading…`,"common.retry":`Retry`,"common.save":`Save`,"common.cancel":`Cancel`,"common.close":`Close`,"common.settings":`Settings`,"common.ready":`Ready`,"common.live":`Live`,"common.reconnecting":`Reconnecting`,"common.stale":`Snapshot stale`,"common.degraded":`Snapshot degraded`,"common.external":`External`,"common.pause":`Pause`,"common.run":`Run`,"common.local":`Local`,"common.all":`All`,"common.unassigned":`Unassigned`,"common.closeSessions":`Close sessions`,"common.resizeSessions":`Resize sessions`,"common.resizePreview":`Resize preview`,"common.expandPreview":`Expand preview`,"connection.pairingTitle":`This browser is not paired with Argus`,"connection.pairingDetail":`Close this tab and reopen the workbench from Argus Desktop, or open a fresh pairing link.`,"connection.unreachableTitle":`The local Argus service is unavailable`,"connection.unreachableDetail":`Keep Argus Desktop running and wait for the local backend to become ready, then retry.`,"sidebar.collapse":`Collapse sessions`,"sidebar.expand":`Expand sessions`,"sidebar.create":`Create session`,"sidebar.find":`Find a session`,"sidebar.clearSearch":`Clear search`,"sidebar.refreshFailed":`Refresh failed · retry`,"sidebar.noSessions":`No sessions`,"sidebar.daemonAlive":`daemon alive`,"sidebar.stopped":`stopped`,"sidebar.runningFor":`running · {uptime}`,"sidebar.manage":`Manage {name}`,"sidebar.manageHint":`Rename, pause, or delete`,"sidebar.openSettings":`Open settings`,"sidebar.theme":`{current} theme; switch to {next}`,"landing.selectOrCreate":`Select a session from the sidebar, or create a new one.`,"landing.noSessions":`No sessions yet. Create one to begin.`,"landing.select":`Select session`,"landing.new":`New session`,"topbar.openSessions":`Open sessions`,"topbar.externallyManaged":`Externally managed`,"topbar.pauseDaemon":`Pause daemon`,"topbar.runDaemon":`Run daemon`,"topbar.externalDaemonHint":`Daemon is live in an external PID namespace; use its supervisor to control it.`,"topbar.manageSession":`Manage session`,"topbar.showPreview":`Show preview`,"topbar.showActivity":`Show activity`,"mobile.views":`Views`,"mobile.sessions":`Sessions`,"mobile.mission":`Mission`,"mobile.activity":`Activity`,"mobile.workbench":`Workbench`,"mobile.preview":`Preview`,"chat.yourMessage":`Your message`,"chat.stopWaitingHint":`Esc stop waiting`,"chat.messageArgus":`message Argus`,"chat.selectSession":`Select a session…`,"chat.placeholder":`Ask a question or assign work`,"chat.attach":`attach files`,"chat.attachHint":`PNG, JPEG, WebP, PDF, Markdown/text, JSON, CSV · up to {count} files, {perFile} each, {total} total`,"chat.attachDrop":`Drop files to attach`,"chat.attachRemove":`remove attachment {name}`,"chat.attachUnsupported":`{name} is not supported. Use PNG, JPEG, WebP, PDF, Markdown/text, JSON, or CSV.`,"chat.attachTooLarge":`{name} exceeds the {size} per-file limit.`,"chat.attachTooMany":`You can attach up to {count} files per message.`,"chat.attachTotalTooLarge":`Attachments exceed the {size} total limit.`,"chat.attachmentUploadFailed":`Attachment upload failed: {error}`,"chat.uploadingAttachments":`Uploading attachments`,"chat.rewriteHint":`Let the Manager rewrite this prompt into a brief the team can act on. Nothing is sent — the rewrite lands back in this box for you to edit.`,"chat.rewriteLabel":`rewrite prompt with the Manager`,"chat.rewriting":`rewriting`,"chat.rewrite":`✦ Rewrite`,"chat.stopWaiting":`stop waiting`,"chat.stopWaitingTitle":`stop waiting for this reply; server-side work may continue`,"chat.send":`send message`,"copy.message":`Copy`,"copy.code":`Copy code`,"copy.copied":`Copied`,"help.title":`Keyboard shortcuts`,"help.commands":`Commands`,"help.palette":`command palette`,"help.sessions":`toggle sessions`,"help.managerChat":`focus Manager chat`,"help.rewrite":`rewrite the current prompt before sending`,"help.reasoning":`toggle agent reasoning`,"help.kiosk":`toggle kiosk (read-only) mode`,"help.composer":`focus the composer`,"help.send":`send message`,"help.newline":`insert newline`,"help.thisHelp":`this help`,"help.escape":`close overlay / stop waiting in composer`,"palette.placeholder":`Type a command or search…`,"palette.noMatches":`no matching commands`,"palette.navigate":`↑↓ navigate`,"palette.run":`↵ run`,"palette.close":`esc close`,"palette.view":`View`,"palette.action":`Action`,"palette.project":`Project`,"palette.newDaemon":`New daemon`,"palette.openTranscript":`Open Transcript`,"palette.openProject":`Open Project`,"palette.projectHint":`work · memory · agents`,"palette.openOperations":`Open Operations`,"palette.operationsHint":`backend controls`,"palette.hideReasoning":`Hide reasoning`,"palette.showReasoning":`Show reasoning`,"palette.exitKiosk":`Exit kiosk mode`,"palette.enterKiosk":`Enter kiosk mode`,"palette.messageArgus":`Message Argus…`,"palette.stopWaiting":`Stop waiting for Manager reply`,"palette.stopContinuous":`Stop continuous campaign`,"palette.startContinuous":`Start continuous campaign`,"palette.stopDaemon":`Stop daemon`,"palette.startDaemon":`Start daemon`,"slash.suggestions":`Slash command suggestions`,"mission.roleActive":`{role} active`,"mission.overview":`mission overview`,"mission.operations":`Operations`,"role.manager":`Manager`,"role.planner":`Planner`,"role.engineer":`Engineer`,"role.reviewer":`Reviewer`,"role.critic":`Critic`,"role.system":`Argus`,"role.operator":`You`,"doctor.title":`Doctor`,"doctor.subtitle":`daemon health checks + recommended root-cause fix`,"doctor.recommended":`recommended fix`,"settings.subtitle":`effective roles, budgets, and essential controls`,"settings.connection":`Connection`,"settings.webApi":`Web + REST API`,"settings.eventStream":`Event stream`,"settings.taskDaemon":`Task daemon`,"settings.budgetTitle":`Budget and quota limits`,"settings.budgetHint":`Set 0 for an uncapped provider-call limit where supported.`,"settings.saveBudgets":`Save budget limits`,"settings.budget.global":`Host-global daily`,"settings.budget.codex":`Codex calls / day`,"settings.budget.copilot":`Copilot calls / day`,"settings.budget.premium":`Copilot premium / day`,"settings.required":`{field} is required`,"settings.budgetSaved":`Budget limits saved. Restart running daemons to reload their process caps.`,"settings.advanced":`Advanced setting`,"settings.namePlaceholder":`name or alias, e.g. manager_model`,"settings.valuePlaceholder":`value`,"settings.applyAdvanced":`Apply advanced setting`,"settings.applied":`Applied. Restart affected daemons to reload process-scoped settings.`,"settings.footer":`Role overrides are summarized above. Use Advanced setting for a specific override; the full registry remains available via`,"identity.title":`Identity`,"identity.subtitle":`who argus is working for on this project`,"identity.placeholder":`Describe who Argus is working for and durable preferences…`,"identity.save":`Save identity`,"identity.saved":`Identity saved.`,"transcript.title":`Transcript`,"transcript.subtitle":`recent operator ↔ argus turns · reply from the composer`,"transcript.empty":`no conversation turns yet`,"transcript.operator":`operator`,"new.createDaemon":`Create daemon`,"new.subtitle":`Creates an isolated timeline and Manager context.`,"new.close":`close create daemon`,"new.name":`Name`,"new.optional":`(optional)`,"new.namePlaceholder":`e.g. AAAI embodiment paper`,"new.workdir":`Output workdir`,"new.workdirHint":`Agents write code, papers, reports, and experiment outputs here. Internal memory stays under the session state directory.`,"new.objective":`Objective`,"new.objectivePlaceholder":`Leave blank to start with a conversation, or describe a campaign to start immediately.`,"new.startsAfterCreate":`Campaign starts after session creation`,"new.idleUntilMessage":`Idle until the first message`,"new.startsHint":`The session opens immediately; Manager handoff and executor startup continue in the background.`,"new.idleHint":`No executor is spawned yet. The Manager will reply or dispatch work from your first message.`,"new.shortcut":`Ctrl/⌘+Enter to create`,"new.creating":`Creating…`,"new.createAndStart":`Create and start`,"manage.daemon":`Manage daemon`,"manage.displayName":`Display name`,"manage.executor":`Executor`,"manage.running":`Running`,"manage.runningExternally":`Running externally`,"manage.paused":`Paused`,"manage.pauseHint":`Interrupt the current operation and keep progress resumable.`,"manage.externalHint":`This daemon is supervised outside the Web host PID namespace.`,"manage.resumeHint":`Resume queued research work.`,"manage.working":`Working…`,"manage.resume":`Resume`,"manage.deleteSession":`Delete session`,"manage.deleteHint":`Deleted sessions move to projects_trash and remain recoverable. Pause the executor first.`,"manage.delete":`Delete…`,"manage.confirmQuestion":`Move this session to trash?`,"manage.confirmDelete":`Confirm delete`,"decision.operator":`Operator decision`,"decision.required":`Decision required`,"decision.whyBlocked":`Why work is blocked`,"decision.evidence":`Evidence`,"decision.notePlaceholder":`Add the guidance the Manager should apply…`,"decision.resumeHint":`The Manager applies your choice before work resumes.`,"decision.later":`Later`,"decision.applying":`Applying…`,"decision.stopCampaign":`Stop campaign`,"decision.useOption":`Use this option`,"decision.sendAnswer":`Send answer`,"decision.noteRequired":`Add the required details before sending this choice.`,"artifact.preview":`Artifact preview`,"artifact.title":`Artifact`,"artifact.approvedEvidence":`reviewer-approved evidence`,"artifact.downloading":`Downloading…`,"artifact.download":`Download`,"artifact.open":`Open`,"artifact.close":`close artifact preview`,"artifact.unavailable":`preview unavailable`,"artifact.empty":`(empty file)`,"artifact.truncated":`preview truncated · download to inspect the complete file`,"artifact.htmlTooLarge":`HTML preview is too large to render safely. Download the complete file.`,"artifact.pdfDisabled":`Inline PDF preview is disabled by this browser.`,"artifact.openPdf":`Open PDF`,"artifact.noPreview":`This file type has no safe inline preview.`,"artifact.downloadHint":`Download it to inspect with a local application.`,"task.details":`Task details`,"task.stopLoop":`stop loop`,"task.done":`done`,"task.skip":`skip`,"task.close":`close task details`,"task.waitingOnYou":`Waiting on you`,"task.objective":`Objective`,"task.noObjective":`(no objective recorded)`,"task.priority":`priority`,"task.started":`started`,"task.finished":`finished`,"task.outcome":`Outcome`,"task.iteration":`Iteration`,"task.mode":`mode`,"task.autoIterate":`auto-iterate`,"task.singlePass":`single pass`,"task.cycles":`cycles`,"task.cost":`cost`,"task.lastError":`Last error`,"task.notes":`Notes`,"task.dependsOn":`depends on`,"mission.achievement":`Argus achievement`,"mission.elapsed":`Elapsed`,"mission.rejectedAttempts":`{count} rejected attempts`,"mission.skillsLearned":`{count} skills learned`,"mission.artifacts":`{count} artifacts`,"mission.waiting":`Waiting for a mission`,"mission.control":`Mission control`,"mission.showObjective":`Show full objective`,"mission.stage":`Stage`,"mission.campaign":`Campaign`,"mission.totalElapsed":`Total elapsed`,"mission.round":`Round`,"mission.mode":`Mode`,"mission.summary":`Mission summary`,"mission.team":`AI research team`,"mission.waitingShort":`Waiting`,"mission.roleWork":`Role work`,"mission.filteredBy":`filtered by {task} · clear`,"mission.allVisible":`all visible missions`,"mission.roundNumber":`round {count}`,"mission.noRoleWork":`No persisted {role} work for this selection yet.`,"mission.researchDag":`Research DAG`,"mission.active":`active`,"mission.noDag":`Planner has not added DAG nodes yet.`,"mission.acceptance":`Acceptance`,"mission.nonGoals":`Non-goals`,"mission.capabilities":`Capabilities`,"mission.capabilitiesUnlocked":`Capabilities unlocked`,"mission.skillUnavailable":`Skill content is not available in this snapshot.`,"mission.knowledgeRetained":`Knowledge retained`,"mission.selfEvolution":`Self-evolution storage`,"mission.replay":`Mission replay`,"mission.replayTimeline":`Replay mission timeline`,"mission.waitingEvents":`Waiting for structured research events.`,"research.currentWork":`Current work`,"research.dagProgress":`DAG progress`,"research.verifiedOutputs":`Verified outputs`,"research.recentMilestones":`Recent milestones`,"research.liveProgress":`Live progress`,"research.artifact":`Research artifact`,"research.canvas":`Manager live research canvas`,"research.previewArtifact":`Preview artifact`,"research.openLarge":`Open large preview`,"research.collapse":`Collapse preview`,"research.unavailable":`Manager live view is temporarily unavailable.`,"research.noPreview":`No preview`,"research.waiting":`Waiting…`,"research.updating":`Updating…`,"research.fileUnavailable":`Preview unavailable for this file.`,"research.eventSourced":`event-sourced mission state`,"research.downloadFailed":`download failed`,"operations.title":`Operations`,"operations.work":`Work`,"operations.runtime":`Runtime`,"operations.system":`System`,"operations.recovery":`Recovery`,"operations.workInput":`Work input`,"operations.workHint":`Queue work, guide the active task, save a note, or preview a plan without dispatching it.`,"operations.planPlaceholder":`Objective to preview; preview never queues work`,"operations.actionPlaceholder":`{action} text`,"operations.previewPlan":`Preview plan`,"operations.submitAction":`Submit {action}`,"operations.runtimeHint":`Change where this session runs, reset Manager context, or safely reload the daemon.`,"operations.workdir":`Working directory`,"operations.workdirUpdated":`Working directory updated.`,"operations.applyWorkdir":`Apply working directory`,"operations.replaceSlot":`Replace a running daemon slot`,"operations.skills":`Skills`,"operations.runSkill":`Run skill command`,"operations.metrics":`System metrics`,"operations.trash":`Recoverable trash`,"operations.searchTrash":`Search trash`,"operations.trashEmpty":`Trash is empty.`},Lr={"language.english":`English`,"handshake.connecting":`正在连接 Argus 后端`,"splash.starting":`Argus 启动中`,"rail.workbench":`工作台`,"rail.sessionsShortcut":`会话 · Ctrl/⌘ P`,"panel.backlog":`待办`,"panel.activity":`动态`,"panel.journal":`日志`,"panel.roles":`角色`,"panel.project":`项目`,"panel.liveView":`Manager 实时项目视图`,"stream.jumpToLatest":`跳到最新`,"newDaemon.workdirPlaceholder":`留空 → ~/.argus-skill/workspaces/`,"operations.resetManager":`重置 Manager 上下文`,"language.chinese":`中文`,"language.switchTo":`切换到{language}`,"common.loading":`加载中…`,"common.retry":`重试`,"common.save":`保存`,"common.cancel":`取消`,"common.close":`关闭`,"common.settings":`设置`,"common.ready":`就绪`,"common.live":`实时`,"common.reconnecting":`正在重连`,"common.stale":`快照已过期`,"common.degraded":`快照异常`,"common.external":`外部`,"common.pause":`暂停`,"common.run":`运行`,"common.local":`本地`,"common.all":`全部`,"common.unassigned":`未分配`,"common.closeSessions":`关闭会话列表`,"common.resizeSessions":`调整会话列表宽度`,"common.resizePreview":`调整预览区域宽度`,"common.expandPreview":`展开预览`,"connection.pairingTitle":`此浏览器尚未与 Argus 配对`,"connection.pairingDetail":`请关闭此标签页,然后从 Argus Desktop 重新打开工作台,或使用新的配对链接。`,"connection.unreachableTitle":`Argus 本地服务当前不可达`,"connection.unreachableDetail":`请保持 Argus Desktop 运行,等待本地后端就绪后再重试。`,"sidebar.collapse":`收起会话`,"sidebar.expand":`展开会话`,"sidebar.create":`创建会话`,"sidebar.find":`查找会话`,"sidebar.clearSearch":`清除搜索`,"sidebar.refreshFailed":`刷新失败 · 重试`,"sidebar.noSessions":`暂无会话`,"sidebar.daemonAlive":`守护进程运行中`,"sidebar.stopped":`已停止`,"sidebar.runningFor":`运行中 · {uptime}`,"sidebar.manage":`管理 {name}`,"sidebar.manageHint":`重命名、暂停或删除`,"sidebar.openSettings":`打开设置`,"sidebar.theme":`{current}主题;切换到{next}主题`,"landing.selectOrCreate":`从侧边栏选择一个会话,或创建新会话。`,"landing.noSessions":`还没有会话。创建一个即可开始。`,"landing.select":`选择会话`,"landing.new":`新建会话`,"topbar.openSessions":`打开会话列表`,"topbar.externallyManaged":`由外部管理`,"topbar.pauseDaemon":`暂停守护进程`,"topbar.runDaemon":`运行守护进程`,"topbar.externalDaemonHint":`守护进程位于外部 PID 命名空间中;请使用其 supervisor 进行控制。`,"topbar.manageSession":`管理会话`,"topbar.showPreview":`显示预览`,"topbar.showActivity":`显示动态`,"mobile.views":`视图`,"mobile.sessions":`会话`,"mobile.mission":`任务`,"mobile.activity":`动态`,"mobile.workbench":`工作台`,"mobile.preview":`预览`,"chat.yourMessage":`你的消息`,"chat.stopWaitingHint":`按 Esc 停止等待`,"chat.messageArgus":`向 Argus 发送消息`,"chat.selectSession":`请选择会话…`,"chat.placeholder":`提问或安排工作`,"chat.attach":`添加文件`,"chat.attachHint":`支持 PNG、JPEG、WebP、PDF、Markdown/文本、JSON、CSV · 每条消息最多 {count} 个文件,单个 {perFile},总计 {total}`,"chat.attachDrop":`拖放文件以添加附件`,"chat.attachRemove":`移除附件 {name}`,"chat.attachUnsupported":`{name} 不受支持。请使用 PNG、JPEG、WebP、PDF、Markdown/文本、JSON 或 CSV。`,"chat.attachTooLarge":`{name} 超过单文件大小限制 {size}。`,"chat.attachTooMany":`每条消息最多只能附带 {count} 个文件。`,"chat.attachTotalTooLarge":`附件总大小超过 {size} 限制。`,"chat.attachmentUploadFailed":`附件上传失败:{error}`,"chat.uploadingAttachments":`正在上传附件`,"chat.rewriteHint":`让 Manager 将提示词改写为团队可执行的任务说明。不会直接发送,改写结果会回到输入框供你编辑。`,"chat.rewriteLabel":`使用 Manager 改写提示词`,"chat.rewriting":`正在改写`,"chat.rewrite":`✦ 改写`,"chat.stopWaiting":`停止等待`,"chat.stopWaitingTitle":`停止等待此回复;服务端工作可能仍会继续`,"chat.send":`发送消息`,"copy.message":`复制`,"copy.code":`复制代码`,"copy.copied":`已复制`,"help.title":`键盘快捷键`,"help.commands":`命令`,"help.palette":`打开命令面板`,"help.sessions":`展开或收起会话`,"help.managerChat":`聚焦 Manager 对话框`,"help.rewrite":`发送前改写当前提示词`,"help.reasoning":`显示或隐藏 Agent 推理`,"help.kiosk":`切换只读展示模式`,"help.composer":`聚焦输入框`,"help.send":`发送消息`,"help.newline":`插入换行`,"help.thisHelp":`打开此帮助`,"help.escape":`关闭浮层或停止等待`,"palette.placeholder":`输入命令或搜索…`,"palette.noMatches":`没有匹配的命令`,"palette.navigate":`↑↓ 导航`,"palette.run":`↵ 执行`,"palette.close":`Esc 关闭`,"palette.view":`视图`,"palette.action":`操作`,"palette.project":`项目`,"palette.newDaemon":`新建守护进程`,"palette.openTranscript":`打开对话记录`,"palette.openProject":`打开项目`,"palette.projectHint":`工作 · 记忆 · Agent`,"palette.openOperations":`打开运行控制`,"palette.operationsHint":`后端控制`,"palette.hideReasoning":`隐藏推理`,"palette.showReasoning":`显示推理`,"palette.exitKiosk":`退出展示模式`,"palette.enterKiosk":`进入展示模式`,"palette.messageArgus":`向 Argus 发送消息…`,"palette.stopWaiting":`停止等待 Manager 回复`,"palette.stopContinuous":`停止持续任务`,"palette.startContinuous":`启动持续任务`,"palette.stopDaemon":`停止守护进程`,"palette.startDaemon":`启动守护进程`,"slash.suggestions":`Slash 命令建议`,"mission.roleActive":`{role} 正在工作`,"mission.overview":`任务概览`,"mission.operations":`运行控制`,"role.manager":`Manager`,"role.planner":`Planner`,"role.engineer":`Engineer`,"role.reviewer":`Reviewer`,"role.critic":`Critic`,"role.system":`Argus`,"role.operator":`你`,"doctor.title":`诊断`,"doctor.subtitle":`守护进程健康检查与推荐的根因修复方案`,"doctor.recommended":`推荐修复`,"settings.subtitle":`生效中的角色、预算和关键控制项`,"settings.connection":`连接`,"settings.webApi":`Web + REST API`,"settings.eventStream":`事件流`,"settings.taskDaemon":`任务守护进程`,"settings.budgetTitle":`预算和配额限制`,"settings.budgetHint":`支持时,将调用限制设为 0 表示不设上限。`,"settings.saveBudgets":`保存预算限制`,"settings.budget.global":`主机全局每日预算`,"settings.budget.codex":`Codex 每日调用`,"settings.budget.copilot":`Copilot 每日调用`,"settings.budget.premium":`Copilot 每日 Premium 请求`,"settings.required":`必须填写{field}`,"settings.budgetSaved":`预算限制已保存。请重启正在运行的守护进程以重新加载进程级限制。`,"settings.advanced":`高级设置`,"settings.namePlaceholder":`名称或别名,例如 manager_model`,"settings.valuePlaceholder":`值`,"settings.applyAdvanced":`应用高级设置`,"settings.applied":`设置已应用。请重启受影响的守护进程以重新加载进程级设置。`,"settings.footer":`上方汇总了角色覆盖配置。可使用“高级设置”指定覆盖项;完整配置仍可通过以下命令查看:`,"identity.title":`身份`,"identity.subtitle":`本项目中 Argus 服务的对象`,"identity.placeholder":`描述 Argus 正在为谁工作,以及需要长期遵循的偏好…`,"identity.save":`保存身份`,"identity.saved":`身份已保存。`,"transcript.title":`对话记录`,"transcript.subtitle":`近期操作者 ↔ Argus 对话 · 请从输入框继续回复`,"transcript.empty":`暂无对话记录`,"transcript.operator":`操作者`,"new.createDaemon":`创建守护进程`,"new.subtitle":`创建隔离的时间线和 Manager 上下文。`,"new.close":`关闭创建会话窗口`,"new.name":`名称`,"new.optional":`(可选)`,"new.namePlaceholder":`例如:AAAI 具身智能论文`,"new.workdir":`输出工作目录`,"new.workdirHint":`Agent 会在这里写入代码、论文、报告和实验结果。内部记忆仍保存在会话状态目录中。`,"new.objective":`目标`,"new.objectivePlaceholder":`留空则从对话开始,也可以填写一个立即启动的持续任务。`,"new.startsAfterCreate":`创建会话后立即启动任务`,"new.idleUntilMessage":`收到第一条消息前保持空闲`,"new.startsHint":`会话会立即打开;Manager 交接和执行器启动将在后台继续。`,"new.idleHint":`暂时不会启动执行器。Manager 会在收到第一条消息后回复或分派工作。`,"new.shortcut":`按 Ctrl/⌘+Enter 创建`,"new.creating":`正在创建…`,"new.createAndStart":`创建并启动`,"manage.daemon":`管理守护进程`,"manage.displayName":`显示名称`,"manage.executor":`执行器`,"manage.running":`运行中`,"manage.runningExternally":`由外部运行`,"manage.paused":`已暂停`,"manage.pauseHint":`中断当前操作并保留可恢复的进度。`,"manage.externalHint":`此守护进程由 Web 主机 PID 命名空间之外的 supervisor 管理。`,"manage.resumeHint":`继续执行队列中的研究工作。`,"manage.working":`处理中…`,"manage.resume":`继续`,"manage.deleteSession":`删除会话`,"manage.deleteHint":`删除的会话会移入 projects_trash,之后仍可恢复。请先暂停执行器。`,"manage.delete":`删除…`,"manage.confirmQuestion":`将此会话移入回收站?`,"manage.confirmDelete":`确认删除`,"decision.operator":`操作者决策`,"decision.required":`需要你的决策`,"decision.whyBlocked":`工作被阻塞的原因`,"decision.evidence":`证据`,"decision.notePlaceholder":`添加 Manager 应采用的指导…`,"decision.resumeHint":`Manager 会在恢复工作前应用你的选择。`,"decision.later":`稍后处理`,"decision.applying":`正在应用…`,"decision.stopCampaign":`停止持续任务`,"decision.useOption":`使用此选项`,"decision.sendAnswer":`发送回答`,"decision.noteRequired":`这个选项需要补充说明后才能提交。`,"artifact.preview":`产物预览`,"artifact.title":`产物`,"artifact.approvedEvidence":`Reviewer 批准的证据`,"artifact.downloading":`正在下载…`,"artifact.download":`下载`,"artifact.open":`打开`,"artifact.close":`关闭产物预览`,"artifact.unavailable":`无法预览`,"artifact.empty":`(空文件)`,"artifact.truncated":`预览已截断 · 请下载完整文件查看`,"artifact.htmlTooLarge":`HTML 文件过大,无法安全预览。请下载完整文件。`,"artifact.pdfDisabled":`此浏览器已禁用内嵌 PDF 预览。`,"artifact.openPdf":`打开 PDF`,"artifact.noPreview":`此文件类型无法安全地在线预览。`,"artifact.downloadHint":`请下载后使用本地应用查看。`,"task.details":`任务详情`,"task.stopLoop":`停止循环`,"task.done":`完成`,"task.skip":`跳过`,"task.close":`关闭任务详情`,"task.waitingOnYou":`等待你的回复`,"task.objective":`目标`,"task.noObjective":`(未记录目标)`,"task.priority":`优先级`,"task.started":`开始时间`,"task.finished":`完成时间`,"task.outcome":`结果`,"task.iteration":`迭代`,"task.mode":`模式`,"task.autoIterate":`自动迭代`,"task.singlePass":`单次执行`,"task.cycles":`轮次`,"task.cost":`成本`,"task.lastError":`最近错误`,"task.notes":`备注`,"task.dependsOn":`依赖`,"mission.achievement":`Argus 成果`,"mission.elapsed":`耗时`,"mission.rejectedAttempts":`{count} 次方案被拒绝`,"mission.skillsLearned":`学习了 {count} 个 Skill`,"mission.artifacts":`{count} 个产物`,"mission.waiting":`等待任务`,"mission.control":`任务控制`,"mission.showObjective":`显示完整目标`,"mission.stage":`阶段`,"mission.campaign":`持续任务`,"mission.totalElapsed":`总耗时`,"mission.round":`轮次`,"mission.mode":`模式`,"mission.summary":`本次完成`,"mission.team":`AI 研究团队`,"mission.waitingShort":`等待中`,"mission.roleWork":`角色工作`,"mission.filteredBy":`按 {task} 筛选 · 清除`,"mission.allVisible":`全部可见任务`,"mission.roundNumber":`第 {count} 轮`,"mission.noRoleWork":`当前筛选下还没有持久化的 {role} 工作记录。`,"mission.researchDag":`研究 DAG`,"mission.active":`进行中`,"mission.noDag":`Planner 尚未添加 DAG 节点。`,"mission.acceptance":`验收标准`,"mission.nonGoals":`非目标`,"mission.capabilities":`能力`,"mission.capabilitiesUnlocked":`已解锁能力`,"mission.skillUnavailable":`当前快照中没有此 Skill 的内容。`,"mission.knowledgeRetained":`已保留知识`,"mission.selfEvolution":`自进化存储`,"mission.replay":`任务回放`,"mission.replayTimeline":`回放任务时间线`,"mission.waitingEvents":`等待结构化研究事件。`,"research.currentWork":`当前工作`,"research.dagProgress":`DAG 进度`,"research.verifiedOutputs":`已验证输出`,"research.recentMilestones":`近期里程碑`,"research.liveProgress":`实时进度`,"research.artifact":`研究产物`,"research.canvas":`Manager 实时研究面板`,"research.previewArtifact":`预览产物`,"research.openLarge":`打开大尺寸预览`,"research.collapse":`收起预览`,"research.unavailable":`Manager 实时视图暂时不可用。`,"research.noPreview":`暂无预览`,"research.waiting":`等待中…`,"research.updating":`正在更新…`,"research.fileUnavailable":`此文件无法预览。`,"research.eventSourced":`基于事件的任务状态`,"research.downloadFailed":`下载失败`,"operations.title":`运行控制`,"operations.work":`工作`,"operations.runtime":`运行时`,"operations.system":`系统`,"operations.recovery":`恢复`,"operations.workInput":`工作输入`,"operations.workHint":`加入工作、指导当前任务、保存备注,或仅预览计划而不分派。`,"operations.planPlaceholder":`要预览的目标;预览不会加入任务队列`,"operations.actionPlaceholder":`输入 {action} 内容`,"operations.previewPlan":`预览计划`,"operations.submitAction":`提交 {action}`,"operations.runtimeHint":`更改会话运行位置、重置 Manager 上下文,或安全重载守护进程。`,"operations.workdir":`工作目录`,"operations.workdirUpdated":`工作目录已更新。`,"operations.applyWorkdir":`应用工作目录`,"operations.replaceSlot":`替换正在运行的守护进程槽位`,"operations.skills":`Skills`,"operations.runSkill":`运行 Skill 命令`,"operations.metrics":`系统指标`,"operations.trash":`可恢复的回收站`,"operations.searchTrash":`搜索回收站`,"operations.trashEmpty":`回收站为空。`};function Rr(){try{let e=localStorage.getItem(Fr);if(e===`en`||e===`zh-CN`)return e}catch{}return navigator.language.toLowerCase().startsWith(`zh`)?`zh-CN`:`en`}function zr(e,t={},n=Rr()){return((n===`zh-CN`?Lr[e]:Ir[e])??e).replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??`{${n}}`))}var Br=(0,M.createContext)({locale:`en`,setLocale:()=>void 0,t:(e,t)=>zr(e,t,`en`)});function Vr({children:e}){let[t,n]=(0,M.useState)(Rr),r=e=>{try{localStorage.setItem(Fr,e)}catch{}n(e)};(0,M.useEffect)(()=>{document.documentElement.lang=t},[t]);let i=(0,M.useMemo)(()=>({locale:t,setLocale:r,t:(e,n)=>zr(e,n,t)}),[t]);return(0,K.jsx)(Br.Provider,{value:i,children:e})}function q(){return(0,M.useContext)(Br)}var Hr=new Set([`running`,`in_progress`,`claimed`]);function Ur(e){return e.find(e=>e.active)??e.find(e=>e.role===`manager`)}function Wr({snap:e,streamOk:t,onStart:n,onStop:r,onManage:i,onOpenSessions:a,mobileView:s,onToggleMobileView:c,busy:u,snapshotStale:d=!1,readOnly:f=!1,missionView:p}){let{t:m}=q(),h=Ur(e.roles),g=p?.roles.find(e=>e.role===p.active_role),_=g?.role||h?.role||`manager`,v=g?g.status===`active`:!!h?.active,y=e.backlog.find(e=>Hr.has(e.status)),b=g?.label||y?.title||y?.objective||e.session.objective||m(`common.ready`),x=!!(e.partial||e.observability?.slo.status===`degraded`),S=e.daemon.alive&&e.daemon.control_available===!1,C=S?m(`topbar.externallyManaged`):e.daemon.alive?m(`topbar.pauseDaemon`):m(`topbar.runDaemon`),w=x?[...(e.diagnostics??[]).map(e=>`${e.section}: ${e.message}`),...e.observability?.slo.violations??[]].join(` -`)||m(`common.degraded`):m(d?`common.stale`:t?`common.live`:`common.reconnecting`);return(0,K.jsxs)(`header`,{className:`glass-panel glass-panel--raised flex h-12 min-w-0 shrink-0 items-center gap-2 border-b px-3 sm:gap-3 sm:px-4`,children:[a?(0,K.jsx)(`button`,{type:`button`,onClick:a,"aria-label":m(`topbar.openSessions`),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ink-faint hover:bg-bg hover:text-ink lg:hidden`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:(0,K.jsx)(`path`,{d:`M2.5 4h11M2.5 8h11M2.5 12h11`})})}):null,(0,K.jsx)(`div`,{className:`hidden min-w-0 max-w-28 truncate text-sm font-semibold text-ink sm:block`,children:e.session.display_name||e.session.id}),(0,K.jsx)(`span`,{className:`hidden h-4 w-px shrink-0 bg-line/40 sm:block`}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${v?`animate-pulse`:``}`,style:{background:z.role[_]||`rgb(var(--ink-faint))`}}),(0,K.jsx)(`span`,{className:`hidden shrink-0 text-xs font-semibold capitalize text-ink-dim sm:inline`,children:_}),(0,K.jsx)(`span`,{className:`truncate text-xs text-ink-faint`,children:b})]}),(0,K.jsx)(`span`,{title:w,className:`h-2 w-2 shrink-0 rounded-full transition-shadow duration-150 ${x||d?`bg-err ring-1 ring-err/30 ring-offset-1 ring-offset-panel`:t?`bg-ok ring-1 ring-ok/30 ring-offset-1 ring-offset-panel`:`bg-ink-faint/50`}`}),(0,K.jsx)(Pr,{settledUsd:e.spend_usd,knownUsd:e.usage_summary?.known_cost_usd,status:e.spend_status,calls:e.usage_summary?.call_count,premiumRequests:e.usage_summary?.premium_requests,live:e.daemon.alive,compact:!0}),c?(0,K.jsx)(`button`,{type:`button`,onClick:c,"aria-label":m(s===`activity`?`topbar.showPreview`:`topbar.showActivity`),title:m(s===`activity`?`topbar.showPreview`:`topbar.showActivity`),className:`icon-control flex h-8 w-8 shrink-0 items-center justify-center lg:hidden`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:s===`activity`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`rect`,{x:`2`,y:`2.5`,width:`12`,height:`11`,rx:`1.5`}),(0,K.jsx)(`path`,{d:`M9.5 2.75v10.5`})]}):(0,K.jsx)(`path`,{d:`M3 4h10M3 8h10M3 12h7`})})}):null,f?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{type:`button`,disabled:u||S,onClick:e.daemon.alive?r:n,"aria-label":C,title:S?m(`topbar.externalDaemonHint`):C,className:`compact-control flex h-8 shrink-0 items-center gap-1 px-2 disabled:opacity-40`,children:[(0,K.jsx)(o,{icon:e.daemon.alive?E:l,className:`h-3 w-3`}),(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:S?m(`common.external`):e.daemon.alive?m(`common.pause`):m(`common.run`)})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":m(`topbar.manageSession`),title:m(`topbar.manageSession`),onClick:i,className:`icon-control flex h-8 w-8 shrink-0 items-center justify-center text-sm tracking-widest`,children:`···`})]})]})}var Gr=`modulepreload`,Kr=function(e){return`/`+e},qr={},Jr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Kr(t,n),t=s(t),t in qr)return;qr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Gr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Yr={fast:.18,normal:.28},Xr={magnetic:5},Zr={all:`(min-width: 0px)`,reduceMotion:`(prefers-reduced-motion: reduce)`};function Qr(e,t,n=[]){let r=(0,M.useRef)(t);r.current=t,(0,M.useEffect)(()=>{let t=!1,n=null;return Jr(()=>import(`./motion-sqs9Ax-g.js`).then(e=>e.t).then(i=>{if(t||!e.current)return;let a=i.gsap;n=a.matchMedia(),n.add(Zr,e=>r.current(a,!!e.conditions?.reduceMotion),e.current)}),__vite__mapDeps([0,1])),()=>{t=!0,n?.revert()}},n)}function $r(e,t=!0){Qr(e,(n,r)=>{let i=e.current;if(!t||r||!i||!window.matchMedia(`(hover: hover) and (pointer: fine)`).matches)return;let a=n.quickTo(i,`x`,{duration:Yr.fast,ease:`power2.out`}),o=n.quickTo(i,`y`,{duration:Yr.fast,ease:`power2.out`}),s=null,c=()=>{s=i.getBoundingClientRect()},l=e=>{if(s||c(),!s)return;let t=((e.clientX-s.left)/s.width-.5)*Xr.magnetic*2,n=((e.clientY-s.top)/s.height-.5)*Xr.magnetic*2;a(t),o(n)},u=()=>{a(0),o(0)};return i.addEventListener(`pointerenter`,c),i.addEventListener(`pointermove`,l,{passive:!0}),i.addEventListener(`pointerleave`,u),window.addEventListener(`resize`,c),()=>{i.removeEventListener(`pointerenter`,c),i.removeEventListener(`pointermove`,l),i.removeEventListener(`pointerleave`,u),window.removeEventListener(`resize`,c)}},[t])}function ei(e){if(!e)return`—`;let t=Date.now()/1e3,n=Math.max(0,t-e);return n<5?`just now`:n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function J(e){if(e==null||e<0)return`—`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t?`${t}d ${n}h`:n?`${n}h ${r}m`:r?`${r}m`:`${Math.floor(e)}s`}function ti(e,t=2){return e==null||!isFinite(e)?`$0.00`:`$${e.toFixed(t)}`}function ni(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?r.toFixed(0):r.toFixed(1)} ${t[n]}`}function ri(e){let t=e.ts??e.time,n=null;if(typeof t==`number`)n=t>0xe8d4a51000?t:t*1e3;else if(typeof t==`string`){let e=Date.parse(t);isNaN(e)||(n=e)}if(n==null)return``;let r=new Date(n),i=e=>String(e).padStart(2,`0`);return`${i(r.getHours())}:${i(r.getMinutes())}:${i(r.getSeconds())}`}function ii(e){return e instanceof Error?e.message:String(e||`Unknown error`)}function ai(e,t){let n=ii(e);return t?`Reply interrupted after a partial response: ${n}`:`Message failed before a response was received: ${n}`}var oi=`operator console`,si=[`No active work.`,`Event stream is idle.`,`Ready for input.`];function ci(e,t=3800){return e[Math.floor(Date.now()/t)%e.length]}function li({ok:e,pulse:t=!1,title:n}){return(0,K.jsx)(`span`,{title:n,className:`inline-block h-1.5 w-1.5 rounded-full transition-shadow duration-150 ${e?`bg-ok ring-1 ring-ok/30 ring-offset-1 ring-offset-panel`:`bg-ink-faint/50`}`,"data-live":e&&t?`true`:void 0})}function ui({children:e,color:t,className:n=``}){return(0,K.jsx)(`span`,{className:`chip text-ink-dim ${n}`,style:t?{color:t,borderColor:`${t}44`}:void 0,children:e})}function di({children:e,onClick:t,variant:n=`ghost`,disabled:r,title:i,className:a=``}){let o=(0,M.useRef)(null);return $r(o,n!==`danger`&&!r),(0,K.jsx)(`button`,{ref:o,type:`button`,title:i,disabled:r,onClick:t,className:`brand-button ${{ghost:`brand-button-ghost`,primary:`brand-button-primary`,danger:`brand-button-danger`}[n]} ${a}`,children:e})}function fi({title:e,right:t}){return(0,K.jsxs)(`div`,{className:`panel-header flex min-h-11 items-center justify-between border-b px-4`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.06em] text-ink-faint`,children:e}),t]})}function pi(){return(0,K.jsx)(`span`,{className:`inline-block h-3 w-3 animate-spin rounded-full border-2 border-line border-t-blue`})}function mi({children:e}){return(0,K.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-ink-faint`,children:e})}async function hi(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function gi({text:e,label:t,copiedLabel:n,className:r=``}){let[i,a]=(0,M.useState)(!1),o=(0,M.useRef)();(0,M.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let s=async()=>{await hi(e)&&(a(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>a(!1),1600))};return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>void s(),"aria-label":i?n:t,title:i?n:t,className:`inline-flex h-7 items-center gap-1 rounded-md border border-line/60 bg-panel/85 px-2 text-[10px] text-ink-faint shadow-sm backdrop-blur transition hover:border-blue/45 hover:text-blue focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue/50 ${r}`,children:[i?(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,K.jsx)(`path`,{d:`m3.5 8.5 2.7 2.7 6.3-6.4`})}):(0,K.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,children:[(0,K.jsx)(`rect`,{x:`5.2`,y:`5.2`,width:`7.2`,height:`7.2`,rx:`1.2`}),(0,K.jsx)(`path`,{d:`M10.8 5.2V3.8a1.2 1.2 0 0 0-1.2-1.2H3.8a1.2 1.2 0 0 0-1.2 1.2v5.8a1.2 1.2 0 0 0 1.2 1.2h1.4`})]}),(0,K.jsx)(`span`,{children:i?n:t})]})}function _i(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(_i).join(``):(0,M.isValidElement)(e)?_i(e.props.children):``}function vi({src:e,alt:t}){let[n,r]=(0,M.useState)(!1);return n||!e?(0,K.jsxs)(`span`,{className:`text-xs text-ink-faint`,children:[`Image unavailable`,t?` · ${t}`:``]}):(0,K.jsx)(`img`,{src:e,alt:t||``,loading:`lazy`,decoding:`async`,onError:()=>r(!0),className:`my-2 h-auto max-w-full rounded-lg`})}function yi({children:e}){let{t}=q();return(0,K.jsx)(ge,{remarkPlugins:[_e],components:{h1:({children:e})=>(0,K.jsx)(`h1`,{className:`mb-2 mt-3 text-base font-semibold text-ink first:mt-0`,children:e}),h2:({children:e})=>(0,K.jsx)(`h2`,{className:`mb-1.5 mt-3 text-sm font-semibold text-ink first:mt-0`,children:e}),h3:({children:e})=>(0,K.jsx)(`h3`,{className:`mb-1 mt-2 text-sm font-medium text-ink first:mt-0`,children:e}),p:({children:e})=>(0,K.jsx)(`p`,{className:`my-1.5 whitespace-pre-wrap break-words leading-[1.625] first:mt-0 last:mb-0`,children:e}),ul:({children:e})=>(0,K.jsx)(`ul`,{className:`my-2 list-disc space-y-1 pl-5`,children:e}),ol:({children:e})=>(0,K.jsx)(`ol`,{className:`my-2 list-decimal space-y-1 pl-5`,children:e}),li:({children:e})=>(0,K.jsx)(`li`,{className:`pl-0.5`,children:e}),blockquote:({children:e})=>(0,K.jsx)(`blockquote`,{className:`my-2 border-l border-blue/50 pl-3 text-ink-dim`,children:e}),hr:()=>(0,K.jsx)(`hr`,{className:`my-3 border-line/60`}),a:({href:e,children:t})=>(0,K.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-blue underline decoration-blue/35 underline-offset-2 hover:decoration-blue`,children:t}),code:({className:e,children:t,...n})=>{let r=!!e||String(t).includes(` -`);return(0,K.jsx)(`code`,{...n,className:r?`block min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-ink ${e??``}`:`break-all rounded bg-bg px-1.5 py-0.5 font-mono text-xs text-ink`,children:t})},pre:({children:e})=>(0,K.jsxs)(`pre`,{className:`group/code relative my-2 max-w-full overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-line/50 bg-bg px-3 pb-3 pt-10`,children:[(0,K.jsx)(gi,{text:M.Children.toArray(e).map(_i).join(``),label:t(`copy.code`),copiedLabel:t(`copy.copied`),className:`absolute right-2 top-2`}),e]}),table:({children:e})=>(0,K.jsx)(`table`,{className:`my-2 w-full table-fixed border-collapse text-left text-xs`,children:e}),th:({children:e})=>(0,K.jsx)(`th`,{className:`break-words border border-line/60 bg-bg px-2 py-1.5 font-semibold text-ink`,children:e}),td:({children:e})=>(0,K.jsx)(`td`,{className:`break-words border border-line/60 px-2 py-1.5 align-top`,children:e}),strong:({children:e})=>(0,K.jsx)(`strong`,{className:`font-semibold text-ink`,children:e}),img:({src:e,alt:t})=>(0,K.jsx)(vi,{src:e,alt:t})},children:e})}function bi(e){return`${e}-${(0,M.useId)().replaceAll(`:`,``)}`}function xi({size:e,className:t=`text-ink`}){let n=bi(`argus-rounded-mark`);return(0,K.jsxs)(`svg`,{"data-logo":`rounded-mark`,viewBox:`0 0 512 512`,role:`img`,"aria-label":`Argus`,style:{width:e,height:e},className:`shrink-0 ${t}`,children:[(0,K.jsx)(`defs`,{children:(0,K.jsxs)(`linearGradient`,{id:n,gradientUnits:`userSpaceOnUse`,x1:`66`,y1:`0`,x2:`440`,y2:`0`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`rgb(var(--spectral-blue))`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`rgb(var(--spectral-gold))`})]})}),(0,K.jsx)(`path`,{d:`M352 112q0-30 30-30h28q30 0 30 30v320h-88v-52q-46 62-129 62Q66 442 66 266T228 88q80 0 124 56v-32ZM140 266q46-80 102-80t110 80q-54 80-110 80t-102-80Z`,fill:`url(#${n})`,fillRule:`evenodd`}),(0,K.jsx)(`path`,{d:`M286 266A42 42 0 1 0 202 266A42 42 0 1 0 286 266ZM274 248A12 12 0 1 0 250 248A12 12 0 1 0 274 248Z`,fill:`url(#${n})`,fillRule:`evenodd`})]})}function Si({size:e}){let t=bi(`argus-rounded-horizontal`);return(0,K.jsxs)(`svg`,{"data-logo":`rounded-horizontal`,viewBox:`150 40 1160 390`,role:`img`,"aria-label":`Argus`,style:{width:e*2.75,height:e},className:`shrink-0`,children:[(0,K.jsx)(`defs`,{children:(0,K.jsxs)(`linearGradient`,{id:t,gradientUnits:`userSpaceOnUse`,x1:`180`,y1:`0`,x2:`1280`,y2:`0`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`rgb(var(--spectral-blue))`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`rgb(var(--spectral-gold))`})]})}),(0,K.jsxs)(`g`,{transform:`translate(180 92) scale(.54)`,children:[(0,K.jsx)(`path`,{d:`M352 112q0-30 30-30h28q30 0 30 30v320h-88v-52q-46 62-129 62Q66 442 66 266T228 88q80 0 124 56v-32ZM140 266q46-80 102-80t110 80q-54 80-110 80t-102-80Z`,fill:`url(#${t})`,fillRule:`evenodd`}),(0,K.jsx)(`path`,{d:`M286 266A42 42 0 1 0 202 266A42 42 0 1 0 286 266ZM274 248A12 12 0 1 0 250 248A12 12 0 1 0 274 248Z`,fill:`url(#${t})`,fillRule:`evenodd`})]}),(0,K.jsxs)(`g`,{fill:`url(#${t})`,children:[(0,K.jsx)(`path`,{d:`M383 556Q394 556 409 555Q424 554 433 552L422 412Q415 414 401.5 415.5Q388 417 378 417Q340 417 305 403.5Q270 390 248.5 360Q227 330 227 278V0H78V546H191L213 454H220Q244 496 286 526Q328 556 383 556Z`,transform:`translate(444 334) scale(.36 -.36)`}),(0,K.jsx)(`path`,{d:`M255 556Q356 556 413 476H417L429 546H555V-1Q555-118 486-179Q417-240 282-240Q224-240 174.5-233Q125-226 78-208V-89Q179-131 291-131Q406-131 406-7V4Q406 21 407.5 39Q409 57 410 71H406Q378 28 339 9Q300-10 251-10Q154-10 99.5 64.5Q45 139 45 272Q45 406 101 481Q157 556 255 556ZM302 435Q197 435 197 270Q197 107 304 107Q361 107 388.5 139.5Q416 172 416 253V271Q416 359 389 397Q362 435 302 435Z`,transform:`translate(617.52 334) scale(.36 -.36)`}),(0,K.jsx)(`path`,{d:`M579 546V0H465L445 70H437Q411 28 365.5 9Q320-10 269-10Q181-10 128 37.5Q75 85 75 190V546H224V227Q224 169 245 139Q266 109 312 109Q380 109 405 155.5Q430 202 430 289V546Z`,transform:`translate(855.48 334) scale(.36 -.36)`}),(0,K.jsx)(`path`,{d:`M459 162Q459 79 400.5 34.5Q342-10 226-10Q169-10 128-2.5Q87 5 46 22V145Q90 125 141 112Q192 99 231 99Q275 99 293.5 112Q312 125 312 146Q312 160 304.5 171Q297 182 272 196Q247 210 194 232Q143 254 110 275.5Q77 297 61 327.5Q45 358 45 404Q45 480 104 518Q163 556 261 556Q312 556 358 546Q404 536 453 513L408 406Q368 423 332 434.5Q296 446 259 446Q193 446 193 410Q193 397 201.5 386.5Q210 376 234.5 364Q259 352 307 332Q354 313 388 292.5Q422 272 440.5 241.5Q459 211 459 162Z`,transform:`translate(1102.08 334) scale(.36 -.36)`})]})]})}function Ci({size:e=20,tag:t,compact:n=!1}){return(0,K.jsxs)(`span`,{className:`inline-flex select-none items-center gap-2.5`,children:[n?(0,K.jsx)(xi,{size:e}):(0,K.jsx)(Si,{size:e}),t&&!n?(0,K.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-ink-faint`,children:t}):null]})}var wi=[`manager`,`planner`,`engineer`,`reviewer`],Ti=/Info: (?:Operation cancelled by user|Response was interrupted due to a server error\. Retrying\.\.\.)/gi;function Ei(e){let t=new Map;return e.forEach(e=>{let n=String(e.type??``);if(n===`life.mission.completed`||n===`mission.completed`){t.clear();return}let r=String(e.call_id??``);r&&(n===`provider.request.started`?t.set(r,e):(n===`provider.request.completed`||n===`provider.request.denied`)&&t.delete(r))}),Array.from(t.values()).at(-1)??null}function Di({ev:e,r:t,first:n,last:r}){let i=z.role[t.role]??z.inkFaint,a=tr(t.tone);return(0,K.jsxs)(`div`,{className:`group relative grid grid-cols-[16px_minmax(0,1fr)] gap-3 px-4 py-3 transition-colors hover:bg-bg/70 ${r?`animate-appear`:``} ${t.reasoning?`opacity-60`:``}`,style:t.rule?{marginTop:4}:void 0,children:[(0,K.jsxs)(`div`,{className:`relative flex justify-center`,children:[n?null:(0,K.jsx)(`span`,{className:`absolute -top-2.5 h-4 w-px bg-line/60`}),r?null:(0,K.jsx)(`span`,{className:`absolute -bottom-2.5 top-2 w-px bg-line/60`}),(0,K.jsx)(`span`,{className:`relative z-10 mt-1.5 h-2 w-2 rounded-full border-2 border-panel`,style:{backgroundColor:i,boxShadow:`0 0 0 1px ${i}55`}})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-semibold uppercase tracking-[0.06em]`,style:{color:i},title:t.label,children:t.label}),(0,K.jsx)(`span`,{className:`text-xs`,style:{color:a},children:t.glyph}),(0,K.jsx)(`time`,{className:`ml-auto font-mono text-xs tabular-nums text-ink-faint opacity-0 transition-opacity group-hover:opacity-100`,children:ri(e)})]}),(0,K.jsx)(`div`,{className:`mt-0.5 whitespace-pre-wrap break-words text-sm leading-5 ${t.reasoning?`italic`:``}`,style:{color:a},children:t.text})]})]})}function Oi({ev:e,r:t}){let{t:n}=q(),r=String(e.type)===`ui.operator`,i=Number(e.response_latency_ms??0),a=!r&&i>=100?` · ${(i/1e3).toFixed(1)}s`:``,o=(0,M.useRef)(null);return Qr(o,(e,t)=>{o.current&&(t||e.fromTo(o.current,{autoAlpha:0,x:r?12:0,y:r?0:8},{autoAlpha:1,x:0,y:0,duration:.28,ease:`power2.out`,clearProps:`transform,opacity,visibility`}))}),(0,K.jsx)(`article`,{ref:o,className:`group mx-auto w-full max-w-full px-4 py-3 sm:px-6 lg:max-w-[61.8vw]`,children:r?(0,K.jsxs)(`div`,{className:`flex items-end justify-end gap-2`,children:[(0,K.jsx)(gi,{text:t.text,label:n(`copy.message`),copiedLabel:n(`copy.copied`),className:`opacity-60 sm:opacity-0 sm:group-hover:opacity-100`}),(0,K.jsx)(`time`,{className:`shrink-0 pb-1 font-mono text-[10px] tabular-nums text-ink-faint`,children:ri(e)}),(0,K.jsx)(`div`,{className:`max-w-[calc(100%_-_3rem)] rounded-[18px] bg-conversation-user px-4 py-2.5 text-[15px] leading-relaxed text-ink ring-1 ring-line/35 sm:max-w-[82%]`,children:(0,K.jsx)(yi,{children:t.text})})]}):(0,K.jsxs)(`div`,{className:`flex gap-3`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center`,children:(0,K.jsx)(xi,{size:26,className:`text-blue`})}),(0,K.jsxs)(`div`,{className:`relative min-w-0 flex-1 text-[15px] leading-relaxed text-ink`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-blue`,children:`Argus`}),(0,K.jsx)(gi,{text:t.text,label:n(`copy.message`),copiedLabel:n(`copy.copied`),className:`ml-auto opacity-60 sm:opacity-0 sm:group-hover:opacity-100`}),(0,K.jsxs)(`time`,{className:`font-mono text-[10px] tabular-nums text-ink-faint`,children:[ri(e),a]})]}),(0,K.jsx)(yi,{children:t.text})]})]})})}function ki({role:e,rows:t,open:n,active:r,onToggle:i}){let a=z.role[e],o=(0,M.useRef)(null),s=t[t.length-1]?.r.text.length??0;return(0,M.useEffect)(()=>{if(!n)return;let e=window.requestAnimationFrame(()=>{o.current&&o.current.scrollHeight>o.current.clientHeight&&(o.current.scrollTop=o.current.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[n,t.length,s]),(0,K.jsxs)(`section`,{className:`role-log-group border-b border-line/50`,"data-role":e,"data-open":n?`true`:`false`,"data-active":r?`true`:`false`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":n,className:`group flex h-11 w-full items-center gap-2 px-4 text-left transition-colors hover:bg-bg/60`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 rounded-full ${r?`animate-pulse`:`opacity-55`}`,style:{background:a}}),(0,K.jsx)(`span`,{className:`text-xs font-semibold capitalize text-ink-dim`,children:e}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-ink-faint`,children:t.length}),t.length>0?(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-ink-faint`,children:t[t.length-1].r.text}):(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-ink-faint transition-transform duration-panel ease-panel ${n?`rotate-90`:``}`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,K.jsx)(`path`,{d:`m6 3.5 4.5 4.5L6 12.5`})})]}),(0,K.jsx)(`div`,{className:`grid transition-[grid-template-rows] duration-panel ease-panel ${n?`grid-rows-[1fr]`:`grid-rows-[0fr]`}`,children:(0,K.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:(0,K.jsx)(`div`,{ref:o,className:`max-h-72 overflow-x-hidden overflow-y-auto border-t border-line/40 scroll-thin`,children:t.length>0?t.map(({ev:e,r:n,key:r},i)=>(0,K.jsx)(Di,{ev:e,r:n,first:i===0,last:i===t.length-1},r)):(0,K.jsx)(`div`,{className:`px-4 py-3 text-xs text-ink-faint`,children:`No logs`})})})})]})}function Ai(e){let t={manager:[],planner:[],engineer:[],reviewer:[]},n=[];return e.forEach(e=>{wi.includes(e.r.role)?t[e.r.role].push(e):n.push(e)}),{roleRows:t,systemRows:n,lastRole:[...e].reverse().find(e=>wi.includes(e.r.role))?.r.role??``}}function ji({rows:e,live:t}){let{roleRows:n,systemRows:r,lastRole:i}=(0,M.useMemo)(()=>Ai(e),[e]),[a,o]=(0,M.useState)(()=>new Set(t&&i?[i]:[])),s=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{!t||!i||s.current||o(new Set([i]))},[i,t]),(0,K.jsxs)(`div`,{className:`bg-bg/25`,children:[wi.map(e=>(0,K.jsx)(ki,{role:e,rows:n[e],open:a.has(e),active:i===e,onToggle:()=>{s.current=!0,o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}},e)),r.length>0?(0,K.jsxs)(`details`,{className:`border-b border-line/50`,children:[(0,K.jsxs)(`summary`,{className:`flex h-10 cursor-pointer list-none items-center gap-2 px-4 text-xs text-ink-faint hover:bg-bg/60`,children:[(0,K.jsx)(`span`,{children:`System`}),(0,K.jsx)(`span`,{className:`font-mono`,children:r.length})]}),(0,K.jsx)(`div`,{className:`border-t border-line/40`,children:r.map(({ev:e,r:t,key:n},i)=>(0,K.jsx)(Di,{ev:e,r:t,first:i===0,last:i===r.length-1},n))})]}):null]})}function Mi({group:e,latest:t}){let n=e=>e.ev.type===`ui.argus`&&/^(info:|operation cancelled|cancelled\b)/i.test(e.r.text.trim()),r=e.rows.filter(e=>e.ev.type===`ui.argus`).map(e=>{let t=e.r.text.match(Ti)??[],r=e.r.text.replace(Ti,``).trim();return{reply:r&&!n(e)?{...e,r:{...e.r,text:r}}:null,messages:n(e)&&t.length===0?[e.r.text]:t}}),i=r.flatMap(e=>e.reply?[e.reply]:[]),a=r.flatMap(e=>e.messages),o=e.rows.filter(({ev:e})=>e.type!==`ui.argus`);return(0,K.jsxs)(`section`,{className:`border-b border-line/60`,children:[(0,K.jsx)(Oi,{ev:e.operator.ev,r:e.operator.r}),i.map(e=>(0,K.jsx)(Oi,{ev:e.ev,r:e.r},e.key)),a.map((t,n)=>(0,K.jsx)(`div`,{className:`mx-auto w-full max-w-full px-6 py-1.5 text-center text-xs text-ink-faint lg:max-w-[61.8vw]`,children:t},`${e.key}-system-${n}`)),o.length>0?(0,K.jsx)(`div`,{className:`mx-auto w-full max-w-full border-t border-line/40 lg:max-w-[61.8vw]`,children:(0,K.jsx)(ji,{rows:o,live:t})}):null]})}function Ni({events:e,connected:t,showReasoning:n,onToggleReasoning:r,embedded:i=!1,filter:a=`all`,query:o=``,skipFirst:s=0}){let{locale:c,t:l}=q(),[u,d]=(0,M.useState)(!0),[f,p]=(0,M.useState)(()=>Date.now()),m=(0,M.useRef)(null),h=(0,M.useMemo)(()=>Ei(e),[e]);(0,M.useEffect)(()=>{if(!h)return;p(Date.now());let e=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(e)},[h]);let g=h?Math.max(0,Math.floor((f-Number(h.ts??0)*1e3)/1e3)):0,_=(0,M.useMemo)(()=>{let t=[],r=new Map,i=0;return(s>0?e.slice(s):e).forEach((e,s)=>{let l=nr(e,c);if(!l)return;if(l.reasoning&&!n){i++;return}if(!At(e,l,a,o))return;let u=e,d=String(u.message_id??``),f=!!d&&String(u.type)===`engineer.progress`&&[`assistant_message`,`agent_message`,`message`].includes(String(u.kind));if(f&&r.has(d)){let n=r.get(d);t[n]={...t[n],ev:{...t[n].ev,...e},r:{...t[n].r,...l,text:Dt(t[n].r.text,l.text,Tt(e))}};return}let p={ev:e,r:l,key:rr(e,s)};f&&r.set(d,t.length),t.push(p)}),{list:t,hiddenReasoning:i}},[e,n,a,o,s,c]),v=(0,M.useMemo)(()=>{let e=[],t=[],n=null;return _.list.forEach(r=>{r.ev.type===`ui.operator`?(n={key:r.key,operator:r,rows:[]},e.push(n)):n?n.rows.push(r):t.push(r)}),{groups:e,earlier:t}},[_.list]),y=(0,M.useMemo)(()=>e.filter(xt).length,[e]),b=(0,M.useMemo)(()=>_.list.slice(-20).reduce((e,t)=>e+t.r.text.length,0),[_.list]);return(0,M.useEffect)(()=>{u&&m.current&&(m.current.scrollTop=m.current.scrollHeight)},[_.list.length,b,u]),(0,M.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>d(e.scrollHeight-e.scrollTop-e.clientHeight<40);return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]),(0,K.jsxs)(`section`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden bg-panel ${i?``:`rounded-lg border border-line/80`}`,children:[(0,K.jsx)(fi,{title:l(`panel.activity`),right:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(`button`,{onClick:r,className:`rounded px-1.5 py-0.5 text-xs transition-colors ${n?`text-blue-sky`:`text-ink-faint hover:text-ink-dim`}`,title:`toggle agent reasoning (⌘T)`,children:[`reasoning`,y?` ·${y}`:``]}),(0,K.jsx)(`span`,{className:`text-xs ${t?`text-ok`:`text-ink-faint`}`,children:t?`● live`:`○ reconnecting`})]})}),h?(0,K.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line/60 bg-blue-deep/5 px-4 text-xs text-ink-dim`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-blue-sky`}),(0,K.jsxs)(`span`,{className:`truncate`,children:[String(h.run_label??`provider call`),` · working`]}),(0,K.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono tabular-nums text-ink-faint`,children:[g,`s`]})]}):null,(0,K.jsx)(`div`,{ref:m,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto pb-6 pt-1.5 scroll-thin`,children:_.list.length===0?(0,K.jsx)(mi,{children:ci(si)}):(0,K.jsxs)(K.Fragment,{children:[v.earlier.length>0?(0,K.jsxs)(`section`,{className:`mx-auto w-full max-w-full border-b border-line/60 lg:max-w-[61.8vw]`,children:[(0,K.jsxs)(`div`,{className:`flex h-10 items-center gap-2 border-b border-line/40 px-4 text-[10px] font-semibold uppercase tracking-[0.12em] text-ink-faint`,children:[`Autonomous activity`,(0,K.jsx)(`span`,{className:`font-mono font-normal tracking-normal`,children:v.earlier.length})]}),(0,K.jsx)(ji,{rows:v.earlier,live:v.groups.length===0})]}):null,v.groups.map((e,t)=>(0,K.jsx)(Mi,{group:e,latest:t===v.groups.length-1},e.key))]})}),!u&&(0,K.jsx)(`button`,{onClick:()=>{d(!0),m.current?.scrollTo({top:m.current.scrollHeight,behavior:`smooth`})},"aria-label":l(`stream.jumpToLatest`),title:l(`stream.jumpToLatest`),className:`absolute bottom-4 left-1/2 flex h-8 w-8 -translate-x-1/2 items-center justify-center rounded-full border border-line/60 bg-panel text-sm text-ink-dim shadow-glow transition-all duration-200 hover:border-ink-faint hover:text-ink`,children:`↓`})]})}function Pi(e){return e.nativeEvent.isComposing||e.keyCode===229}var Fi={Everyday:`常用`,"Task management":`任务管理`,"Sessions & diagnostics":`会话与诊断`,Configuration:`配置`,Other:`其他`},Ii={status:`查看角色、队列、日志和健康状态`,roles:`查看各角色的后端、模型、推理强度和实时活动`,journal:`查看近期日志(默认 10 条)`,backlog:`查看待处理任务(all 包含已完成和已跳过)`,artifacts:`查看 Reviewer 批准的结果文件(按 Enter 预览)`,artifact:`预览一个已批准的结果文件`,events:`搜索动态:all / watch / milestones / messages`,find:`搜索当前事件缓冲区`,cancel:`停止等待当前 Manager 回复`,ask:`直接回答,不排任务、不走 Planner/Engineer/Reviewer`,task:`直接加入任务队列`,plan:`预览 Planner 编写的执行计划`,rewrite:`让 Manager 在发送前改写提示词`,nudge:`向正在运行的任务注入指导`,abort:`立即终止正在运行的任务`,note:`向时间线添加手动备注`,done:`将任务标记为完成`,skip:`跳过任务`,stop:`停止任务的自动迭代`,item:`查看完整任务契约`,run:`返回持续更新的任务动态`,new:`检查、创建并切换到新会话`,daemons:`查找全部会话并切换或创建`,resume:`切换到其他项目或会话`,attach:`跟随其他项目并读取其动态`,rename:`重命名当前会话`,doctor:`诊断为什么没有任务运行`,backend:`查看或更改共享 Runner 后端`,config:`查看或更改运行时设置`,identity:`查看或替换操作者身份卡`,reset:`清除 Manager 的热会话上下文`,skills:`查看或提升运行时 Skill`,clear:`清空事件动态视图`,reconnect:`重新连接实时事件流`,help:`查看快捷键和完整命令参考`,quit:`离开控制台(后台工作继续运行)`};function Li(e,t){return t===`zh-CN`?Ii[e.id]:e.desc}function Ri(e,t){return t===`zh-CN`?Fi[e.group]:e.group}function zi(e,t){let n=new Map;for(let r of e){let e=Ri(r,t),i=r.aliases?.length?` (= ${r.aliases.join(`, `)})`:``,a=`${r.name}${r.arg?` ${r.arg}`:``}${i}`;n.has(e)||n.set(e,[]),n.get(e).push({label:a,desc:Li(r,t)})}return[...n.entries()].map(([e,t])=>({group:e,rows:t}))}var Y=`slash-completion-listbox`;function X(e,t){return t<=0?0:Math.max(0,Math.min(e,t-1))}function Bi(e){return`slash-completion-option-${e}`}function Vi({query:e,selected:t,onSelect:n}){let{locale:r,t:i}=q(),a=Lt(e);if(a.length===0)return null;let o=a.slice(0,8),s=X(t,o.length);return(0,K.jsx)(`div`,{id:Y,role:`listbox`,"aria-label":i(`slash.suggestions`),className:`slash-completion-menu scroll-thin border-b border-line/40`,children:o.map((e,t)=>(0,K.jsxs)(`button`,{id:Bi(e.id),type:`button`,role:`option`,"aria-selected":t===s,onPointerDown:e=>{e.preventDefault(),n(t)},className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm transition-colors ${t===s?`bg-blue/10 text-ink`:`text-ink-dim hover:bg-line/20`}`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-blue`,children:e.name}),e.arg?(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-ink-faint`,children:e.arg}):null,(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-ink-faint`,children:Li(e,r)})]},e.id))})}var Hi=10485760,Ui=26214400,Wi=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.pdf`,`.md`,`.markdown`,`.txt`,`.json`,`.csv`].join(`,`),Gi={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".webp":`image/webp`,".pdf":`application/pdf`,".md":`text/markdown`,".markdown":`text/markdown`,".txt":`text/plain`,".json":`application/json`,".csv":`text/csv`};function Ki(e){let t=String(e||``).trim().toLowerCase(),n=t.lastIndexOf(`.`);return n>=0?t.slice(n):``}function qi(e){return Gi[Ki(e.name)]||String(e.type||``).split(`;`,1)[0].trim()||`application/octet-stream`}function Ji(e){return Object.hasOwn(Gi,Ki(e.name))}function Yi(e){return qi(e).startsWith(`image/`)}function Xi(e){return[e.name,String(e.size),qi(e),String(e.lastModified??``)].join(`::`)}function Zi(e,t){let n=[],r=[],i=new Set(e.map(Xi)),a=e.reduce((e,t)=>e+Math.max(0,t.size||0),0),o=e.length;for(let e of t){let t=Xi(e);if(!i.has(t)){if(i.add(t),!Ji(e)){r.push({code:`unsupported`,fileName:e.name});continue}if(o>=5){r.push({code:`too-many`,limitCount:5});continue}if(e.size>10485760){r.push({code:`too-large`,fileName:e.name,limitBytes:Hi});continue}if(a+e.size>26214400){r.push({code:`too-large-total`,limitBytes:Ui});continue}n.push(e),a+=e.size,o+=1}}return{accepted:n,issues:r}}function Qi(e){return e?Array.from(e):[]}function $i(e){return Qi(e?.types).map(e=>String(e)).includes(`Files`)||ea(e).length>0}function ea(e){let t=Qi(e?.files).filter(e=>e instanceof File);if(t.length)return t;let n=[];for(let t of Qi(e?.items)){if(String(t?.kind||``)!==`file`||typeof t?.getAsFile!=`function`)continue;let e=t.getAsFile();e instanceof File&&n.push(e)}return n}function ta({file:e,removeLabel:t,onRemove:n}){let[r,i]=(0,M.useState)(``);return(0,M.useEffect)(()=>{if(!Yi(e)||typeof URL>`u`||typeof URL.createObjectURL!=`function`){i(``);return}let t=URL.createObjectURL(e);return i(t),()=>URL.revokeObjectURL(t)},[e]),(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-2xl border border-line/50 bg-panel/80 px-2.5 py-2 text-xs shadow-[0_10px_24px_-20px_rgb(var(--spectral-blue)/0.8)]`,children:[r?(0,K.jsx)(`img`,{src:r,alt:``,className:`h-10 w-10 shrink-0 rounded-xl border border-line/40 object-cover`}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate font-medium text-ink`,title:e.name,children:e.name}),(0,K.jsxs)(`div`,{className:`truncate text-ink-faint`,children:[ni(e.size),` · `,qi(e)]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":t,title:t,className:`send-control h-8 w-8 shrink-0 rounded-full border-line/60 text-ink-faint hover:border-err/50 hover:bg-err/10 hover:text-err`,children:`×`})]})}function na(e,t){if(!t.onRewrite||!Xn(e.key,e.ctrlKey,e.metaKey))return!1;e.preventDefault();let n=t.value.trim();return n&&!t.disabled&&!t.pending&&!t.rewriting&&t.onRewrite(n),!0}function ra({value:e,onChange:t,onSend:n,onCancel:r,disabled:i,pending:a,focusSignal:o,embedded:s=!1,phase:c=``,heartbeat:l=!1,quietS:u=0,startedAt:d=0,steps:f=[],onRewrite:p,rewriting:m=!1,slashSelection:h,onSlashSelectionChange:g}){let{t:_}=q(),v=(0,M.useRef)(null),y=(0,M.useRef)(null),[b,x]=(0,M.useState)(0),[S,C]=(0,M.useState)(!1),[w,T]=(0,M.useState)([]),[ee,te]=(0,M.useState)(``),[E,ne]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!a&&!m)return;x(e=>e+1);let e=setInterval(()=>x(e=>e+1),120);return()=>clearInterval(e)},[a,m]);let re=Hn(c,b,l,u),ie=d?Math.max(0,Math.floor((Date.now()-d)/1e3)):0,ae=qn(f),D=Date.now()/1e3;(0,M.useEffect)(()=>{o&&!i&&v.current?.focus()},[o,i]);let O=Lt(e).slice(0,8),oe=O.length>0&&!S,se=oe?X(h,O.length):0,ce=oe?O[se]:void 0,k=e=>{let n=O[e];n&&(t(zt(n)),n.argument===`none`&&C(!0),g(0),v.current?.focus())},le=async()=>{let r=e.trim();!r||a||i||await n(r,w.map(e=>e.file))&&(t(``),g(0),C(!1),T([]),te(``))},A=(e,t)=>_(e===`unsupported`?`chat.attachUnsupported`:e===`too-large`?`chat.attachTooLarge`:e===`too-many`?`chat.attachTooMany`:`chat.attachTotalTooLarge`,t),ue=e=>{if(!e.length||i||a)return;let{accepted:t,issues:n}=Zi(w.map(e=>e.file),e);t.length&&T(e=>[...e,...t.map(e=>({id:globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`,file:e}))]),te(n.map(e=>e.code===`unsupported`?A(e.code,{name:e.fileName}):e.code===`too-large`?A(e.code,{name:e.fileName,size:ni(e.limitBytes)}):e.code===`too-many`?A(e.code,{count:e.limitCount}):A(e.code,{size:ni(e.limitBytes)})).join(` `))};return(0,K.jsxs)(`div`,{onDragEnter:e=>{$i(e.dataTransfer)&&(e.preventDefault(),ne(e=>e+1))},onDragOver:e=>{$i(e.dataTransfer)&&e.preventDefault()},onDragLeave:e=>{$i(e.dataTransfer)&&(e.preventDefault(),ne(e=>Math.max(0,e-1)))},onDrop:e=>{$i(e.dataTransfer)&&(e.preventDefault(),ne(0),ue(ea(e.dataTransfer)))},className:`glass-card glass-panel--raised flex flex-col overflow-hidden rounded-2xl ${s?`shadow-[0_12px_36px_-22px_rgb(var(--spectral-violet)/0.7)] backdrop-blur-md`:``} ${E>0?`ring-2 ring-manager/60 ring-offset-0`:``}`,children:[a?(0,K.jsxs)(`div`,{className:`border-b border-line/40 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`font-mono text-manager`,children:Vn(b)}),(0,K.jsx)(`span`,{className:`shrink-0 font-semibold text-manager`,children:_(`chat.yourMessage`)}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-blue`,title:re,children:re}),(0,K.jsxs)(`span`,{className:`shrink-0 font-mono tabular-nums text-ink-faint`,children:[ie,`s`]})]}),ae.length?(0,K.jsx)(`ol`,{className:`mt-1.5 space-y-0.5`,children:ae.map((e,t)=>{let n=t===ae.length-1&&!e.endedTs,r=Yn(Jn(e,D));return(0,K.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono ${n?`text-manager`:`text-ok`}`,children:n?Vn(b):`✓`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono ${n?`text-ink`:`text-ink-faint`}`,title:e.detail||e.label,children:e.label}),r?(0,K.jsx)(`span`,{className:`shrink-0 font-mono tabular-nums text-ink-faint`,children:r}):null]},e.id)})}):null,(0,K.jsx)(`div`,{className:`mt-1 text-xs text-ink-faint`,children:_(`chat.stopWaitingHint`)})]}):null,oe?(0,K.jsx)(Vi,{query:e,selected:se,onSelect:k}):null,w.length||ee||E>0?(0,K.jsxs)(`div`,{className:`border-b border-line/30 px-3 py-2`,children:[E>0?(0,K.jsx)(`div`,{className:`mb-2 text-xs font-medium text-manager`,children:_(`chat.attachDrop`)}):null,w.length?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.map(e=>(0,K.jsx)(ta,{file:e.file,removeLabel:_(`chat.attachRemove`,{name:e.file.name}),onRemove:()=>{T(t=>t.filter(t=>t.id!==e.id)),te(``)}},e.id))}):null,(0,K.jsx)(`div`,{className:`mt-2 text-xs ${ee?`text-err`:`text-ink-faint`}`,children:ee||_(`chat.attachHint`,{count:5,perFile:ni(10485760),total:ni(26214400)})})]}):null,(0,K.jsxs)(`div`,{className:`flex items-end gap-2 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`pb-2 font-mono text-lg text-blue`,title:_(`chat.messageArgus`),children:`›`}),(0,K.jsx)(`input`,{ref:y,type:`file`,multiple:!0,accept:Wi,onChange:e=>{ue(Array.from(e.target.files??[])),e.target.value=``},className:`hidden`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>y.current?.click(),disabled:i||a,title:`${_(`chat.attach`)} · ${_(`chat.attachHint`,{count:5,perFile:ni(Hi),total:ni(Ui)})}`,"aria-label":_(`chat.attach`),className:`send-control h-9 w-9 shrink-0 rounded-full border-line/70 bg-panel/80 text-base text-ink-faint hover:border-blue/50 hover:bg-blue/10 hover:text-blue disabled:opacity-40`,children:`📎`}),(0,K.jsx)(`textarea`,{ref:v,value:e,onChange:e=>{t(e.target.value),g(0),C(!1)},onPaste:e=>{let t=ea(e.clipboardData);t.length&&(e.preventDefault(),ue(t))},onKeyDown:t=>{Pi(t)||na(t,{value:e,disabled:i,pending:a,rewriting:m,onRewrite:p})||(oe?t.key===`ArrowDown`?(t.preventDefault(),g(X(se+1,O.length))):t.key===`ArrowUp`?(t.preventDefault(),g(X(se-1,O.length))):t.key===`Tab`||t.key===`Enter`&&!t.shiftKey?(t.preventDefault(),k(se)):t.key===`Escape`&&(t.preventDefault(),C(!0)):t.key===`Escape`&&a?(t.preventDefault(),r()):t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),le()))},"aria-keyshortcuts":`Control+R Meta+R`,rows:1,disabled:i,"aria-controls":oe?Y:void 0,"aria-expanded":oe,"aria-activedescendant":ce?Bi(ce.id):void 0,placeholder:_(i?`chat.selectSession`:`chat.placeholder`),className:`max-h-48 min-h-[38px] min-w-0 flex-1 resize-none bg-transparent py-2 font-sans text-[15px] text-ink outline-none placeholder:text-ink-faint`,style:{fieldSizing:`content`}}),p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>p(e.trim()),disabled:i||a||m||!e.trim(),title:`Ctrl/⌘+R · ${_(`chat.rewriteHint`)}`,"aria-label":_(`chat.rewriteLabel`),"aria-keyshortcuts":`Control+R Meta+R`,className:`send-control h-9 shrink-0 rounded-full border-manager/70 bg-manager/10 px-3 text-xs font-medium text-manager hover:border-manager hover:bg-manager/20 disabled:opacity-40`,children:m?`${Vn(b)} ${_(`chat.rewriting`)}`:_(`chat.rewrite`)}):null,(0,K.jsx)(`button`,{type:`button`,onClick:a?r:()=>void le(),disabled:i||!a&&!e.trim(),title:a?_(`chat.stopWaitingTitle`):void 0,"aria-label":_(a?`chat.stopWaiting`:`chat.send`),className:`send-control h-9 w-9 shrink-0 rounded-full text-sm font-medium disabled:opacity-40 ${a?`border-line text-warn hover:border-warn/60 hover:bg-warn/10`:`border-blue/70 bg-blue/10 text-blue hover:border-blue hover:bg-blue/20`}`,children:a?`■`:`↑`})]})]})}function ia({open:e,onClose:t,children:n,label:r,width:i=`max-w-2xl`,align:a=`center`}){let o=(0,M.useRef)(null),s=(0,M.useRef)(null),c=(0,M.useRef)(t);return c.current=t,Qr(o,(t,n)=>{if(!(!e||!o.current||!s.current)){if(n){t.set([s.current,o.current],{clearProps:`all`});return}t.timeline({defaults:{overwrite:`auto`}}).fromTo(s.current,{autoAlpha:0},{autoAlpha:1,duration:.18,ease:`power1.out`},0).fromTo(o.current,{autoAlpha:0,y:a===`top`?-10:12,scale:.985},{autoAlpha:1,y:0,scale:1,duration:.28,ease:`power3.out`,clearProps:`transform,opacity,visibility`},.03)}},[e,a]),(0,M.useEffect)(()=>{if(!e)return;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=window.requestAnimationFrame(()=>{(o.current?.querySelector(`[data-autofocus]`)??o.current?.querySelector(`input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])`)??o.current)?.focus()}),r=e=>{if(e.key===`Escape`){e.preventDefault(),c.current();return}if(e.key!==`Tab`||!o.current)return;let t=Array.from(o.current.querySelectorAll(`input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])`)).filter(e=>e.getAttribute(`aria-hidden`)!==`true`);if(t.length===0){e.preventDefault(),o.current.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&(document.activeElement===n||!o.current.contains(document.activeElement))?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,r),()=>{window.cancelAnimationFrame(n),window.removeEventListener(`keydown`,r),t?.isConnected&&t.focus()}},[e]),e?(0,K.jsxs)(`div`,{className:`fixed inset-0 z-50 flex ${a===`top`?`items-start pt-4 sm:pt-16`:`items-center`} justify-center p-4`,onMouseDown:t,children:[(0,K.jsx)(`div`,{ref:s,className:`absolute inset-0 bg-[rgb(4_11_24_/_0.58)] backdrop-blur-md`}),(0,K.jsx)(`div`,{ref:o,role:`dialog`,"aria-modal":`true`,"aria-label":r,tabIndex:-1,className:`brand-modal glass-panel glass-panel--raised relative z-10 w-full ${i} max-h-[calc(100dvh-2rem)] overflow-x-hidden overflow-y-auto rounded-xl border shadow-glow scroll-thin sm:max-h-[88dvh]`,onMouseDown:e=>e.stopPropagation(),children:n})]}):null}function aa({title:e,sub:t}){return(0,K.jsxs)(`div`,{className:`border-b border-line px-5 py-3`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-ink`,children:e}),t&&(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-faint`,children:t})]})}function oa(e,t,n,r=`en`){return e.map(e=>({id:`command-${e.id}`,label:Li(e,r),hint:`${e.name}${e.arg?` ${e.arg}`:``}`,group:Ri(e,r),keywords:[e.name,...e.aliases??[]].join(` `),run:()=>Nt(e)?n(`${e.name} `):t(e.name)}))}function sa(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);return n.length?e.filter(e=>{let t=`${e.label} ${e.group} ${e.hint??``} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))}):e}function ca({open:e,onClose:t,items:n}){let{t:r}=q(),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(0),c=(0,M.useRef)(null),l=(0,M.useRef)(null);(0,M.useEffect)(()=>{e&&(a(``),s(0),setTimeout(()=>c.current?.focus(),0))},[e]);let u=(0,M.useMemo)(()=>sa(n,i),[i,n]);(0,M.useEffect)(()=>{o>=u.length&&s(Math.max(0,u.length-1))},[u.length,o]),(0,M.useEffect)(()=>{l.current?.scrollIntoView({block:`nearest`})},[e,i,o]);let d=e=>{e&&(t(),e.run())},f=e=>{Pi(e)||(e.key===`ArrowDown`?(e.preventDefault(),u.length&&s(e=>Math.min(u.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(0,e-1))):e.key===`Enter`&&(e.preventDefault(),d(u[o])))},p=[];for(let e of u){let t=p.find(t=>t.name===e.group);t||(t={name:e.group,items:[]},p.push(t)),t.items.push(e)}let m=-1;return(0,K.jsxs)(ia,{open:e,onClose:t,label:r(`help.palette`),width:`max-w-xl`,align:`top`,children:[(0,K.jsx)(`div`,{className:`border-b border-line px-4 py-3`,children:(0,K.jsx)(`input`,{ref:c,value:i,onChange:e=>a(e.target.value),onKeyDown:f,placeholder:r(`palette.placeholder`),role:`combobox`,"aria-expanded":e,"aria-autocomplete":`list`,"aria-controls":`command-palette-results`,"aria-activedescendant":u[o]?`palette-${u[o].id}`:void 0,className:`w-full bg-transparent font-mono text-sm text-ink outline-none placeholder:text-ink-faint`})}),(0,K.jsxs)(`div`,{id:`command-palette-results`,role:`listbox`,className:`max-h-[52vh] overflow-y-auto scroll-thin py-1.5`,children:[u.length===0&&(0,K.jsx)(`div`,{className:`px-4 py-6 text-center text-xs text-ink-faint`,children:r(`palette.noMatches`)}),p.map(e=>(0,K.jsxs)(`div`,{className:`mb-1`,children:[(0,K.jsx)(`div`,{className:`px-4 py-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:e.name}),e.items.map(e=>{m++;let t=m===o;return(0,K.jsxs)(`button`,{id:`palette-${e.id}`,ref:t?l:void 0,role:`option`,"aria-selected":t,onMouseEnter:()=>s(u.indexOf(e)),onClick:()=>d(e),className:`flex w-full items-center justify-between px-4 py-1.5 text-left text-sm transition-colors ${t?`bg-blue-deep/20 text-ink`:`text-ink-dim hover:bg-panel/60`}`,children:[(0,K.jsx)(`span`,{children:e.label}),e.hint&&(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-ink-faint`,children:e.hint})]},e.id)})]},e.name))]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-line px-4 py-1.5 text-[10px] text-ink-faint`,children:[(0,K.jsx)(`span`,{children:r(`palette.navigate`)}),(0,K.jsx)(`span`,{children:r(`palette.run`)}),(0,K.jsx)(`span`,{children:r(`palette.close`)})]})]})}var la=[{keys:`⌘K / Ctrl+K`,desc:`help.palette`},{keys:`⌘B / Ctrl+B`,desc:`help.sessions`},{keys:`⌘J / Ctrl+J`,desc:`help.managerChat`},{keys:`⌘R / Ctrl+R`,desc:`help.rewrite`},{keys:`⌘T / Ctrl+T`,desc:`help.reasoning`},{keys:`⌘. / Ctrl+.`,desc:`help.kiosk`},{keys:`/`,desc:`help.composer`},{keys:`↵ Enter`,desc:`help.send`},{keys:`Shift+Enter`,desc:`help.newline`},{keys:`?`,desc:`help.thisHelp`},{keys:`Esc`,desc:`help.escape`}];function ua({open:e,onClose:t}){let{locale:n,t:r}=q(),i=zi(jt,n);return(0,K.jsxs)(ia,{open:e,onClose:t,label:r(`help.title`),width:`max-w-2xl`,children:[(0,K.jsx)(aa,{title:r(`help.title`)}),(0,K.jsxs)(`div`,{className:`max-h-[70dvh] overflow-y-auto scroll-thin`,children:[(0,K.jsx)(`div`,{className:`p-4`,children:la.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between py-1.5`,children:[(0,K.jsx)(`span`,{className:`text-sm text-ink-dim`,children:r(e.desc)}),(0,K.jsx)(`kbd`,{className:`rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-ink`,children:e.keys})]},e.keys))}),(0,K.jsxs)(`div`,{className:`border-t border-line px-4 pb-4 pt-3`,children:[(0,K.jsx)(`p`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-ink-faint`,children:r(`help.commands`)}),i.map(e=>(0,K.jsxs)(`div`,{className:`mb-4`,children:[(0,K.jsx)(`p`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:e.group}),e.rows.map(e=>(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-1`,children:[(0,K.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-ink`,children:e.label}),(0,K.jsx)(`span`,{className:`text-right text-xs text-ink-dim`,children:e.desc})]},e.label))]},e.group))]})]})]})}var da=[{name:`ARGUS_SKILL_MAX_ACTIVE_DAEMONS`,group:`Limits`,label:`Active daemon limit`,description:`Maximum background sessions running on this host.`},{name:`ARGUS_SKILL_UNPRICED_COST_POLICY`,group:`Safety`,label:`Unpriced calls`,description:`Whether calls with unresolved pricing are blocked or allowed.`},{name:`ARGUS_SKILL_SAFE_MODE`,group:`Safety`,label:`Safe mode`,description:`Enable extra-conservative runtime guardrails.`},{name:`ARGUS_SKILL_ENABLE_TELEGRAM`,group:`Interface`,label:`Telegram`,description:`Enable the Telegram notification bridge.`},{name:`ARGUS_SKILL_SHOW_REASONING`,group:`Interface`,label:`Show reasoning`,description:`Stream role reasoning into the cockpit activity view.`}];function fa(e){let t=new Map(e.map(e=>[e.name,e]));return da.flatMap(e=>{let n=t.get(e.name);return n?[{...n,group:e.group,label:e.label,doc:e.description}]:[]})}function pa(e){let t=e.trim();if(!t)return``;if(t===`not applicable for this model`)return`n/a`;if(t.startsWith(`capability vault`))return`vault / default`;if(t.startsWith(`default:`))return`default`;let n=t.startsWith(`persisted:`),r=n?t.slice(10):t;return r.startsWith(`ARGUS_SKILL_`)?`${r.slice(12).toLowerCase().replaceAll(`_`,` `)}${n?` · persisted`:` · env`}`:t}function ma(e,t){let n=new URL(e),r=n.protocol===`https:`?`wss:`:`ws:`,i=encodeURIComponent(t);return{webApi:`${n.origin}/api`,eventStream:`${r}//${n.host}/api/projects/${i}/stream`,daemon:`local process · events.jsonl · no TCP port`}}var ha=[{alias:`global_daily_cap`,env:`ARGUS_SKILL_GLOBAL_DAILY_CAP_USD`,label:`settings.budget.global`,unit:`USD`},{alias:`codex_daily_requests`,env:`ARGUS_SKILL_CODEX_DAILY_CALL_CAP`,label:`settings.budget.codex`,unit:`calls`},{alias:`copilot_daily_requests`,env:`ARGUS_SKILL_COPILOT_DAILY_CALL_CAP`,label:`settings.budget.copilot`,unit:`calls`},{alias:`copilot_daily_premium`,env:`ARGUS_SKILL_COPILOT_DAILY_PREMIUM_CAP`,label:`settings.budget.premium`,unit:`requests`}];function ga({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a}=gr(e,t);return(0,K.jsxs)(ia,{open:t,onClose:n,label:r(`doctor.title`),width:`max-w-3xl`,children:[(0,K.jsx)(aa,{title:r(`doctor.title`),sub:r(`doctor.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-4`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(pi,{})}),i?.recommended&&(0,K.jsxs)(`div`,{className:`mb-4 rounded-lg border border-gold/40 bg-gold/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-gold`,children:r(`doctor.recommended`)}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-ink`,children:i.recommended.name}),(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-ink-dim`,children:i.recommended.detail}),i.recommended.fix&&(0,K.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words rounded bg-bg p-2 font-mono text-xs text-blue-sky`,children:i.recommended.fix})]}),(0,K.jsx)(`div`,{className:`space-y-1.5`,children:(i?.checks??[]).map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-line/60 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:e.ok?`text-ok`:`text-err`,children:e.ok?`✓`:`✗`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium text-ink`,children:e.name}),e.detail&&(0,K.jsx)(`div`,{className:`mt-0.5 text-[11px] text-ink-dim`,children:e.detail}),!e.ok&&e.fix&&(0,K.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words rounded bg-bg p-1.5 font-mono text-xs text-ink-dim`,children:e.fix})]})]},t))}),i?.log_tail&&(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-ink-faint`,children:`daemon.log`}),(0,K.jsx)(`pre`,{className:`max-h-48 overflow-x-hidden overflow-y-auto whitespace-pre-wrap break-words rounded-lg bg-bg p-3 font-mono text-xs leading-relaxed text-ink-dim scroll-thin`,children:i.log_tail})]})]})]})}function _a({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a,refetch:s}=_r(e,t),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(``),[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(``),[g,_]=(0,M.useState)(!1),[v,b]=(0,M.useState)(``),[x,S]=(0,M.useState)({});(0,M.useEffect)(()=>{if(!t||!i)return;let e=new Map(i.operator_knobs.map(e=>[e.name,e.value]));S(Object.fromEntries(ha.map(t=>[t.alias,e.get(t.env)??``])))},[i,t]);let C=async()=>{if(!g){_(!0),b(``);try{let t=Object.fromEntries(ha.map(e=>{let t=String(x[e.alias]??``).trim();if(!t)throw Error(r(`settings.required`,{field:r(e.label)}));return[e.alias,t]}));await R.setBudgets(e,t),await s(),b(r(`settings.budgetSaved`))}catch(e){b(e instanceof Error?e.message:String(e))}finally{_(!1)}}},T=async t=>{if(t.preventDefault(),!(!c.trim()||!u.trim()||f)){p(!0),h(``);try{await R.setConfig(e,c.trim(),u.trim()),await s(),h(r(`settings.applied`))}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}}},ee=fa(i?.operator_knobs??[]).reduce((e,t)=>((e[t.group]??=[]).push(t),e),{}),te=ma(window.location.origin,e);return(0,K.jsxs)(ia,{open:t,onClose:n,label:r(`common.settings`),width:`max-w-4xl`,children:[(0,K.jsx)(aa,{title:r(`common.settings`),sub:r(`settings.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-4`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(pi,{})}),(0,K.jsxs)(`section`,{className:`mb-4 rounded-lg border border-line bg-surface p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-ink-faint`,children:r(`settings.connection`)}),(0,K.jsxs)(`div`,{className:`mt-2 grid gap-2 text-[10px] sm:grid-cols-[100px_minmax(0,1fr)]`,children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:r(`settings.webApi`)}),(0,K.jsx)(`code`,{className:`min-w-0 break-all text-ink-dim`,children:te.webApi}),(0,K.jsx)(`span`,{className:`text-ink-faint`,children:r(`settings.eventStream`)}),(0,K.jsx)(`code`,{className:`min-w-0 break-all text-ink-dim`,children:te.eventStream}),(0,K.jsx)(`span`,{className:`text-ink-faint`,children:r(`settings.taskDaemon`)}),(0,K.jsx)(`span`,{className:`text-ink-dim`,children:te.daemon})]})]}),(0,K.jsxs)(`section`,{className:`mb-4 rounded-lg border border-gold/40 bg-gold/5 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-gold`,children:r(`settings.budgetTitle`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[10px] text-ink-faint`,children:r(`settings.budgetHint`)})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void C(),disabled:g||a,title:r(`settings.saveBudgets`),"aria-label":r(`settings.saveBudgets`),className:`flex h-9 w-9 items-center justify-center rounded bg-gold text-xs font-semibold text-bg disabled:opacity-40`,children:g?`…`:(0,K.jsx)(o,{icon:w})})]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2 lg:grid-cols-3`,children:ha.map(e=>(0,K.jsxs)(`label`,{className:`rounded border border-line/70 bg-bg/60 p-2`,children:[(0,K.jsx)(`span`,{className:`block text-[10px] text-ink-faint`,children:r(e.label)}),(0,K.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`number`,min:`0`,step:e.unit===`USD`?`0.1`:`1`,value:x[e.alias]??``,onChange:t=>S(n=>({...n,[e.alias]:t.target.value})),className:`h-8 min-w-0 flex-1 bg-transparent font-mono text-sm text-ink outline-none`}),(0,K.jsx)(`span`,{className:`text-[9px] text-ink-faint`,children:e.unit})]})]},e.alias))}),v?(0,K.jsx)(`div`,{className:`mt-2 text-xs text-ink-dim`,children:v}):null]}),(0,K.jsxs)(`form`,{onSubmit:e=>void T(e),className:`mb-4 rounded-lg border border-blue/30 bg-blue/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-blue`,children:r(`settings.advanced`)}),(0,K.jsxs)(`div`,{className:`mt-2 grid gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,K.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:r(`settings.namePlaceholder`),className:`h-9 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:r(`settings.valuePlaceholder`),className:`h-9 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{disabled:f||!c.trim()||!u.trim(),title:r(`settings.applyAdvanced`),"aria-label":r(`settings.applyAdvanced`),className:`flex h-9 w-9 items-center justify-center rounded bg-blue-deep text-xs font-medium text-white disabled:opacity-40`,children:f?`…`:(0,K.jsx)(o,{icon:y})})]}),m?(0,K.jsx)(`div`,{className:`mt-2 text-xs text-ink-dim`,children:m}):null]}),(0,K.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(i?.roles??[]).map(e=>(0,K.jsxs)(`div`,{className:`rounded-lg border border-line bg-surface p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold capitalize text-ink`,children:e.role}),(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:e.backend_label})]}),(0,K.jsx)(`div`,{className:`mt-2 truncate font-mono text-[11px] text-ink-dim`,title:e.model,children:e.model}),(0,K.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`truncate`,title:e.model_source,children:pa(e.model_source)}),e.reasoning_effort&&(0,K.jsx)(`span`,{className:`ml-auto shrink-0`,style:{color:ut(e.reasoning_effort)},children:e.reasoning_effort})]}),e.description?(0,K.jsx)(`p`,{className:`mt-2 text-[10px] leading-relaxed text-ink-faint`,children:e.description}):null]},e.role))}),Object.entries(ee).map(([e,t])=>(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`mb-1.5 text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:e}),(0,K.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line`,children:t.map((e,t)=>(0,K.jsxs)(`div`,{className:`grid gap-1 px-3 py-2.5 sm:grid-cols-[minmax(0,1fr)_auto] ${t?`border-t border-line/60`:``}`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium text-ink-dim`,title:e.name,children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[10px] leading-relaxed text-ink-faint`,children:e.doc})]}),(0,K.jsxs)(`div`,{className:`text-left sm:text-right`,children:[(0,K.jsx)(`div`,{className:`font-mono text-[11px] text-ink`,children:e.value}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[9px] text-ink-faint`,children:pa(e.source)})]})]},e.name))})]},e)),(0,K.jsxs)(`p`,{className:`mt-4 text-[10px] text-ink-faint`,children:[r(`settings.footer`),` `,(0,K.jsx)(`code`,{children:`argus-skill --config-help`}),`.`]})]})]})}function Z({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a,refetch:s}=vr(e,t),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(!1),[f,p]=(0,M.useState)(``);(0,M.useEffect)(()=>{t&&i!=null&&l(i)},[i,t]);let m=async()=>{if(!u){d(!0),p(``);try{await R.setIdentity(e,c),await s(),p(r(`identity.saved`))}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,K.jsxs)(ia,{open:t,onClose:n,label:r(`identity.title`),width:`max-w-2xl`,children:[(0,K.jsx)(aa,{title:r(`identity.title`),sub:r(`identity.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-5`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(pi,{})}),a?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),rows:12,className:`w-full resize-y rounded-lg border border-line bg-bg p-3 font-sans text-sm leading-relaxed text-ink outline-none focus:border-blue`,placeholder:r(`identity.placeholder`)}),(0,K.jsxs)(`div`,{className:`mt-3 flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-xs text-ink-faint`,children:f}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:u||c===(i??``),title:r(`identity.save`),"aria-label":r(`identity.save`),className:`flex h-9 w-9 items-center justify-center rounded bg-blue-deep text-xs font-medium text-white disabled:opacity-40`,children:u?`…`:(0,K.jsx)(o,{icon:w})})]})]})]})]})}function va({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a}=yr(e,t),o=i??[];return(0,K.jsxs)(ia,{open:t,onClose:n,label:r(`transcript.title`),width:`max-w-2xl`,children:[(0,K.jsx)(aa,{title:r(`transcript.title`),sub:r(`transcript.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-4`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(pi,{})}),!a&&o.length===0&&(0,K.jsx)(mi,{children:r(`transcript.empty`)}),o.map((e,t)=>{let n=e.role===`operator`;return(0,K.jsxs)(`div`,{className:`grid grid-cols-[72px_minmax(0,1fr)] border-b border-line/50 py-2.5 last:border-b-0`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-mono text-[10px] font-semibold uppercase tracking-wide ${n?`text-ink-faint`:`text-blue-sky`}`,children:n?r(`transcript.operator`):`argus`}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[9px] text-ink-faint`,children:ei(e.ts)})]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-ink-dim`,children:e.text})]},t)})]})]})}function ya({questions:e,backlog:t,onAnswer:n}){let r=ht(e,t);if(!r.length)return null;let i=r[0];return(0,K.jsxs)(`div`,{className:`mb-2 flex min-h-11 items-center gap-3 rounded-md border border-gold/40 bg-gold/5 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium text-gold`,children:i.title}),(0,K.jsx)(`div`,{className:`truncate text-xs text-ink-dim`,title:i.reason||i.question,children:i.reason||i.question})]}),r.length>1?(0,K.jsxs)(`span`,{className:`font-mono text-xs text-ink-faint`,children:[`+`,r.length-1]}):null,(0,K.jsx)(`button`,{onClick:n,className:`shrink-0 text-xs font-medium text-gold hover:text-gold-soft`,children:`Decide`})]})}function ba({reply:e,open:t,busy:n,onClose:r,onSubmit:i}){let{t:a}=q(),o=(0,M.useMemo)(()=>e?.options[0]?.id??`custom`,[e]),[s,c]=(0,M.useState)(o),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(``);if((0,M.useEffect)(()=>{t&&(c(o),u(``),f(``))},[o,t,e?.id]),!e)return null;let p=e.options.length===0,m=e.options.find(e=>e.id===s),h=p?!!l.trim():!!(m&&(!m.requires_note||l.trim())),g=()=>{if(!n){if(!h){f(a(`decision.noteRequired`));return}f(``),i(p?`custom`:s,l.trim())}};return(0,K.jsxs)(ia,{open:t,onClose:n?()=>void 0:r,label:a(`decision.operator`),width:`max-w-2xl`,children:[(0,K.jsx)(aa,{title:a(`decision.required`),sub:e.title}),(0,K.jsxs)(`div`,{className:`space-y-4 px-5 py-4`,children:[e.reason?(0,K.jsxs)(`section`,{className:`rounded-md border border-gold/30 bg-gold/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-gold`,children:a(`decision.whyBlocked`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm leading-relaxed text-ink`,children:e.reason})]}):null,e.evidence.length?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-2 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:a(`decision.evidence`)}),(0,K.jsx)(`div`,{className:`space-y-2`,children:e.evidence.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded border border-line/70 bg-bg/40 p-2.5`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium text-ink`,children:e.label}),e.summary?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-ink-dim`,children:e.summary}):null,e.path?(0,K.jsx)(`div`,{className:`mt-1 break-all font-mono text-[10px] text-blue-sky`,children:e.path}):null]},`${e.path}:${t}`))})]}):null,(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-ink`,children:e.question}),e.options.length?(0,K.jsx)(`div`,{className:`space-y-2`,children:e.options.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{c(e.id),f(``)},disabled:n,className:`w-full rounded-md border p-3 text-left ${s===e.id?`border-blue bg-blue/5`:`border-line bg-bg/30`}`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-ink`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-1 text-xs leading-relaxed text-ink-dim`,children:e.description})]},e.id))}):null,p||m?.requires_note||l?(0,K.jsx)(`textarea`,{"data-autofocus":!0,value:l,onChange:e=>{u(e.target.value),f(``)},onKeyDown:e=>{Pi(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())},rows:3,disabled:n,placeholder:a(`decision.notePlaceholder`),className:`w-full resize-y rounded-lg border border-line bg-bg px-3 py-2 text-sm leading-relaxed text-ink outline-none focus:border-blue disabled:opacity-60`}):null,d?(0,K.jsx)(`p`,{role:`alert`,className:`text-xs text-err`,children:d}):null,(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-ink-faint`,children:a(`decision.resumeHint`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`rounded-md px-3 py-2 text-xs text-ink-dim hover:bg-bg disabled:opacity-50`,children:a(`decision.later`)}),(0,K.jsx)(`button`,{type:`button`,onClick:g,disabled:n,className:`rounded-md bg-blue-deep px-3 py-2 text-xs font-medium text-white hover:bg-blue-deep/85 disabled:opacity-50`,children:a(n?`decision.applying`:p||s===`custom`?`decision.sendAnswer`:s===`stop`?`decision.stopCampaign`:`decision.useOption`)})]})]})]})]})}function xa({alert:e}){if(!e)return null;let t=e.tone===`block`,n=e.kind===`budget`;return(0,K.jsxs)(`div`,{className:`mx-3 mt-3 flex items-center gap-2.5 rounded-lg border px-3.5 py-2 text-[13px] ${t?`border-err/50 bg-err/10 text-err`:`border-warn/50 bg-warn/10 text-warn`}`,role:t?`alert`:`status`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs font-bold leading-none`,children:n?`$`:t?`!`:`i`}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] font-semibold uppercase tracking-wide`,children:n?`budget alarm`:t?`action required`:`notice`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.text,children:e.text})]})}function Sa({html:e,title:t,className:n=``}){return(0,K.jsx)(`iframe`,{title:t,srcDoc:e,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,className:`min-h-0 w-full flex-1 border-0 bg-white ${n}`})}function Ca(e){let t=e.trim();if(!t)return``;try{return JSON.stringify(JSON.parse(t),null,2)}catch{try{return t.split(/\r?\n/).filter(Boolean).map(e=>JSON.parse(e)).map(e=>JSON.stringify(e,null,2)).join(` -`)}catch{return e}}}function wa(e,t){let n=[],r=[],i=``,a=!1;for(let o=0;oe.some(e=>e.length>0))}function Ta({value:e}){return(0,K.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words p-5 font-mono text-xs leading-6 text-ink-dim scroll-thin`,children:Ca(e)||`(empty data)`})}function Ea({value:e,delimiter:t}){let n=wa(e,t).slice(0,200),r=n[0]??[];return(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4 scroll-thin`,children:n.length?(0,K.jsxs)(`table`,{className:`w-full border-collapse text-left text-xs`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsx)(`tr`,{children:r.slice(0,40).map((e,t)=>(0,K.jsx)(`th`,{className:`border border-line/60 bg-surface px-2 py-1.5 font-semibold text-ink`,children:e},t))})}),(0,K.jsx)(`tbody`,{children:n.slice(1).map((e,t)=>(0,K.jsx)(`tr`,{children:r.slice(0,40).map((t,n)=>(0,K.jsx)(`td`,{className:`border border-line/50 px-2 py-1.5 align-top text-ink-dim`,children:e[n]??``},n))},t))})]}):(0,K.jsx)(`div`,{className:`text-sm text-ink-faint`,children:`(empty table)`})})}function Da({sid:e,path:t,onClose:n}){let{t:r}=q(),i=xr(e,t),a=i.data,[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(!1);(0,M.useEffect)(()=>{if(s(null),l(``),!e||!t||!a||![`image`,`pdf`,`audio`,`video`].includes(a.kind))return;let n=!0,r=``,i=new AbortController;return R.artifactBlob(e,t,!1,i.signal).then(e=>{n&&(r=URL.createObjectURL(e),s(r))},e=>n&&l(e.message)),()=>{n=!1,i.abort(),r&&URL.revokeObjectURL(r)}},[e,t,a?.kind]);let f=async()=>{if(!(!e||!t||!a)){d(!0),l(``);try{let n=await R.artifactBlob(e,t,!0),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=a.name,document.body.appendChild(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}catch(e){l(e.message)}finally{d(!1)}}};return(0,K.jsxs)(ia,{open:!!t,onClose:n,label:r(`artifact.preview`),width:`max-w-5xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-line px-4 py-3 sm:px-5`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h2`,{className:`truncate font-mono text-sm font-semibold text-ink`,title:a?.path??t??``,children:a?.name??t??r(`artifact.title`)}),(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-[11px] text-ink-faint`,children:a?`${a.kind} · ${ni(a.size)} · ${a.mime}`:r(`artifact.approvedEvidence`)})]}),(0,K.jsx)(`button`,{type:`button`,disabled:!a||u,onClick:()=>void f(),className:`rounded-md border border-blue-deep/60 bg-blue-deep/10 px-3 py-1.5 text-xs text-blue-sky transition-colors hover:bg-blue-deep/20 disabled:cursor-wait disabled:opacity-50`,children:r(u?`artifact.downloading`:`artifact.download`)}),a?.kind===`pdf`&&o?(0,K.jsx)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,className:`rounded-md border border-line px-3 py-1.5 text-xs text-ink-dim transition-colors hover:border-ink-faint hover:bg-surface hover:text-ink`,children:r(`artifact.open`)}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":r(`artifact.close`),onClick:n,className:`rounded-md px-2 py-1 text-lg leading-none text-ink-faint hover:bg-surface hover:text-ink`,children:`×`})]}),(0,K.jsxs)(`div`,{className:`flex min-h-64 max-h-[72vh] flex-col overflow-x-hidden overflow-y-auto bg-bg/40 p-3 scroll-thin sm:p-4`,children:[i.isLoading?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(pi,{})}):null,i.isError?(0,K.jsxs)(`div`,{className:`m-auto text-sm text-err`,children:[r(`artifact.unavailable`),` · `,i.error.message]}):null,a?.why?(0,K.jsxs)(`div`,{className:`mb-3 rounded-md border border-line bg-surface px-3 py-2 text-xs text-ink-dim`,children:[(0,K.jsx)(`span`,{className:`mr-1 text-ink-faint`,children:`Reviewer:`}),a.why]}):null,a?.kind===`text`?(0,K.jsxs)(`pre`,{className:`min-h-52 overflow-x-hidden overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-bg p-4 font-mono text-xs leading-relaxed text-ink-dim scroll-thin`,children:[a.preview||r(`artifact.empty`),a.truncated?`\n\n… ${r(`artifact.truncated`)}`:``]}):null,a?.kind===`markdown`?(0,K.jsx)(`div`,{className:`min-h-52 overflow-auto rounded-lg border border-line bg-bg p-4 text-sm text-ink-dim scroll-thin`,children:(0,K.jsx)(yi,{children:a.preview||r(`artifact.empty`)})}):null,a?.kind===`json`?(0,K.jsx)(Ta,{value:a.preview||``}):null,a?.kind===`table`?(0,K.jsx)(Ea,{value:a.preview||``,delimiter:a.name.endsWith(`.tsv`)?` `:`,`}):null,a?.kind===`html`&&!a.truncated?(0,K.jsx)(`div`,{className:`flex min-h-[60vh] overflow-hidden rounded-lg border border-line`,children:(0,K.jsx)(Sa,{html:a.preview||``,title:`HTML preview: ${a.name}`})}):null,a?.kind===`html`&&a.truncated?(0,K.jsx)(`div`,{className:`m-auto text-sm text-warn`,children:r(`artifact.htmlTooLarge`)}):null,a?.kind===`image`&&o?(0,K.jsx)(`div`,{className:`flex min-h-64 flex-1 items-center justify-center rounded border border-line bg-bg/50`,children:(0,K.jsx)(`img`,{src:o,alt:a.why||a.name,className:`max-h-[62vh] max-w-full object-contain`})}):null,a?.kind===`pdf`&&o?(0,K.jsx)(`object`,{data:`${o}#toolbar=1&navpanes=0&view=FitH`,type:`application/pdf`,"aria-label":`PDF preview: ${a.name}`,className:`h-[62vh] w-full rounded-lg border border-line bg-white`,children:(0,K.jsxs)(`div`,{className:`flex h-full min-h-64 flex-col items-center justify-center gap-2 text-center text-sm text-ink-dim`,children:[(0,K.jsx)(`span`,{children:r(`artifact.pdfDisabled`)}),(0,K.jsx)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,className:`text-blue underline underline-offset-2`,children:r(`artifact.openPdf`)})]})}):null,a?.kind===`audio`&&o?(0,K.jsx)(`div`,{className:`m-auto w-full max-w-xl`,children:(0,K.jsx)(`audio`,{controls:!0,preload:`metadata`,src:o,className:`w-full`})}):null,a?.kind===`video`&&o?(0,K.jsx)(`div`,{className:`flex min-h-64 flex-1 items-center justify-center rounded border border-line bg-black`,children:(0,K.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,src:o,className:`max-h-[62vh] max-w-full`})}):null,a&&[`image`,`pdf`,`audio`,`video`].includes(a.kind)&&!o&&!c?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(pi,{})}):null,a?.kind===`binary`?(0,K.jsxs)(`div`,{className:`m-auto max-w-md text-center`,children:[(0,K.jsx)(`div`,{className:`text-3xl text-ink-faint`,children:`◇`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-ink-dim`,children:r(`artifact.noPreview`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-faint`,children:r(`artifact.downloadHint`)})]}):null,c?(0,K.jsx)(`div`,{className:`mt-3 text-center text-xs text-err`,children:c}):null]})]})}var Oa=`__argus_live_progress__`;function ka(e){return(e??[]).filter(e=>e.source===`manager_live`)}function Aa(e){return ka(e).filter(e=>e.exists)[0]??null}function ja(e){let t=e??[],n={markdown:0,pdf:1,html:2,text:3,table:4,json:5,image:6,video:7,audio:8,binary:9},r=t.filter(e=>e.exists&&e.source===`manager_live`),i=t.filter(e=>e.exists&&e.source!==`manager_live`);return i.length?[...r,...[...i].sort((e,t)=>(n[e.kind]??99)-(n[t.kind]??99))]:r}function Ma(e){return ja(e).find(e=>e.exists)??null}function Na(e){let t=e.path.split(`/`);return t[t.length-1]||e.path}function Pa(e,t){let n=Aa(t);return n?n.path:e?Oa:Ma(t)?.path??``}var Fa={manager:`Manager`,planner:`Planner`,engineer:`Engineer`,reviewer:`Reviewer`};function Ia(e){let t=String(e.agent_layer??e.actor??``);if(t===`main`)return`engineer`;if(t)return t;let n=String(e.type??``);return n.startsWith(`round.review`)||n.startsWith(`reviewer`)?`reviewer`:n.startsWith(`life.planner`)?`planner`:n.startsWith(`life.manager`)||n.startsWith(`manager`)?`manager`:n.startsWith(`engineer`)||n.startsWith(`round.`)?`engineer`:``}function La(e,t=[]){let n=String(e?.active_role??``);if(!n)return null;let r=e?.roles.find(e=>e.role===n),i=``;for(let e=t.length-1;e>=0;--e){let r=t[e];if(Ia(r)!==n||String(r.kind??``)===`reasoning`)continue;let a=String(r.text??r.action_summary??``).trim();if(!(!a||a.startsWith(`{`))){i=a.split(` -`)[0].slice(0,240);break}}return{role:n,roleLabel:Fa[n]??n,label:r?.label||`Working`,detail:i}}function Ra(e){let t=e.dag.find(e=>[`running`,`in_progress`,`claimed`].includes(e.status)),n=e.dag.filter(e=>[`done`,`completed`].includes(e.status)).length,r=e.dag.length,i=`Awaiting Planner`;return e.mission.status===`idle`?i=`Ready for a new mission`:e.mission.status===`complete`&&(i=`Mission complete`),{title:Dn(t?.title||e.mission.title||i),dagProgress:r>0?`${n} / ${r} complete`:`Not planned`}}function za({view:e,liveStatus:t,artifacts:n=[],onOpenArtifact:r}){let{t:i}=q(),a=Ra(e),o=[...n].filter(e=>e.exists&&e.source!==`manager_live`).sort((e,t)=>Number(t.mtime??0)-Number(e.mtime??0)).slice(0,4),s=e.timeline.slice(-6).reverse(),c=e=>e===`done`?`text-ok`:[`running`,`in_progress`,`claimed`].includes(e)?`text-blue-sky`:[`failed`,`blocked`,`rejected`].includes(e)?`text-err`:`text-ink-faint`;return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 text-sm text-ink-dim scroll-thin`,children:[(0,K.jsxs)(`section`,{className:`rounded-lg border border-blue-deep/30 bg-blue-deep/10 p-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-blue-sky`,children:i(`research.currentWork`)}),(0,K.jsx)(`h3`,{className:`mt-2 text-base font-semibold leading-snug text-ink`,children:a.title}),t?.detail?(0,K.jsx)(`p`,{className:`mt-2 leading-6 text-ink-dim`,children:t.detail}):null,(0,K.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 text-xs`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`mission.stage`)}),(0,K.jsx)(`div`,{className:`mt-1 font-medium capitalize text-blue-sky`,children:e.stage.label||e.stage.id||`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`mission.campaign`)}),(0,K.jsx)(`div`,{className:`mt-1 font-mono text-ink`,children:On(e.mission.campaign_elapsed_seconds)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`mission.round`)}),(0,K.jsxs)(`div`,{className:`mt-1 font-mono text-ink`,children:[e.round.current||`—`,e.round.max?` / ${e.round.max}`:``]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`research.dagProgress`)}),(0,K.jsx)(`div`,{className:`mt-1 font-mono text-ink`,children:a.dagProgress})]})]})]}),(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:i(`mission.researchDag`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.dag.map(e=>(0,K.jsx)(`div`,{className:`rounded-md border border-line/60 bg-panel px-3 py-2.5`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 shrink-0 font-mono text-xs ${c(e.status)}`,children:e.status===`done`?`✓`:[`running`,`in_progress`,`claimed`].includes(e.status)?`●`:`○`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium leading-5 text-ink`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] ${c(e.status)}`,children:e.status})]})]})},e.id))})]}),o.length?(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:i(`research.verifiedOutputs`)}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:o.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),className:`rounded border border-line/70 bg-panel px-2.5 py-1.5 font-mono text-[10px] text-blue-sky hover:border-blue/60`,children:[Na(e),` ↗`]},e.path))})]}):null,s.length?(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:i(`research.recentMilestones`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-2 border-l border-line/70 pl-3`,children:s.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs font-medium text-ink`,children:e.title}),e.detail?(0,K.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs leading-5 text-ink-faint`,children:e.detail}):null]},e.id))})]}):null]})}function Ba({sid:e,artifacts:t,error:n=!1,onExpand:r,className:i=``,embedded:a=!1,onCollapse:s,missionView:c,activityEvents:l=[]}){let{t:u}=q(),d=(0,M.useMemo)(()=>ja(t),[t]),f=(0,M.useMemo)(()=>Ma(t),[t]),[p,m]=(0,M.useState)(null);(0,M.useEffect)(()=>m(null),[e]);let h=p??Pa(c,t),g=h===Oa,_=g?null:d.find(e=>e.path===h)??f,y=xr(e,_?.exists?_.path:null,_?.mtime??null),b=y.data,[x,S]=(0,M.useState)(null),[C,w]=(0,M.useState)(``),[T,ee]=(0,M.useState)(!1),te=(0,M.useRef)(null),[E,ne]=(0,M.useState)(``),re=(0,M.useMemo)(()=>La(c,l),[l,c]);(0,M.useEffect)(()=>{if(S(null),w(``),!e||!_||!b||![`image`,`pdf`,`audio`,`video`].includes(b.kind))return;let t=!0,n=``,r=new AbortController;return R.artifactBlob(e,_.path,!1,r.signal).then(e=>{t&&(n=URL.createObjectURL(e),S(n))},e=>t&&w(e.message)),()=>{t=!1,r.abort(),n&&URL.revokeObjectURL(n)}},[e,_?.path,b?.kind,b?.mtime]);let ie=g?u(`research.liveProgress`):d[0]?.group_title||u(`research.artifact`),ae=async()=>{if(!(!e||!_)){ee(!0),ne(``);try{let t=await R.artifactBlob(e,_.path,!0),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=_.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),0)}catch(e){ne(e.message)}finally{ee(!1)}}};return Qr(te,(e,t)=>{te.current&&(t||e.fromTo(te.current,{autoAlpha:0,y:6,scale:.995},{autoAlpha:1,y:0,scale:1,duration:.3,ease:`power2.out`,clearProps:`transform,opacity,visibility`}))},[g,_?.path,b?.kind]),(0,K.jsxs)(`section`,{className:`glass-panel glass-panel--side flex min-h-0 flex-col overflow-hidden ${a?``:`rounded-lg border`} ${i}`,"aria-label":u(`research.canvas`),children:[(0,K.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b border-line/50 bg-panel px-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-blue`}),(0,K.jsx)(`h2`,{className:`max-w-24 truncate text-sm font-semibold text-ink sm:max-w-48`,children:ie})]}),c||d.length>0?(0,K.jsxs)(`label`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:u(`research.previewArtifact`)}),(0,K.jsxs)(`select`,{value:g?Oa:_?.path??``,onChange:e=>m(e.target.value),className:`h-8 w-full min-w-0 max-w-64 truncate rounded-md border border-line/50 bg-bg px-2 font-mono text-xs text-ink-dim outline-none focus:border-blue/60`,children:[c?(0,K.jsx)(`option`,{value:Oa,children:u(`research.liveProgress`)}):null,d.map(e=>(0,K.jsxs)(`option`,{value:e.path,disabled:!e.exists,children:[e.source===`manager_live`?`Checkpoint · `:``,Na(e),e.exists?``:` · pending`]},e.path))]})]}):(0,K.jsx)(`div`,{className:`flex-1`}),(0,K.jsx)(`div`,{className:`shrink-0`,children:_?(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>void ae(),disabled:T||!_.exists,title:u(`artifact.download`),"aria-label":u(`artifact.download`),className:`flex h-7 w-7 items-center justify-center rounded-md text-ink-faint hover:bg-surface hover:text-ink disabled:opacity-40`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:(0,K.jsx)(`path`,{d:`M8 2.25v7.5M5.25 7.5 8 10.25 10.75 7.5M3 13.25h10`})})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>r(_.path),title:u(`research.openLarge`),"aria-label":u(`research.openLarge`),className:`flex h-7 w-7 items-center justify-center rounded-md text-ink-faint hover:bg-surface hover:text-ink`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:(0,K.jsx)(`path`,{d:`M6 3H3v3M10 3h3v3M6 13H3v-3M10 13h3v-3`})})})]}):null}),s?(0,K.jsx)(`button`,{type:`button`,onClick:s,"aria-label":u(`research.collapse`),title:u(`research.collapse`),className:`hidden h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line/50 bg-bg/40 text-ink-faint hover:border-blue/50 hover:text-ink lg:flex`,children:(0,K.jsx)(o,{icon:v,className:`h-3.5 w-3.5`})}):null]}),re?(0,K.jsxs)(`div`,{className:`shrink-0 border-b border-line/50 bg-blue-deep/10 px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-blue`}),(0,K.jsx)(`span`,{className:`font-semibold text-ink`,children:re.roleLabel}),(0,K.jsx)(`span`,{className:`text-blue-sky`,children:u(`mission.active`)}),(0,K.jsxs)(`span`,{className:`truncate text-ink-faint`,children:[`· `,re.label]})]}),re.detail?(0,K.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-ink-dim`,children:re.detail}):null]}):null,(0,K.jsxs)(`div`,{ref:te,className:`relative flex min-h-0 flex-1 flex-col bg-bg`,children:[g&&c?(0,K.jsx)(za,{view:c,liveStatus:re,artifacts:t,onOpenArtifact:r}):null,!g&&n?(0,K.jsx)(`div`,{className:`m-auto max-w-sm px-6 text-center text-sm text-warn`,children:u(`research.unavailable`)}):null,!g&&!n&&d.length===0?(0,K.jsxs)(`div`,{className:`m-auto max-w-sm px-8 text-center`,children:[(0,K.jsx)(`div`,{className:`text-3xl text-ink-faint`,children:`◇`}),(0,K.jsx)(`h3`,{className:`mt-3 text-xs text-ink-faint`,children:u(`research.noPreview`)})]}):null,!g&&!n&&d.length>0&&!_?(0,K.jsxs)(`div`,{className:`m-auto max-w-sm px-8 text-center`,children:[(0,K.jsx)(pi,{}),(0,K.jsx)(`p`,{className:`mt-3 text-xs text-ink-faint`,children:u(`research.waiting`)})]}):null,_&&!_.exists?(0,K.jsxs)(`div`,{className:`m-auto max-w-sm px-8 text-center`,children:[(0,K.jsx)(pi,{}),(0,K.jsx)(`p`,{className:`mt-3 text-xs text-ink-faint`,children:u(`research.updating`)})]}):null,_?.exists&&y.isLoading?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(pi,{})}):null,_?.exists&&y.isError?(0,K.jsxs)(`div`,{className:`m-auto px-6 text-center text-sm text-err`,children:[u(`artifact.unavailable`),` · `,y.error.message]}):null,b?.kind===`text`?(0,K.jsxs)(`pre`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto whitespace-pre-wrap break-words p-5 font-mono text-xs leading-6 text-ink-dim scroll-thin`,children:[b.preview||`(empty file)`,b.truncated?` - -… live preview truncated · expand to inspect the complete file`:``]}):null,b?.kind===`markdown`?(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-5 text-sm text-ink-dim scroll-thin`,children:(0,K.jsx)(yi,{children:b.preview||`(empty file)`})}):null,b?.kind===`json`?(0,K.jsx)(Ta,{value:b.preview||``}):null,b?.kind===`table`?(0,K.jsx)(Ea,{value:b.preview||``,delimiter:b.name.endsWith(`.tsv`)?` `:`,`}):null,b?.kind===`html`&&!b.truncated?(0,K.jsx)(Sa,{html:b.preview||``,title:`Live HTML preview: ${b.name}`}):null,b?.kind===`html`&&b.truncated?(0,K.jsx)(`div`,{className:`m-auto max-w-sm px-8 text-center text-sm text-warn`,children:u(`artifact.htmlTooLarge`)}):null,b?.kind===`image`&&x?(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4`,children:(0,K.jsx)(`img`,{src:x,alt:b.why||b.name,className:`max-h-full max-w-full object-contain`})}):null,b?.kind===`pdf`&&x?(0,K.jsx)(`embed`,{src:`${x}#toolbar=0&navpanes=0&scrollbar=0&view=FitH`,type:`application/pdf`,"aria-label":`Live PDF preview: ${b.name}`,className:`min-h-0 flex-1 bg-white`}):null,b?.kind===`audio`&&x?(0,K.jsx)(`div`,{className:`m-auto w-full max-w-xl px-6`,children:(0,K.jsx)(`audio`,{controls:!0,preload:`metadata`,src:x,className:`w-full`})}):null,b?.kind===`video`&&x?(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden bg-black p-2`,children:(0,K.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,src:x,className:`max-h-full max-w-full`})}):null,b?.kind===`binary`?(0,K.jsx)(`div`,{className:`m-auto max-w-sm px-8 text-center text-sm text-ink-dim`,children:u(`research.fileUnavailable`)}):null,b&&[`image`,`pdf`,`audio`,`video`].includes(b.kind)&&!x&&!C?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(pi,{})}):null,C?(0,K.jsx)(`div`,{className:`m-auto px-6 text-center text-sm text-err`,children:C}):null]},g?Oa:_?.path??`empty`),g?(0,K.jsxs)(`footer`,{className:`flex h-9 items-center gap-2 border-t border-line px-4 font-mono text-xs text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:u(`research.eventSourced`)}),(0,K.jsx)(`span`,{className:`shrink-0 text-ok`,children:u(`common.live`)})]}):b?(0,K.jsxs)(`footer`,{className:`flex h-9 items-center gap-2 border-t border-line px-4 font-mono text-xs text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:b.path}),E?(0,K.jsx)(`span`,{className:`ml-auto truncate text-err`,title:E,children:u(`research.downloadFailed`)}):null,(0,K.jsxs)(`span`,{className:`shrink-0`,children:[b.kind,` · `,ni(b.size)]}),(0,K.jsx)(`span`,{className:`shrink-0 text-ok`,children:u(`common.live`)})]}):null]})}function Va({notice:e,onClose:t}){if((0,M.useEffect)(()=>{if(!e)return;let n=window.setTimeout(t,e.tone===`error`?8e3:4e3);return()=>window.clearTimeout(n)},[e,t]),!e)return null;let n=e.tone===`error`?`border-err/60 bg-err/10 text-err`:e.tone===`success`?`border-ok/60 bg-ok/10 text-ok`:`border-blue-deep/60 bg-panel text-blue-sky`;return(0,K.jsxs)(`div`,{role:e.tone===`error`?`alert`:`status`,"aria-live":e.tone===`error`?`assertive`:`polite`,className:`fixed bottom-4 left-4 right-4 z-[70] flex items-start gap-2 rounded-md border px-3 py-2.5 shadow-glow sm:left-auto sm:max-w-md ${n}`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mt-px shrink-0`,children:e.tone===`error`?`!`:e.tone===`success`?`✓`:`i`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-xs leading-relaxed text-ink-dim`,children:e.message}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`dismiss notification`,onClick:t,className:`shrink-0 rounded px-1 text-base leading-none opacity-70 hover:bg-white/5 hover:opacity-100`,children:`×`})]})}function Ha({open:e,busy:t,onClose:n,onCreate:r}){let{t:i}=q(),[a,o]=(0,M.useState)(``),[s,c]=(0,M.useState)(``),[l,u]=(0,M.useState)(``),d=(0,M.useRef)(null);(0,M.useEffect)(()=>{e&&(o(``),c(``),u(``))},[e]);let f=()=>{t||n()},p=async e=>{e.preventDefault(),!t&&await r(a.trim(),s.trim(),l.trim())&&n()},m=e=>{Pi(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d.current?.requestSubmit())},h=!!s.trim();return(0,K.jsx)(ia,{open:e,onClose:f,label:i(`new.createDaemon`),width:`max-w-xl`,children:(0,K.jsxs)(`form`,{ref:d,onSubmit:e=>void p(e),children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-line px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold text-ink`,children:i(`landing.new`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-faint`,children:i(`new.subtitle`)})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":i(`new.close`),onClick:f,disabled:t,className:`rounded px-2 py-1 text-lg leading-none text-ink-faint hover:bg-surface hover:text-ink disabled:opacity-40`,children:`×`})]}),(0,K.jsxs)(`div`,{className:`space-y-4 p-5`,children:[(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsxs)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:[i(`new.name`),` `,(0,K.jsx)(`span`,{className:`normal-case tracking-normal`,children:i(`new.optional`)})]}),(0,K.jsx)(`input`,{"data-autofocus":!0,value:a,onChange:e=>o(e.target.value),maxLength:80,disabled:t,placeholder:i(`new.namePlaceholder`),className:`h-10 w-full rounded border border-line bg-bg/50 px-3 text-sm text-ink outline-none placeholder:text-ink-faint focus:border-blue-deep disabled:opacity-50`})]}),(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsxs)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:[i(`new.workdir`),` `,(0,K.jsx)(`span`,{className:`normal-case tracking-normal`,children:i(`new.optional`)})]}),(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),disabled:t,placeholder:i(`newDaemon.workdirPlaceholder`),className:`h-10 w-full rounded border border-line bg-bg/50 px-3 font-mono text-xs text-ink outline-none placeholder:text-ink-faint focus:border-blue-deep disabled:opacity-50`}),(0,K.jsx)(`span`,{className:`mt-1 block text-[10px] leading-relaxed text-ink-faint`,children:i(`new.workdirHint`)})]}),(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsxs)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:[i(`new.objective`),` `,(0,K.jsx)(`span`,{className:`normal-case tracking-normal`,children:i(`new.optional`)})]}),(0,K.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),onKeyDown:m,maxLength:4e3,disabled:t,rows:4,placeholder:i(`new.objectivePlaceholder`),className:`w-full resize-y rounded border border-line bg-bg/50 px-3 py-2.5 text-sm leading-relaxed text-ink outline-none placeholder:text-ink-faint focus:border-blue-deep disabled:opacity-50`})]}),(0,K.jsxs)(`div`,{className:`rounded border p-3 ${h?`border-gold/40 bg-gold/5`:`border-line bg-bg/30`}`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium ${h?`text-gold`:`text-blue-sky`}`,children:i(h?`new.startsAfterCreate`:`new.idleUntilMessage`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-ink-faint`,children:i(h?`new.startsHint`:`new.idleHint`)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-line px-5 py-3`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:i(`new.shortcut`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:f,disabled:t,className:`rounded border border-line px-3 py-1.5 text-xs text-ink-dim hover:bg-surface disabled:opacity-40`,children:i(`common.cancel`)}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`rounded border border-blue-deep bg-blue-deep px-3 py-1.5 text-xs font-medium text-ink hover:bg-blue-deep/80 disabled:cursor-wait disabled:opacity-50`,children:i(t?`new.creating`:h?`new.createAndStart`:`sidebar.create`)})]})]})]})})}function Ua({open:e,sid:t,name:n,alive:r,controlAvailable:i=!0,busy:a,onClose:o,onRename:s,onStart:c,onPause:l,onDelete:u}){let{t:d}=q(),[f,p]=(0,M.useState)(n),[m,h]=(0,M.useState)(!1);(0,M.useEffect)(()=>{e&&(p(n),h(!1))},[e,n,t]);let g=async e=>{e.preventDefault(),await s(f.trim())};return(0,K.jsxs)(ia,{open:e,onClose:()=>!a&&o(),label:d(`manage.daemon`),width:`max-w-lg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-line px-5 py-4`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold text-ink`,children:d(`topbar.manageSession`)}),(0,K.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px] text-ink-faint`,children:t})]}),(0,K.jsx)(`form`,{onSubmit:e=>void g(e),className:`border-b border-line p-5`,children:(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsx)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:d(`manage.displayName`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),maxLength:80,disabled:a,className:`h-9 min-w-0 flex-1 rounded border border-line bg-bg/50 px-3 text-sm text-ink outline-none focus:border-blue-deep disabled:opacity-50`}),(0,K.jsx)(`button`,{type:`submit`,disabled:a||f.trim()===n,className:`rounded border border-line px-3 text-xs text-ink-dim hover:bg-surface disabled:opacity-40`,children:d(`common.save`)})]})]})}),(0,K.jsxs)(`div`,{className:`border-b border-line p-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:d(`manage.executor`)}),(0,K.jsxs)(`div`,{className:`mt-2 flex items-center justify-between rounded border border-line bg-bg/30 p-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm text-ink`,children:d(r?i?`manage.running`:`manage.runningExternally`:`manage.paused`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[11px] text-ink-faint`,children:d(r?i?`manage.pauseHint`:`manage.externalHint`:`manage.resumeHint`)})]}),(0,K.jsx)(`button`,{type:`button`,disabled:a||!i,onClick:()=>void(r?l():c()),className:`rounded border px-3 py-1.5 text-xs disabled:cursor-wait disabled:opacity-50 ${r?`border-warn/50 text-warn hover:bg-warn/10`:`border-blue-deep bg-blue-deep text-white hover:bg-blue-deep/80`}`,children:d(a?`manage.working`:i?r?`common.pause`:`manage.resume`:`common.external`)})]})]}),(0,K.jsxs)(`div`,{className:`p-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-err`,children:d(`manage.deleteSession`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-ink-faint`,children:d(`manage.deleteHint`)}),m?(0,K.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 rounded border border-err/40 bg-err/5 p-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-ink-dim`,children:d(`manage.confirmQuestion`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(!1),className:`rounded px-2 py-1 text-xs text-ink-faint hover:bg-surface`,children:d(`common.cancel`)}),(0,K.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>void u(),className:`rounded bg-err px-3 py-1 text-xs font-medium text-bg disabled:opacity-50`,children:d(`manage.confirmDelete`)})]})]}):(0,K.jsx)(`button`,{type:`button`,disabled:a||r,onClick:()=>h(!0),className:`mt-3 rounded border border-err/40 px-3 py-1.5 text-xs text-err hover:bg-err/10 disabled:cursor-not-allowed disabled:opacity-40`,children:d(`manage.delete`)})]})]})}function Wa(e,t,n){if(e.length===0)return`local`;let r=n.trim(),i=r?e.filter(e=>e.launch_cwd?.trim()===r):[];return i.length===0||t&&!i.some(e=>e.id===t)?`all`:`local`}function Ga({projects:e,activeId:t,localCwd:n,onSelect:r,onPrefetch:i,onManage:s,onOpenPanel:c,onNew:l,loading:m,creating:h=!1,error:g,onRetry:_,mobileOpen:y=!1,collapsed:b=!1,onToggleCollapse:x,themeMode:S,onCycleTheme:w,expandedWidth:T=256}){let{locale:ee,setLocale:te,t:E}=q(),[ne,re]=(0,M.useState)(`local`),ie=(0,M.useRef)(!1),[ae,D]=(0,M.useState)(``),O=b&&!y,oe=n.trim(),se=(0,M.useMemo)(()=>oe?e.filter(e=>e.launch_cwd?.trim()===oe):[],[oe,e]);(0,M.useEffect)(()=>{ie.current||m||e.length===0||(ie.current=!0,re(Wa(e,t,oe)))},[t,m,oe,e]);let ce=ne===`local`?se:e,k=ae.trim()?Xt(ce,ae):ce,le=(0,M.useMemo)(()=>{if(ne===`local`)return k.length>0?[[oe||`Local`,k]]:[];let e=new Map;return k.forEach(t=>{let n=t.launch_cwd?.trim()||E(`common.unassigned`),r=e.get(n)??[];r.push(t),e.set(n,r)}),[...e.entries()]},[oe,ne,k]),A=S===`light`?a:p,ue=S===`light`?`dark`:`light`;return(0,K.jsxs)(`aside`,{"data-state":O?`collapsed`:`expanded`,style:{"--sidebar-width":`${T}px`},className:`glass-panel glass-panel--side fixed inset-y-0 left-0 z-40 flex h-full shrink-0 flex-col border-r transition-[width,transform,visibility] duration-panel ease-panel lg:visible lg:static lg:z-auto lg:translate-x-0 ${O?`w-14`:`w-64 lg:w-[var(--sidebar-width)]`} ${y?`visible translate-x-0`:`invisible -translate-x-full`}`,children:[(0,K.jsx)(`div`,{className:`flex h-12 shrink-0 items-center border-b border-line/50 ${O?`justify-center`:`justify-between px-4`}`,children:O?(0,K.jsx)(Ci,{size:22,compact:!0}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ci,{size:24}),(0,K.jsx)(`button`,{type:`button`,onClick:x,"aria-label":E(`sidebar.collapse`),title:`${E(`sidebar.collapse`)} · Ctrl/⌘ B`,className:`icon-control flex h-8 w-8 shrink-0 items-center justify-center`,children:(0,K.jsx)(o,{icon:C,className:`h-3.5 w-3.5`})})]})}),O?(0,K.jsx)(`div`,{className:`flex h-12 shrink-0 items-center justify-center`,children:(0,K.jsx)(`button`,{type:`button`,onClick:x,"aria-label":E(`sidebar.expand`),title:`${E(`sidebar.expand`)} · Ctrl/⌘ B`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line/50 bg-bg/40 text-ink-faint hover:border-blue/50 hover:text-ink`,children:(0,K.jsx)(o,{icon:v,className:`h-3.5 w-3.5`})})}):null,O?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-1 border-b border-line/50 px-3`,children:[[`local`,`all`].map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>re(t),className:`h-8 rounded-md px-3 text-xs font-medium capitalize transition-colors ${ne===t?`bg-bg text-ink`:`text-ink-faint hover:text-ink-dim`}`,children:[E(`common.${t}`),(0,K.jsx)(`span`,{className:`ml-1.5 font-mono text-ink-faint`,children:t===`local`?se.length:e.length})]},t)),(0,K.jsx)(`button`,{type:`button`,onClick:l,disabled:h,"aria-label":E(`sidebar.create`),title:E(`sidebar.create`),className:`ml-auto flex h-8 w-8 items-center justify-center rounded-md text-lg text-blue hover:bg-bg disabled:opacity-40`,children:h?`…`:`+`})]}),(0,K.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,K.jsx)(`label`,{className:`sr-only`,htmlFor:`daemon-search`,children:E(`sidebar.find`)}),(0,K.jsxs)(`div`,{className:`flex items-center rounded-md border border-line/60 bg-bg/60 px-2 focus-within:border-blue/60`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mr-1.5 text-xs text-ink-faint`,children:`/`}),(0,K.jsx)(`input`,{id:`daemon-search`,value:ae,onChange:e=>D(e.target.value),placeholder:E(`sidebar.find`),className:`h-8 min-w-0 flex-1 bg-transparent text-xs text-ink outline-none placeholder:text-ink-faint`}),ae?(0,K.jsx)(`button`,{type:`button`,"aria-label":E(`sidebar.clearSearch`),onClick:()=>D(``),className:`px-1 text-sm text-ink-faint hover:text-ink`,children:`×`}):null]})]}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-3 pb-3 scroll-thin`,children:[m&&e.length===0?(0,K.jsx)(`div`,{className:`px-1 py-3 text-xs text-ink-faint`,children:E(`common.loading`)}):null,g?(0,K.jsx)(`button`,{type:`button`,onClick:_,className:`mb-2 w-full rounded-md bg-err/5 px-3 py-2 text-left text-xs text-err`,children:E(`sidebar.refreshFailed`)}):null,!m&&!g&&k.length===0?(0,K.jsx)(`div`,{className:`px-1 py-4 text-xs text-ink-faint`,children:E(`sidebar.noSessions`)}):null,le.map(([e,n])=>(0,K.jsxs)(`section`,{className:`mb-4 last:mb-0`,children:[(0,K.jsx)(`div`,{className:`mb-1 truncate px-1 font-mono text-xs text-ink-faint`,title:e,children:e}),n.map(e=>{let n=e.id===t;return(0,K.jsxs)(`div`,{"data-active":n?`true`:`false`,onPointerEnter:()=>{n||i?.(e.id)},className:`session-card group relative mb-1 w-full rounded-md transition-colors duration-150 ease-panel ${n?`text-ink`:`text-ink-dim hover:text-ink`}`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`absolute left-0 transition-colors ${n?`inset-y-1 w-px bg-blue`:`inset-y-2 w-px bg-transparent group-hover:bg-ink-faint/30`}`}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),onFocus:()=>{n||i?.(e.id)},"aria-current":n?`page`:void 0,title:`${e.label||e.id}${e.objective?` — ${e.objective}`:``}`,className:`w-full min-w-0 px-3 py-2.5 pr-10 text-left`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(li,{ok:e.daemon_alive,title:e.daemon_alive?E(`sidebar.daemonAlive`):E(`sidebar.stopped`)}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.label||e.id})]}),(0,K.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center justify-between gap-2 pl-4 text-xs text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.daemon_alive?E(`sidebar.runningFor`,{uptime:J(e.uptime_seconds)}):ei(e.last_active)}),(0,K.jsx)(Pr,{settledUsd:e.spend_usd,knownUsd:e.known_cost_usd,status:e.spend_status,calls:e.usage_calls,premiumRequests:e.premium_requests,live:e.daemon_alive})]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>s(e.id),"aria-label":E(`sidebar.manage`,{name:e.label||e.id}),title:E(`sidebar.manageHint`),className:`absolute right-1.5 top-1.5 flex h-8 w-8 items-center justify-center rounded-md text-ink-faint opacity-100 transition-opacity hover:bg-panel-raised hover:text-ink sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,K.jsx)(o,{icon:u,className:`h-4 w-4`})})]},e.id)})]},e))]}),(0,K.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between border-t border-line/50 px-4 py-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(`config`),className:`icon-control flex h-8 w-8 items-center justify-center`,"aria-label":E(`sidebar.openSettings`),title:E(`common.settings`),children:(0,K.jsx)(o,{icon:d,className:`h-3.5 w-3.5`})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>te(ee===`zh-CN`?`en`:`zh-CN`),title:E(`language.switchTo`,{language:E(ee===`zh-CN`?`language.english`:`language.chinese`)}),"aria-label":E(`language.switchTo`,{language:E(ee===`zh-CN`?`language.english`:`language.chinese`)}),className:`icon-control flex h-8 w-8 items-center justify-center`,children:(0,K.jsx)(o,{icon:f,className:`h-3.5 w-3.5`})}),(0,K.jsx)(`button`,{type:`button`,onClick:w,title:E(`sidebar.theme`,{current:S,next:ue}),"aria-label":E(`sidebar.theme`,{current:S,next:ue}),className:`icon-control flex h-8 w-8 items-center justify-center`,children:(0,K.jsx)(o,{icon:A,className:`h-3.5 w-3.5`})})]})]})]})}var Ka={in_progress:`#8fa7b8`,running:`#8fa7b8`,pending:`#7e7d75`,queued:`#7e7d75`,done:`#7fa386`,completed:`#7fa386`,blocked:`#c77b72`,failed:`#c77b72`};function qa({items:e,onDispose:t,onStop:n,onInspect:r,busy:i,readOnly:a=!1}){let{t:o}=q(),[s,c]=(0,M.useState)(!1),l=Ln(e,!1),u=Ln(e,!0),d=s?u:l;return(0,K.jsxs)(`section`,{className:`card flex flex-col ${d.length>0?`min-h-0 flex-1`:`shrink-0`}`,children:[(0,K.jsx)(fi,{title:o(`panel.backlog`),right:(0,K.jsx)(`button`,{className:`text-[10px] text-ink-faint transition-colors hover:text-ink`,onClick:()=>c(e=>!e),children:s?`active · ${l.length}`:`history · ${u.length}`})}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto scroll-thin`,children:[d.length===0&&(0,K.jsx)(mi,{children:s?`no completed runs yet`:`nothing queued — Argus is standing by`}),d.map(e=>{let o=Ka[e.status]??`#8a93a6`,s=e.iterate;return(0,K.jsx)(`div`,{className:`group border-b border-line/60 px-3 py-2 last:border-0`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>r?.(e.id),disabled:!r,className:`block max-w-full truncate text-left text-xs font-medium text-ink enabled:hover:text-blue-sky enabled:focus-visible:outline-none enabled:focus-visible:underline`,title:r?`view full task details`:void 0,children:e.title||e.objective}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-ink-faint`,children:e.id.slice(0,8)}),(0,K.jsx)(ui,{color:o,children:e.status}),typeof e.priority==`number`&&(0,K.jsxs)(`span`,{className:`text-[10px] text-ink-faint`,children:[`p`,e.priority]}),s&&(0,K.jsx)(`span`,{className:`text-[10px] text-blue-sky`,children:`↻ iterating`})]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100`,children:[!a&&s&&(0,K.jsx)(di,{variant:`ghost`,onClick:()=>n(e.id),disabled:i,title:`stop iterating`,children:`stop`}),!a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(di,{variant:`ghost`,onClick:()=>t(e.id,`done`),disabled:i,title:`mark done`,children:`✓`}),(0,K.jsx)(di,{variant:`ghost`,onClick:()=>t(e.id,`rm`),disabled:i,title:`remove`,children:`✕`})]})]})]})},e.id)})]})]})}var Ja={win:`#7fa386`,milestone:`#c7a66a`,insight:`#8fa7b8`,decision:`#a69daf`,failure:`#c77b72`,note:`#7e7d75`};function Ya({entries:e}){let{t}=q(),n=[...e].reverse();return(0,K.jsxs)(`section`,{className:`card flex min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(fi,{title:t(`panel.journal`),right:(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:e.length})}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto scroll-thin`,children:[e.length===0&&(0,K.jsx)(mi,{children:`no journal entries yet`}),n.map(e=>{let t=Ja[e.kind]??`#8a93a6`,n=String(e.extra?.pricing_status??``),r=e.extra&&Object.prototype.hasOwnProperty.call(e.extra,`cost_usd`)?e.extra.cost_usd:e.cost_usd,i=typeof r==`number`&&r>0?`${ti(r)}${n===`partial`||n===`unpriced`?`+`:``}`:n===`partial`||n===`unpriced`?n:``;return(0,K.jsxs)(`div`,{className:`border-b border-line/60 px-3 py-2 last:border-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full`,style:{background:t}}),(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide`,style:{color:t},children:e.kind}),(0,K.jsx)(`span`,{className:`ml-auto text-[10px] text-ink-faint`,children:ei(e.ts)})]}),(0,K.jsx)(`div`,{className:`mt-1 text-xs font-medium text-ink`,children:e.title}),e.summary&&(0,K.jsx)(`div`,{className:`mt-0.5 text-[11px] leading-snug text-ink-dim`,children:e.summary}),(0,K.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:[(e.tags??[]).slice(0,4).map(e=>(0,K.jsx)(`span`,{className:`rounded bg-line/60 px-1 text-[9px] text-ink-faint`,children:e},e)),i?(0,K.jsx)(`span`,{className:`ml-auto text-[10px] text-ink-faint`,children:i}):null]})]},e.id)})]})]})}var Xa=[`manager`,`planner`,`engineer`,`reviewer`];function Za(e){return e==null?``:e<3?`now`:e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m`:`${Math.floor(e/3600)}h`}function Qa({roles:e}){let{t}=q(),n=new Map(e.map(e=>[e.role,e])),r=Xa.map(e=>n.get(e)).filter(Boolean),i=e.filter(e=>!Xa.includes(e.role)),a=[...r,...i];return(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(fi,{title:t(`panel.roles`)}),(0,K.jsx)(`div`,{children:a.map(e=>{let t=z.role[e.role]??z.info;return(0,K.jsxs)(`div`,{className:`grid grid-cols-[84px_minmax(0,1fr)_auto] items-center gap-2 border-b border-line/60 px-3 py-2 last:border-b-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full`,style:{background:e.active?t:`rgb(var(--ink-faint))`}}),(0,K.jsx)(`span`,{className:`text-[11px] font-medium capitalize`,style:{color:e.active?t:z.inkDim},children:e.role})]}),(0,K.jsx)(`div`,{className:`min-w-0 truncate font-mono text-[10px] text-ink-faint`,title:e.model,children:e.model||`—`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 text-right`,children:[(0,K.jsx)(`span`,{className:`text-[10px]`,style:{color:e.active?z.ink:z.inkFaint},children:e.active?e.status||`active`:`idle`}),e.active&&Za(e.age_s)&&(0,K.jsxs)(`span`,{className:`text-[10px] tabular-nums text-ink-faint`,children:[`· `,Za(e.age_s)]}),e.effort&&(0,K.jsxs)(`span`,{className:`text-[10px]`,style:{color:ut(e.effort)},children:[`· `,e.effort]})]})]},e.role)})})]})}function $a({open:e,snap:t,journal:n,busy:r,onClose:i,onDispose:a,onStop:o,onInspect:s}){let{t:c}=q();return(0,K.jsxs)(ia,{open:e,onClose:i,label:`Project inspector`,width:`max-w-6xl`,children:[(0,K.jsx)(aa,{title:c(`panel.project`),sub:t.session.display_name||t.session.id}),(0,K.jsxs)(`div`,{className:`h-[68vh] min-h-0 space-y-3 overflow-y-auto bg-bg p-3 scroll-thin lg:grid lg:grid-cols-[minmax(0,1.4fr)_minmax(300px,0.8fr)] lg:gap-3 lg:space-y-0 lg:overflow-hidden`,children:[(0,K.jsx)(qa,{items:t.backlog,onDispose:a,onStop:o,onInspect:s,busy:r}),(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,K.jsx)(Qa,{roles:t.roles}),(0,K.jsx)(Ya,{entries:n})]})]})]})}var eo=e=>e?new Date(e*1e3).toLocaleString():`—`;function to({label:e,value:t}){return(0,K.jsxs)(`div`,{className:`rounded-md border border-line/70 bg-bg/40 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[9px] font-semibold uppercase tracking-wider text-ink-faint`,children:e}),(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-ink-dim`,children:t})]})}function no({sid:e,itemId:t,onClose:n,onDone:r,onSkip:i,onStop:a,busy:o,readOnly:s=!1}){let{t:c}=q(),l=Cr(e,t),u=l.data,d=u?In(u):!1,f=ln(u?.outcome);return(0,K.jsxs)(ia,{open:!!t,onClose:n,label:c(`task.details`),width:`max-w-3xl`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3 border-b border-line px-4 py-3 sm:flex-nowrap sm:px-5`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`truncate text-sm font-semibold text-ink`,children:u?.title||c(`task.details`)}),u?(0,K.jsx)(ui,{children:u.status}):null]}),(0,K.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px] text-ink-faint`,children:t})]}),!s&&u&&!d?(0,K.jsxs)(`div`,{className:`order-3 flex w-full shrink-0 items-center justify-end gap-1 sm:order-none sm:w-auto`,children:[u.iterate?(0,K.jsx)(di,{onClick:()=>a(u.id),disabled:o,children:c(`task.stopLoop`)}):null,(0,K.jsx)(di,{onClick:()=>r(u.id),disabled:o,children:c(`task.done`)}),(0,K.jsx)(di,{variant:`danger`,onClick:()=>i(u.id),disabled:o,children:c(`task.skip`)})]}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":c(`task.close`),onClick:n,className:`order-2 rounded-md px-2 py-1 text-lg leading-none text-ink-faint hover:bg-surface hover:text-ink sm:order-none`,children:`×`})]}),(0,K.jsxs)(`div`,{className:`max-h-[70vh] overflow-y-auto p-4 scroll-thin sm:p-5`,children:[l.isLoading?(0,K.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,K.jsx)(pi,{})}):null,l.isError?(0,K.jsx)(`div`,{className:`rounded-md border border-err/40 bg-err/5 p-3 text-xs text-err`,children:l.error.message}):null,u?(0,K.jsxs)(`div`,{className:`space-y-4`,children:[u.pending_question?(0,K.jsxs)(`div`,{className:`rounded-lg border border-warn/40 bg-warn/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-warn`,children:c(`task.waitingOnYou`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm leading-relaxed text-ink`,children:u.pending_question})]}):null,(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.objective`)}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap rounded-lg border border-line bg-bg/50 p-3 text-sm leading-relaxed text-ink-dim`,children:u.objective||u.original_objective||c(`task.noObjective`)})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,K.jsx)(to,{label:c(`task.priority`),value:`p${u.priority}`}),(0,K.jsx)(to,{label:c(`task.started`),value:eo(u.started_ts)}),(0,K.jsx)(to,{label:c(`task.finished`),value:eo(u.finished_ts)})]}),f.length?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.outcome`)}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:f.map(e=>(0,K.jsx)(ui,{children:e},e))})]}):null,u.iterate||u.iteration_cycles_done||u.iteration_cost_usd?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.iteration`)}),(0,K.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,K.jsx)(to,{label:c(`task.mode`),value:u.iterate?c(`task.autoIterate`):c(`task.singlePass`)}),(0,K.jsx)(to,{label:c(`task.cycles`),value:`${u.iteration_cycles_done??0}/${u.iteration_max_cycles??`—`}`}),(0,K.jsx)(to,{label:c(`task.cost`),value:`$${(u.iteration_cost_usd??0).toFixed(2)}`})]})]}):null,u.last_error?(0,K.jsxs)(`section`,{className:`rounded-lg border border-err/30 bg-err/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-err`,children:c(`task.lastError`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap font-mono text-xs leading-relaxed text-ink-dim`,children:u.last_error})]}):null,u.notes?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.notes`)}),(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-xs leading-relaxed text-ink-dim`,children:u.notes})]}):null,u.tags?.length||u.deps?.length?(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(u.tags??[]).map(e=>(0,K.jsxs)(ui,{children:[`#`,e]},`tag-${e}`)),(u.deps??[]).map(e=>(0,K.jsxs)(ui,{children:[c(`task.dependsOn`),` `,e]},`dep-${e}`))]}):null]}):null]})]})}function ro({onPointerDown:e,onReset:t,onNudge:n,value:r,min:i=240,max:a=600,label:o=`Resize panel`}){return(0,K.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":o,"aria-valuenow":r,"aria-valuemin":i,"aria-valuemax":a,tabIndex:0,onPointerDown:e,onDoubleClick:t,onKeyDown:e=>{e.key===`ArrowLeft`?(e.preventDefault(),n(-16)):e.key===`ArrowRight`?(e.preventDefault(),n(16)):e.key===`Home`&&(e.preventDefault(),t())},className:`group relative hidden w-2 shrink-0 cursor-col-resize items-center justify-center outline-none lg:flex`,children:(0,K.jsx)(`span`,{className:`h-full w-px bg-line/30 transition-colors duration-150 group-hover:bg-blue/70 group-focus:bg-blue/70`})})}var io=[`manager`,`planner`,`engineer`,`reviewer`];function ao(e){let t=[...e.dag],n=[],r=new Set;for(;t.length;){let i=t.findIndex(t=>t.deps.every(t=>r.has(t)||!e.dag.some(e=>e.id===t))),[a]=t.splice(i>=0?i:0,1);n.push(a),r.add(a.id)}return n}function oo(e,t=16){let n=ao(e);if(n.length<=t)return{nodes:n,hidden:[]};let r=new Set(n.slice(-t).map(e=>e.id)),i=n.find(e=>[`running`,`in_progress`,`claimed`].includes(e.status)),a=new Map(n.map(e=>[e.id,e])),o=i?[i]:[];for(;o.length;){let e=o.pop();r.has(e.id)||(r.add(e.id),e.deps.forEach(e=>{let t=a.get(e);t&&o.push(t)}))}return{nodes:n.filter(e=>r.has(e.id)),hidden:n.filter(e=>!r.has(e.id))}}function so({view:e}){let{t}=q(),n=e.achievement;return n?(0,K.jsxs)(`section`,{className:`border-b border-ok/35 bg-ok/5 px-5 py-4 animate-appear`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ok`,children:t(`mission.achievement`)}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-ink`,children:n.title}),n.summary?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-ink-dim`,children:n.summary}):null,(0,K.jsxs)(`div`,{className:`mt-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`text-ink-faint`,children:[t(`mission.elapsed`),` `]}),(0,K.jsx)(`span`,{className:`font-mono text-ink`,children:On(n.elapsed_seconds??0)})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[11px] text-ink-dim`,children:[(0,K.jsx)(`span`,{children:t(`mission.rejectedAttempts`,{count:n.rejected_attempts??0})}),(0,K.jsx)(`span`,{children:t(`mission.skillsLearned`,{count:n.skills_learned??0})}),(0,K.jsx)(`span`,{children:t(`mission.artifacts`,{count:n.artifacts??0})})]})]}):null}function co({view:e,onOpenArtifact:t,gitDiff:n}){let{t:r}=q(),i=new Map(e.roles.map(e=>[e.role,e])),a=e.dag.find(e=>[`running`,`in_progress`,`claimed`].includes(e.status)),o=oo(e),s=o.nodes,c=Dn(e.mission.objective||e.mission.title||r(`mission.waiting`)),[l,u]=(0,M.useState)(Math.max(0,e.timeline.length-1)),[d,f]=(0,M.useState)(e.active_role||`planner`),[p,m]=(0,M.useState)(a?.id||``),h=ln(e.outcome),g=hn(e.routing);(0,M.useEffect)(()=>u(Math.max(0,e.timeline.length-1)),[e.timeline.length]),(0,M.useEffect)(()=>{a?.id&&m(a.id)},[a?.id]);let _=e.timeline.slice(0,l+1).slice(-12).reverse(),v=e.dag.find(e=>e.id===p),y=e.role_work.filter(e=>e.role===d).filter(e=>!p||!e.item_id||e.item_id===p).slice(-40).reverse();return(0,K.jsxs)(`section`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto bg-panel scroll-thin`,"aria-label":r(`mission.control`),children:[(0,K.jsxs)(`header`,{className:`border-b border-line/60 px-5 py-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mobile.mission`)}),(0,K.jsx)(`div`,{role:`heading`,"aria-level":1,className:`mt-1 line-clamp-4 max-w-4xl text-lg font-semibold leading-snug text-ink`,title:c,children:(0,K.jsx)(yi,{children:c})}),c.length>600?(0,K.jsxs)(`details`,{className:`mt-2 text-xs text-ink-faint`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer hover:text-ink`,children:r(`mission.showObjective`)}),(0,K.jsx)(`div`,{className:`mt-2 text-ink-dim`,children:(0,K.jsx)(yi,{children:c})})]}):null,(0,K.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-x-6 gap-y-3 text-xs sm:grid-cols-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(`mission.stage`)}),(0,K.jsx)(`div`,{className:`mt-0.5 font-medium capitalize text-blue-sky`,children:e.stage.label||e.stage.id||`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(e.routing.open_ended?`mission.campaign`:`mission.totalElapsed`)}),(0,K.jsx)(`div`,{className:`mt-0.5 font-mono text-ink`,children:On(e.mission.campaign_elapsed_seconds)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(`mission.round`)}),(0,K.jsxs)(`div`,{className:`mt-0.5 font-mono text-ink`,children:[e.round.current||`—`,e.round.max?` / ${e.round.max}`:``]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(`mission.mode`)}),(0,K.jsx)(`div`,{className:`mt-0.5 font-mono text-ink`,children:g||`—`})]})]}),h.length?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-x-3 gap-y-1 font-mono text-[10px] text-ink-dim`,children:h.map(e=>(0,K.jsx)(`span`,{children:e},e))}):null,e.mission.summary?(0,K.jsxs)(`div`,{className:`mt-3 rounded border border-ok/25 bg-ok/5 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em] text-ok`,children:r(`mission.summary`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-xs leading-relaxed text-ink-dim`,children:e.mission.summary})]}):null,e.frontier.change?(0,K.jsxs)(`div`,{className:`mt-3 rounded border border-blue/25 bg-blue/5 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em] text-blue-sky`,children:[`Task frontier · `,e.frontier.change.replaceAll(`_`,` `)]}),e.frontier.summary?(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-dim`,children:e.frontier.summary}):null]}):null]}),(0,K.jsx)(so,{view:e}),(0,K.jsxs)(`section`,{className:`border-b border-line/60 px-5 py-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.team`)}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2 xl:grid-cols-4`,children:io.map(e=>{let t=i.get(e),n=t?.status===`active`,a=t?.status===`rejected`||t?.status===`error`,o=z.role[e]??z.inkFaint;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>f(e),className:`min-w-0 border-l-2 pl-3 text-left ${d===e?`bg-white/[0.03]`:``}`,style:{borderColor:n||t?.status===`done`?o:`rgb(var(--line))`},children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 rounded-full ${n?`animate-pulse motion-reduce:animate-none`:``}`,style:{background:a?z.error:n||t?.status===`done`?o:z.inkFaint}}),(0,K.jsx)(`span`,{className:`text-xs font-semibold capitalize`,style:{color:o},children:e})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate text-xs ${a?`text-err`:`text-ink-dim`}`,children:t?.label||r(`mission.waitingShort`)})]},e)})})]}),(0,K.jsxs)(`section`,{className:`border-b border-line/60 px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:[r(`mission.roleWork`),` · `,(0,K.jsx)(`span`,{className:`text-blue-sky`,children:d})]}),v?(0,K.jsx)(`button`,{type:`button`,onClick:()=>m(``),className:`text-[10px] text-ink-faint hover:text-ink`,children:r(`mission.filteredBy`,{task:v.title||v.id})}):(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:r(`mission.allVisible`)})]}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 lg:grid-cols-2`,children:[y.map(e=>(0,K.jsxs)(`article`,{className:`min-w-0 rounded border border-line/60 bg-bg/35 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-medium text-ink`,children:e.title}),(0,K.jsx)(`time`,{className:`shrink-0 font-mono text-[10px] text-ink-faint`,children:new Date(e.ts*1e3).toISOString().slice(11,19)})]}),(0,K.jsxs)(`div`,{className:`mt-1 flex gap-2 font-mono text-[10px] text-ink-faint`,children:[(0,K.jsx)(`span`,{children:e.kind}),e.status?(0,K.jsx)(`span`,{children:e.status}):null,e.round_index==null?null:(0,K.jsx)(`span`,{children:r(`mission.roundNumber`,{count:e.round_index})})]}),e.detail?(0,K.jsx)(`p`,{className:`mt-2 max-h-36 overflow-auto whitespace-pre-wrap text-[11px] leading-5 text-ink-dim scroll-thin`,children:e.detail}):null]},e.id)),y.length?null:(0,K.jsx)(`div`,{className:`col-span-full py-8 text-center text-xs text-ink-faint`,children:r(`mission.noRoleWork`,{role:d})})]})]}),(0,K.jsxs)(`div`,{className:`grid min-h-[320px] border-b border-line/60 lg:grid-cols-[minmax(0,1.15fr)_minmax(260px,0.85fr)]`,children:[(0,K.jsxs)(`section`,{className:`min-w-0 border-b border-line/60 px-5 py-4 lg:border-b-0 lg:border-r`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.researchDag`)}),a?(0,K.jsxs)(`span`,{className:`max-w-48 truncate text-[10px] text-blue-sky`,children:[r(`mission.active`),` · `,a.title]}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-0`,children:[o.hidden.length?(0,K.jsxs)(`div`,{className:`mb-3 rounded border border-line/60 bg-bg/50 px-3 py-2 text-[10px] text-ink-faint`,children:[o.hidden.length,` earlier tasks collapsed · `,o.hidden.filter(e=>[`failed`,`blocked`].includes(e.status)).length,` failed · `,o.hidden.filter(e=>e.status===`skipped`).length,` skipped`]}):null,s.length?s.map((e,t)=>{let n=e.id===a?.id,r=[`done`,`completed`].includes(e.status),i=[`failed`,`blocked`].includes(e.status);return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>m(e.id),className:`relative flex w-full min-w-0 gap-3 pb-3 text-left last:pb-0 ${p===e.id?`bg-white/[0.03]`:``}`,children:[t(0,K.jsx)(`li`,{children:e},e))})]}):null]}):null]}),(0,K.jsxs)(`section`,{className:`min-w-0 px-5 py-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.capabilities`)}),e.learned_skills.length?(0,K.jsxs)(`div`,{className:`mt-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-[0.12em] text-ok`,children:r(`mission.capabilitiesUnlocked`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.learned_skills.filter(e=>e.status===`active`).slice(-8).map(e=>(0,K.jsxs)(`details`,{className:`rounded border border-ok/35 bg-ok/5 px-2 py-1.5`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer text-[10px] text-ok`,children:String(e.name||e.id)}),(0,K.jsxs)(`div`,{className:`mt-2 space-y-1 font-mono text-[9px] text-ink-faint`,children:[e.mission_title?(0,K.jsxs)(`div`,{children:[`evolved during · `,e.mission_title]}):null,e.path?(0,K.jsxs)(`div`,{className:`break-all`,children:[`path · `,e.path]}):null,(0,K.jsxs)(`div`,{children:[`version · `,e.version,` · scope · `,e.scope||`project`]})]}),e.content?(0,K.jsxs)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap border-t border-ok/20 pt-2 font-mono text-[10px] leading-5 text-ink-dim scroll-thin`,children:[e.content,e.content_truncated?` -… content truncated`:``]}):(0,K.jsx)(`div`,{className:`mt-2 text-[10px] text-ink-faint`,children:r(`mission.skillUnavailable`)})]},String(e.id)))})]}):null,e.learned_wiki_pages.some(e=>e.status!==`retired`)?(0,K.jsxs)(`div`,{className:`mt-4 border-t border-line/50 pt-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-[0.12em] text-blue-sky`,children:r(`mission.knowledgeRetained`)}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.learned_wiki_pages.filter(e=>e.status!==`retired`).slice(-6).map(e=>(0,K.jsx)(`span`,{className:`rounded border border-blue/35 bg-blue/5 px-2 py-1 text-[10px] text-blue-sky`,children:String(e.title||e.id)},String(e.id)))})]}):null,e.storage.project_skill_dir||e.storage.global_skill_dir||e.storage.wiki_paths.length||e.storage.skill_history_compressed||e.storage.wiki_retired_compressed?(0,K.jsxs)(`div`,{className:`mt-4 border-t border-line/50 pt-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-[0.12em] text-ink-faint`,children:r(`mission.selfEvolution`)}),(0,K.jsxs)(`div`,{className:`mt-2 space-y-1 font-mono text-[10px] text-ink-dim`,children:[e.storage.project_skill_dir?(0,K.jsxs)(`div`,{className:`break-all`,children:[`project skills (`,e.storage.project_skill_count,`) · `,e.storage.project_skill_dir]}):null,e.storage.global_skill_dir?(0,K.jsxs)(`div`,{className:`break-all`,children:[`global skills (`,e.storage.global_skill_count,`) · `,e.storage.global_skill_dir]}):null,e.storage.wiki_paths.map(e=>(0,K.jsxs)(`div`,{className:`break-all`,children:[`project wiki · `,e]},e)),e.storage.skill_history_compressed||e.storage.wiki_retired_compressed?(0,K.jsxs)(`div`,{children:[`cold history · skill `,e.storage.skill_history_compressed,` · wiki `,e.storage.wiki_retired_compressed,` · `,ni(e.storage.skill_history_bytes_saved+e.storage.wiki_retired_bytes_saved),` saved`]}):null]})]}):null]})]}),(0,K.jsxs)(`section`,{className:`px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.replay`)}),e.timeline.length>1?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{type:`range`,min:0,max:e.timeline.length-1,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":r(`mission.replayTimeline`),className:`h-1 min-w-32 flex-1 accent-blue`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-ink-faint`,children:[l+1,`/`,e.timeline.length]})]}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[_.map(e=>(0,K.jsxs)(`div`,{className:`grid grid-cols-[44px_10px_minmax(0,1fr)] gap-2 text-xs`,children:[(0,K.jsx)(`time`,{className:`font-mono text-[10px] text-ink-faint`,children:new Date(e.ts*1e3).toISOString().slice(11,16)}),(0,K.jsx)(`span`,{className:`mt-1 h-2 w-2 rounded-full ${e.tone===`error`?`bg-err`:e.tone===`success`||e.tone===`metric`||e.tone===`skill`?`bg-ok`:`bg-blue`}`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`font-medium text-ink`,children:e.title}),e.detail?(0,K.jsxs)(`span`,{className:`text-ink-dim`,children:[` · `,e.detail]}):null]})]},e.id)),e.timeline.length?null:(0,K.jsx)(`div`,{className:`py-10 text-center text-xs text-ink-faint`,children:r(`mission.waitingEvents`)})]}),e.artifacts.length?(0,K.jsx)(`div`,{className:`mt-5 flex flex-wrap gap-2 border-t border-line/50 pt-4`,children:e.artifacts.slice(-8).map(e=>{let n=String(e.path||``);return(0,K.jsx)(`button`,{type:`button`,disabled:!n||!t,onClick:()=>n&&t?.(n),className:`rounded border border-line px-2 py-1 font-mono text-[10px] text-blue-sky hover:border-blue-sky/50 disabled:text-ink-faint`,children:String(e.title||n)},String(e.id||n))})}):null,n?.available&&(n.status||n.diff)?(0,K.jsxs)(`details`,{className:`mt-5 border-t border-line/50 pt-4`,children:[(0,K.jsxs)(`summary`,{className:`cursor-pointer text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint hover:text-ink`,children:[`Git changes`,n.branch?` · ${n.branch}`:``]}),n.stat?(0,K.jsx)(`pre`,{className:`mt-3 overflow-x-auto whitespace-pre-wrap font-mono text-[10px] leading-5 text-ink-dim`,children:n.stat}):null,n.diff?(0,K.jsxs)(`pre`,{className:`mt-3 max-h-80 overflow-auto whitespace-pre font-mono text-[10px] leading-5 text-ink-dim scroll-thin`,children:[n.diff,n.truncated?` -… diff truncated`:``]}):null]}):null]})]})}var lo=e=>e instanceof Error?e.message:String(e||`Unknown error`);async function uo(e){let t=await e,n=t&&typeof t==`object`?t:{},r=String(n.command_status??``);if(Number(n.rc??0)!==0||r===`failed`||r===`rejected`)throw Error(String(n.error||`daemon command ${r||`failed`}`));return t}function fo({open:e,sid:t,snap:r,onClose:i,onChanged:a,onRestored:u}){let{t:f}=q(),[p,h]=(0,M.useState)(`task`),[g,_]=(0,M.useState)(``),[v,C]=(0,M.useState)(r.session.workdir??r.session.cwd??``),[w,ee]=(0,M.useState)(`ls`),[E,ne]=(0,M.useState)(``),[re,ie]=(0,M.useState)(``),[ae,D]=(0,M.useState)(null),[O,oe]=(0,M.useState)([]),[se,ce]=(0,M.useState)(0),[k,le]=(0,M.useState)(``),[A,ue]=(0,M.useState)(``),[de,fe]=(0,M.useState)(`work`);(0,M.useEffect)(()=>{e&&(C(r.session.workdir??r.session.cwd??``),Promise.all([R.metrics(),R.trash()]).then(([e,t])=>{D(e),oe(t.entries),ce(t.total)},e=>ne(lo(e))))},[e,r.session.cwd,r.session.workdir]);let j=async(e,t,n)=>{if(!A){ue(e),ne(``);try{let e=await t();n!==null&&ne(n||JSON.stringify(e,null,2)),a()}catch(e){ne(lo(e))}finally{ue(``)}}},pe=async()=>{let e=g.trim();if(e){if(p===`plan`){await j(`quick`,async()=>{let n=await R.previewPlan(t,e);return ne([...n.steps.map((e,t)=>`${t+1}. ${e.title}${e.detail?` — ${e.detail}`:``}`),...n.notes.map(e=>`Note: ${e}`),...n.error?[`Error: ${n.error}`]:[]].join(` -`)),n},null);return}await j(`quick`,p===`task`?()=>R.addTask(t,e):p===`nudge`?()=>R.nudge(t,e):()=>R.note(t,e),`${p} submitted.`),_(``)}},me=async e=>{await j(`restore:${e.trash_id}`,async()=>{let t=await R.restoreTrash(e.trash_id);return oe(t=>t.filter(t=>t.trash_id!==e.trash_id)),ce(e=>Math.max(0,e-1)),await u(t.sid),t},`Restored ${e.label}.`)},he=r.daemon.alive&&r.daemon.protocol_compatible===!1,ge=r.daemon.alive&&r.daemon.control_available===!1,_e=r.daemon_admission?.running_daemons??[],ve=p===`task`?b:p===`nudge`?T:p===`note`?s:S,ye=async()=>{await j(`trash-search`,async()=>{let e=await R.trash(k);return oe(e.entries),ce(e.total),e},null)};return(0,K.jsxs)(ia,{open:e,onClose:()=>!A&&i(),label:f(`operations.title`),width:`max-w-5xl`,children:[(0,K.jsx)(aa,{title:f(`operations.title`),sub:r.session.display_name||t}),(0,K.jsx)(`div`,{className:`flex gap-1 border-b border-line bg-panel px-4 py-2`,children:[[`work`,f(`operations.work`),b],[`runtime`,f(`operations.runtime`),d],[`system`,f(`operations.system`),c],[`recovery`,f(`operations.recovery`),n]].map(([e,t,n])=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>{fe(e),ne(``)},title:t,"aria-label":t,className:`flex h-8 w-9 items-center justify-center rounded-md text-xs ${de===e?`bg-blue-deep text-white`:`text-ink-faint hover:bg-bg hover:text-ink`}`,children:(0,K.jsx)(o,{icon:n})},e))}),(0,K.jsxs)(`div`,{className:`grid max-h-[76vh] gap-3 overflow-y-auto bg-bg p-3 scroll-thin lg:grid-cols-2`,children:[de===`work`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4 lg:col-span-2`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.workInput`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-faint`,children:f(`operations.workHint`)}),(0,K.jsx)(`div`,{className:`mt-3 flex gap-1`,children:[[`task`,b],[`nudge`,T],[`note`,s],[`plan`,S]].map(([e,t])=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(e),title:e,"aria-label":e,className:`flex h-8 w-9 items-center justify-center rounded text-xs capitalize ${p===e?`bg-blue-deep text-white`:`bg-bg text-ink-dim`}`,children:(0,K.jsx)(o,{icon:t})},e))}),(0,K.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value),rows:5,placeholder:p===`plan`?f(`operations.planPlaceholder`):f(`operations.actionPlaceholder`,{action:p}),className:`mt-3 w-full resize-y rounded border border-line bg-bg p-3 text-sm text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void pe(),disabled:!!A||!g.trim(),title:p===`plan`?f(`operations.previewPlan`):f(`operations.submitAction`,{action:p}),"aria-label":p===`plan`?f(`operations.previewPlan`):f(`operations.submitAction`,{action:p}),className:`mt-2 flex h-9 w-9 items-center justify-center rounded bg-blue-deep text-xs font-medium text-white disabled:opacity-40`,children:A===`quick`?`…`:(0,K.jsx)(o,{icon:ve})})]}):null,de===`runtime`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4 lg:col-span-2`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.runtime`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-faint`,children:f(`operations.runtimeHint`)}),(0,K.jsx)(`label`,{className:`mt-3 block text-[10px] uppercase tracking-wide text-ink-faint`,children:f(`operations.workdir`)}),(0,K.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,K.jsx)(`input`,{value:v,onChange:e=>C(e.target.value),className:`h-9 min-w-0 flex-1 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void j(`cwd`,()=>R.setWorkdir(t,v),f(`operations.workdirUpdated`)),disabled:!!A||!v.trim(),title:f(`operations.applyWorkdir`),"aria-label":f(`operations.applyWorkdir`),className:`flex h-9 w-9 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:y})})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>void j(`reset`,()=>R.resetManager(t),`Manager context reset.`),disabled:!!A,title:f(`operations.resetManager`),"aria-label":f(`operations.resetManager`),className:`flex h-9 w-9 items-center justify-center rounded border border-line text-xs text-ink-dim disabled:opacity-40`,children:(0,K.jsx)(o,{icon:te})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void j(`upgrade`,()=>uo(R.upgradeDaemon(t,r.daemon_commands?.revision)),`Current-release daemon started after safely draining active work.`),disabled:!!A||ge,title:ge?`Externally supervised daemon cannot be restarted from this Web host`:he?`Upgrade incompatible daemon`:`Restart on current release`,"aria-label":ge?`Externally supervised daemon`:he?`Upgrade incompatible daemon`:`Restart on current release`,className:`flex h-9 w-9 items-center justify-center rounded border text-xs disabled:opacity-40 ${he?`border-err/60 bg-err/10 text-err`:`border-line text-ink-dim`}`,children:(0,K.jsx)(o,{icon:x})})]}),r.daemon.protocol_error?(0,K.jsx)(`p`,{className:`mt-2 text-xs text-err`,children:r.daemon.protocol_error}):null,_e.length?(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-ink-faint`,children:f(`operations.replaceSlot`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-1`,children:_e.map(e=>(0,K.jsxs)(`button`,{type:`button`,disabled:!!A,onClick:()=>void j(`replace:${e.id}`,()=>uo(R.replaceDaemon(t,e.id,!!r.continuous?.enabled,r.daemon_commands?.revision)),`Parked ${e.label||e.id} and started this session.`),title:`Replace ${e.label||e.id}`,"aria-label":`Replace ${e.label||e.id}`,className:`flex w-full items-center justify-between rounded border border-line bg-bg px-2 py-1.5 text-left text-xs text-ink-dim disabled:opacity-40`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.label||e.id}),(0,K.jsx)(o,{icon:x,className:`ml-2 text-warn`})]},e.id))})]}):null]}):null,de===`system`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.skills`)}),(0,K.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,K.jsx)(`input`,{value:w,onChange:e=>ee(e.target.value),className:`h-9 min-w-0 flex-1 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`,placeholder:`ls, stats, show NAME…`}),(0,K.jsx)(`button`,{type:`button`,disabled:!!A,onClick:()=>void j(`skills`,async()=>{let e=await R.skills(t,w);return ie(e),e},null),title:f(`operations.runSkill`),"aria-label":f(`operations.runSkill`),className:`flex h-9 w-9 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:l})})]}),re?(0,K.jsx)(`pre`,{className:`mt-3 max-h-48 overflow-auto whitespace-pre-wrap rounded bg-bg p-3 font-mono text-xs text-ink-dim scroll-thin`,children:re}):null]}):null,de===`system`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.metrics`)}),(0,K.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`rounded px-2 py-1 text-xs font-semibold ${ae?.slo?.status===`healthy`?`bg-ok/10 text-ok`:`bg-warn/10 text-warn`}`,children:ae?.slo?.status??`loading`}),(0,K.jsxs)(`span`,{className:`text-xs text-ink-faint`,children:[`event validation failures: `,ae?.event_validation_failures??`—`]})]}),ae?(0,K.jsx)(`pre`,{className:`mt-3 max-h-48 overflow-auto whitespace-pre-wrap rounded bg-bg p-3 font-mono text-[10px] text-ink-dim scroll-thin`,children:JSON.stringify({web:ae.web,provider:ae.provider,cost_control:ae.cost_control},null,2)}):null]}):null,de===`recovery`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4 lg:col-span-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`h3`,{className:`mr-auto text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:[f(`operations.trash`),` · `,se]}),(0,K.jsx)(`input`,{value:k,onChange:e=>le(e.target.value),onKeyDown:e=>{!Pi(e)&&e.key===`Enter`&&ye()},placeholder:f(`operations.searchTrash`),className:`h-8 min-w-52 rounded border border-line bg-bg px-2 text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{type:`button`,disabled:!!A,onClick:()=>void ye(),title:f(`operations.searchTrash`),"aria-label":f(`operations.searchTrash`),className:`flex h-8 w-8 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:m})})]}),O.length?(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:O.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded border border-line bg-bg p-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs text-ink`,children:e.label}),(0,K.jsx)(`div`,{className:`truncate font-mono text-[10px] text-ink-faint`,children:e.trash_path})]}),(0,K.jsx)(`button`,{type:`button`,disabled:!!A,onClick:()=>void me(e),title:`Restore ${e.label}`,"aria-label":`Restore ${e.label}`,className:`flex h-8 w-8 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:n})})]},e.trash_id))}):(0,K.jsx)(`p`,{className:`mt-3 text-xs text-ink-faint`,children:f(`operations.trashEmpty`)}),se>O.length?(0,K.jsxs)(`p`,{className:`mt-2 text-[10px] text-ink-faint`,children:[`Showing the newest `,O.length,` matches. Narrow the search to find older sessions.`]}):null]}):null,E?(0,K.jsx)(`pre`,{className:`rounded-lg border border-line bg-panel p-3 font-mono text-xs whitespace-pre-wrap text-ink-dim lg:col-span-2`,children:E}):null]})]})}var po=[`API`,`Protocol`,`Workspace`];function mo(){let{t:e}=q(),t=(0,M.useRef)(null);return Qr(t,(e,t)=>{if(t){e.set(`[data-handshake-line], [data-handshake-node]`,{opacity:1,scale:1,clearProps:`transform`});return}e.to(`[data-handshake-mark]`,{scale:1.055,duration:.75,ease:`sine.inOut`,repeat:-1,yoyo:!0,transformOrigin:`50% 50%`}),e.timeline({repeat:-1,repeatDelay:.25}).fromTo(`[data-handshake-line]`,{scaleX:0,opacity:.25,transformOrigin:`0% 50%`},{scaleX:1,opacity:.8,duration:.9,ease:`power2.inOut`}).fromTo(`[data-handshake-node]`,{autoAlpha:.25,scale:.72},{autoAlpha:1,scale:1,duration:.28,stagger:.16,ease:`back.out(1.8)`},.12).to(`[data-handshake-node]`,{autoAlpha:.35,duration:.3,stagger:.08},`+=0.35`)}),(0,K.jsxs)(`div`,{ref:t,role:`status`,"aria-label":e(`handshake.connecting`),className:`w-full max-w-xl px-6 text-center`,children:[(0,K.jsx)(`div`,{"data-handshake-mark":!0,className:`handshake-mark glass-card mx-auto flex h-16 w-16 items-center justify-center rounded-3xl text-blue shadow-glow sm:h-20 sm:w-20`,children:(0,K.jsx)(xi,{size:48,className:`text-blue`})}),(0,K.jsxs)(`div`,{className:`relative mx-auto mt-8 h-10 max-w-sm sm:max-w-md`,children:[(0,K.jsx)(`div`,{className:`absolute left-[10%] right-[10%] top-3 h-px bg-line/80`}),(0,K.jsx)(`div`,{"data-handshake-line":!0,className:`handshake-line absolute left-[10%] right-[10%] top-3 h-px`}),(0,K.jsx)(`div`,{className:`relative flex justify-between`,children:po.map(e=>(0,K.jsxs)(`div`,{className:`flex w-20 flex-col items-center gap-2.5`,children:[(0,K.jsx)(`span`,{"data-handshake-node":!0,className:`handshake-node h-6 w-6 rounded-full border ring-4 ring-bg`,children:(0,K.jsx)(`span`,{className:`m-auto mt-[7px] block h-2 w-2 rounded-full bg-blue`})}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-ink-faint`,children:e})]},e))})]}),(0,K.jsx)(`p`,{className:`mt-9 text-base font-medium text-ink-dim`,children:`Connecting to Argus`}),(0,K.jsx)(`p`,{className:`mt-1.5 text-sm text-ink-faint`,children:`Negotiating protocol and restoring your workspace…`})]})}function ho({loading:e,hasProjects:t,error:n,onRetry:r,onNew:i,onChoose:a,canCreate:o}){let{t:s}=q();return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 text-center`,children:[e?(0,K.jsx)(mo,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ci,{size:32,tag:oi}),(0,K.jsx)(`p`,{className:`max-w-md text-sm leading-relaxed ${n?`text-err`:`text-ink-faint`}`,children:n||s(t?`landing.selectOrCreate`:`landing.noSessions`)})]}),!e&&(0,K.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[n?(0,K.jsx)(di,{onClick:r,variant:`danger`,children:s(`common.retry`)}):null,t?(0,K.jsx)(di,{onClick:a,children:s(`landing.select`)}):o?(0,K.jsx)(di,{onClick:i,variant:`primary`,children:s(`landing.new`)}):null]})]})}function go({active:e,onSelect:t,onOpenSessions:n}){let{t:r}=q(),i=[{id:`mission`,label:r(`mobile.mission`),icon:S},{id:`activity`,label:r(`mobile.activity`),icon:_},{id:`workbench`,label:r(`mobile.workbench`),icon:g},{id:`preview`,label:r(`mobile.preview`),icon:ee}];return(0,K.jsxs)(`nav`,{"aria-label":r(`mobile.views`),className:`mobile-tabbar glass-panel glass-panel--raised fixed inset-x-0 bottom-0 z-40 flex items-stretch border-t border-line/60 lg:hidden`,children:[n?(0,K.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":r(`topbar.openSessions`),className:`flex min-h-[3.25rem] flex-1 flex-col items-center justify-center gap-0.5 text-ink-faint active:bg-panel-raised`,children:[(0,K.jsx)(o,{icon:h,className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-[10px] leading-none`,children:r(`mobile.sessions`)})]}):null,i.map(n=>{let r=n.id===e;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),"aria-current":r?`page`:void 0,className:`flex min-h-[3.25rem] flex-1 flex-col items-center justify-center gap-0.5 active:bg-panel-raised ${r?`text-blue`:`text-ink-faint`}`,children:[(0,K.jsx)(o,{icon:n.icon,className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-[10px] leading-none`,children:n.label})]},n.id)})]})}function _o(){(0,M.useEffect)(()=>{let e=window.visualViewport,t=document.documentElement;if(!e)return;let n=null,r=()=>{n!=null&&window.cancelAnimationFrame(n),n=window.requestAnimationFrame(()=>{let n=window.innerHeight-e.height-e.offsetTop,r=n>24?Math.round(n):0;t.style.setProperty(`--keyboard-inset`,`${r}px`)})};return r(),e.addEventListener(`resize`,r),e.addEventListener(`scroll`,r),()=>{n!=null&&window.cancelAnimationFrame(n),e.removeEventListener(`resize`,r),e.removeEventListener(`scroll`,r),t.style.removeProperty(`--keyboard-inset`)}},[])}async function vo(e,t){let n=V(e.trim());if(!n)return{kind:`not-command`};if(!n.cmd){let e=Vt(n.name);return{kind:`error`,message:e?`Unknown command ${n.name}. Did you mean ${e}?`:`Unknown command ${n.name}. Use /help for the full list.`}}if(n.cmd.id===`ask`)return{kind:`not-command`};if(Nt(n.cmd)&&!n.rest)return{kind:`error`,message:`Usage: ${n.cmd.name}${n.cmd.arg?` ${n.cmd.arg}`:``}`};try{await t[n.cmd.id](n.rest)}catch(e){return{kind:`error`,message:e instanceof Error?e.message:String(e??`Command failed`)}}return{kind:`handled`}}function yo({activeSid:e,activityEventsRef:t,notify:n,onClearEvents:r,onDispose:i,onOpenConfig:a,onOpenDoctor:o,onOpenHelp:s,onOpenIdentity:c,onOpenInspector:l,onOpenNewDaemon:u,onOpenOperations:d,onOpenSidebar:f,onReconnectEvents:p,onRenameProject:m,onRewriteDraft:h,onSelectProject:g,onSetArtifactPath:_,onSetEventFilter:v,onSetEventQuery:y,onSetTaskItemId:b,onSetWorkspaceView:x,onShowArtifacts:S,onStopIteration:C,onStopWaiting:w,refetchSnapshot:T}){return{status:async()=>l(),roles:async()=>d(),journal:async()=>l(),backlog:async()=>x(`mission`),item:async e=>{e&&b(e)},artifacts:async()=>S(),artifact:async e=>{e&&_(e)},events:async e=>{x(`activity`);let{filter:t,query:n}=Bt(e);v(t),y(n)},find:async e=>{x(`activity`),v(`all`),y(e)},run:async()=>x(`activity`),clear:async()=>{x(`activity`),v(`all`),y(``),r(t.current.length)},cancel:async()=>w(),task:async t=>{e&&(await R.addTask(e,t),T(),n(`success`,`Task queued.`))},rewrite:async e=>{let t=e.trim();if(!t){n(`info`,`Type your prompt in the composer and press Rewrite, or use /rewrite .`);return}h(t)},plan:async t=>{if(!e)return;let r=await R.previewPlan(e,t);r.error?n(`error`,r.error):n(`info`,r.steps.map(e=>e.title).join(` -`)||`Plan preview ready.`)},nudge:async t=>{e&&(await R.nudge(e,t),n(`success`,`Guidance injected.`))},abort:async t=>{e&&(await R.abortMission(e,t||`operator abort`),n(`info`,`Abort requested.`))},note:async t=>{e&&(await R.note(e,t),n(`success`,`Note appended to timeline.`))},done:async e=>{e&&i(e,`done`)},skip:async e=>{e&&i(e,`rm`)},stop:async e=>{e&&C(e)},new:async()=>u(),daemons:async()=>f(),resume:async e=>{e&&e!==`list`?g(e):f()},attach:async e=>{e&&g(e)},rename:async t=>{!e||!t||await m(t)},doctor:async()=>o(),backend:async t=>{if(!e||!t){a();return}await R.setConfig(e,`runner_backend`,t),n(`success`,`Backend set to ${t}.`)},config:async t=>{if(!e||!t){a();return}let r=t.indexOf(`=`);r>0?(await R.setConfig(e,t.slice(0,r).trim(),t.slice(r+1).trim()),n(`success`,`Config updated.`)):a()},identity:async()=>c(),reset:async()=>{e&&(await R.resetManager(e),n(`success`,`Manager context reset.`))},skills:async t=>{e&&n(`info`,(await R.skills(e,t||`ls`)).slice(0,400))},reconnect:async()=>p(),help:async()=>s(),quit:async()=>n(`info`,`Background work continues; close this browser tab when ready.`)}}function bo(e){return e.kind===`error`?(typeof e.reply==`string`?e.reply.trim():``)||`Manager could not handle this message.`:null}function xo(e,t){e.kind===`task`&&t.dispatchTask(e);let n=bo(e);n&&t.notifyError(n),t.refetchTranscript()}var So={skipFirst:0,reconnectKey:0};function Co(e,t){return t.kind===`clear`?{...e,skipFirst:Math.max(0,t.offset)}:t.kind===`reconnect`?{skipFirst:0,reconnectKey:e.reconnectKey+1}:{...e,skipFirst:0}}var wo=`local_request_id`;function To(e,t,n,r=Date.now()){return{type:`ui.operator`,agent_layer:`operator`,text:n,ts:r/1e3,event_id:`local-${e}-${t}-operator`,message_id:`local-${t}-operator`,[wo]:t}}function Eo(e,t,n,r,i,a=Date.now(),o=`auto`){let s=r.trim();if(!s)return e;let c=e.findIndex(e=>e.type===`ui.argus`&&Number(e[wo])===n),l=i.endsWith(`-argus`)?`${i.slice(0,-6)}-operator`:``,u=l?e.map(e=>e.type===`ui.operator`&&Number(e[wo])===n?{...e,message_id:l}:e):e,d=u.find(e=>e.type===`ui.operator`&&Number(e[wo])===n),f=d?Math.max(0,a-Number(d.ts??a/1e3)*1e3):0;if(c<0)return[...u,{type:`ui.argus`,agent_layer:`manager`,text:s,ts:a/1e3,event_id:`local-${t}-${n}-argus`,message_id:i||`local-${n}-argus`,fragment_mode:o,response_latency_ms:f,[wo]:n}];let p=u[c],m=[...u];return m[c]={...p,text:Dt(String(p.text??``),s,o),message_id:i||p.message_id,fragment_mode:o},m}function Do(e,t,n){let r=new Map;e.forEach(e=>{let t=String(e.type??``);if(t!==`ui.operator`&&t!==`ui.argus`)return;let n=`${t}\u0000${String(e.text??``)}`;r.set(n,(r.get(n)??0)+1)});let i=t.map(e=>({type:e.role===`operator`?`ui.operator`:`ui.argus`,agent_layer:e.role===`operator`?`operator`:`manager`,text:e.text,ts:e.ts,message_id:`transcript-${e.ts}-${e.role}`})),a=Array(i.length).fill(!0);for(let e=i.length-1;e>=0;--e){let t=i[e],n=`${String(t.type)}\u0000${String(t.text??``)}`,o=r.get(n)??0;o>0&&(a[e]=!1,r.set(n,o-1))}let o=[...i.filter((e,t)=>a[t]),...e],s=Array(o.length).fill(!0),c=new Set,l=n.filter(e=>{let t=String(e.message_id??``),n=t?o.findIndex((e,n)=>!c.has(n)&&String(e.message_id??``)===t):-1,r=Number(e.ts??0);return n<0&&(n=o.findIndex((t,n)=>{if(c.has(n)||t.type!==e.type||t.text!==e.text)return!1;let i=Number(t.ts??0);return Math.abs(i-r)<=5})),n>=0&&(c.add(n),s[n]=!1),!0});return[...o.filter((e,t)=>s[t]),...l].sort((e,t)=>Number(e.ts??0)-Number(t.ts??0))}function Oo(e,t){if(!t.length)return e;let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return t?{...e,spend_usd:t.spend_usd,known_cost_usd:t.known_cost_usd,spend_status:t.spend_status,usage_calls:t.usage_calls,premium_requests:t.premium_requests,cost_updated_at:t.updated_at}:e})}async function ko(e,t,n,r=``){let i=await e.createDaemon(``,t,r),a=n.trim();return{created:i,startCampaign:a?()=>e.setContinuous(i.sid,!0,a):null}}var Ao=e=>e instanceof Error?e.message:String(e||`Unknown error`);function jo({localCwd:e,notify:t,onFocusComposer:n,queryClient:r,refetchProjects:i,selectProject:a}){let[o,s]=(0,M.useState)(!1),c=(0,M.useRef)(!1);return{createDaemon:async(o,l,u)=>{if(c.current)return!1;c.current=!0,s(!0);try{let{created:s,startCampaign:c}=await ko(R,o,l,u),d=String(s.workdir||u||``);return r.setQueryData([`projects`],t=>({local_cwd:t?.local_cwd??e,projects:[{id:s.sid,label:o||s.sid,display_name:o,objective:``,launch_cwd:d,workdir:d,last_active:Date.now()/1e3,daemon_alive:!1,daemon_pid:null,uptime_seconds:null},...(t?.projects??[]).filter(e=>e.id!==s.sid)]})),a(s.sid),i(),window.setTimeout(n,0),t(c?`info`:`success`,c?`Session created and selected. Campaign is starting in the background.`:`Session created and selected.`),c&&c().then(()=>{r.invalidateQueries({queryKey:[`snapshot`,s.sid]}),i(),t(`success`,`Campaign started.`)}).catch(e=>{t(`error`,`Session was created, but the campaign could not start: ${Ao(e)}`)}),!0}catch(e){return t(`error`,`Could not create session: ${Ao(e)}`),!1}finally{c.current=!1,s(!1)}},creatingDaemon:o}}var Mo=e=>e instanceof Error?e.message:String(e||`Unknown error`);function No({actions:e,activeSid:t,clearProjectSelection:n,continuous:r,currentSnapshotSid:i,notify:a,refetchProjects:o,selectProject:s,setDaemonManageOpen:c}){let[l,u]=(0,M.useState)(null),d=e.startDaemon.isPending||e.stopDaemon.isPending||e.updateProject.isPending||e.deleteProject.isPending,f=(0,M.useCallback)(e=>({onSuccess:()=>a(`success`,e),onError:e=>a(`error`,Mo(e))}),[a]),p=(0,M.useCallback)(()=>e.startDaemon.mutate(void 0,f(`Daemon start requested.`)),[f,e.startDaemon]),m=(0,M.useCallback)(()=>e.stopDaemon.mutate(!1,f(`Pause requested; the current operation is being interrupted.`)),[f,e.stopDaemon]),h=(0,M.useCallback)(async()=>{try{return await e.startDaemon.mutateAsync(),a(`success`,`Daemon resumed.`),!0}catch(e){return a(`error`,Mo(e)),!1}},[e.startDaemon,a]),g=(0,M.useCallback)(async()=>{try{return await e.stopDaemon.mutateAsync(!1),a(`success`,`Daemon paused. Progress remains resumable.`),!0}catch(e){return a(`error`,Mo(e)),!1}},[e.stopDaemon,a]),_=(0,M.useCallback)(async n=>{if(!t)return!1;try{return await e.updateProject.mutateAsync({sid:t,name:n}),a(`success`,`Session name updated.`),!0}catch(e){return a(`error`,Mo(e)),!1}},[e.updateProject,t,a]),v=(0,M.useCallback)(async()=>{if(!t)return!1;try{let t=await e.deleteProject.mutateAsync();c(!1),n(`replace`);let r=Gt((await o()).data?.projects??[])[0];return r&&s(r.id,`replace`),a(`success`,t.workdir_preserved?`Session moved to recoverable trash. Files remain in ${t.workdir}.`:`Session moved to recoverable trash.`),!0}catch(e){return a(`error`,Mo(e)),!1}},[e.deleteProject,t,n,a,o,s,c]),y=(0,M.useCallback)(e=>{if(c(!1),e===t&&i===e){u(null),c(!0);return}u(e),s(e)},[t,i,s,c]);return(0,M.useEffect)(()=>{!l||t!==l||i!==l||(u(null),c(!0))},[t,i,l,c]),{daemonBusy:d,manageDeleteProject:v,managePauseDaemon:g,manageRenameProject:_,manageStartDaemon:h,requestDispose:(0,M.useCallback)((t,n)=>e.disposeBacklog.mutate({id:t,op:n},{onSuccess:()=>a(`success`,n===`done`?`Work marked done.`:`Work removed.`),onError:e=>a(`error`,Mo(e))}),[e.disposeBacklog,a]),requestManageSession:y,requestStartDaemon:p,requestStopDaemon:m,requestStopIteration:(0,M.useCallback)(t=>e.stopBacklog.mutate(t,{onSuccess:()=>a(`success`,`Iteration stopped.`),onError:e=>a(`error`,Mo(e))}),[e.stopBacklog,a]),toggleContinuous:(0,M.useCallback)(()=>{if(!r)return;let t=!r.enabled;e.setContinuous.mutate({enabled:t,objective:r.objective},f(t?`Continuous campaign enabled.`:`Continuous campaign stopped.`))},[f,e.setContinuous,r])}}function Po({focusComposer:e,openHelp:t,toggleKiosk:n,togglePalette:r,toggleReasoning:i,toggleSidebarCollapse:a}){(0,M.useEffect)(()=>{let o=o=>{let s=o.target,c=s?.tagName===`INPUT`||s?.tagName===`TEXTAREA`,l=o.metaKey||o.ctrlKey;l&&o.key.toLowerCase()===`k`?(o.preventDefault(),r()):l&&o.key.toLowerCase()===`t`?(o.preventDefault(),i()):l&&o.key===`.`?(o.preventDefault(),n()):l&&o.key.toLowerCase()===`b`?(o.preventDefault(),a()):l&&o.key.toLowerCase()===`j`?(o.preventDefault(),e()):!c&&o.key===`?`?(o.preventDefault(),t()):!c&&o.key===`/`&&(o.preventDefault(),e())};return window.addEventListener(`keydown`,o),()=>window.removeEventListener(`keydown`,o)},[e,t,n,r,i,a])}var Fo=e=>e instanceof Error?e.message:String(e||`Unknown error`);function Io({activeSid:e,backlog:t,notify:n,pendingQuestions:r,refetchSnapshot:i}){let[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(!1),l=(0,M.useRef)(``),u=(0,M.useMemo)(()=>{let e=(t??[]).map(e=>({...e,operator_decision:e.operator_decision}));return ht(r??[],e)[0]??null},[t,r]);return(0,M.useEffect)(()=>{if(!u||!e){o(!1);return}let t=`${e}:${u.id}`;l.current!==t&&(l.current=t,o(!0))},[e,u]),{answerPendingReply:async(t,r)=>{if(!(!e||!u||s)){c(!0);try{let a=u.legacy?await R.answerPending(e,u.item_id,r):await R.resolveDecision(e,u.id,t,r);if(a.resolved===!1){n(`info`,String(a.reply||`Manager needs a more specific answer.`));return}o(!1),await i(),a.daemon&&Number(a.daemon.rc??0)!==0?n(`error`,`Answer queued, but the daemon did not start: ${a.daemon.error||`operator action required`}`):n(`success`,String(a.reply||`Manager delivered your answer to the team.`))}catch(e){await i(),n(`error`,`Could not send answer: ${Fo(e)}`)}finally{c(!1)}}},pendingReply:u,pendingReplyBusy:s,pendingReplyOpen:a,setPendingReplyOpen:o}}var Lo=`argus.browser.project.v1`;function Ro(){try{return window.sessionStorage.getItem(Lo)}catch{return null}}function zo(e){try{e?window.sessionStorage.setItem(Lo,e):window.sessionStorage.removeItem(Lo)}catch{}}function Bo(e,t){let n=new URL(window.location.href);e?n.searchParams.set(`project`,e):n.searchParams.delete(`project`);let r=t===`push`?`pushState`:`replaceState`;window.history[r](window.history.state,``,n.toString())}function Vo({cancelActiveMessage:e,notify:t,projects:n,projectsError:r,projectsReady:i,queryClient:a,setArtifactPath:o,setSidebarOpen:s,setTaskItemId:c}){let l=new URLSearchParams(window.location.search),[u,d]=(0,M.useState)(l.get(`project`)||Ro()),f=(0,M.useRef)(u),p=(0,M.useRef)(!1);f.current=u;let m=(0,M.useCallback)(t=>{t!==f.current&&(e(),o(null),c(null)),f.current=t,d(t),zo(t)},[e,o,c]),h=(0,M.useCallback)((e,t=`push`)=>{let n=new URLSearchParams(window.location.search).get(`project`);m(e),n!==e&&Bo(e,t)},[m]),g=(0,M.useCallback)((e=`replace`)=>{let t=new URLSearchParams(window.location.search).get(`project`);m(null),t!=null&&Bo(null,e)},[m]),_=(0,M.useCallback)(e=>{a.prefetchQuery({queryKey:[`snapshot`,e],queryFn:({signal:t})=>R.snapshot(e,t),staleTime:3e3})},[a]);return(0,M.useEffect)(()=>{if(!i)return;let e=p.current,r=Jt(n,f.current,e);if(!e&&(p.current=!0,r.id===f.current?zo(r.id):m(r.id),new URLSearchParams(window.location.search).get(`project`)!==r.id&&Bo(r.id,`replace`),r.recovered)){let e=n.find(e=>e.id===r.id);t(`info`,e?`Project “${r.requested}” was not found. Switched to ${e.label||e.id}.`:`Project “${r.requested}” was not found. Create a daemon to continue.`)}},[m,t,n,i]),(0,M.useEffect)(()=>{let e=()=>{let e=new URLSearchParams(window.location.search).get(`project`);if(s(!1),!e){m(null);return}if(!i){m(e);return}let r=qt(n,e);if(m(r.id),r.recovered){Bo(r.id,`replace`);let e=n.find(e=>e.id===r.id);t(`info`,e?`Project “${r.requested}” was not found. Switched to ${e.label||e.id}.`:`Project “${r.requested}” was not found. Create a daemon to continue.`)}};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[m,t,n,i,s]),{activateProject:m,activeSid:i?u&&n.some(e=>e.id===u)?u:null:r?u:null,clearProjectSelection:g,prefetchProject:_,selectProject:h,sid:u,sidRef:f}}function Ho(e,t){let n=localStorage.getItem(e);return n==null?t:n===`true`}function Uo(){let e=new URLSearchParams(window.location.search),[t,n]=(0,M.useState)(e.get(`kiosk`)===`1`),[r,i]=(0,M.useState)(()=>Ho(`argus.reasoning.visible.v1`,!1)),[a,o]=(0,M.useState)(()=>{let e=localStorage.getItem(`argus.workspace.view`);return e===`mission`||e===`workbench`?e:`activity`}),[s,c]=(0,M.useState)(`activity`),[l,u]=(0,M.useState)(()=>Ho(`argus.preview.expanded.v5`,!0)),[d,f]=(0,M.useState)(()=>{let e=Number(localStorage.getItem(`argus.sidebar.width.v2`)||256);return Number.isFinite(e)?Math.max(220,Math.min(400,e)):256}),[p,m]=(0,M.useState)(()=>{let e=Number(localStorage.getItem(`argus.preview.width.v2`)||440);return Number.isFinite(e)?Math.max(320,Math.min(600,e)):440}),[h,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(()=>Ho(`argus.sidebar.expanded.v4`,!0)),[y,b]=(0,M.useState)(()=>{let e=localStorage.getItem(`argus.theme`);return e===`light`||e===`dark`?e:null}),[x,S]=(0,M.useState)(()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches),C=y??(x?`dark`:`light`),w=(0,M.useRef)(null),T=(0,M.useRef)(null);(0,M.useEffect)(()=>{localStorage.setItem(`argus.sidebar.expanded.v4`,String(_)),localStorage.setItem(`argus.preview.expanded.v5`,String(l)),localStorage.setItem(`argus.sidebar.width.v2`,String(d)),localStorage.setItem(`argus.preview.width.v2`,String(p))},[_,d,l,p]),(0,M.useEffect)(()=>{localStorage.setItem(`argus.workspace.view`,a)},[a]),(0,M.useEffect)(()=>{localStorage.setItem(`argus.reasoning.visible.v1`,String(r))},[r]),(0,M.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>S(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,M.useEffect)(()=>{document.documentElement.dataset.theme=C},[C]),(0,M.useEffect)(()=>{let e=()=>{document.documentElement.dataset.pageVisible=String(!document.hidden)};return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let ee=(0,M.useCallback)(()=>{let e=C===`light`?`dark`:`light`;b(e),localStorage.setItem(`argus.theme`,e)},[C]),te=(0,M.useCallback)((e,t)=>{let n=w.current;if(!n)return;t.preventDefault();let r=n.getBoundingClientRect();document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let i=t=>{T.current!=null&&window.cancelAnimationFrame(T.current),T.current=window.requestAnimationFrame(()=>{if(e===`left`){let e=l?p+8:56,n=Math.max(220,Math.min(400,r.width-e-360-8));f(Math.max(220,Math.min(n,t.clientX-r.left)))}else{let e=_?d+8:56,n=Math.max(320,Math.min(600,r.width-e-360-8));m(Math.max(320,Math.min(n,r.right-t.clientX)))}})},a=()=>{T.current!=null&&window.cancelAnimationFrame(T.current),T.current=null,document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a,{once:!0}),window.addEventListener(`pointercancel`,a,{once:!0})},[_,d,l,p]);return(0,M.useEffect)(()=>{let e=()=>{if(window.innerWidth<1024||!w.current)return;let e=w.current.clientWidth,t=_?d:56,n=l?p:56,r=(_?8:0)+(l?8:0),i=Math.max(540,e-360-r);if(t+n<=i)return;let a=l?Math.max(320,Math.min(p,i-t)):n,o=_?Math.max(220,Math.min(d,i-a)):t;o+a>i&&l&&(a=Math.max(320,i-o)),_&&f(o),l&&m(a)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[_,d,l,p]),{cycleTheme:ee,kiosk:t,leftPanelOpen:_,leftWidth:d,mobileView:s,resizeSidebar:te,rightPanelOpen:l,rightWidth:p,setKiosk:n,setLeftPanelOpen:v,setLeftWidth:f,setMobileView:c,setRightPanelOpen:u,setRightWidth:m,setShowReasoning:i,setSidebarOpen:g,setWorkspaceView:o,shellRef:w,showReasoning:r,sidebarOpen:h,themeMode:C,workspaceView:a}}function Wo({error:e,onRetry:t}){let{t:n}=q(),r=Ye(e),i=e instanceof Je;return!r&&!i?null:(0,K.jsxs)(`div`,{role:`alert`,className:`fixed left-1/2 top-3 z-[100] flex w-[min(92vw,42rem)] -translate-x-1/2 items-start gap-3 rounded-xl border border-err/50 bg-panel/95 px-4 py-3 text-left text-sm text-ink shadow-xl backdrop-blur`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 font-mono font-bold text-err`,children:`!`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`strong`,{className:`block text-err`,children:n(r?`connection.pairingTitle`:`connection.unreachableTitle`)}),(0,K.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-ink-dim`,children:n(r?`connection.pairingDetail`:`connection.unreachableDetail`)})]}),r?null:(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 rounded-md border border-err/40 px-2.5 py-1 text-xs text-err hover:bg-err/10`,children:n(`common.retry`)})]})}var Go=0,Ko=(0,M.lazy)(async()=>({default:(await Jr(()=>import(`./ResearchWorkbenchPanel-BOPEGTC6.js`),__vite__mapDeps([2,1,3,4,5,6]))).ResearchWorkbenchPanel}));function qo(){let{locale:e,t}=q(),n=se(),r=fr(),i=pr(),a=(0,M.useMemo)(()=>Gt(Oo(r.data?.projects??[],i.data?.projects??[])),[i.data?.projects,r.data?.projects]),s=r.data?.local_cwd??``,c=[r.error,i.error].find(e=>Xe(e)),[l,u]=(0,M.useState)(`none`),{cycleTheme:d,kiosk:f,leftPanelOpen:p,leftWidth:m,mobileView:h,resizeSidebar:g,rightPanelOpen:_,rightWidth:v,setKiosk:y,setLeftPanelOpen:b,setLeftWidth:x,setMobileView:S,setRightPanelOpen:w,setRightWidth:T,setShowReasoning:ee,setSidebarOpen:te,setWorkspaceView:E,shellRef:ne,showReasoning:re,sidebarOpen:ie,themeMode:ae,workspaceView:D}=Uo(),[O,oe]=(0,M.useState)(()=>D===`mission`?`mission`:`activity`),[ce,k]=(0,M.useState)(D===`workbench`);(0,M.useEffect)(()=>{if(D===`workbench`){k(!0);return}oe(D)},[D]),_o();let[le,A]=(0,M.useState)(0),[ue,de]=(0,M.useState)(``),[fe,j]=(0,M.useState)(!1),[pe,me]=(0,M.useState)(0),[he,ge]=(0,M.useState)(!1),[_e,ve]=(0,M.useState)([]),[ye,be]=(0,M.useState)(``),[xe,Se]=(0,M.useState)(!1),[Ce,we]=(0,M.useState)(0),[Te,Ee]=(0,M.useState)([]),[De,Oe]=(0,M.useState)(0),[ke,Ae]=(0,M.useState)(null),[je,Me]=(0,M.useState)(null),[Ne,Pe]=(0,M.useState)(!1),[Fe,Ie]=(0,M.useState)(!1),Le=(0,M.useRef)(null),Re=(0,M.useRef)(0),[ze,Be]=(0,M.useState)(null),[Ve,He]=(0,M.useReducer)(Co,So),[Ue,We]=(0,M.useState)(`all`),[Ge,Ke]=(0,M.useState)(``),qe=(0,M.useCallback)(()=>Be(null),[]),N=(0,M.useCallback)((e,t)=>{Be({id:++Go,tone:e,message:t})},[]),Je=(0,M.useCallback)(()=>{let e=!!Le.current;return Re.current+=1,Le.current?.controller.abort(),Le.current=null,ge(!1),be(``),Se(!1),we(0),Ee([]),Oe(0),e},[]),Ye=(0,M.useCallback)(()=>{Je()&&N(`info`,`Stopped waiting for this reply. Server-side work may still finish in the project timeline.`)},[Je,N]),{activeSid:P,clearProjectSelection:Ze,prefetchProject:Qe,selectProject:F,sidRef:$e}=Vo({cancelActiveMessage:Je,notify:N,projects:a,projectsError:r.isError,projectsReady:r.isSuccess,queryClient:n,setArtifactPath:Ae,setSidebarOpen:te,setTaskItemId:Me});(0,M.useEffect)(()=>()=>{Re.current+=1,Le.current?.controller.abort(),Le.current=null},[]);let et=(0,M.useCallback)(e=>{let t=(e||``).trim(),n=$e.current;!t||!n||fe||(j(!0),R.rewritePrompt(n,t).then(e=>{if(j(!1),e.error||!e.rewritten.trim()){N(`error`,`Rewrite failed: ${e.error||`empty rewrite`} — your prompt is unchanged`);return}de(e.rewritten),A(e=>e+1);let t=e.questions.length?` Manager asks: ${e.questions.join(` · `)}`:``;N(`success`,`Prompt rewritten — review it, then send.${t}`)},e=>{j(!1),N(`error`,`Rewrite failed: ${ii(e)} — your prompt is unchanged`)}))},[N,fe,$e]),{createDaemon:tt,creatingDaemon:nt}=jo({localCwd:s,notify:N,onFocusComposer:()=>A(e=>e+1),queryClient:n,refetchProjects:r.refetch,selectProject:F}),I=mr(P),L=I.data,rt=L?.session.id===P?P:null,it=L?.continuous,at=br(rt,!0),ot=Sr(rt,O===`mission`),{events:st,connected:ct}=jr(rt,Ve.reconnectKey),lt=(0,M.useMemo)(()=>Or(st),[st]),z=(0,M.useMemo)(()=>Ar(st),[st]);(0,M.useEffect)(()=>{!rt||!lt||n.invalidateQueries({queryKey:[`artifacts`,rt],exact:!0})},[lt,rt,n]),(0,M.useEffect)(()=>{!rt||!z||n.invalidateQueries({queryKey:[`snapshot`,rt],exact:!0})},[rt,n,z]);let ut=(0,M.useMemo)(()=>Pn(st),[st]),dt=yr(rt,O===`activity`,120),ft=hr(P,20,l===`inspector`),{answerPendingReply:pt,pendingReply:mt,pendingReplyBusy:ht,pendingReplyOpen:B,setPendingReplyOpen:gt}=Io({activeSid:P,backlog:L?.backlog,notify:N,pendingQuestions:L?.pending_questions,refetchSnapshot:I.refetch}),_t=(0,M.useMemo)(()=>Do(st,dt.data??[],_e),[st,_e,dt.data]),vt=(0,M.useMemo)(()=>L?En(L,_t,at.data??[]):null,[_t,at.data,L]),yt=(0,M.useRef)(_t);yt.current=_t,(0,M.useEffect)(()=>{We(`all`),Ke(``),ve([]),He({kind:`reset`})},[rt]);let bt=wr(P,L?.daemon_commands?.revision),{daemonBusy:xt,manageDeleteProject:St,managePauseDaemon:Ct,manageRenameProject:wt,manageStartDaemon:Tt,requestDispose:Et,requestManageSession:Dt,requestStartDaemon:Ot,requestStopDaemon:kt,requestStopIteration:At,toggleContinuous:Mt}=No({actions:bt,activeSid:P,clearProjectSelection:Ze,continuous:it,currentSnapshotSid:L?.session.id,notify:N,refetchProjects:r.refetch,selectProject:F,setDaemonManageOpen:Ie}),Nt=(0,M.useCallback)(async e=>{if(!P)return;let t=await bt.updateProject.mutateAsync({sid:P,name:e});N(`success`,`Renamed to "${t.name}".`)},[bt.updateProject,P,N]),Pt=(0,M.useMemo)(()=>yo({activeSid:P,activityEventsRef:yt,notify:N,onClearEvents:e=>He({kind:`clear`,offset:e}),onDispose:Et,onOpenConfig:()=>u(`config`),onOpenDoctor:()=>u(`doctor`),onOpenHelp:()=>u(`help`),onOpenIdentity:()=>u(`identity`),onOpenInspector:()=>u(`inspector`),onOpenNewDaemon:()=>Pe(!0),onOpenOperations:()=>u(`operations`),onOpenSidebar:()=>te(!0),onReconnectEvents:()=>He({kind:`reconnect`}),onRenameProject:Nt,onRewriteDraft:et,onSelectProject:F,onSetArtifactPath:Ae,onSetEventFilter:We,onSetEventQuery:Ke,onSetTaskItemId:Me,onSetWorkspaceView:E,onShowArtifacts:()=>w(!0),onStopIteration:At,onStopWaiting:Ye,refetchSnapshot:I.refetch}),[P,N,Nt,Et,At,F,I.refetch,Ye,E]);Po({focusComposer:()=>A(e=>e+1),openHelp:()=>u(`help`),toggleKiosk:()=>y(e=>!e),togglePalette:()=>u(e=>e===`palette`?`none`:`palette`),toggleReasoning:()=>ee(e=>!e),toggleSidebarCollapse:()=>b(e=>!e)});let Ft=async(e,n=[])=>{let r=P;if(!r||Le.current)return!1;if(!n.length){let t=await vo(e,Pt);if(t.kind===`handled`)return!0;if(t.kind===`error`)return N(`error`,t.message),!1}let i=++Re.current,a=new AbortController;Le.current={id:i,sid:r,controller:a};let o=()=>{let e=Le.current;return!!(e&&e.id===i&&e.sid===r&&$e.current===r&&!a.signal.aborted)},s=()=>{Le.current?.id===i&&(Le.current=null,ge(!1),be(``),Se(!1),we(0),Oe(0),Ee([]))};ge(!0),be(n.length?t(`chat.uploadingAttachments`):``),Se(!1),we(0),Ee([]),Oe(Date.now());let c=[];if(n.length)try{let e=await R.uploadAttachments(r,n,a.signal);if(!o())return!1;c=e.attachments.map(e=>({attachment_id:e.attachment_id}))}catch(e){return o()&&(N(`error`,t(`chat.attachmentUploadFailed`,{error:ii(e)})),s()),!1}ve(t=>[...t,To(r,i,e)]);let l=(e,t=``,n=`auto`)=>{!o()||typeof e!=`string`||!e.trim()||ve(a=>Eo(a,r,i,e,t,Date.now(),n))},u=e=>{if(!o())return;let t=e.daemon&&typeof e.daemon==`object`?e.daemon:null,n=typeof e.reply==`string`?e.reply:null;t?.admission_required?N(`error`,n||`Task queued, but all daemon slots are busy: ${String(t.error||`operator action required`)}`):t&&Number(t.rc??0)!==0?N(`error`,n||`Task queued, but executor did not start: ${String(t.error||`unknown error`)}`):n&&N(`success`,n),I.refetch?.()},d=e=>{o()&&xo(e,{dispatchTask:u,notifyError:e=>N(`error`,e),refetchTranscript:()=>{dt.refetch()}})};return(async()=>{let t=!1,n=null,i=[];try{try{await R.messageStream(r,e,{onPhase:(e,t,n)=>{o()&&(be(e),Se(n.heartbeat),we(n.quietS),i=Gn(i,{label:e,role:t,kind:n.kind,detail:n.detail,heartbeat:n.heartbeat,quietS:n.quietS}),Ee(i))},onDelta:(e,n,r)=>{o()&&(t=!0,i=Kn(i),Ee(i),be(``),Se(!1),we(0),l(e,n,r===`append`||r===`snapshot`?r:`auto`))},onDone:e=>{o()&&(l(e.reply,``,`snapshot`),d(e))},onError:e=>{o()&&(n=e)}},{signal:a.signal,attachments:c})}catch(e){o()&&(n=e)}if(!o())return;n&&N(`error`,ai(n,t))}finally{s()}})(),!0},It=(0,M.useRef)(Ft);It.current=Ft;let Lt=(0,M.useMemo)(()=>{let n=oa(jt,e=>{It.current(e)},e=>{de(e),A(e=>e+1)},e),r=[...f?[]:[{id:`new`,label:t(`palette.newDaemon`),hint:`+`,group:t(`palette.view`),run:()=>Pe(!0)}],{id:`transcript`,label:t(`palette.openTranscript`),hint:`/transcript`,group:t(`palette.view`),run:()=>u(`transcript`)},{id:`inspector`,label:t(`palette.openProject`),hint:t(`palette.projectHint`),group:t(`palette.view`),run:()=>u(`inspector`)},{id:`operations`,label:t(`palette.openOperations`),hint:t(`palette.operationsHint`),group:t(`palette.view`),run:()=>u(`operations`)},{id:`help`,label:t(`help.title`),hint:`?`,group:t(`palette.view`),run:()=>u(`help`)},{id:`reasoning`,label:t(re?`palette.hideReasoning`:`palette.showReasoning`),hint:`⌘T`,group:t(`palette.view`),run:()=>ee(e=>!e)},{id:`kiosk`,label:t(f?`palette.exitKiosk`:`palette.enterKiosk`),hint:`⌘.`,group:t(`palette.view`),run:()=>y(e=>!e)}],i=f?[]:[{id:`message`,label:t(`palette.messageArgus`),hint:`/`,group:t(`palette.action`),run:()=>A(e=>e+1)},...he?[{id:`cancel-message`,label:t(`palette.stopWaiting`),hint:`Esc`,group:t(`palette.action`),run:Ye}]:[],...it?[{id:`continuous`,label:it.enabled?t(`palette.stopContinuous`):t(`palette.startContinuous`),group:t(`palette.action`),run:Mt}]:[],...L?.daemon.control_available===!1?[]:[L?.daemon.alive?{id:`stop`,label:t(`palette.stopDaemon`),group:t(`palette.action`),run:kt}:{id:`start`,label:t(`palette.startDaemon`),group:t(`palette.action`),run:Ot}]],o=a.map(e=>({id:`p-${e.id}`,label:e.label||e.id,hint:e.daemon_alive?`● ${t(`common.live`)}`:`○`,keywords:`${e.id} ${e.display_name??``} ${e.objective} ${e.daemon_alive?`live running`:`stopped idle`}`,group:t(`palette.project`),run:()=>F(e.id)}));return[...r,...i,...n,...o]},[a,L?.daemon.alive,f,re,it?.enabled,he,Ye,e,t]);return(0,K.jsxs)(`div`,{ref:ne,className:`workbench-shell ambient-canvas flex h-screen h-[100dvh] w-screen max-w-full overflow-hidden text-ink`,children:[(0,K.jsx)(Wo,{error:c,onRetry:()=>{r.refetch(),i.refetch()}}),!f&&ie?(0,K.jsx)(`button`,{type:`button`,"aria-label":t(`common.closeSessions`),onClick:()=>te(!1),className:`fixed inset-0 z-30 bg-black/40 lg:hidden`}):null,f?null:(0,K.jsx)(Ga,{projects:a,activeId:P,localCwd:s,onSelect:e=>{F(e),te(!1)},onPrefetch:Qe,onManage:Dt,onOpenPanel:e=>u(e),onNew:()=>Pe(!0),loading:r.isLoading,creating:nt,error:r.isError?ii(r.error):void 0,onRetry:()=>void r.refetch(),mobileOpen:ie,collapsed:!p,onToggleCollapse:()=>b(e=>!e),themeMode:ae,onCycleTheme:d,expandedWidth:m}),!f&&p?(0,K.jsx)(ro,{label:t(`common.resizeSessions`),value:m,min:220,max:400,onPointerDown:e=>g(`left`,e),onReset:()=>x(256),onNudge:e=>x(t=>Math.max(220,Math.min(400,t+e)))}):null,(0,K.jsx)(`main`,{className:`flex min-w-0 flex-1 overflow-x-hidden`,children:L?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{className:`${h===`activity`?`flex`:`hidden`} glass-panel glass-panel--main h-full min-w-0 flex-1 flex-col lg:flex`,children:[(0,K.jsx)(Wr,{snap:L,streamOk:ct,onStart:Ot,onStop:kt,onManage:()=>Ie(!0),busy:xt,snapshotStale:I.isError,readOnly:f,missionView:vt}),(0,K.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-1 border-b border-line/60 px-3`,children:[(0,K.jsxs)(`div`,{className:`workspace-tabs`,"data-active":D,children:[(0,K.jsx)(`span`,{className:`workspace-tab-indicator`,"aria-hidden":`true`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`mission`),className:`workspace-tab`,"data-selected":D===`mission`,children:t(`mobile.mission`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`activity`),className:`workspace-tab`,"data-selected":D===`activity`,children:t(`mobile.activity`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`workbench`),className:`workspace-tab`,"data-selected":D===`workbench`,children:t(`mobile.workbench`)})]}),D===`mission`?(0,K.jsx)(`span`,{className:`ml-auto hidden max-w-72 truncate text-[10px] text-ink-faint sm:block`,children:vt?.active_role?t(`mission.roleActive`,{role:vt.active_role}):t(`mission.overview`)}):(0,K.jsx)(`span`,{className:`ml-auto`}),f?null:(0,K.jsx)(`button`,{type:`button`,onClick:()=>u(`operations`),className:`rounded border border-line/60 px-2 py-1 text-[10px] text-ink-faint hover:border-blue/50 hover:text-blue`,children:t(`mission.operations`)})]}),(0,K.jsxs)(`div`,{className:`${D===`workbench`?`hidden`:`flex`} min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(xa,{alert:ut}),O===`mission`&&vt?(0,K.jsx)(co,{view:vt,gitDiff:ot.data,onOpenArtifact:Ae}):(0,K.jsx)(Ni,{events:_t,connected:ct,showReasoning:re,onToggleReasoning:()=>ee(e=>!e),embedded:!0,filter:Ue,query:Ge,skipFirst:Ve.skipFirst}),f?null:(0,K.jsx)(`div`,{className:`composer-dock shrink-0 px-4 pt-3`,children:(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-full lg:max-w-[61.8vw]`,children:[(0,K.jsx)(ya,{questions:L.pending_questions??[],backlog:L.backlog,onAnswer:()=>gt(!0)}),(0,K.jsx)(ra,{value:ue,onChange:de,onSend:Ft,onCancel:Ye,disabled:!P,pending:he,focusSignal:le,embedded:!0,phase:ye,heartbeat:xe,quietS:Ce,steps:Te,startedAt:De,onRewrite:et,rewriting:fe,slashSelection:pe,onSlashSelectionChange:me},P||`no-session`)]})})]}),ce&&P?(0,K.jsx)(`div`,{className:`${D===`workbench`?`flex`:`hidden`} min-h-0 flex-1`,children:(0,K.jsx)(M.Suspense,{fallback:(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-xs text-ink-faint`,children:t(`common.loading`)}),children:(0,K.jsx)(Ko,{sid:P,active:D===`workbench`})})}):null]}),_?(0,K.jsx)(ro,{label:t(`common.resizePreview`),value:v,min:320,max:600,onPointerDown:e=>g(`right`,e),onReset:()=>T(440),onNudge:e=>T(t=>Math.max(320,Math.min(600,t-e)))}):null,(0,K.jsxs)(`aside`,{style:{"--preview-width":`${v}px`},className:`${h===`preview`?`flex`:`hidden`} relative min-w-0 flex-1 flex-col overflow-hidden border-l border-line/60 bg-panel transition-[width] duration-[250ms] ease-panel lg:flex lg:flex-none ${_?`lg:w-[var(--preview-width)]`:`lg:w-14`}`,children:[(0,K.jsx)(`div`,{className:`lg:hidden`,children:(0,K.jsx)(Wr,{snap:L,streamOk:ct,onStart:Ot,onStop:kt,onManage:()=>Ie(!0),busy:xt,snapshotStale:I.isError,readOnly:f,missionView:vt})}),(0,K.jsx)(Ba,{sid:rt,artifacts:at.data,error:at.isError,onExpand:Ae,className:`min-h-0 flex-1 mobile-scroll-region ${_?`lg:flex`:`lg:hidden`}`,embedded:!0,onCollapse:()=>w(!1),missionView:vt,activityEvents:_t}),_?null:(0,K.jsx)(`div`,{className:`hidden h-12 items-center justify-center border-b border-line/50 text-ink-faint lg:flex`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>w(!0),"aria-label":t(`common.expandPreview`),title:t(`common.expandPreview`),className:`flex h-8 w-8 items-center justify-center rounded-md border border-line/50 bg-bg/40 hover:border-blue/50 hover:text-ink`,children:(0,K.jsx)(o,{icon:C,className:`h-3.5 w-3.5`})})})]})]}):(0,K.jsx)(ho,{loading:r.isLoading||!!(P&&I.isLoading),hasProjects:a.length>0,error:r.isError&&a.length===0?ii(r.error):I.isError&&!L?ii(I.error):void 0,onRetry:()=>{r.refetch(),P&&I.refetch()},onNew:()=>Pe(!0),onChoose:()=>te(!0),canCreate:!f})}),(0,K.jsx)(ca,{open:l===`palette`,onClose:()=>u(`none`),items:Lt}),(0,K.jsx)(ua,{open:l===`help`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(ga,{sid:P,open:l===`doctor`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(_a,{sid:P,open:l===`config`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(Z,{sid:P,open:l===`identity`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(va,{sid:P,open:l===`transcript`,onClose:()=>u(`none`)}),P&&L?(0,K.jsx)($a,{open:l===`inspector`,snap:L,journal:ft.data??[],busy:bt.disposeBacklog.isPending||bt.stopBacklog.isPending,onClose:()=>u(`none`),onDispose:Et,onStop:At,onInspect:Me}):null,P&&L?(0,K.jsx)(fo,{open:l===`operations`,sid:P,snap:L,onClose:()=>u(`none`),onChanged:()=>{I.refetch(),r.refetch()},onRestored:async e=>{await r.refetch(),F(e)}}):null,(0,K.jsx)(Da,{sid:P,path:ke,onClose:()=>Ae(null)}),(0,K.jsx)(no,{sid:P,itemId:je,onClose:()=>Me(null),onDone:e=>Et(e,`done`),onSkip:e=>Et(e,`rm`),onStop:At,busy:bt.disposeBacklog.isPending||bt.stopBacklog.isPending,readOnly:f}),(0,K.jsx)(Ha,{open:Ne,busy:nt,onClose:()=>Pe(!1),onCreate:tt}),(0,K.jsx)(ba,{reply:mt,open:B,busy:ht,onClose:()=>gt(!1),onSubmit:pt}),P&&L?(0,K.jsx)(Ua,{open:Fe,sid:P,name:L.session.display_name||``,alive:L.daemon.alive,controlAvailable:L.daemon.control_available!==!1,busy:xt,onClose:()=>Ie(!1),onRename:wt,onStart:Tt,onPause:Ct,onDelete:St}):null,(0,K.jsx)(Va,{notice:ze,onClose:qe}),L&&!f?(0,K.jsx)(go,{active:h===`preview`?`preview`:D,onSelect:e=>{if(e===`preview`){S(`preview`);return}S(`activity`),E(e)},onOpenSessions:()=>te(!0)}):null]})}function Jo({onDone:e}){let{t}=q(),n=(0,M.useRef)(!1),r=(0,M.useCallback)(()=>{n.current||(n.current=!0,e())},[e]);return(0,M.useEffect)(()=>{let e=window.setTimeout(r,330),t=()=>r();return window.addEventListener(`keydown`,t,{once:!0}),()=>{window.clearTimeout(e),window.removeEventListener(`keydown`,t)}},[r]),(0,K.jsxs)(`div`,{role:`status`,"aria-label":t(`splash.starting`),onClick:r,onAnimationEnd:e=>{e.currentTarget===e.target&&r()},className:`argus-web-splash`,children:[(0,K.jsx)(`div`,{className:`argus-web-splash-logo argus-web-splash-logo-full`,"aria-hidden":`true`,children:(0,K.jsx)(Ci,{size:72})}),(0,K.jsx)(`div`,{className:`argus-web-splash-logo argus-web-splash-logo-compact`,"aria-hidden":`true`,children:(0,K.jsx)(xi,{size:112})})]})}He();var Yo=new Ee({defaultOptions:{queries:{staleTime:3e3,retry:ur,refetchOnWindowFocus:!1}}});function Xo(){let[e,t]=(0,M.useState)(!0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(qo,{}),e?(0,K.jsx)(Jo,{onDone:()=>t(!1)}):null]})}De.createRoot(document.getElementById(`root`)).render((0,K.jsx)(M.StrictMode,{children:(0,K.jsx)(de,{client:Yo,children:(0,K.jsx)(Vr,{children:(0,K.jsx)(Xo,{})})})}));export{ot as a,Ge as i,q as n,Ze as o,We as r,Jr as t}; \ No newline at end of file diff --git a/frontend/web/dist/assets/index-zS7B6Urk.js b/frontend/web/dist/assets/index-zS7B6Urk.js new file mode 100644 index 00000000..7cd33399 --- /dev/null +++ b/frontend/web/dist/assets/index-zS7B6Urk.js @@ -0,0 +1,30 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/motion-sqs9Ax-g.js","assets/rolldown-runtime-hePW80VL.js","assets/ResearchWorkbenchPanel-DpQaJ9Sz.js","assets/icons-BgG77X6K.js","assets/query-DOc9YWJi.js","assets/markdown-BdostSiP.js","assets/ResearchWorkbenchPanel-Bxi8TjKE.css"])))=>i.map(i=>d[i]); +import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{C as n,D as r,E as i,S as a,T as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as ee,x as te,y as E}from"./icons-BgG77X6K.js";import{_ as ne,a as re,c as ie,d as ae,f as D,g as O,h as oe,i as se,l as ce,m as k,n as le,o as A,p as ue,r as de,s as fe,t as j,u as pe,v as me,y as he}from"./query-DOc9YWJi.js";import{n as ge,t as _e}from"./markdown-BdostSiP.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ve=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,ae(x);else{var t=n(l);t!==null&&D(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&D(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,ee=-1;function te(){return!(e.unstable_now()-eee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,D(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ae(x))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ye=t(((e,t)=>{t.exports=ve()})),be=t((e=>{var t=r(),n=ye();function i(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function m(e){return u.call(p,e)?!0:u.call(f,e)?!1:d.test(e)?p[e]=!0:(f[e]=!0,!1)}function h(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function g(e,t,n,r){if(t==null||h(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var v={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){v[e]=new _(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];v[t]=new _(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){v[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){v[e]=new _(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){v[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){v[e]=new _(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){v[e]=new _(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){v[e]=new _(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){v[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(y,b);v[t]=new _(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new _(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){v[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,t,n,r){var i=v.hasOwnProperty(t)?v[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` +`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?A(e):``}function fe(e){switch(e.tag){case 5:return A(e.type);case 16:return A(`Lazy`);case 13:return A(`Suspense`);case 19:return A(`SuspenseList`);case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return``}}function j(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case w:return`Portal`;case te:return`Profiler`;case ee:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ne:return(e.displayName||`Context`)+`.Consumer`;case E:return(e._context.displayName||`Context`)+`.Provider`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return j(t);case 8:return t===ee?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function me(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ge(e){var t=he(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _e(e){e._valueTracker||=ge(e)}function ve(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=he(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function be(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function xe(e,t){var n=t.checked;return k({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Se(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=me(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function Ce(e,t){t=t.checked,t!=null&&x(e,`checked`,t,!1)}function we(e,t){Ce(e,t);var n=me(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Ee(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Ee(e,t.type,me(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Te(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Ee(e,t,n){(t!==`number`||be(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var M=Array.isArray;function De(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ie(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Le={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Re=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Le).forEach(function(e){Re.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Le[t]=Le[e]})});function ze(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Le.hasOwnProperty(e)&&Le[e]?(``+t).trim():t+`px`}function Be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=ze(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ve=k({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function He(e,t){if(t){if(Ve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(i(62))}}function Ue(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var We=null;function Ge(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ke=null,qe=null,Je=null;function N(e){if(e=Pi(e)){if(typeof Ke!=`function`)throw Error(i(280));var t=e.stateNode;t&&(t=Ii(t),Ke(e.stateNode,e.type,t))}}function Ye(e){qe?Je?Je.push(e):Je=[e]:qe=e}function Xe(){if(qe){var e=qe,t=Je;if(Je=qe=null,N(e),t)for(e=0;e>>=0,e===0?32:31-(Tt(e)/Et|0)|0}var Ot=64,kt=4194304;function At(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=At(a))):r=At(s)}else o=n&~i,o===0?a!==0&&(r=At(a)):r=At(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Lt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function Rt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=W),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Xn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Zn&&tr(e,t)?(e=xn(),bn=yn=vn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(){for(var e=window,t=be();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=be(e.document)}return t}function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Mr(e){var t=Ar(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kr(n.ownerDocument.documentElement,n)){if(r!==null&&jr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Or(n,a);var o=Or(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==be(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=si(Pr,`onSelect`),0Ri||(e.current=Li[Ri],Li[Ri]=null,Ri--)}function X(e,t){Ri++,Li[Ri]=e.current,e.current=t}var Bi={},Vi=zi(Bi),Hi=zi(!1),Ui=Bi;function Wi(e,t){var n=e.type.contextTypes;if(!n)return Bi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Gi(e){return e=e.childContextTypes,e!=null}function Ki(){Y(Hi),Y(Vi)}function qi(e,t,n){if(Vi.current!==Bi)throw Error(i(168));X(Vi,t),X(Hi,n)}function Ji(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!=`function`)return n;for(var a in r=r.getChildContext(),r)if(!(a in t))throw Error(i(108,pe(e)||`Unknown`,a));return k({},n,r)}function Yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Ui=Vi.current,X(Vi,e),X(Hi,Hi.current),!0}function Xi(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=Ji(e,t,Ui),r.__reactInternalMemoizedMergedChildContext=e,Y(Hi),Y(Vi),X(Vi,e)):Y(Hi),X(Hi,n)}var Zi=null,Qi=!1,$i=!1;function ea(e){Zi===null?Zi=[e]:Zi.push(e)}function ta(e){Qi=!0,ea(e)}function na(){if(!$i&&Zi!==null){$i=!0;var e=0,t=H;try{var n=Zi;for(H=1;e>=o,i-=o,ua=1<<32-wt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Z&&fa(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Z&&fa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Z&&fa(a,g),u}for(h=r(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Z&&fa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===T&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case C:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===T){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===O&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===T?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case w:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case O:return l=i._init,_(e,r,l(i._payload),o)}if(M(i))return h(e,r,i,o);if(ce(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=zi(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Y(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e){if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(i(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e}return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=k({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{H=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=bo,a=jo();if(Z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vc===null)throw Error(i(349));yo&30||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,r,o,e),[e]),r.flags|=2048,Wo(9,zo.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(Z){var n=da,r=ua;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof r.is==`string`?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n===`select`&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Di]=t,e[Oi]=r,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ue(n,r),n){case`dialog`:J(`cancel`,e),J(`close`,e),a=r;break;case`iframe`:case`object`:case`embed`:J(`load`,e),a=r;break;case`video`:case`audio`:for(a=0;ael&&(t.flags|=128,r=!0,ac(s,!1),t.lanes=4194304)}}else{if(!r){if(e=mo(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Z)return oc(t),null}else 2*B()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,r=!0,ac(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=B(),t.sibling=null,n=po.current,X(po,r?n&1|2:n&1),t);case 22:case 23:return wl(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function cc(e,t){switch(ha(t),t.tag){case 1:return Gi(t.type)&&Ki(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Y(Hi),Y(Vi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Y(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(hi=fn,e=Ar(),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},fn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[Oi],delete t[Ai],delete t[ji],delete t[Mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mi));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(St&&typeof St.onCommitFiberUnmount==`function`)try{St.onCommitFiberUnmount(xt,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?Ci(e.parentNode,n):e.nodeType===1&&Ci(e,n),un(e)):Ci(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var r=0;ra&&(a=s),r&=~o}if(r=a,r=B()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Lc(r/1960))-r,10e?16:e,ol===null)var r=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(i(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lB()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=kt,kt<<=1,!(kt&130023424)&&(kt=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(Lt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}r!==null&&r.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Hi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}}else Ms=!1,Z&&t.flags&1048576&&pa(t,oa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$s(e,t),e=t.pendingProps;var a=Wi(t,Vi.current);Ha(t,n),a=ko(null,t,r,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gi(r)?(o=!0,Yi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,r,e,n),t=Vs(null,t,r,!0,o,n)):(t.tag=0,Z&&o&&ma(t),Ns(null,t,a,n),t=t.child),t;case 16:r=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=Jl(r),e=hs(r,e),a){case 0:t=zs(null,t,r,e,n);break a;case 1:t=Bs(null,t,r,e,n);break a;case 11:t=Ps(null,t,r,e,n);break a;case 14:t=Fs(null,t,r,hs(r.type,e),n);break a}throw Error(i(306,r,``))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),zs(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),Bs(e,t,r,a,n);case 3:a:{if(Hs(t),e===null)throw Error(i(387));r=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(i(423)),t),t=Us(e,t,r,n,a);break a}if(r!==a){a=Ss(Error(i(424)),t),t=Us(e,t,r,n,a);break a}for(_a=wi(t.stateNode.containerInfo.firstChild),ga=t,Z=!0,va=null,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ea(),r===a){t=ec(e,t,n);break a}Ns(e,t,r,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),r=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,_i(r,a)?s=null:o!==null&&_i(r,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):Ns(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),Ps(e,t,r,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,X(Fa,r._currentValue),r._currentValue=s,o!==null){if(Tr(o.value,s)){if(o.children===a.children&&!Hi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(i(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Ha(t,n),a=Ua(a),r=r(a),t.flags|=1,Ns(e,t,r,n),t.child;case 14:return r=t.type,a=hs(r,t.pendingProps),a=hs(r.type,a),Fs(e,t,r,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:hs(r,a),$s(e,t),t.tag=1,Gi(r)?(e=!0,Yi(t)):e=!1,Ha(t,n),ys(t,r,a),xs(t,r,a,n),Vs(null,t,r,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(i(156,t.tag))};function Wl(e,t){return ft(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===re)return 11;if(e===D)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,r,a,o){var s=2;if(r=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case T:return Zl(n.children,a,o,t);case ee:s=8,a|=8;break;case te:return e=Kl(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=Kl(13,n,t,a),e.elementType=ie,e.lanes=o,e;case ae:return e=Kl(19,n,t,a),e.elementType=ae,e.lanes=o,e;case oe:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case E:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}throw Error(i(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=oe,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=It(0),this.expirationTimes=It(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=It(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=be()})),Se=t((e=>{var t=xe();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),Ce=class extends he{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new re({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=we(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=we(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=we(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=we(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ie.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>D(t,e))}findAll(e={}){return this.getAll().filter(t=>D(e,t))}notify(e){ie.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ie.batch(()=>Promise.all(e.map(e=>e.continue().catch(k))))}};function we(e){return e.options.scope?.id}var Te=class extends he{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ae(r,t),a=this.get(i);return a||(a=new A({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ie.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ue(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ue(e,t)):t}notify(e){ie.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ie.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ie.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ee=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Te,this.#t=e.mutationCache||new Ce,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=me.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=fe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(O(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ce(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ie.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ie.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ie.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ie.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(k).catch(k)}invalidateQueries(e,t={}){return ie.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ie.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(k)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(k)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(k).catch(k)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(k).catch(k)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return fe.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(pe(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{oe(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(pe(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{oe(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ae(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===ne&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},M=e(r(),1),De=e(Se(),1),Oe=class extends Error{status;method;path;constructor(e,t,n,r){super(e),this.name=`ApiError`,this.status=t,this.method=n,this.path=r}};function ke(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;try{let t=JSON.parse(e);for(let e of[`detail`,`error`,`message`]){let n=t[e];if(typeof n==`string`&&n.trim())return n.trim();if(Array.isArray(n)){let e=n.map(e=>e&&typeof e==`object`?String(e.msg??``):``).filter(Boolean);if(e.length)return e.join(`; `)}}}catch{}return t.startsWith(`typeof e==`string`):[],o=Ie(r?.major),s=Ie(r?.minor);if(!n||!r||!i)return{compatible:!1,reason:`malformed /api/meta response`};if(typeof i.source_root!=`string`||Ie(i.pid)===null||typeof i.package_version!=`string`||typeof i.release_id!=`string`)return{compatible:!1,reason:`malformed /api/meta runtime identity`};if(n.service!==`argus-skill-webapi`)return{compatible:!1,reason:`unexpected service ${String(n.service||`unknown`)}`};let c=e;if(r.name!==Ne.name||o!==Ne.major)return{compatible:!1,reason:`protocol ${String(r.name||`unknown`)}/${String(o)} is incompatible with client ${Ne.name}/${Ne.major}`,meta:c};if(s===null||s!a.includes(e));if(l.length>0)return{compatible:!1,reason:`missing capabilities: ${l.join(`, `)}`,meta:c};if(i.source_root_matches_config===!1)return{compatible:!1,reason:`backend loaded source ${String(i.source_root)} but ARGUS_SKILL_SOURCE_ROOT points to ${String(i.configured_source_root)}`,meta:c};if(i.release_id!==t.releaseId)return{compatible:!1,reason:`backend release ${String(i.release_id)} does not match client release ${t.releaseId}`,meta:c};if(t.sourceDigest){if(typeof i.runtime_source_digest!=`string`||!i.runtime_source_digest)return{compatible:!1,reason:`backend process does not report the source digest required by this local checkout`,meta:c};if(i.runtime_source_digest!==t.sourceDigest)return{compatible:!1,reason:`backend process source ${String(i.runtime_source_digest).slice(0,16)} does not match local source ${t.sourceDigest.slice(0,16)}`,meta:c}}return{compatible:!0,reason:``,warning:i.release_matches_source===!1?`backend source differs from its prebuilt release artifacts; pull a complete published revision and reinstall`:void 0,meta:c}}function Re(e,t){let n=Le(e);if(!n.compatible||!n.meta)throw Error(`incompatible Argus API: ${n.reason}`);return n.warning&&t?.(n.warning),n.meta}function ze(e){let t=Fe(e),n=Fe(t?.daemon);if(!t||t.schema_version!==7)throw Error(`incompatible snapshot schema: expected 7, got ${String(t?.schema_version??`missing`)}`);if(!n)throw Error(`invalid snapshot: daemon section is missing`);let r=[`global_daily_cap_usd`,`read_status`,`read_error`,`protocol_compatible`,`protocol_error`].filter(e=>!Object.hasOwn(n,e));if(r.length>0)throw Error(`invalid snapshot: daemon fields missing: ${r.join(`, `)}`);let i=[`spend_usd`,`spend_status`,`usage_summary`,`request_usage`,`cost_control`,`daemon_commands`,`observability`,`mission_view`,`partial`,`diagnostics`].filter(e=>!Object.hasOwn(t,e));if(i.length>0)throw Error(`invalid snapshot: fields missing: ${i.join(`, `)}`);if(!Array.isArray(t.diagnostics))throw Error(`invalid snapshot: diagnostics must be an array`);return e}var Be=`argus_web_token`,Ve=null;function He(){let e;try{e=new URLSearchParams(window.location.search)}catch{return}let t=e.get(`token`);if(t){Ve=t;try{localStorage.setItem(Be,t)}catch{}try{e.delete(`token`);let t=e.toString();window.history.replaceState(null,``,`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`)}catch{}}}var Ue=()=>{if(Ve)return Ve;try{return new URLSearchParams(window.location.search).get(`token`)||localStorage.getItem(Be)}catch{return null}};function We(){let e=Ue();return e?{Authorization:`Bearer ${e}`}:{}}function Ge(){return Ue()??``}var Ke=8e3,qe=12e3,Je=class extends Error{constructor(){super(`This browser is not paired with Argus. Reopen it from Argus Desktop or use a fresh pairing link.`),this.name=`PairingRequiredError`}},N=class extends Error{method;path;constructor(e,t,n=`could not reach the local Argus service`){super(`${e.toUpperCase()} ${t} ${n}. Make sure Argus Desktop is running, then retry.`),this.name=`LocalArgusUnavailableError`,this.method=e.toUpperCase(),this.path=t}};function Ye(e){return e instanceof Je||!!(e&&typeof e==`object`&&Number(e.status)===401)}function Xe(e){return Ye(e)||e instanceof N}async function Ze(e,t){try{return await fetch(e,t)}catch(n){throw t.signal?.aborted?n:new N(String(t.method??`GET`),e)}}async function P(e,t,n,r){let i=new AbortController,a=t.signal??void 0,o=!1,s=()=>{};if(a){let e=()=>i.abort(a.reason);a.aborted?e():(a.addEventListener(`abort`,e,{once:!0}),s=()=>a.removeEventListener(`abort`,e))}let c,l=(async()=>await r(await Ze(e,{...t,signal:i.signal})))(),u=new Promise((e,t)=>{c=setTimeout(()=>{o=!0;let e=Error(`request timed out after ${n}ms`);i.abort(e),t(e)},n)});try{return await Promise.race([l,u])}catch(r){if(o){let r=Math.round(n/1e3);throw new N(String(t.method??`GET`),e,`timed out after ${r}s because the local Argus service did not respond`)}throw r}finally{c&&clearTimeout(c),s()}}async function Qe(e,t,n){return P(e,{headers:We(),signal:t},n??qe,async t=>(await je(t,`GET`,e),await t.json()))}async function F(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`,...We()},body:t===void 0?void 0:JSON.stringify(t),signal:n});return await je(r,`POST`,e),await r.json()}async function $e(e,t,n){let r=await fetch(e,{method:`POST`,headers:We(),body:t,signal:n});return await je(r,`POST`,e),await r.json()}function et(e){let t=e&&typeof e==`object`?e:{},n=String(t.command_status??``);if(Number(t.rc??0)!==0||n===`failed`||n===`rejected`)throw Error(String(t.error||`daemon command ${n||`failed`}`));return e}async function tt(e,t,n){let r=await fetch(t,{method:e,headers:{"Content-Type":`application/json`,...We()},body:n===void 0?void 0:JSON.stringify(n)});return await je(r,e,t),await r.json()}async function nt(e,t){let n=await fetch(e,{headers:We(),signal:t});return await je(n,`GET`,e),n.blob()}var I=(e,t=``)=>`/api/projects/${encodeURIComponent(e)}${t}`,rt=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`,L;function it(e){return!!(e&&typeof e==`object`&&`aborted`in e&&typeof e.aborted==`boolean`)}function at(e,t){return t?.length?{text:e,attachments:t}:{text:e}}function ot(){if(!L){let e=(async()=>{let e=`/api/meta`,t=await P(e,{headers:We()},Ke,async t=>{if(t.status===404)throw Error(`incompatible Argus API: service does not expose /api/meta`);return await je(t,`GET`,e),Re(await t.json(),e=>console.warn(`Argus API compatibility warning: ${e}`))});if(t.authentication?.required&&!t.authentication.authenticated)throw new Je;return t})();L=e,e.catch(t=>{L===e&&!(t instanceof Je)&&(L=void 0)})}return L}function st(e){let t=[],n;for(;(n=e.indexOf(` + +`))>=0;){let r=e.slice(0,n);e=e.slice(n+2);for(let e of r.split(` +`)){let n=e.trim();if(n.startsWith(`data:`))try{t.push(JSON.parse(n.slice(5).trim()))}catch{}}}return{frames:t,rest:e}}var ct=null,R={meta:ot,projectIndex:async()=>(await ot(),Qe(`/api/projects`,void 0,qe)),listProjects:async()=>(await ot(),Qe(`/api/projects`,void 0,qe).then(e=>e.projects)),projectCosts:async e=>(await ot(),Qe(`/api/projects/costs`,e)),createDaemon:async(e,t=``,n=``,r)=>{let i=`/api/daemons`,a={objective:e,name:t,workdir:n,command_id:rt(),expected_revision:r},o=()=>fetch(i,{method:`POST`,headers:{"Content-Type":`application/json`,...We()},body:JSON.stringify(a),cache:`no-store`}),s=await o();return s.status===400&&/Invalid HTTP request received/i.test(await s.clone().text())&&(s=await o()),await je(s,`POST`,i),et(await s.json())},updateProject:(e,t)=>tt(`PATCH`,I(e),{name:t}),deleteProject:e=>tt(`DELETE`,I(e)),snapshot:async(e,t,n=!1)=>(await ot(),ze(await Qe(I(e,`/snapshot?compact=true&events_limit=1${n?`&prewarm=true`:``}`),t,qe))),activeSnapshot:async(e,t)=>{let n=ct!==e;n&&(ct=e);try{return await R.snapshot(e,t,n)}catch(t){throw n&&ct===e&&(ct=null),t}},prefetchSnapshot:(e,t)=>R.snapshot(e,t,!1),status:(e,t)=>Qe(I(e,`/status`),t),journal:(e,t=20,n)=>Qe(I(e,`/journal?n=${t}`),n).then(e=>e.journal),doctor:(e,t)=>Qe(I(e,`/doctor`),t),config:(e,t)=>Qe(I(e,`/config`),t),identity:(e,t)=>Qe(I(e,`/identity`),t).then(e=>e.identity),transcript:(e,t=30,n)=>Qe(I(e,`/transcript?n=${t}`),n).then(e=>e.turns),events:(e,t=80,n)=>Qe(I(e,`/events?limit=${t}&view=ui`),n).then(e=>e.events),backlogItem:(e,t,n)=>Qe(I(e,`/backlog/${encodeURIComponent(t)}`),n).then(e=>e.item),artifacts:(e,t)=>Qe(I(e,`/artifacts`),t).then(e=>e.artifacts),artifact:(e,t,n)=>Qe(I(e,`/artifact?${new URLSearchParams({path:t})}`),n),artifactBlob:(e,t,n=!1,r)=>{let i=new URLSearchParams({path:t});return n&&i.set(`download`,`true`),nt(I(e,`/artifact/raw?${i}`),r)},gitDiff:(e,t)=>Qe(I(e,`/git-diff`),t),metrics:e=>Qe(`/api/metrics`,e),trash:(e=``,t=100,n=0,r)=>Qe(`/api/trash?${new URLSearchParams({query:e,limit:String(t),offset:String(n)})}`,r),restoreTrash:e=>F(`/api/trash/${encodeURIComponent(e)}/restore`),addTask:(e,t)=>F(I(e,`/tasks`),{text:t}).then(e=>e.item),abortMission:(e,t)=>F(I(e,`/mission/abort`),{reason:t}),answerPending:(e,t,n)=>F(I(e,`/backlog/${encodeURIComponent(t)}/answer`),{text:n}),resolveDecision:(e,t,n,r)=>F(I(e,`/decisions/${encodeURIComponent(t)}/resolve`),{option_id:n,note:r}),uploadAttachments:async(e,t,n)=>{await ot();let r=new FormData;return t.forEach(e=>r.append(`files`,e,e.name)),$e(I(e,`/attachments`),r,n)},message:(e,t,n)=>{let r=it(n)?n:n?.signal,i=it(n)?void 0:n?.attachments;return F(I(e,`/message`),at(t,i),r)},messageStream:async(e,t,n,r)=>{let i=it(r)?r:r?.signal,a=it(r)?void 0:r?.attachments,o=await fetch(I(e,`/message/stream`),{method:`POST`,headers:{"Content-Type":`application/json`,...We()},body:JSON.stringify(at(t,a)),signal:i});if(await je(o,`POST`,I(e,`/message/stream`)),!o.body)throw Error(`Manager stream returned no response body`);let s=!1,c=e=>{if(!i?.aborted){if(e.type===`phase`){let t=Number(e.quiet_s??0);n.onPhase?.(String(e.label??``),String(e.role??`manager`),{heartbeat:e.heartbeat===!0,quietS:Number.isFinite(t)?t:0,kind:String(e.kind??``),detail:String(e.detail??``)})}else e.type===`delta`?n.onDelta?.(String(e.text??``),String(e.message_id??``),String(e.fragment_mode??`auto`)):e.type===`done`?(s=!0,n.onDone?.(e.result??{})):e.type===`error`&&(s=!0,n.onError?.(Error(String(e.error??`stream error`))))}},l=o.body.getReader(),u=new TextDecoder,d=``;for(;;){let{done:e,value:t}=await l.read();if(e)break;d+=u.decode(t,{stream:!0});let n=st(d);d=n.rest,n.frames.forEach(c)}if(!i?.aborted&&(st(d+` + +`).frames.forEach(c),!s))throw Error(`Manager stream ended before a terminal event`)},nudge:(e,t)=>F(I(e,`/nudge`),{text:t}),note:(e,t)=>F(I(e,`/note`),{text:t}),previewPlan:(e,t)=>F(I(e,`/plan`),{text:t}),rewritePrompt:(e,t)=>F(I(e,`/prompt/rewrite`),{text:t}),setConfig:(e,t,n)=>F(I(e,`/config/set`),{name:t,value:n}),setBudgets:(e,t)=>F(I(e,`/config/budget`),{values:t}),setIdentity:(e,t)=>F(I(e,`/identity`),{text:t}),resetManager:e=>F(I(e,`/reset`)),skills:(e,t=`ls`)=>F(I(e,`/skills`),{args:t}).then(e=>e.text),setLaunchCwd:(e,t)=>F(I(e,`/launch-cwd`),{launch_cwd:t}),setWorkdir:(e,t)=>F(I(e,`/workdir`),{workdir:t}),disposeBacklog:(e,t,n)=>F(I(e,`/backlog/${encodeURIComponent(t)}/dispose`),{op:n}),stopBacklog:(e,t)=>F(I(e,`/backlog/${encodeURIComponent(t)}/stop`)),setContinuous:(e,t,n=``)=>F(I(e,`/continuous`),{enabled:t,objective:n}),startDaemon:(e,t)=>F(I(e,`/daemon/start`),{command_id:rt(),expected_revision:t}).then(et),stopDaemon:(e,t=!1,n)=>F(I(e,`/daemon/stop`),{drain:t,command_id:rt(),expected_revision:n}).then(et),replaceDaemon:(e,t,n=!1,r)=>F(I(e,`/daemon/replace`),{victim_sid:t,resume_continuous:n,command_id:rt(),expected_revision:r}).then(et),upgradeDaemon:(e,t)=>F(I(e,`/daemon/upgrade`),{command_id:rt(),expected_revision:t}).then(et)},lt=new Set([4401,4404]);function ut(e,t,n={}){let r=window.location.protocol===`https:`?`wss:`:`ws:`,i=new URLSearchParams;n.replay!=null&&i.set(`replay`,String(n.replay)),i.set(`view`,`ui`);let a=Ue();a&&i.set(`token`,a);let o=`${r}//${window.location.host}${I(e,`/stream`)}?${i}`,s=null,c=!1,l,u=()=>{c||(s=new WebSocket(o),s.onopen=()=>n.onOpen?.(),s.onmessage=e=>{try{let n=JSON.parse(e.data);n&&typeof n==`object`&&t(n)}catch{}},s.onclose=e=>{let t=!lt.has(e.code);n.onClose?.({code:e.code,reason:e.reason,retryable:t}),!c&&t&&(l=setTimeout(u,1e3))},s.onerror=()=>s?.close())};return u(),()=>{c=!0,l&&clearTimeout(l),s?.close()}}var z={accent:`rgb(var(--spectral-gold))`,success:`#7fa386`,error:`#c77b72`,warning:`rgb(var(--spectral-gold))`,info:`rgb(var(--spectral-blue))`,ink:`rgb(var(--ink))`,inkDim:`rgb(var(--ink-dim))`,inkFaint:`rgb(var(--ink-faint))`,role:{manager:`rgb(var(--role-manager))`,planner:`rgb(var(--role-planner))`,engineer:`rgb(var(--role-engineer))`,reviewer:`rgb(var(--role-reviewer))`}};function dt(e){switch(e){case`medium`:return z.inkDim;case`high`:return z.info;case`xhigh`:return z.accent;case`max`:return z.error;default:return z.inkFaint}}var ft=e=>String(e??``).trim(),pt=/^[a-z][a-z -]+ requires an operator-owned decision before continuing\.?$/i,mt=e=>{let t=ft(e);return pt.test(t)?``:t},ht=(e,t)=>{let n=/[\u3400-\u9fff]/.test(`${e}\n${t}`);return{id:`custom`,label:n?`自己输入`:`Write my own answer`,description:n?`直接告诉 Argus 你的决定。`:`Tell Argus your decision directly.`,requires_note:!0}};function B(e,t){let n=[...e,...t],r=[],i=new Set;for(let e of n){let t=ft(e.id),n=e.operator_decision;if(n&&typeof n==`object`&&!Array.isArray(n)){let a=n,o=ft(a.id);if(!o||i.has(o)||ft(a.status)!==`pending`)continue;i.add(o);let s=ft(a.options_source)===`agent`&&Array.isArray(a.options)?a.options.filter(e=>!!ft(e?.id)&&!!ft(e?.label)).map(e=>({...e,requires_note:!1})):[];s.push(ht(ft(a.title),ft(a.question))),r.push({id:o,item_id:ft(a.item_id)||t,revision:Number(a.revision??1),status:`pending`,title:ft(a.title)||ft(e.title)||`Decision required`,reason:mt(a.reason),question:ft(a.question)||ft(e.pending_question),evidence:Array.isArray(a.evidence)?a.evidence.filter(e=>ft(e?.label)!==`Acceptance check`):[],options:s,options_source:s.length?`agent`:`none`,selected_option:``,note:``});continue}let a=ft(e.pending_question??e.question??e.text);if(!t||!a)continue;let o=`legacy-${t}`;i.has(o)||(i.add(o),r.push({id:o,item_id:t,revision:1,status:`pending`,title:ft(e.title??e.objective)||`Blocked task`,reason:``,question:a,evidence:[],options:[ht(ft(e.title??e.objective),a)],options_source:`none`,selected_option:``,note:``,legacy:!0}))}return r}var V={AGENT_IO_START:`agent.io.start`,AGENT_IO_STREAM:`agent.io.stream`,AGENT_IO_COMPLETE:`agent.io.complete`,AGENT_IO_ERROR:`agent.io.error`,USAGE_RECORDED:`usage.recorded`,PROVIDER_REQUEST_STARTED:`provider.request.started`,PROVIDER_REQUEST_COMPLETED:`provider.request.completed`,PROVIDER_REQUEST_DENIED:`provider.request.denied`,CODEX_UTIL_COMPLETED:`codex.util.completed`,SKILL_COST_COMPLETED:`skill.cost.completed`,BUDGET_RESERVATION_CREATED:`budget.reservation.created`,BUDGET_RESERVATION_DENIED:`budget.reservation.denied`,BUDGET_RESERVATION_SETTLED:`budget.reservation.settled`,BUDGET_RESERVATION_RELEASED:`budget.reservation.released`,BUDGET_UNPRICED_BLOCKED:`budget.unpriced.blocked`,LOOP_START:`loop.start`,LOOP_DONE:`loop.done`,ROUND_START:`round.start`,ROUND_MAIN_COMPLETED:`round.main.completed`,ROUND_REVIEW_STARTED:`round.review.started`,ROUND_REVIEW_DEFERRED:`round.review.deferred`,ROUND_REVIEW_COMPLETED:`round.review.completed`,ROUND_CHECKPOINT_RECORDED:`round.checkpoint.recorded`,ROUND_CHECKPOINT_FAILED:`round.checkpoint.failed`,ROUND_SECRET_REDACTED:`round.secret_redacted`,ROUND_ESCALATED:`round.escalated`,ROUND_STALL:`round.stall`,ROUND_REVIEWER_BACKEND_FAILURE:`round.reviewer_backend_failure`,ROLE_SESSION_TURN:`role.session.turn`,ENGINEER_PROGRESS:`engineer.progress`,ENGINEER_SELF_REVIEW_ACCEPTED:`engineer.self_review.accepted`,ENGINEER_SELF_REVIEW_REJECTED:`engineer.self_review.rejected`,ENGINEER_SKILL_MAINTENANCE_STARTED:`engineer.skill_maintenance.started`,ENGINEER_SKILL_MAINTENANCE_COMPLETED:`engineer.skill_maintenance.completed`,LIFE_STATUS:`life.status`,LIFE_PHASE_STARTED:`life.phase.started`,LIFE_MISSION_STARTED:`life.mission.started`,LIFE_MISSION_COMPLETED:`life.mission.completed`,LIFE_MISSION_FAILED:`life.mission.failed`,LIFE_MISSION_SKIPPED:`life.mission.skipped`,LIFE_MISSION_ORPHANED:`life.mission.orphaned`,LIFE_MISSION_REQUEUED:`life.mission.requeued`,LIFE_MANAGER_INTENT_STARTED:`life.manager.intent.started`,LIFE_MANAGER_INTENT_COMPLETED:`life.manager.intent.completed`,LIFE_MANAGER_INTENT_FAILED:`life.manager.intent.failed`,LIFE_MANAGER_STAGE_DECISION:`life.manager.stage_decision`,LIFE_MANAGER_PLAN_CHALLENGE_DECIDED:`life.manager.plan_challenge.decided`,LIFE_VERTICAL_RESOLVED:`life.vertical.resolved`,LIFE_PLANNER_START:`life.planner.start`,LIFE_PLANNER_TASK_ADDED:`life.planner.task_added`,LIFE_PLANNER_TASK_SKIPPED:`life.planner.task_skipped`,LIFE_PLANNER_VERDICT:`life.planner.verdict`,LIFE_PLANNER_WAITING:`life.planner.waiting`,LIFE_PLANNER_WAITING_WOKEN:`life.planner.waiting_woken`,LIFE_PLANNER_TERMINAL_IDLE:`life.planner.terminal_idle`,LIFE_PLANNER_VERIFICATION_PROBE:`life.planner.verification_probe`,LIFE_PLANNER_STALL_ESCALATION:`life.planner.stall_escalation`,LIFE_PLANNER_ERROR:`life.planner.error`,LIFE_PLAN_SIGNAL:`life.plan.signal`,LIFE_PLAN_REVISION_PROPOSED:`life.plan.revision.proposed`,LIFE_PLAN_REVISION_REJECTED:`life.plan.revision.rejected`,LIFE_PLAN_REVISION_COMMITTED:`life.plan.revision.committed`,LIFE_PLAN_NODE_SUPERSEDED:`life.plan.node.superseded`,LIFE_BUDGET_PAUSE:`life.budget.pause`,LIFE_LIFECYCLE_BLOCK:`life.lifecycle.block`,LIFE_LIFECYCLE_TRANSITION:`life.lifecycle.transition`,LIFE_INBOX_QUEUED:`life.inbox.queued`,LIFE_INBOX_DRAINED:`life.inbox.drained`,LIFE_OPERATOR_QUESTION_PENDING:`life.operator_question.pending`,LIFE_OPERATOR_QUESTION_ANSWERED:`life.operator_question.answered`,LIFE_DAEMON_IDLE_TIMEOUT:`life.daemon.idle_timeout`,PROJECT_COMPLETED:`project.completed`,PROJECT_COMPLETION_REFUSED:`project.completion_refused`,DAEMON_PARKED:`daemon.parked`,DAEMON_COMMAND_SUBMITTED:`daemon.command.submitted`,DAEMON_COMMAND_COMPLETED:`daemon.command.completed`,DAEMON_COMMAND_REJECTED:`daemon.command.rejected`,IDEA_SEARCH_STARTED:`idea.search.started`,IDEA_SEARCH_COMPLETED:`idea.search.completed`,IDEA_SEARCH_SKIPPED:`idea.search.skipped`,VENUE_RESEARCH_STARTED:`venue.research.started`,VENUE_RESEARCH_COMPLETED:`venue.research.completed`,RESEARCH_ACHIEVEMENT_CERTIFIED:`research.achievement.certified`,SKILL_LIBRARY_AVAILABLE:`skill.library.available`,SKILL_CREATED:`skill.created`,SKILL_UPDATED:`skill.updated`,SKILL_ARCHIVED:`skill.archived`,SKILL_OUTCOME:`skill.outcome`,SKILL_TRANSFER_STARTED:`skill.transfer.started`,SKILL_TRANSFER_COMPLETED:`skill.transfer.completed`,SKILL_SCIENTIST_STARTED:`skill.scientist.started`,SKILL_SCIENTIST_CREATED:`skill.scientist.created`,SKILL_SCIENTIST_ADAPTATION_STARTED:`skill.scientist.adaptation_started`,SKILL_SCIENTIST_ADAPTATION_CREATED:`skill.scientist.adaptation_created`,SKILL_TIDIED:`skill.tidied`,SKILL_COMPACTED:`skill.compacted`,SKILL_COMPACT_ERROR:`skill.compact.error`,SKILL_OP_ERROR:`skill.op.error`,SKILL_OP_REFUSED:`skill.op.refused`,SKILL_PROPOSAL_REJECTED:`skill.proposal.rejected`,SKILL_DISTILL_REJECTED:`skill.distill.rejected`,SKILL_REVISED:`skill.revised`,SKILL_USE_RECORDED:`skill.use.recorded`,SKILL_HISTORY_COMPRESSED:`skill.history.compressed`,SKILL_EVOLUTION_COMPLETED:`skill.evolution.completed`,WIKI_INITIALIZED:`wiki.initialized`,WIKI_INITIALIZATION_FAILED:`wiki.initialization.failed`,WIKI_HOOK_OK:`wiki.hook.ok`,WIKI_HOOK_WARNING:`wiki.hook.warning`,WIKI_COMPACTED:`wiki.compacted`,WIKI_COMPACT_ERROR:`wiki.compact.error`,WIKI_CREATED:`wiki.created`,WIKI_UPDATED:`wiki.updated`,WIKI_RETIRED:`wiki.retired`,WIKI_SOURCE_CREATED:`wiki.source.created`,WIKI_SOURCE_SKIPPED:`wiki.source.skipped`,WIKI_PROMOTION_PROMOTED:`wiki.promotion.promoted`,WIKI_PROMOTION_DEMOTED:`wiki.promotion.demoted`,WIKI_RETIRED_COMPRESSED:`wiki.retired.compressed`,WIKI_EVOLUTION_COMPLETED:`wiki.evolution.completed`,OPERATOR_ALERT:`operator_alert`},gt={"loop.started":V.LOOP_START,"loop.completed":V.LOOP_DONE,"round.started":V.ROUND_START,"mission.started":V.LIFE_MISSION_STARTED,"mission.completed":V.LIFE_MISSION_COMPLETED,"mission.error":V.LIFE_MISSION_FAILED};V.LOOP_START,V.LOOP_DONE,V.ROUND_START,V.ROUND_MAIN_COMPLETED,V.ROUND_REVIEW_DEFERRED,V.ROUND_REVIEW_COMPLETED,V.ROUND_CHECKPOINT_RECORDED,V.ROUND_CHECKPOINT_FAILED,V.ROUND_SECRET_REDACTED,V.ROUND_ESCALATED,V.ROUND_STALL,V.ROUND_REVIEWER_BACKEND_FAILURE,V.ENGINEER_SELF_REVIEW_ACCEPTED,V.ENGINEER_SELF_REVIEW_REJECTED,V.ENGINEER_SKILL_MAINTENANCE_STARTED,V.ENGINEER_SKILL_MAINTENANCE_COMPLETED,V.SKILL_LIBRARY_AVAILABLE,V.SKILL_CREATED,V.SKILL_UPDATED,V.SKILL_ARCHIVED,V.SKILL_OUTCOME,V.SKILL_TRANSFER_STARTED,V.SKILL_TRANSFER_COMPLETED,V.SKILL_SCIENTIST_STARTED,V.SKILL_SCIENTIST_CREATED,V.SKILL_SCIENTIST_ADAPTATION_STARTED,V.SKILL_SCIENTIST_ADAPTATION_CREATED,V.SKILL_TIDIED,V.SKILL_COMPACTED,V.SKILL_COMPACT_ERROR,V.SKILL_OP_ERROR,V.SKILL_OP_REFUSED,V.SKILL_PROPOSAL_REJECTED,V.SKILL_DISTILL_REJECTED,V.SKILL_REVISED,V.SKILL_USE_RECORDED,V.SKILL_HISTORY_COMPRESSED,V.SKILL_EVOLUTION_COMPLETED,V.WIKI_INITIALIZED,V.WIKI_INITIALIZATION_FAILED,V.WIKI_HOOK_OK,V.WIKI_HOOK_WARNING,V.WIKI_COMPACTED,V.WIKI_COMPACT_ERROR,V.WIKI_CREATED,V.WIKI_UPDATED,V.WIKI_RETIRED,V.WIKI_SOURCE_CREATED,V.WIKI_SOURCE_SKIPPED,V.WIKI_PROMOTION_PROMOTED,V.WIKI_PROMOTION_DEMOTED,V.WIKI_RETIRED_COMPRESSED,V.WIKI_EVOLUTION_COMPLETED,V.LIFE_MISSION_STARTED,V.LIFE_MISSION_COMPLETED,V.LIFE_MANAGER_INTENT_STARTED,V.LIFE_MANAGER_INTENT_COMPLETED,V.LIFE_MANAGER_INTENT_FAILED,V.LIFE_MANAGER_STAGE_DECISION,V.LIFE_MANAGER_PLAN_CHALLENGE_DECIDED,V.LIFE_VERTICAL_RESOLVED,V.LIFE_PLANNER_START,V.LIFE_PLANNER_TASK_ADDED,V.LIFE_PLANNER_TASK_SKIPPED,V.LIFE_PLANNER_VERDICT,V.LIFE_PLANNER_WAITING,V.LIFE_PLANNER_WAITING_WOKEN,V.LIFE_PLANNER_TERMINAL_IDLE,V.LIFE_PLANNER_VERIFICATION_PROBE,V.LIFE_PLANNER_STALL_ESCALATION,V.LIFE_PLAN_SIGNAL,V.LIFE_PLAN_REVISION_PROPOSED,V.LIFE_PLAN_REVISION_REJECTED,V.LIFE_PLAN_REVISION_COMMITTED,V.LIFE_PLAN_NODE_SUPERSEDED,V.LIFE_BUDGET_PAUSE,V.BUDGET_RESERVATION_DENIED,V.BUDGET_UNPRICED_BLOCKED,V.LIFE_LIFECYCLE_BLOCK,V.LIFE_LIFECYCLE_TRANSITION,V.PROVIDER_REQUEST_STARTED,V.PROVIDER_REQUEST_COMPLETED,V.PROVIDER_REQUEST_DENIED,V.LIFE_INBOX_QUEUED,V.LIFE_INBOX_DRAINED,V.LIFE_DAEMON_IDLE_TIMEOUT,V.PROJECT_COMPLETED,V.PROJECT_COMPLETION_REFUSED,V.DAEMON_PARKED,V.DAEMON_COMMAND_COMPLETED,V.DAEMON_COMMAND_REJECTED,V.IDEA_SEARCH_STARTED,V.IDEA_SEARCH_COMPLETED,V.IDEA_SEARCH_SKIPPED,V.VENUE_RESEARCH_STARTED,V.VENUE_RESEARCH_COMPLETED,V.RESEARCH_ACHIEVEMENT_CERTIFIED,V.OPERATOR_ALERT,V.AGENT_IO_START,V.AGENT_IO_COMPLETE,V.AGENT_IO_ERROR,V.PROVIDER_REQUEST_STARTED,V.PROVIDER_REQUEST_COMPLETED,V.PROVIDER_REQUEST_DENIED,V.USAGE_RECORDED;function _t(e){let t=String(e??``).trim();return gt[t]??t}function vt(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(vt).join(`,`)}]`;let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${vt(t[e])}`).join(`,`)}}`}function yt(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function bt(e){let t=e.event_id??e.id??e.seq??e._offset,n=String(e.type??`event`);return t!=null&&t!==``?`${n}-${String(t)}`:`${n}-${String(e.ts??e.time??``)}-${yt(vt(e))}`}function xt(e){return e.type===V.ENGINEER_PROGRESS&&e.kind===`reasoning`}function St(e){if(e.type!==V.ENGINEER_PROGRESS||![`assistant_message`,`agent_message`,`message`].includes(String(e.kind??``)))return!1;let t=String(e.agent_layer??e.actor??``);return String(e.text??``).trimStart().startsWith(`{`)?t===`reviewer`||t===`planner`:!1}var Ct=/^(?:MILESTONE_STATUS|OPERATOR_QUESTION|OPERATOR_OPTIONS)\s*=/i;function wt(e){return String(e??``).split(/\r?\n/).filter(e=>!Ct.test(e.trim())).join(` +`).trim()}function Tt(e){let t=String(e.fragment_mode??``);return t===`append`||t===`snapshot`?t:e.replace===!0?`snapshot`:`auto`}function Et(e,t){let n=Math.min(e.length,t.length);for(let r=n;r>=8;--r)if(e.endsWith(t.slice(0,r)))return r;return 0}function Dt(e,t,n=`auto`){let r=(e||``).trim(),i=(t||``).trim();if(!r)return i;if(!i)return r;if(n===`snapshot`)return i;if(r.includes(i))return r;if(n===`append`)return`${r}\n${i}`;if(i.includes(r))return i;let a=Et(r,i);return a?`${r}${i.slice(a)}`:`${r}\n${i}`}var Ot=[`all`,`attention`,`milestones`,`messages`],kt=new Set([V.LIFE_MISSION_STARTED,V.LIFE_MISSION_COMPLETED,V.LIFE_MISSION_FAILED,V.LOOP_START,V.LOOP_DONE,V.LIFE_PLANNER_VERDICT,`final.report.ready`,`pptx.report.ready`,`plan.completed`,V.LIFE_BUDGET_PAUSE,V.LIFE_LIFECYCLE_BLOCK]);function At(e,t,n=`all`,r=``){let i=_t(e.canonical_type??e.type),a=String(e.kind??``);if(n===`attention`&&![`warn`,`err`].includes(String(t.tone??``))&&e.operator_alert!==!0||n===`milestones`&&!(t.rule&&!i.startsWith(`ui.`))&&!kt.has(i)||n===`messages`&&t.tone!==`bright`&&![`assistant_message`,`agent_message`,`message`].includes(a)&&![`ui.operator`,`ui.argus`].includes(i))return!1;let o=r.trim().toLocaleLowerCase();return!o||[i,a,t.role,t.label,t.text,e.title,e.objective,e.text,e.summary,e.reason,e.error,e.status,e.action_summary,e.command,e.path,Array.isArray(e.tags)?e.tags.join(` `):e.tags].some(e=>String(e??``).toLocaleLowerCase().includes(o))}var jt=[{id:`status`,name:`/status`,argument:`none`,desc:`roles, queued work, journal, and health`,group:`Everyday`,kind:`panel`},{id:`roles`,name:`/roles`,argument:`none`,desc:`per-role backend / model / effort + live activity`,group:`Everyday`,kind:`panel`},{id:`journal`,name:`/journal`,arg:`[N]`,argument:`optional`,desc:`recent journal entries (default 10)`,group:`Everyday`,kind:`panel`},{id:`backlog`,name:`/backlog`,arg:`[all]`,argument:`optional`,desc:`pending tasks (all = incl. done/skipped)`,group:`Everyday`,kind:`panel`},{id:`artifacts`,name:`/artifacts`,argument:`none`,desc:`reviewer-approved result files (Enter previews)`,group:`Everyday`,kind:`panel`},{id:`artifact`,name:`/artifact`,arg:``,argument:`required`,desc:`preview one approved result file`,group:`Everyday`,kind:`panel`},{id:`events`,name:`/events`,arg:`[filter] [query]`,argument:`optional`,desc:`search feed: all / watch / milestones / messages`,group:`Everyday`,kind:`panel`},{id:`find`,name:`/find`,arg:``,argument:`required`,desc:`search the current event buffer`,group:`Everyday`,kind:`panel`},{id:`cancel`,name:`/cancel`,argument:`none`,desc:`stop waiting for the current Manager reply`,group:`Everyday`,kind:`local`},{id:`ask`,name:`/ask`,arg:``,argument:`required`,desc:`answer inline — no task queued, no Planner/Engineer/Reviewer`,aliases:[`/chat`],group:`Everyday`,kind:`action`},{id:`task`,name:`/task`,arg:``,argument:`required`,desc:`queue work directly`,aliases:[`/add`],group:`Task management`,kind:`action`},{id:`plan`,name:`/plan`,arg:``,argument:`required`,desc:`preview a Planner-authored execution plan`,group:`Task management`,kind:`action`},{id:`rewrite`,name:`/rewrite`,arg:`[text]`,argument:`optional`,desc:`let the Manager rewrite your prompt before sending`,aliases:[`/refine`],group:`Task management`,kind:`action`},{id:`nudge`,name:`/nudge`,arg:``,argument:`required`,desc:`inject guidance into the running mission`,aliases:[`/inject`,`/notify`],group:`Task management`,kind:`action`},{id:`abort`,name:`/abort`,argument:`none`,desc:`immediately stop the running mission`,group:`Task management`,kind:`action`},{id:`note`,name:`/note`,arg:``,argument:`required`,desc:`append a manual note to the timeline`,group:`Task management`,kind:`action`},{id:`done`,name:`/done`,arg:``,argument:`required`,desc:`mark a task done`,group:`Task management`,kind:`action`},{id:`skip`,name:`/skip`,arg:``,argument:`required`,desc:`skip a task`,aliases:[`/rm`],group:`Task management`,kind:`action`},{id:`stop`,name:`/stop`,arg:``,argument:`required`,desc:`stop a task's auto-iteration`,group:`Task management`,kind:`action`},{id:`item`,name:`/item`,arg:``,argument:`required`,desc:`inspect a full task contract`,group:`Task management`,kind:`panel`},{id:`run`,name:`/run`,argument:`none`,desc:`return to the always-live mission feed`,group:`Task management`,kind:`local`},{id:`new`,name:`/new`,arg:`[objective]`,argument:`optional`,desc:`review, create, and switch to a fresh conversation`,group:`Sessions & diagnostics`,kind:`action`},{id:`daemons`,name:`/daemons`,arg:`[query]`,argument:`optional`,desc:`find every session + switch or create`,group:`Sessions & diagnostics`,kind:`panel`},{id:`resume`,name:`/resume`,arg:`[list|]`,argument:`optional`,desc:`switch to another project/session`,group:`Sessions & diagnostics`,kind:`action`},{id:`attach`,name:`/attach`,arg:``,argument:`required`,desc:`follow another project (read the stream)`,group:`Sessions & diagnostics`,kind:`action`},{id:`rename`,name:`/rename`,arg:``,argument:`required`,desc:`rename the current conversation`,group:`Sessions & diagnostics`,kind:`action`},{id:`doctor`,name:`/doctor`,argument:`none`,desc:`diagnose 'why isn't anything running'`,group:`Sessions & diagnostics`,kind:`panel`},{id:`backend`,name:`/backend`,arg:`[codex|claude|copilot|opencode|pi|grok]`,argument:`optional`,desc:`view or change the shared runner backend`,group:`Configuration`,kind:`action`},{id:`config`,name:`/config`,arg:`[key=value …]`,argument:`optional`,desc:`view or change runtime settings`,group:`Configuration`,kind:`panel`},{id:`identity`,name:`/identity`,arg:`[set ]`,argument:`optional`,desc:`view or replace the operator identity card`,group:`Configuration`,kind:`panel`},{id:`reset`,name:`/reset`,argument:`none`,desc:`drop the warm Manager conversation context`,group:`Configuration`,kind:`action`},{id:`skills`,name:`/skills`,arg:`[ls|promote ]`,argument:`optional`,desc:`inspect or promote runtime skills`,group:`Configuration`,kind:`action`},{id:`clear`,name:`/clear`,argument:`none`,desc:`clear the event feed view`,group:`Other`,kind:`local`},{id:`reconnect`,name:`/reconnect`,argument:`none`,desc:`reconnect the live event stream`,group:`Other`,kind:`local`},{id:`help`,name:`/help`,argument:`none`,desc:`keys + full command reference`,aliases:[`/?`,`/commands`],group:`Other`,kind:`local`},{id:`quit`,name:`/quit`,argument:`none`,desc:`leave the cockpit (background work keeps running)`,aliases:[`/exit`,`/q`],group:`Other`,kind:`local`}];new Map(jt.map(e=>[e.id,e]));var Mt=new Map;for(let e of jt)for(let t of[e.name,...e.aliases??[]])Mt.set(t.toLowerCase(),e);function Nt(e){return e.argument===`required`}var Pt=/^\/[A-Za-z0-9_-]+$/;function Ft(e){if(!e.startsWith(`/`))return!1;let t=e.indexOf(` `),n=t===-1?e:e.slice(0,t);return Pt.test(n)}function It(e){return e.startsWith(`/`)&&!e.includes(` `)&&!e.slice(1).includes(`/`)}function Lt(e){if(!It(e))return[];let t=e.toLowerCase(),n=new Set,r=[];for(let e of jt)[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t))&&!n.has(e.name)&&(n.add(e.name),r.push(e));return r.sort((e,n)=>Number(Rt(n,t))-Number(Rt(e,t)))}function Rt(e,t){return[e.name,...e.aliases??[]].some(e=>e.toLowerCase()===t)}function zt(e){return e.arg?`${e.name} `:e.name}function H(e){let t=e.trim();if(!t)return{filter:`all`,query:``};let[n,...r]=t.split(/\s+/);return n.toLowerCase()===`watch`?{filter:`attention`,query:r.join(` `)}:Ot.includes(n.toLowerCase())?{filter:n.toLowerCase(),query:r.join(` `)}:{filter:`all`,query:t}}function Bt(e){if(!Ft(e))return null;let t=e.indexOf(` `),n=(t===-1?e:e.slice(0,t)).toLowerCase(),r=t===-1?``:e.slice(t+1).trim(),i=Mt.get(n)??null;return{cmd:i,name:i?i.name:n,rest:r}}function Vt(e){let t=e.toLowerCase(),n=null,r=0;for(let e of Mt.keys()){let i=Ht(t,e);i>r&&(r=i,n=Mt.get(e).name)}return r>=.6?n:null}function Ht(e,t){return 1-Ut(e,t)/(Math.max(e.length,t.length)||1)}function Ut(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},(e,t)=>[t,...Array(r).fill(0)]);for(let e=0;e<=r;e+=1)i[0][e]=e;for(let a=1;a<=n;a+=1)for(let n=1;n<=r;n+=1)i[a][n]=Math.min(i[a-1][n]+1,i[a][n-1]+1,i[a-1][n-1]+(e[a-1]===t[n-1]?0:1));return i[n][r]}function Wt(e){let t=(e.label||e.display_name||``).trim();return!!(t&&t!==e.id)}function Gt(e){return[...e].sort((e,t)=>{if(e.daemon_alive!==t.daemon_alive)return e.daemon_alive?-1:1;let n=Wt(e);return n===Wt(t)?(t.last_active||0)-(e.last_active||0):n?-1:1})}function Kt(e){return Gt(e)[0]}function qt(e,t){let n=t?.trim()||null;return n&&e.some(e=>e.id===n)?{id:n,requested:n,recovered:!1}:{id:Kt(e)?.id??null,requested:n,recovered:!!n}}function Jt(e,t,n){if(n){let e=t?.trim()||null;return{id:e,requested:e,recovered:!1}}return qt(e,t)}function Yt(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;let r=e.daemon_alive?`live running`:`stopped idle`,i=[e.id,e.label,e.display_name,e.objective,r].filter(Boolean).join(` `).toLowerCase();return n.every(e=>i.includes(e))}function Xt(e,t){return e.filter(e=>Yt(e,t))}var Zt=new Set([`done`,`success`,`completed`]),Qt=new Set([`research_incomplete`,`paused_no_breakthrough`,`exhausted_current_methods`]),$t=new Set([`no_progress`,`max_rounds`]),en=new Set([`blocked`,`infra_blocked`]),tn=new Set([`error`,`failed`,`supervisor_error`]),nn={completed:{glyph:`🎉`,tone:`ok`,missionStatus:`complete`},incomplete:{glyph:`◌`,tone:`warn`,missionStatus:`incomplete`},stalled:{glyph:`⏸`,tone:`warn`,missionStatus:`stalled`},blocked:{glyph:`⛔`,tone:`err`,missionStatus:`blocked`},failed:{glyph:`💥`,tone:`err`,missionStatus:`failed`},ended:{glyph:`■`,tone:`info`,missionStatus:`ended`}},rn={completed:`Task completed`,incomplete:`Mission incomplete`,stalled:`Mission stalled`,blocked:`Mission blocked`,failed:`Mission failed`,ended:`Mission ended`};function an(e){return String(e??``).trim().toLowerCase()}function on(e){let t=an(e);switch(t){case`completed`:case`incomplete`:case`stalled`:case`blocked`:case`failed`:case`ended`:return t;default:return null}}function sn(e){let t=an(e.status);return e.success===!0||Zt.has(t)?`completed`:Qt.has(t)?`incomplete`:$t.has(t)?`stalled`:en.has(t)?`blocked`:tn.has(t)?`failed`:`ended`}function cn(e){let t=e.outcome;if(t&&typeof t==`object`&&!Array.isArray(t)){let n=t;return{execution_status:an(n.execution_status)||sn(e),review_status:an(n.review_status)||`not_assessed`,stage_certification:an(n.stage_certification)||`not_assessed`,interruption_kind:an(n.interruption_kind)||`none`,resumable:n.resumable===!0}}return{execution_status:sn(e),review_status:`not_assessed`,stage_certification:`not_assessed`,interruption_kind:an(e.stop_kind)||`none`,resumable:e.resumable===!0}}function ln(e){return e?.execution_status?[`execution=${e.execution_status}`,e.review_status&&e.review_status!==`not_assessed`?`review=${e.review_status}`:``,e.stage_certification&&e.stage_certification!==`not_assessed`?`stage=${e.stage_certification}`:``,e.interruption_kind&&e.interruption_kind!==`none`?`interrupt=${e.interruption_kind}`:``,e.resumable?`resumable=yes`:``].filter(Boolean):[]}function un(e){let t=on(e.outcome_class)??sn(e),n=String(e.status??``).trim(),r=nn[t];return{outcomeClass:t,label:t===`completed`&&e.final_submission_certified===!0?`Submission certified`:t===`ended`&&n?`Mission ended · ${n}`:rn[t],glyph:r.glyph,tone:r.tone,missionStatus:r.missionStatus}}var dn=[`manager`,`planner`,`engineer`,`reviewer`],fn=new Set([`planner`,`engineer`,`reviewer`]),pn=new Set([`running`,`in_progress`,`claimed`]),U=(e,t)=>String(e[t]??``).trim(),mn=(e,t)=>{let n=Number(e[t]);return Number.isFinite(n)?n:null};function hn(e){let t=[e.route?e.route.toUpperCase():``,e.vertical,e.workflow_mode?e.workflow_mode.toUpperCase():``].filter(Boolean);return e.lifetime===`standing`?t.push(`STANDING · OPEN-ENDED`):e.lifetime===`bounded_increment`?t.push(`BOUNDED INCREMENT`):e.lifetime===`bounded`&&e.continuous?t.push(`BOUNDED · FINITE CONTINUOUS`):e.lifetime&&t.push(e.lifetime.toUpperCase()),t.join(` · `)}function gn(e){return JSON.parse(JSON.stringify(e))}function _n(){return{schema_version:5,bootstrapped:!1,mission:{id:``,title:``,objective:``,summary:``,status:`idle`,started_at:null,completed_at:null,elapsed_seconds:0,campaign_started_at:null,campaign_elapsed_seconds:0},stage:{id:``,label:``},routing:{route:``,vertical:``,workflow_mode:``,lifetime:``,continuous:!1,open_ended:!1},round:{current:0,max:0},active_role:``,roles:dn.map(e=>({role:e,status:`waiting`,label:`Waiting`,updated_at:0})),role_work:[],dag:[],timeline:[],artifacts:[],learned_skills:[],learned_wiki_pages:[],storage:{project_skill_dir:``,global_skill_dir:``,project_skill_count:0,global_skill_count:0,skill_history_compressed:0,wiki_retired_compressed:0,skill_history_bytes_saved:0,wiki_retired_bytes_saved:0,wiki_paths:[]},achievement:null,review:{status:``,reason:``,rejected_attempts:0},frontier:{change:``,summary:``,updated_at:0},outcome:{},last_event_ts:0,updated_at:0}}function vn(e,t,n,r){if(n==null||n===``)return;let i=e.findIndex(e=>e[t]===n);i>=0?e[i]={...e[i],...r}:e.push(r)}function yn(e,t,n,r,i){if(!dn.includes(t))return;n===`active`&&fn.has(t)&&e.roles.forEach(e=>{fn.has(e.role)&&e.role!==t&&e.status===`active`&&Object.assign(e,{status:`done`,label:`Handed off`,updated_at:i})});let a={role:t,status:n,label:r,updated_at:i};vn(e.roles,`role`,t,a),n===`active`?e.active_role=t:e.active_role===t&&(e.active_role=``)}function bn(e,t,n,r,i=``,a=`neutral`){let o=bt(t);if(e.timeline.some(e=>e.id===o))return;let s={id:o,ts:Number(t.ts??Date.now()/1e3),type:_t(t.type),role:n,title:r.slice(0,180),detail:i.slice(0,500),tone:a};[`item_id`,`branch_id`].forEach(e=>{let n=U(t,e);n&&(s[e]=n)}),e.timeline=[...e.timeline,s].slice(-120)}function xn(e,t,n,r,i,a=``,o=``){if(!dn.includes(n))return;let s=U(t,`message_id`),c=s?`${n}:${s}`:bt(t),l=e.role_work.find(e=>e.id===c),u=l&&l.detail.length>a.length?l.detail:a,d={id:c,ts:Number(t.ts??Date.now()/1e3),role:n,kind:r,title:i.slice(0,240),detail:u.slice(0,4e3),status:o,item_id:U(t,`item_id`),mission_id:e.mission.id,mission_title:e.mission.title.slice(0,240),round_index:mn(t,`round_index`)},f=e.role_work.findIndex(e=>e.id===c);f>=0?e.role_work[f]=d:e.role_work.push(d);let p=new Set;dn.forEach(t=>{e.role_work.filter(e=>e.role===t).slice(-40).forEach(e=>p.add(e.id))}),e.role_work=e.role_work.filter(e=>p.has(e.id))}function Sn(e){return e===`ok`?`success`:e===`err`?`error`:`info`}var Cn={agent_message:`Reporting progress`,assistant_message:`Reporting progress`,command_execution:`Running a command`,reasoning:`Reasoning`,tool_use:`Using a tool`,tool_result:`Inspecting tool output`,codex_idle:`Waiting for model output`};function wn(e,t){let n=_t(t.type),r=Number(t.ts??Date.now()/1e3);if(e.last_event_ts=Math.max(e.last_event_ts,r),n===V.LIFE_MANAGER_INTENT_STARTED)e.mission.id=U(t,`item_id`)||U(t,`intent_id`),e.mission.title=U(t,`objective`).slice(0,240),e.mission.objective=U(t,`objective`),e.mission.status=`grounding`,yn(e,`manager`,`active`,`Grounding project`,r),bn(e,t,`manager`,`Project grounding started`,U(t,`objective`)),xn(e,t,`manager`,`grounding`,`Grounding project`,U(t,`objective`),`active`);else if(n===V.LIFE_MANAGER_INTENT_COMPLETED){e.mission.id=U(t,`item_id`),e.mission.title=U(t,`objective`).slice(0,240),e.mission.objective=U(t,`objective`),e.mission.status=`framed`,e.routing.route=U(t,`route`)||e.routing.route||`team`,e.routing.vertical=U(t,`vertical`)||e.routing.vertical,e.routing.workflow_mode=U(t,`workflow_mode`)||e.routing.workflow_mode,e.routing.lifetime=U(t,`lifetime`)||e.routing.lifetime,`continuous`in t&&(e.routing.continuous=t.continuous===!0),`open_ended`in t&&(e.routing.open_ended=t.open_ended===!0);let n=U(t,`current_stage`),i=Array.isArray(t.stages)?t.stages:[];if(n)e.stage={id:n,label:n.replaceAll(`_`,` `)};else if(!e.stage.id&&i[0]){let t=String(i[0]);e.stage={id:t,label:t.replaceAll(`_`,` `)}}yn(e,`manager`,`done`,`Goal framed`,r),bn(e,t,`manager`,`Goal framed`,U(t,`reason`),`success`),xn(e,t,`manager`,`decision`,`Goal framed`,U(t,`reason`)||U(t,`execution_task`),`done`)}else if(n===V.LIFE_MANAGER_INTENT_FAILED)e.mission.status=`failed`,yn(e,`manager`,`error`,`Manager routing failed`,r),bn(e,t,`manager`,`Manager routing failed`,U(t,`error`)||U(t,`reason`),`error`),xn(e,t,`manager`,`grounding`,`Manager routing failed`,U(t,`error`)||U(t,`reason`),`error`);else if(n===V.LIFE_MANAGER_STAGE_DECISION){let n=U(t,`target_stage`)||U(t,`stage`)||U(t,`current_stage`);n&&(e.stage={id:n,label:n.replaceAll(`_`,` `)}),yn(e,`manager`,`done`,n?`Stage · ${n}`:`Stage reviewed`,r),bn(e,t,`manager`,n?`Stage → ${n}`:`Stage reviewed`,U(t,`reason`)),xn(e,t,`manager`,`stage_decision`,n?`Stage → ${n}`:`Stage reviewed`,U(t,`reason`),U(t,`action`))}else if(n===V.LIFE_PLANNER_START)yn(e,`planner`,`active`,`Planning next work`,r),xn(e,t,`planner`,`planning`,`Planning next work`,U(t,`objective`),`active`);else if(n===V.LIFE_PLANNER_TASK_ADDED){let n=U(t,`item_id`),i={id:n,title:U(t,`title`),objective:U(t,`objective`),status:`pending`,deps:Array.isArray(t.deps)?t.deps.map(String):[],branch_id:U(t,`branch_id`)||n,parent_branch_id:U(t,`parent_branch_id`)||null};vn(e.dag,`id`,n,i),yn(e,`planner`,`done`,`Research branch added`,r),bn(e,t,`planner`,`Research branch added`,i.title,`info`),xn(e,t,`planner`,`task`,i.title||`Task added`,i.objective,`pending`)}else if(n===V.LIFE_PLANNER_VERDICT){let n=!!t.project_done,i=n?`Project reviewed`:`Planning complete`;yn(e,`planner`,`done`,i,r),bn(e,t,`planner`,i,U(t,`reason`),n?`success`:`neutral`),xn(e,t,`planner`,`verdict`,i,U(t,`reason`),n?`done`:`planned`)}else if(n===V.LIFE_PLANNER_WAITING){yn(e,`planner`,`waiting`,`Waiting on external work`,r);let n=U(t,`reason`)||U(t,`waiting_reason`);bn(e,t,`planner`,`Planner waiting`,n),xn(e,t,`planner`,`waiting`,`Planner waiting`,n,`waiting`)}else if(n===V.LIFE_MISSION_STARTED)e.review={status:``,reason:``,rejected_attempts:0},e.mission.campaign_started_at??=r,e.mission={...e.mission,id:U(t,`item_id`),title:U(t,`title`),objective:U(t,`objective`),summary:``,status:`working`,started_at:r,completed_at:null},yn(e,`reviewer`,`waiting`,`Awaiting engineer handoff`,r),yn(e,`engineer`,`active`,`Starting mission`,r),bn(e,t,`engineer`,`Mission started`,U(t,`title`),`info`),xn(e,t,`engineer`,`task`,U(t,`title`)||`Mission started`,U(t,`objective`),`active`);else if(n===V.ROUND_START)e.round={current:mn(t,`round_index`)??0,max:mn(t,`round_max`)??e.round.max},yn(e,`engineer`,`active`,`Running round ${e.round.current}`,r),bn(e,t,`engineer`,`Round ${e.round.current} started`);else if(n===V.ENGINEER_PROGRESS){let n=U(t,`agent_layer`)||U(t,`actor`)||`engineer`,i=n===`main`?`engineer`:n,a=U(t,`kind`),o=Cn[a]??`Working`;yn(e,i,`active`,o,r);let s=U(t,`action_summary`)||U(t,`text`);s&&!xt(t)&&!St(t)&&xn(e,t,i,a||`progress`,o,s,`active`),[`reasoning`,`assistant_message`,`agent_message`].includes(a)||bn(e,t,i,o,U(t,`action_summary`)||U(t,`text`))}else if(n===V.ROUND_MAIN_COMPLETED)yn(e,`engineer`,`done`,`Engineer handoff ready`,r),xn(e,t,`engineer`,`handoff`,`Engineer handoff ready`,U(t,`text`)||U(t,`summary`),`done`);else if(n===V.ROUND_REVIEW_STARTED)yn(e,`reviewer`,`active`,`Reviewing benchmark evidence`,r),xn(e,t,`reviewer`,`review`,`Review started`,``,`active`);else if(n===V.ROUND_REVIEW_DEFERRED){let n=U(t,`next_step`);yn(e,`engineer`,`active`,`Continuing before review`,r),yn(e,`reviewer`,`waiting`,`Review deferred for one round`,r),bn(e,t,`engineer`,`Continued before review`,n,`info`)}else if(n===V.ROUND_REVIEW_COMPLETED){let n=U(t,`status`),i=U(t,`reason`);e.review={status:n,reason:i,rejected_attempts:e.review.rejected_attempts+ +!![`continue`,`blocked`].includes(n)};let a=U(t,`frontier_change`);a&&(e.frontier={change:a,summary:U(t,`frontier_summary`),updated_at:r}),yn(e,`reviewer`,n===`done`?`done`:`rejected`,n===`done`?`Accepted evidence`:`Requested another attempt`,r),bn(e,t,`reviewer`,n===`done`?`Evidence accepted`:`Attempt rejected`,i,n===`done`?`success`:`error`);let o=U(t,`next_action`);xn(e,t,`reviewer`,`verdict`,n===`done`?`Evidence accepted`:`Attempt rejected`,o?`${i}\n\nNext action: ${o}`:i,n)}else if([V.SKILL_CREATED,V.SKILL_UPDATED].includes(n)){let i=U(t,`skill_id`)||U(t,`name`);i&&(vn(e.learned_skills,`id`,i,{id:i,name:U(t,`name`),version:mn(t,`version`)??1,scope:U(t,`scope`),path:U(t,`path`),status:`active`,updated_at:r,mission_id:e.mission.id,mission_title:e.mission.title}),bn(e,t,`reviewer`,n===V.SKILL_CREATED?`Capability unlocked`:`Capability upgraded`,U(t,`name`),`skill`))}else if(n===V.SKILL_EVOLUTION_COMPLETED)e.storage.project_skill_dir=U(t,`project_skill_dir`)||e.storage.project_skill_dir,e.storage.global_skill_dir=U(t,`global_skill_dir`)||e.storage.global_skill_dir,e.storage.project_skill_count=mn(t,`project_skill_count`)??e.storage.project_skill_count,e.storage.global_skill_count=mn(t,`global_skill_count`)??e.storage.global_skill_count;else if(n===V.SKILL_HISTORY_COMPRESSED)e.storage.skill_history_compressed+=mn(t,`count`)??0,e.storage.skill_history_bytes_saved+=mn(t,`bytes_saved`)??0;else if(n===V.SKILL_TIDIED){let n=U(t,`name`);if(n){let i=e.learned_skills.find(e=>e.name===n),a={source_path:U(t,`path`),source_placement:U(t,`placement`),source_vertical:U(t,`vertical`),updated_at:r};i?Object.assign(i,a):vn(e.learned_skills,`id`,n,{id:n,name:n,version:1,scope:``,path:``,status:`active`,...a}),bn(e,t,`manager`,`Capability promoted to source`,n,`skill`)}}else if([V.WIKI_INITIALIZED,V.WIKI_EVOLUTION_COMPLETED].includes(n)){let n=[...(Array.isArray(t.paths)?t.paths:[]).map(e=>String(e)),U(t,`path`)].filter(Boolean);e.storage.wiki_paths=[...new Set([...e.storage.wiki_paths,...n])]}else if(n===V.WIKI_RETIRED_COMPRESSED)e.storage.wiki_retired_compressed+=mn(t,`count`)??0,e.storage.wiki_retired_bytes_saved+=mn(t,`bytes_saved`)??0;else if([V.WIKI_CREATED,V.WIKI_UPDATED].includes(n)){let i=U(t,`page_id`);i&&(vn(e.learned_wiki_pages,`id`,i,{id:i,title:U(t,`title`)||i,card_type:U(t,`card_type`),status:U(t,`status`)||`scratch`,path:U(t,`path`),updated_at:r}),bn(e,t,`reviewer`,n===V.WIKI_CREATED?`Knowledge captured`:`Knowledge refined`,U(t,`title`)||i,`skill`))}else if(n===V.WIKI_RETIRED){let n=U(t,`page_id`);if(n){let i=e.learned_wiki_pages.find(e=>e.id===n);i?Object.assign(i,{status:`retired`,updated_at:r}):vn(e.learned_wiki_pages,`id`,n,{id:n,title:n,card_type:U(t,`card_type`),status:`retired`,path:``,updated_at:r}),bn(e,t,`reviewer`,`Knowledge retired`,n,`error`)}}else if([V.WIKI_PROMOTION_PROMOTED,V.WIKI_PROMOTION_DEMOTED].includes(n)){let i=U(t,`page_id`);if(i){let a=e.learned_wiki_pages.find(e=>e.id===i);a?Object.assign(a,{status:U(t,`to_status`),updated_at:r}):vn(e.learned_wiki_pages,`id`,i,{id:i,title:i,card_type:U(t,`card_type`),status:U(t,`to_status`),path:``,updated_at:r});let o=n===V.WIKI_PROMOTION_PROMOTED;bn(e,t,`reviewer`,o?`Knowledge promoted`:`Knowledge demoted`,`${i} → ${U(t,`to_status`)}`,o?`success`:`neutral`)}}else if(n===V.RESEARCH_ACHIEVEMENT_CERTIFIED)e.achievement={id:U(t,`achievement_id`),title:U(t,`title`),goal:U(t,`goal`),summary:U(t,`summary`),rejected_attempts:e.review.rejected_attempts,skills_learned:e.learned_skills.filter(e=>e.status===`active`).length,artifacts:e.artifacts.length,elapsed_seconds:e.mission.elapsed_seconds,evidence:Array.isArray(t.evidence)?t.evidence.map(String):[],reviewer_certified:!0,certified_at:r};else if([V.LIFE_MISSION_COMPLETED,V.LIFE_MISSION_FAILED].includes(n)){let i=n===V.LIFE_MISSION_FAILED?un({...t,outcome_class:`failed`,status:U(t,`status`)||`failed`,success:!1}):un(t);e.mission.id=U(t,`item_id`)||e.mission.id,e.mission.title=U(t,`title`)||e.mission.title,e.mission.objective=U(t,`objective`)||e.mission.objective,e.mission.summary=U(t,`summary`),e.mission.status=i.missionStatus,e.mission.completed_at=r,e.outcome=cn(t),yn(e,`engineer`,i.missionStatus===`complete`?`done`:i.missionStatus,i.label,r),bn(e,t,`engineer`,i.label,U(t,`summary`)||U(t,`title`)||U(t,`status`),Sn(i.tone)),xn(e,t,`engineer`,`completion`,i.label,U(t,`summary`)||U(t,`title`)||U(t,`status`),i.missionStatus)}return e.updated_at=Date.now()/1e3,e}function Tn(e,t,n){let r=t.backlog.find(e=>pn.has(e.status)),i=t.backlog.find(e=>e.status===`pending`),a=t.backlog.find(t=>t.id===e.mission.id),o=r??a,s=!!(r||i||t.continuous?.enabled||t.continuous?.done_reason||t.continuous?.done_at||e.mission.id||![``,`idle`].includes(e.mission.status));t.continuous?.enabled&&(e.routing.route=e.routing.route||`team`,e.routing.continuous=!0,e.routing.open_ended=t.continuous.open_ended===!0,e.routing.lifetime=e.routing.open_ended?`standing`:e.routing.lifetime||`bounded`);let c=o?.objective||o?.title||(t.continuous?.enabled?t.continuous.objective:``)||t.session.objective||(e.mission.id?``:i?.objective)||(e.mission.id?``:i?.title)||e.mission.objective;c&&(e.mission.objective=c,o?e.mission.title=(o.title||c.split(` +`)[0]).slice(0,240):e.mission.title||(e.mission.title=c.split(` +`)[0].slice(0,240))),r?(e.mission.id=r.id,e.mission.status=`working`,e.mission.started_at=e.mission.started_at??r.started_ts??null):a?a.status===`pending`&&(e.mission.status=`queued`):t.continuous?.done_reason||t.continuous?.done_at?e.mission.status=`complete`:i||t.continuous?.enabled?e.mission.status=`queued`:t.daemon.alive&&(e.mission.status=`idle`),t.roles.forEach(t=>{t.active?yn(e,t.role,`active`,t.label||t.status||`Working`,Date.now()/1e3-(t.age_s??0)):s||yn(e,t.role,`waiting`,`Waiting`,Date.now()/1e3);let n=e.roles.find(e=>e.role===t.role);n&&Object.assign(n,{backend:t.backend,model:t.model,effort:t.effort})});let l=t.roles.filter(e=>e.active);l.length?e.active_role=l[l.length-1].role:s||(e.active_role=``),t.backlog.forEach(t=>{let n={id:t.id,title:t.title,objective:t.objective,status:t.status,deps:t.deps??[],branch_id:t.id,parent_branch_id:t.deps?.[0]??null,acceptance_check:t.acceptance_check??``,plan_hypothesis:t.plan_hypothesis??``,goal_contribution:t.goal_contribution??``,expected_regressions:t.expected_regressions??``,decision_rule:t.decision_rule??``,non_goals:t.non_goals??[]};vn(e.dag,`id`,n.id,n)});let u=o?.outcome?.execution_status?o.outcome:e.mission.id?void 0:[...t.backlog].filter(e=>e.outcome?.execution_status).sort((e,t)=>Number(e.finished_ts??0)-Number(t.finished_ts??0)).at(-1)?.outcome;return!r&&u&&(e.outcome=cn({outcome:u,status:`done`,success:!0})),n.forEach(t=>{vn(e.artifacts,`path`,t.path,{id:t.path,path:t.path,title:t.name,kind:t.kind,why:t.why,exists:t.exists,source:t.source})}),s}function En(e,t,n,r){r||(t.roles.forEach(t=>{t.active||yn(e,t.role,`waiting`,`Waiting`,Date.now()/1e3)}),e.active_role=``);let i=Date.now()/1e3,a=e.mission.campaign_started_at??t.session.created??e.mission.started_at;a&&(e.mission.campaign_started_at=a,e.mission.campaign_elapsed_seconds=Math.max(0,i-a)),e.mission.started_at&&e.mission.status===`working`?e.mission.elapsed_seconds=Math.max(0,i-e.mission.started_at):e.mission.started_at&&e.mission.completed_at&&(e.mission.elapsed_seconds=Math.max(0,e.mission.completed_at-e.mission.started_at)),e.achievement?.reviewer_certified&&(e.achievement.elapsed_seconds=e.mission.elapsed_seconds,e.achievement.rejected_attempts=e.review.rejected_attempts,e.achievement.skills_learned=e.learned_skills.filter(e=>e.status===`active`).length,e.achievement.artifacts=n.filter(e=>e.exists).length)}function Dn(e,t=[],n=[]){let r=e.mission_view?gn(e.mission_view):_n();r.storage??=_n().storage,r.storage.skill_history_compressed??=0,r.storage.wiki_retired_compressed??=0,r.storage.skill_history_bytes_saved??=0,r.storage.wiki_retired_bytes_saved??=0,r.learned_wiki_pages??=[],r.role_work??=[],r.outcome??={};let i=r.last_event_ts,a=Tn(r,e,n);return t.filter(e=>e.ts==null||Number(e.ts)>i).sort((e,t)=>Number(e.ts??0)-Number(t.ts??0)).forEach(e=>wn(r,e)),En(r,e,n,a),r}function On(e){return String(e||``).replace(/\\([*_`~])/g,`$1`).replace(/\\\\(?=[A-Za-z])/g,`\\`)}function kn(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),r=Math.floor(t%3600/60);return n?`${n}h ${r}m`:r?`${r}m`:`${t}s`}var An={[V.LIFE_LIFECYCLE_BLOCK]:`block`,[V.ROUND_REVIEWER_BACKEND_FAILURE]:`block`,[V.LIFE_BUDGET_PAUSE]:`warn`,[V.ROUND_STALL]:`warn`,[V.ROUND_ESCALATED]:`warn`,[V.LIFE_PLANNER_STALL_ESCALATION]:`warn`},jn=new Set([V.BUDGET_RESERVATION_DENIED,V.BUDGET_UNPRICED_BLOCKED]),Mn=new Set([V.LIFE_MISSION_STARTED,V.ROUND_MAIN_COMPLETED,V.LIFE_MISSION_COMPLETED,V.LOOP_DONE,V.ROUND_START,`ui.operator`]),Nn=new Set([V.BUDGET_RESERVATION_CREATED,V.PROVIDER_REQUEST_STARTED]);function Pn(e){let t=_t(e.canonical_type??e.type);if(e.event_validation?.status===`invalid`)return{tone:`warn`,text:`invalid event ${t||`unknown`}: ${e.event_validation.errors.join(`; `)}`};if(jn.has(t))return{tone:`block`,kind:`budget`,text:`Budget exhausted or blocked — ${String(e.reason??e.text??t).trim()}`};let n=e.operator_alert===!0?`block`:An[t];return n?{tone:n,text:String(e.text??e.reason??t).trim()}:null}function Fn(e){let t=null;for(let n of e){let e=_t(n.canonical_type??n.type),r=Pn(n);r?t=r:(t?.kind===`budget`&&Nn.has(e)||t&&t.kind!==`budget`&&Mn.has(e))&&(t=null)}return t}var In=new Set([`done`,`completed`,`failed`,`skipped`]);function Ln(e){return In.has(e.status)}function Rn(e,t){return e.filter(e=>Ln(e)===t)}Math.max(...[` ╭───────────────────────────────────────────────────────────────────────────────────╮╮`,` │ ││`,` │ ◉ argus-skill · Autonomous Research Lab ││`,` │ ││`,` ╰───────────────────────────────────────────────────────────────────────────────────╯│`,` │`].map(e=>[...e].length));var zn=[`turning it over`,`consulting a hundred eyes`,`reading the room`,`weighing it`,`thinking it through`,`cross-checking the evidence`,`running the numbers`,`sizing up the angles`,`following the thread`,`letting it settle`],Bn=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function Vn(e,t,n=20){return e.length===0?``:e[Math.floor(t/n)%e.length]}function Hn(e){return Bn[e%Bn.length]}function Un(e,t,n=!1,r=0){let i=`${Vn(zn,t)}…`;if(n)return`${i} · Manager alive · ${Math.max(0,Math.floor(Number.isFinite(r)?r:0))}s quiet`;let a=e||i;return a.includes(`[SESSION HANDOFF`)?`Manager context refreshed · working on your message…`:a.replace(/^Manager\s*·\s*/i,``).slice(0,100)}var Wn=()=>Date.now()/1e3;function Gn(e){return e.trim().replace(/[.…]+$/u,``).toLowerCase()}function Kn(e,t,n=Wn()){let r=(t.label??``).trim();if(!r)return e;let i=t.heartbeat===!0,a=e.slice(),o=a[a.length-1];if(o&&!o.endedTs){if(Gn(o.label)===Gn(r)||i&&o.heartbeat)return a[a.length-1]={...o,label:r,detail:t.detail||o.detail,kind:t.kind||o.kind,heartbeat:i,endedTs:0},a;a[a.length-1]={...o,endedTs:n}}return a.push({id:`${a.length}:${r}:${n}`,role:(t.role||`manager`).trim()||`manager`,label:r,detail:(t.detail||``).trim(),kind:(t.kind||``).trim(),startedTs:n,endedTs:0,heartbeat:i}),a}function qn(e,t=Wn()){if(e.length===0)return[];let n=e.slice(),r=n[n.length-1];return r&&!r.endedTs&&(n[n.length-1]={...r,endedTs:t}),n}function Jn(e,t=6){let n=Math.max(1,t);return e.length<=n?e:e.slice(e.length-n)}function Yn(e,t=Wn()){let n=e.endedTs||t;return Math.max(0,n-e.startedTs)}function Xn(e){if(!Number.isFinite(e)||e<1)return``;if(e<60)return`${Math.floor(e)}s`;let t=Math.floor(e/60),n=Math.floor(e%60);return n?`${t}m${n}s`:`${t}m`}function Zn(e,t=!1,n=!1){return(t||n)&&e.toLowerCase()===`r`}function W(e,t){let n=(e||``).replace(/```[a-z]*\n?/gi,``).replace(/\[([^\]]+)\]\([^)]+\)/g,`[$1]`).trim();return n.length<=t?n:n.slice(0,t-1).trimEnd()+`…`}var Qn=e=>String(e??``).split(` +`)[0]?.trim()??``,G=(e,t)=>String(e[t]??``),$n=e=>{let t=e,n=t.round_index??t.round;return typeof n==`string`||typeof n==`number`?n:`?`},er={manager:`Manager`,planner:`Planner`,engineer:`Engineer`,reviewer:`Reviewer`,critic:`Critic`,system:`Argus`},tr={manager:`Manager`,planner:`Planner`,engineer:`Engineer`,reviewer:`Reviewer`,critic:`Critic`,system:`Argus`},nr=e=>({bright:z.ink,dim:z.inkDim,accent:z.accent,ok:z.success,warn:z.warning,err:z.error,info:z.info})[e];function rr(e,t=`en`){let n=G(e,`type`),r=(e,n)=>t===`zh-CN`?n:e,i=e=>(t===`zh-CN`?tr:er)[e]||e;if(n===`ui.operator`){let t=wt(G(e,`text`));return t?{role:`operator`,label:r(`You`,`你`),glyph:`›`,text:t,tone:`bright`,rule:!0}:null}if(n===`ui.argus`){let t=G(e,`text`);return t?{role:`manager`,label:`Argus`,glyph:`◆`,text:t,tone:`bright`,rule:!0}:null}if(n===`engineer.progress`){let t=G(e,`kind`),n=G(e,`agent_layer`)||`engineer`,a=Qn(e.text??e.action_summary);if(t===`reasoning`){let t=W(G(e,`text`),280);return t?{role:n,label:i(n),glyph:`∴`,text:t,tone:`dim`,reasoning:!0}:null}if(t===`assistant_message`||t===`agent_message`||t===`message`){if(St(e))return null;let t=wt(G(e,`text`));return t?{role:n,label:i(n),glyph:`▌`,text:t,tone:`bright`}:null}if(t===`command_execution`){let t=G(e,`text`)||G(e,`command`)||G(e,`action_summary`);return t?{role:n,label:i(n),glyph:`▸ $`,text:t,tone:`dim`}:null}if(t===`file_change`){let t=G(e,`text`)||G(e,`action_summary`);return{role:n,label:i(n),glyph:`✎`,text:t||r(`(file change)`,`(文件变更)`),tone:`dim`}}if(t===`tool_use`){let t=G(e,`text`)||G(e,`action_summary`);return{role:n,label:i(n),glyph:`⚙`,text:t||r(`(tool)`,`(工具)`),tone:`dim`}}return a?{role:n,label:i(n),glyph:`▸`,text:W(a,160),tone:`dim`}:null}if(n===`life.manager.intent.started`)return{role:`manager`,label:`Manager`,glyph:`🧭`,text:r(`classifying request…`,`判断任务归属…`),tone:`info`};if(n===`life.manager.intent.completed`)return{role:`manager`,label:`Manager`,glyph:`🧭`,text:`→ ${hn({route:G(e,`route`)||`team`,vertical:G(e,`vertical`),workflow_mode:G(e,`workflow_mode`),lifetime:G(e,`lifetime`),continuous:e.continuous===!0,open_ended:e.open_ended===!0})||G(e,`kind`)||r(`resolved`,`已确定`)}`,tone:`info`};if(n===`life.manager.intent.failed`)return{role:`manager`,label:`Manager`,glyph:`⚠`,text:`${r(`routing failed`,`分流失败`)} ${W(G(e,`error`),140)}`,tone:`err`};if(n===`life.manager.stage_decision`){let t=G(e,`target_stage`)||G(e,`stage`)||G(e,`current_stage`);return{role:`manager`,label:`Manager`,glyph:`🧭`,text:`${G(e,`action`)}${t?` → ${t}`:``} ${W(G(e,`reason`),120)}`,tone:`info`}}if(n===`life.planner.start`)return{role:`planner`,label:`Planner`,glyph:`📋`,text:`${r(`planning`,`正在规划`)} ${W(G(e,`objective`),140)}`,tone:`accent`};if(n===`life.planner.verdict`)return G(e,`status`)===`done`||e.project_done===!0?{role:`planner`,label:`Planner`,glyph:`🏁`,text:r(`project done`,`项目已完成`),tone:`ok`}:{role:`planner`,label:`Planner`,glyph:`📋`,text:r(`queued ${G(e,`queued`)||G(e,`n`)||`next`} task(s)`,`已加入 ${G(e,`queued`)||G(e,`n`)||`下一`} 个任务`),tone:`accent`};if(n===`life.planner.task_added`)return{role:`planner`,label:`Planner`,glyph:`+`,text:`${r(`added`,`已添加`)} ${W(G(e,`title`)||G(e,`objective`),140)}`,tone:`accent`};if(n===`life.planner.task_skipped`)return{role:`planner`,label:`Planner`,glyph:`⏭`,text:`${r(`skipped duplicate`,`已跳过重复任务`)} ${W(G(e,`title`),120)}`,tone:`dim`};if(n===`life.planner.error`)return{role:`planner`,label:`Planner`,glyph:`⚠`,text:`${r(`planner error`,`Planner 错误`)} ${W(G(e,`error`)||G(e,`text`),140)}`,tone:`err`};if(n===`life.mission.started`||n===`mission.started`)return{role:`engineer`,label:`Engineer`,glyph:`🚀`,text:W(G(e,`title`)||G(e,`objective`)||G(e,`text`)||r(`mission started`,`任务已开始`),160),tone:`info`,rule:!0};if(n===`round.started`||n===`round.start`)return{role:`engineer`,label:`Engineer`,glyph:`──`,text:r(`round ${$n(e)}`,`第 ${$n(e)} 轮`),tone:`dim`,rule:!0};if(n===`life.phase.started`){let t=G(e,`label`)||G(e,`phase`);if(!t)return null;let n=G(e,`agent_layer`)||`engineer`;return{role:n,label:i(n),glyph:`🔄`,text:r(`entering ${t}`,`进入 ${t}`),tone:`info`}}if(n===`round.review.started`)return{role:`reviewer`,label:`Reviewer`,glyph:`🔄`,text:r(`review round ${$n(e)}`,`审核第 ${$n(e)} 轮`),tone:`info`};if(n===`round.review.deferred`)return{role:`engineer`,label:`Engineer`,glyph:`↪`,text:r(`continues before review · ${W(G(e,`next_step`),160)}`,`审核前继续执行 · ${W(G(e,`next_step`),160)}`),tone:`info`};if(n===`round.main.completed`)return{role:`engineer`,label:`Engineer`,glyph:`✅`,text:r(`round ${$n(e)} completed`,`第 ${$n(e)} 轮已完成`),tone:`info`};if(n===`round.review.completed`){let t=G(e,`status`),n=t===`done`?`ok`:t===`blocked`||t===`no_progress`?`err`:`warn`;return{role:`reviewer`,label:`Reviewer`,glyph:t===`done`?`✅`:t===`blocked`||t===`no_progress`?`⛔`:`↻`,text:`${t||`?`} · ${W(G(e,`reason`),160)}`,tone:n}}if(n===`life.iteration.critic`)return{role:`critic`,label:`Critic`,glyph:`👔`,text:`${G(e,`decision`)||``} ${W(G(e,`reason`),140)}`,tone:`info`};if(n===`life.iteration.continued`)return{role:`critic`,label:`Critic`,glyph:`🔁`,text:r(`queued next iteration`,`已加入下一轮迭代`),tone:`dim`};if(n===`life.mission.completed`||n===`mission.completed`||n===`loop.completed`){let t=un(e),n=W(G(e,`summary`),240);return{role:`engineer`,label:`Engineer`,glyph:t.glyph,text:n?`${t.label} · ${n}`:t.label,tone:t.tone,rule:!0}}if(n===`life.mission.failed`||n===`mission.error`)return{role:`engineer`,label:`Engineer`,glyph:`❌`,text:`${r(`mission failed`,`任务失败`)} ${W(G(e,`reason`)||G(e,`error`),140)}`,tone:`err`,rule:!0};if(n===`loop.start`)return{role:`engineer`,label:`Engineer`,glyph:`▶`,text:W(G(e,`text`)||G(e,`objective`),160),tone:`info`};if(n===`loop.done`)return{role:`engineer`,label:`Engineer`,glyph:`🏁`,text:`${r(`loop done`,`循环完成`)} ${W(G(e,`text`),120)}`,tone:`dim`};if(n===`life.inbox.queued`)return{role:`system`,label:r(`You`,`你`),glyph:`📥`,text:`${r(`nudge`,`追加指导`)} · ${W(G(e,`text`),160)}`,tone:`accent`};if(n===`final.report.ready`||n===`pptx.report.ready`)return{role:`system`,label:`Argus`,glyph:`📄`,text:r(`report ready`,`报告已就绪`),tone:`accent`};if(n===`plan.completed`)return{role:`planner`,label:`Planner`,glyph:`📋`,text:r(`plan completed`,`计划已完成`),tone:`accent`};if(n===`daemon.stopping`)return{role:`system`,label:r(`Daemon`,`守护进程`),glyph:`🛑`,text:r(`stopping`,`正在停止`),tone:`err`};if(n===`round.reviewer_backend_failure`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:r(`reviewer backend down — holding · ${W(G(e,`text`),150)}`,`Reviewer 后端不可用 — 已暂停 · ${W(G(e,`text`),150)}`),tone:`err`,rule:!0};if(n===`round.stall`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:W(G(e,`text`)||r(`no forward progress`,`没有取得进展`),170),tone:`warn`};if(n===`round.escalated`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:W(G(e,`text`)||r(`soft round limit — escalating external blockers`,`达到软轮次上限 — 正在升级外部阻塞`),170),tone:`warn`};if(n===`life.planner.stall_escalation`)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:`${r(`planner stalled`,`Planner 停滞`)} — ${W(G(e,`reason`)||G(e,`text`),150)}`,tone:`warn`};if(n===`life.budget.pause`)return{role:`system`,label:r(`Watch`,`监控`),glyph:`⏸`,text:r(`budget cap reached — paused · ${W(G(e,`text`)||G(e,`reason`),140)}`,`已达到预算上限 — 已暂停 · ${W(G(e,`text`)||G(e,`reason`),140)}`),tone:`warn`};if(n===`budget.reservation.denied`)return{role:`system`,label:r(`Budget`,`预算`),glyph:`$`,text:`${r(`budget denied`,`预算申请被拒绝`)} — ${W(G(e,`reason`)||G(e,`text`),150)}`,tone:`err`,rule:!0};if(n===`budget.unpriced.blocked`)return{role:`system`,label:r(`Budget`,`预算`),glyph:`$`,text:`${r(`budget blocked by unresolved cost`,`预算因成本未确定而阻塞`)} — ${W(G(e,`reason`)||G(e,`text`),150)}`,tone:`err`,rule:!0};if(n===`life.lifecycle.block`)return null;if(n===`life.daemon.idle_timeout`)return{role:`system`,label:r(`Watch`,`监控`),glyph:`🟦`,text:W(G(e,`text`)||r(`idle timeout — standing by`,`空闲超时 — 正在待命`),150),tone:`dim`};if(n===`round.watchdog.restart_requested`)return{role:`system`,label:r(`Watch`,`监控`),glyph:`🔄`,text:r(`stall caught — restarting the round · ${W(G(e,`reason`),160)}`,`检测到停滞 — 正在重启本轮 · ${W(G(e,`reason`),160)}`),tone:`warn`};if(n===`engineer.failure_nudge`)return{role:`engineer`,label:`Engineer`,glyph:`⚠`,text:`${r(`repeated tool failure`,`工具重复失败`)} — ${W(G(e,`text`)||G(e,`reason`),160)}`,tone:`warn`};if(n===`mission.idle`)return{role:`system`,label:`Argus`,glyph:`🟦`,text:W(G(e,`text`)||r(`idle — awaiting the next mission`,`空闲 — 正在等待下一个任务`),160),tone:`dim`};if(e.operator_alert===!0){let t=W(G(e,`text`)||G(e,`reason`)||n,170);if(t)return{role:`system`,label:r(`Notice`,`通知`),glyph:`!`,text:t,tone:`err`,rule:!0}}return null}function ir(e,t){return bt(e)}function ar(e,t,n){e.setQueryData([`snapshot`,t],e=>e&&{...e,session:{...e.session,display_name:n}}),e.setQueryData([`projects`],e=>e&&{...e,projects:e.projects.map(e=>e.id===t?{...e,display_name:n,label:n||e.objective||e.id}:e)})}var or=15e3,sr=5e3,cr=8e3,lr=1e4,ur=1e4;function dr(e,t){return!Ye(t)&&e<1}function fr(e){return!Ye(e)&&sr}var pr=()=>le({queryKey:[`projects`],queryFn:R.projectIndex,refetchInterval:or}),mr=()=>le({queryKey:[`project-costs`],queryFn:({signal:e})=>R.projectCosts(e),retry:dr,refetchInterval:e=>fr(e.state.error),refetchIntervalInBackground:!1}),hr=e=>le({queryKey:[`snapshot`,e],queryFn:({signal:t})=>R.activeSnapshot(e,t),enabled:!!e,refetchInterval:cr}),gr=(e,t=30,n=!0)=>le({queryKey:[`journal`,e,t],queryFn:({signal:n})=>R.journal(e,t,n),enabled:!!e&&n,refetchInterval:n?8e3:!1}),_r=(e,t)=>le({queryKey:[`doctor`,e],queryFn:({signal:t})=>R.doctor(e,t),enabled:!!e&&t}),vr=(e,t)=>le({queryKey:[`config`,e],queryFn:({signal:t})=>R.config(e,t),enabled:!!e&&t}),yr=(e,t)=>le({queryKey:[`identity`,e],queryFn:({signal:t})=>R.identity(e,t),enabled:!!e&&t}),br=(e,t,n=30)=>le({queryKey:[`transcript`,e,n],queryFn:({signal:t})=>R.transcript(e,n,t),enabled:!!e&&t}),xr=(e,t=!0)=>le({queryKey:[`artifacts`,e],queryFn:({signal:t})=>R.artifacts(e,t),enabled:!!e&&t,refetchInterval:t?lr:!1}),Sr=(e,t,n=null)=>le({queryKey:[`artifact`,e,t,n],queryFn:({signal:n})=>R.artifact(e,t,n),enabled:!!e&&!!t}),Cr=(e,t=!0)=>le({queryKey:[`git-diff`,e],queryFn:({signal:t})=>R.gitDiff(e,t),enabled:!!e&&t,refetchInterval:t?ur:!1}),wr=(e,t)=>le({queryKey:[`backlog-item`,e,t],queryFn:({signal:n})=>R.backlogItem(e,t,n),enabled:!!e&&!!t});function Tr(e,t){let n=se(),r=e=>{n.invalidateQueries({queryKey:[`snapshot`,e]}),n.invalidateQueries({queryKey:[`status`,e]}),n.invalidateQueries({queryKey:[`projects`]}),n.invalidateQueries({queryKey:[`backlog-item`,e]})},i=()=>r(e);return{addTask:j({mutationFn:t=>R.addTask(e,t),onSuccess:i}),nudge:j({mutationFn:t=>R.nudge(e,t)}),note:j({mutationFn:t=>R.note(e,t)}),startDaemon:j({mutationFn:()=>R.startDaemon(e,t),onSuccess:i}),stopDaemon:j({mutationFn:n=>R.stopDaemon(e,n,t),onSuccess:i}),updateProject:j({mutationFn:e=>R.updateProject(e.sid,e.name),onSuccess:e=>{ar(n,e.sid,e.name),r(e.sid)}}),deleteProject:j({mutationFn:()=>R.deleteProject(e),onSuccess:async()=>{let t=e;if(t){let e=e=>e.queryKey.some(e=>e===t);await n.cancelQueries({predicate:e}),n.removeQueries({predicate:e})}await n.invalidateQueries({queryKey:[`projects`]})}}),disposeBacklog:j({mutationFn:t=>R.disposeBacklog(e,t.id,t.op),onSuccess:i}),stopBacklog:j({mutationFn:t=>R.stopBacklog(e,t),onSuccess:i}),setContinuous:j({mutationFn:t=>R.setContinuous(e,t.enabled,t.objective??``),onSuccess:i})}}var Er=2e3;function Dr(e,t){if(t.kind===`reset`)return{sid:t.sid,events:[],seen:new Set};if(t.sid!==e.sid)return e;if(t.kind===`seed`){let n=new Set,r=[];[...t.events,...e.events].forEach((e,t)=>{let i=ir(e,t);n.has(i)||(n.add(i),r.push(e))});let i=r.slice(-2e3);return{sid:e.sid,events:i,seen:new Set(i.map((e,t)=>ir(e,t)))}}let n=ir(t.ev,e.events.length);if(e.seen.has(n))return e;let r=new Set(e.seen);r.add(n);let i=[...e.events,t.ev];return i.length>Er&&i.splice(0,i.length-Er).forEach((e,t)=>r.delete(ir(e,t))),{sid:e.sid,events:i,seen:r}}var Or=new Set([`manager.live_view.updated`,`round.review.completed`,`life.mission.completed`]);function kr(e){for(let t=e.length-1;t>=0;--t){let n=e[t],r=String(n.type??``);if(Or.has(r)||r===`engineer.progress`&&n.kind===`file_change`)return ir(n,t)}return``}var Ar=new Set([`life.operator_question.pending`,`life.operator_question.answered`]);function jr(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(Ar.has(String(n.type??``)))return ir(n,t)}return``}function Mr(e,t=0){let[n,r]=(0,M.useReducer)(Dr,{sid:null,events:[],seen:new Set}),[i,a]=(0,M.useState)({sid:null,connected:!1}),o=(0,M.useRef)(e);return o.current=e,(0,M.useEffect)(()=>{if(r({kind:`reset`,sid:e}),a({sid:e,connected:!1}),!e)return;let t=!1,n=new AbortController;R.events(e,120,n.signal).then(n=>{!t&&o.current===e&&r({kind:`seed`,sid:e,events:n})}).catch(()=>{});let i=ut(e,n=>{!t&&o.current===e&&r({kind:`push`,sid:e,ev:n})},{replay:40,onOpen:()=>{!t&&o.current===e&&a({sid:e,connected:!0})},onClose:()=>{!t&&o.current===e&&a({sid:e,connected:!1})}});return()=>{t=!0,n.abort(),i()}},[e,t]),{events:n.sid===e?n.events:[],connected:i.sid===e&&i.connected}}var K=i();function Nr(e){return!Number.isFinite(e)||e<=0?`$0.00`:e>=100?`$${e.toFixed(0)}`:e>=10?`$${e.toFixed(1)}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(3)}`}function Pr({settledUsd:e,knownUsd:t=0,status:n=`empty`}){let r=typeof e==`number`&&Number.isFinite(e)?e:t,i=n===`partial`||n===`unpriced`;return`${Nr(Math.max(0,r||0))}${i?`+`:``}`}function Fr({settledUsd:e,knownUsd:t,status:n,calls:r=0,premiumRequests:i=0,live:a=!1,compact:o=!1}){let s=Pr({settledUsd:e,knownUsd:t,status:n}),c=[`Cumulative settled project spend`,`${r} model call${r===1?``:`s`}`,i>0?`${i.toFixed(1)} premium requests`:``,n&&n!==`empty`?`pricing: ${n}`:``].filter(Boolean).join(` · `);return(0,K.jsxs)(`span`,{title:c,"aria-label":`Project spend ${s}`,className:`inline-flex shrink-0 items-center rounded-full border border-gold/25 bg-gold/8 font-mono tabular-nums text-gold ${o?`h-6 gap-1 px-2 text-[10px]`:`h-5 gap-1 px-1.5 text-[9px]`}`,children:[a?(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 animate-pulse rounded-full bg-gold/80`}):null,(0,K.jsx)(`span`,{children:s})]})}var Ir=`argus.locale`,Lr={"language.english":`English`,"handshake.connecting":`Connecting to Argus backend`,"splash.starting":`Argus starting`,"rail.workbench":`Workbench`,"rail.sessionsShortcut":`Sessions · Ctrl/⌘ P`,"panel.backlog":`Backlog`,"panel.activity":`Activity`,"panel.journal":`Journal`,"panel.roles":`Roles`,"panel.project":`Project`,"panel.liveView":`Manager live project view`,"stream.jumpToLatest":`Jump to latest`,"newDaemon.workdirPlaceholder":`Blank → ~/.argus-skill/workspaces/`,"operations.resetManager":`Reset Manager context`,"language.chinese":`中文`,"language.switchTo":`Switch to {language}`,"common.loading":`Loading…`,"common.retry":`Retry`,"common.save":`Save`,"common.cancel":`Cancel`,"common.close":`Close`,"common.settings":`Settings`,"common.ready":`Ready`,"common.live":`Live`,"common.reconnecting":`Reconnecting`,"common.stale":`Snapshot stale`,"common.degraded":`Snapshot degraded`,"common.external":`External`,"common.pause":`Pause`,"common.run":`Run`,"common.local":`Local`,"common.all":`All`,"common.unassigned":`Unassigned`,"common.closeSessions":`Close sessions`,"common.resizeSessions":`Resize sessions`,"common.resizePreview":`Resize preview`,"common.expandPreview":`Expand preview`,"connection.pairingTitle":`This browser is not paired with Argus`,"connection.pairingDetail":`Close this tab and reopen the workbench from Argus Desktop, or open a fresh pairing link.`,"connection.unreachableTitle":`The local Argus service is unavailable`,"connection.unreachableDetail":`Keep Argus Desktop running and wait for the local backend to become ready, then retry.`,"sidebar.collapse":`Collapse sessions`,"sidebar.expand":`Expand sessions`,"sidebar.create":`Create session`,"sidebar.find":`Find a session`,"sidebar.clearSearch":`Clear search`,"sidebar.refreshFailed":`Refresh failed · retry`,"sidebar.noSessions":`No sessions`,"sidebar.daemonAlive":`daemon alive`,"sidebar.stopped":`stopped`,"sidebar.runningFor":`running · {uptime}`,"sidebar.manage":`Manage {name}`,"sidebar.manageHint":`Rename, pause, or delete`,"sidebar.openSettings":`Open settings`,"sidebar.theme":`{current} theme; switch to {next}`,"landing.selectOrCreate":`Select a session from the sidebar, or create a new one.`,"landing.noSessions":`No sessions yet. Create one to begin.`,"landing.select":`Select session`,"landing.new":`New session`,"topbar.openSessions":`Open sessions`,"topbar.externallyManaged":`Externally managed`,"topbar.pauseDaemon":`Pause daemon`,"topbar.runDaemon":`Run daemon`,"topbar.externalDaemonHint":`Daemon is live in an external PID namespace; use its supervisor to control it.`,"topbar.manageSession":`Manage session`,"topbar.showPreview":`Show preview`,"topbar.showActivity":`Show activity`,"mobile.views":`Views`,"mobile.sessions":`Sessions`,"mobile.mission":`Mission`,"mobile.activity":`Activity`,"mobile.workbench":`Workbench`,"mobile.preview":`Preview`,"chat.yourMessage":`Your message`,"chat.stopWaitingHint":`Esc stop waiting`,"chat.messageArgus":`message Argus`,"chat.selectSession":`Select a session…`,"chat.placeholder":`Ask a question or assign work`,"chat.attach":`attach files`,"chat.attachHint":`PNG, JPEG, WebP, PDF, Markdown/text, JSON, CSV · up to {count} files, {perFile} each, {total} total`,"chat.attachDrop":`Drop files to attach`,"chat.attachRemove":`remove attachment {name}`,"chat.attachUnsupported":`{name} is not supported. Use PNG, JPEG, WebP, PDF, Markdown/text, JSON, or CSV.`,"chat.attachTooLarge":`{name} exceeds the {size} per-file limit.`,"chat.attachTooMany":`You can attach up to {count} files per message.`,"chat.attachTotalTooLarge":`Attachments exceed the {size} total limit.`,"chat.attachmentUploadFailed":`Attachment upload failed: {error}`,"chat.uploadingAttachments":`Uploading attachments`,"chat.rewriteHint":`Let the Manager rewrite this prompt into a brief the team can act on. Nothing is sent — the rewrite lands back in this box for you to edit.`,"chat.rewriteLabel":`rewrite prompt with the Manager`,"chat.rewriting":`rewriting`,"chat.rewrite":`✦ Rewrite`,"chat.stopWaiting":`stop waiting`,"chat.stopWaitingTitle":`stop waiting for this reply; server-side work may continue`,"chat.send":`send message`,"copy.message":`Copy`,"copy.code":`Copy code`,"copy.copied":`Copied`,"help.title":`Keyboard shortcuts`,"help.commands":`Commands`,"help.palette":`command palette`,"help.sessions":`toggle sessions`,"help.managerChat":`focus Manager chat`,"help.rewrite":`rewrite the current prompt before sending`,"help.reasoning":`toggle agent reasoning`,"help.kiosk":`toggle kiosk (read-only) mode`,"help.composer":`focus the composer`,"help.send":`send message`,"help.newline":`insert newline`,"help.thisHelp":`this help`,"help.escape":`close overlay / stop waiting in composer`,"palette.placeholder":`Type a command or search…`,"palette.noMatches":`no matching commands`,"palette.navigate":`↑↓ navigate`,"palette.run":`↵ run`,"palette.close":`esc close`,"palette.view":`View`,"palette.action":`Action`,"palette.project":`Project`,"palette.newDaemon":`New daemon`,"palette.openTranscript":`Open Transcript`,"palette.openProject":`Open Project`,"palette.projectHint":`work · memory · agents`,"palette.openOperations":`Open Operations`,"palette.operationsHint":`backend controls`,"palette.hideReasoning":`Hide reasoning`,"palette.showReasoning":`Show reasoning`,"palette.exitKiosk":`Exit kiosk mode`,"palette.enterKiosk":`Enter kiosk mode`,"palette.messageArgus":`Message Argus…`,"palette.stopWaiting":`Stop waiting for Manager reply`,"palette.stopContinuous":`Stop continuous campaign`,"palette.startContinuous":`Start continuous campaign`,"palette.stopDaemon":`Stop daemon`,"palette.startDaemon":`Start daemon`,"slash.suggestions":`Slash command suggestions`,"mission.roleActive":`{role} active`,"mission.overview":`mission overview`,"mission.operations":`Operations`,"role.manager":`Manager`,"role.planner":`Planner`,"role.engineer":`Engineer`,"role.reviewer":`Reviewer`,"role.critic":`Critic`,"role.system":`Argus`,"role.operator":`You`,"doctor.title":`Doctor`,"doctor.subtitle":`daemon health checks + recommended root-cause fix`,"doctor.recommended":`recommended fix`,"settings.subtitle":`effective roles, budgets, and essential controls`,"settings.connection":`Connection`,"settings.webApi":`Web + REST API`,"settings.eventStream":`Event stream`,"settings.taskDaemon":`Task daemon`,"settings.budgetTitle":`Budget and quota limits`,"settings.budgetHint":`Set 0 for an uncapped provider-call limit where supported.`,"settings.saveBudgets":`Save budget limits`,"settings.budget.global":`Host-global daily`,"settings.budget.codex":`Codex calls / day`,"settings.budget.copilot":`Copilot calls / day`,"settings.budget.premium":`Copilot premium / day`,"settings.required":`{field} is required`,"settings.budgetSaved":`Budget limits saved. Restart running daemons to reload their process caps.`,"settings.advanced":`Advanced setting`,"settings.namePlaceholder":`name or alias, e.g. manager_model`,"settings.valuePlaceholder":`value`,"settings.applyAdvanced":`Apply advanced setting`,"settings.applied":`Applied. Restart affected daemons to reload process-scoped settings.`,"settings.footer":`Role overrides are summarized above. Use Advanced setting for a specific override; the full registry remains available via`,"identity.title":`Identity`,"identity.subtitle":`who argus is working for on this project`,"identity.placeholder":`Describe who Argus is working for and durable preferences…`,"identity.save":`Save identity`,"identity.saved":`Identity saved.`,"transcript.title":`Transcript`,"transcript.subtitle":`recent operator ↔ argus turns · reply from the composer`,"transcript.empty":`no conversation turns yet`,"transcript.operator":`operator`,"new.createDaemon":`Create daemon`,"new.subtitle":`Creates an isolated timeline and Manager context.`,"new.close":`close create daemon`,"new.name":`Name`,"new.optional":`(optional)`,"new.namePlaceholder":`e.g. AAAI embodiment paper`,"new.workdir":`Output workdir`,"new.workdirHint":`Agents write code, papers, reports, and experiment outputs here. Internal memory stays under the session state directory.`,"new.objective":`Objective`,"new.objectivePlaceholder":`Leave blank to start with a conversation, or describe a campaign to start immediately.`,"new.startsAfterCreate":`Campaign starts after session creation`,"new.idleUntilMessage":`Idle until the first message`,"new.startsHint":`The session opens immediately; Manager handoff and executor startup continue in the background.`,"new.idleHint":`No executor is spawned yet. The Manager will reply or dispatch work from your first message.`,"new.shortcut":`Ctrl/⌘+Enter to create`,"new.creating":`Creating…`,"new.createAndStart":`Create and start`,"manage.daemon":`Manage daemon`,"manage.displayName":`Display name`,"manage.executor":`Executor`,"manage.running":`Running`,"manage.runningExternally":`Running externally`,"manage.paused":`Paused`,"manage.pauseHint":`Interrupt the current operation and keep progress resumable.`,"manage.externalHint":`This daemon is supervised outside the Web host PID namespace.`,"manage.resumeHint":`Resume queued research work.`,"manage.working":`Working…`,"manage.resume":`Resume`,"manage.deleteSession":`Delete session`,"manage.deleteHint":`Deleted sessions move to projects_trash and remain recoverable. Pause the executor first.`,"manage.delete":`Delete…`,"manage.confirmQuestion":`Move this session to trash?`,"manage.confirmDelete":`Confirm delete`,"decision.operator":`Operator decision`,"decision.required":`Decision required`,"decision.whyBlocked":`Why work is blocked`,"decision.evidence":`Evidence`,"decision.notePlaceholder":`Add the guidance the Manager should apply…`,"decision.resumeHint":`The Manager applies your choice before work resumes.`,"decision.later":`Later`,"decision.applying":`Applying…`,"decision.stopCampaign":`Stop campaign`,"decision.useOption":`Use this option`,"decision.sendAnswer":`Send answer`,"decision.noteRequired":`Add the required details before sending this choice.`,"artifact.preview":`Artifact preview`,"artifact.title":`Artifact`,"artifact.approvedEvidence":`reviewer-approved evidence`,"artifact.downloading":`Downloading…`,"artifact.download":`Download`,"artifact.open":`Open`,"artifact.close":`close artifact preview`,"artifact.unavailable":`preview unavailable`,"artifact.empty":`(empty file)`,"artifact.truncated":`preview truncated · download to inspect the complete file`,"artifact.htmlTooLarge":`HTML preview is too large to render safely. Download the complete file.`,"artifact.pdfDisabled":`Inline PDF preview is disabled by this browser.`,"artifact.openPdf":`Open PDF`,"artifact.noPreview":`This file type has no safe inline preview.`,"artifact.downloadHint":`Download it to inspect with a local application.`,"task.details":`Task details`,"task.stopLoop":`stop loop`,"task.done":`done`,"task.skip":`skip`,"task.close":`close task details`,"task.waitingOnYou":`Waiting on you`,"task.objective":`Objective`,"task.noObjective":`(no objective recorded)`,"task.priority":`priority`,"task.started":`started`,"task.finished":`finished`,"task.outcome":`Outcome`,"task.iteration":`Iteration`,"task.mode":`mode`,"task.autoIterate":`auto-iterate`,"task.singlePass":`single pass`,"task.cycles":`cycles`,"task.cost":`cost`,"task.lastError":`Last error`,"task.notes":`Notes`,"task.dependsOn":`depends on`,"mission.achievement":`Argus achievement`,"mission.elapsed":`Elapsed`,"mission.rejectedAttempts":`{count} rejected attempts`,"mission.skillsLearned":`{count} skills learned`,"mission.artifacts":`{count} artifacts`,"mission.waiting":`Waiting for a mission`,"mission.control":`Mission control`,"mission.showObjective":`Show full objective`,"mission.stage":`Stage`,"mission.campaign":`Campaign`,"mission.totalElapsed":`Total elapsed`,"mission.round":`Round`,"mission.mode":`Mode`,"mission.summary":`Mission summary`,"mission.team":`AI research team`,"mission.waitingShort":`Waiting`,"mission.roleWork":`Role work`,"mission.filteredBy":`filtered by {task} · clear`,"mission.allVisible":`all visible missions`,"mission.roundNumber":`round {count}`,"mission.noRoleWork":`No persisted {role} work for this selection yet.`,"mission.researchDag":`Research DAG`,"mission.active":`active`,"mission.noDag":`Planner has not added DAG nodes yet.`,"mission.acceptance":`Acceptance`,"mission.nonGoals":`Non-goals`,"mission.capabilities":`Capabilities`,"mission.capabilitiesUnlocked":`Capabilities unlocked`,"mission.skillUnavailable":`Skill content is not available in this snapshot.`,"mission.knowledgeRetained":`Knowledge retained`,"mission.selfEvolution":`Self-evolution storage`,"mission.replay":`Mission replay`,"mission.replayTimeline":`Replay mission timeline`,"mission.waitingEvents":`Waiting for structured research events.`,"research.currentWork":`Current work`,"research.dagProgress":`DAG progress`,"research.verifiedOutputs":`Verified outputs`,"research.recentMilestones":`Recent milestones`,"research.liveProgress":`Live progress`,"research.artifact":`Research artifact`,"research.canvas":`Manager live research canvas`,"research.previewArtifact":`Preview artifact`,"research.openLarge":`Open large preview`,"research.collapse":`Collapse preview`,"research.unavailable":`Manager live view is temporarily unavailable.`,"research.noPreview":`No preview`,"research.waiting":`Waiting…`,"research.updating":`Updating…`,"research.fileUnavailable":`Preview unavailable for this file.`,"research.eventSourced":`event-sourced mission state`,"research.downloadFailed":`download failed`,"operations.title":`Operations`,"operations.work":`Work`,"operations.runtime":`Runtime`,"operations.system":`System`,"operations.recovery":`Recovery`,"operations.workInput":`Work input`,"operations.workHint":`Queue work, guide the active task, save a note, or preview a plan without dispatching it.`,"operations.planPlaceholder":`Objective to preview; preview never queues work`,"operations.actionPlaceholder":`{action} text`,"operations.previewPlan":`Preview plan`,"operations.submitAction":`Submit {action}`,"operations.runtimeHint":`Change where this session runs, reset Manager context, or safely reload the daemon.`,"operations.workdir":`Working directory`,"operations.workdirUpdated":`Working directory updated.`,"operations.applyWorkdir":`Apply working directory`,"operations.replaceSlot":`Replace a running daemon slot`,"operations.skills":`Skills`,"operations.runSkill":`Run skill command`,"operations.metrics":`System metrics`,"operations.trash":`Recoverable trash`,"operations.searchTrash":`Search trash`,"operations.trashEmpty":`Trash is empty.`},Rr={"language.english":`English`,"handshake.connecting":`正在连接 Argus 后端`,"splash.starting":`Argus 启动中`,"rail.workbench":`工作台`,"rail.sessionsShortcut":`会话 · Ctrl/⌘ P`,"panel.backlog":`待办`,"panel.activity":`动态`,"panel.journal":`日志`,"panel.roles":`角色`,"panel.project":`项目`,"panel.liveView":`Manager 实时项目视图`,"stream.jumpToLatest":`跳到最新`,"newDaemon.workdirPlaceholder":`留空 → ~/.argus-skill/workspaces/`,"operations.resetManager":`重置 Manager 上下文`,"language.chinese":`中文`,"language.switchTo":`切换到{language}`,"common.loading":`加载中…`,"common.retry":`重试`,"common.save":`保存`,"common.cancel":`取消`,"common.close":`关闭`,"common.settings":`设置`,"common.ready":`就绪`,"common.live":`实时`,"common.reconnecting":`正在重连`,"common.stale":`快照已过期`,"common.degraded":`快照异常`,"common.external":`外部`,"common.pause":`暂停`,"common.run":`运行`,"common.local":`本地`,"common.all":`全部`,"common.unassigned":`未分配`,"common.closeSessions":`关闭会话列表`,"common.resizeSessions":`调整会话列表宽度`,"common.resizePreview":`调整预览区域宽度`,"common.expandPreview":`展开预览`,"connection.pairingTitle":`此浏览器尚未与 Argus 配对`,"connection.pairingDetail":`请关闭此标签页,然后从 Argus Desktop 重新打开工作台,或使用新的配对链接。`,"connection.unreachableTitle":`Argus 本地服务当前不可达`,"connection.unreachableDetail":`请保持 Argus Desktop 运行,等待本地后端就绪后再重试。`,"sidebar.collapse":`收起会话`,"sidebar.expand":`展开会话`,"sidebar.create":`创建会话`,"sidebar.find":`查找会话`,"sidebar.clearSearch":`清除搜索`,"sidebar.refreshFailed":`刷新失败 · 重试`,"sidebar.noSessions":`暂无会话`,"sidebar.daemonAlive":`守护进程运行中`,"sidebar.stopped":`已停止`,"sidebar.runningFor":`运行中 · {uptime}`,"sidebar.manage":`管理 {name}`,"sidebar.manageHint":`重命名、暂停或删除`,"sidebar.openSettings":`打开设置`,"sidebar.theme":`{current}主题;切换到{next}主题`,"landing.selectOrCreate":`从侧边栏选择一个会话,或创建新会话。`,"landing.noSessions":`还没有会话。创建一个即可开始。`,"landing.select":`选择会话`,"landing.new":`新建会话`,"topbar.openSessions":`打开会话列表`,"topbar.externallyManaged":`由外部管理`,"topbar.pauseDaemon":`暂停守护进程`,"topbar.runDaemon":`运行守护进程`,"topbar.externalDaemonHint":`守护进程位于外部 PID 命名空间中;请使用其 supervisor 进行控制。`,"topbar.manageSession":`管理会话`,"topbar.showPreview":`显示预览`,"topbar.showActivity":`显示动态`,"mobile.views":`视图`,"mobile.sessions":`会话`,"mobile.mission":`任务`,"mobile.activity":`动态`,"mobile.workbench":`工作台`,"mobile.preview":`预览`,"chat.yourMessage":`你的消息`,"chat.stopWaitingHint":`按 Esc 停止等待`,"chat.messageArgus":`向 Argus 发送消息`,"chat.selectSession":`请选择会话…`,"chat.placeholder":`提问或安排工作`,"chat.attach":`添加文件`,"chat.attachHint":`支持 PNG、JPEG、WebP、PDF、Markdown/文本、JSON、CSV · 每条消息最多 {count} 个文件,单个 {perFile},总计 {total}`,"chat.attachDrop":`拖放文件以添加附件`,"chat.attachRemove":`移除附件 {name}`,"chat.attachUnsupported":`{name} 不受支持。请使用 PNG、JPEG、WebP、PDF、Markdown/文本、JSON 或 CSV。`,"chat.attachTooLarge":`{name} 超过单文件大小限制 {size}。`,"chat.attachTooMany":`每条消息最多只能附带 {count} 个文件。`,"chat.attachTotalTooLarge":`附件总大小超过 {size} 限制。`,"chat.attachmentUploadFailed":`附件上传失败:{error}`,"chat.uploadingAttachments":`正在上传附件`,"chat.rewriteHint":`让 Manager 将提示词改写为团队可执行的任务说明。不会直接发送,改写结果会回到输入框供你编辑。`,"chat.rewriteLabel":`使用 Manager 改写提示词`,"chat.rewriting":`正在改写`,"chat.rewrite":`✦ 改写`,"chat.stopWaiting":`停止等待`,"chat.stopWaitingTitle":`停止等待此回复;服务端工作可能仍会继续`,"chat.send":`发送消息`,"copy.message":`复制`,"copy.code":`复制代码`,"copy.copied":`已复制`,"help.title":`键盘快捷键`,"help.commands":`命令`,"help.palette":`打开命令面板`,"help.sessions":`展开或收起会话`,"help.managerChat":`聚焦 Manager 对话框`,"help.rewrite":`发送前改写当前提示词`,"help.reasoning":`显示或隐藏 Agent 推理`,"help.kiosk":`切换只读展示模式`,"help.composer":`聚焦输入框`,"help.send":`发送消息`,"help.newline":`插入换行`,"help.thisHelp":`打开此帮助`,"help.escape":`关闭浮层或停止等待`,"palette.placeholder":`输入命令或搜索…`,"palette.noMatches":`没有匹配的命令`,"palette.navigate":`↑↓ 导航`,"palette.run":`↵ 执行`,"palette.close":`Esc 关闭`,"palette.view":`视图`,"palette.action":`操作`,"palette.project":`项目`,"palette.newDaemon":`新建守护进程`,"palette.openTranscript":`打开对话记录`,"palette.openProject":`打开项目`,"palette.projectHint":`工作 · 记忆 · Agent`,"palette.openOperations":`打开运行控制`,"palette.operationsHint":`后端控制`,"palette.hideReasoning":`隐藏推理`,"palette.showReasoning":`显示推理`,"palette.exitKiosk":`退出展示模式`,"palette.enterKiosk":`进入展示模式`,"palette.messageArgus":`向 Argus 发送消息…`,"palette.stopWaiting":`停止等待 Manager 回复`,"palette.stopContinuous":`停止持续任务`,"palette.startContinuous":`启动持续任务`,"palette.stopDaemon":`停止守护进程`,"palette.startDaemon":`启动守护进程`,"slash.suggestions":`Slash 命令建议`,"mission.roleActive":`{role} 正在工作`,"mission.overview":`任务概览`,"mission.operations":`运行控制`,"role.manager":`Manager`,"role.planner":`Planner`,"role.engineer":`Engineer`,"role.reviewer":`Reviewer`,"role.critic":`Critic`,"role.system":`Argus`,"role.operator":`你`,"doctor.title":`诊断`,"doctor.subtitle":`守护进程健康检查与推荐的根因修复方案`,"doctor.recommended":`推荐修复`,"settings.subtitle":`生效中的角色、预算和关键控制项`,"settings.connection":`连接`,"settings.webApi":`Web + REST API`,"settings.eventStream":`事件流`,"settings.taskDaemon":`任务守护进程`,"settings.budgetTitle":`预算和配额限制`,"settings.budgetHint":`支持时,将调用限制设为 0 表示不设上限。`,"settings.saveBudgets":`保存预算限制`,"settings.budget.global":`主机全局每日预算`,"settings.budget.codex":`Codex 每日调用`,"settings.budget.copilot":`Copilot 每日调用`,"settings.budget.premium":`Copilot 每日 Premium 请求`,"settings.required":`必须填写{field}`,"settings.budgetSaved":`预算限制已保存。请重启正在运行的守护进程以重新加载进程级限制。`,"settings.advanced":`高级设置`,"settings.namePlaceholder":`名称或别名,例如 manager_model`,"settings.valuePlaceholder":`值`,"settings.applyAdvanced":`应用高级设置`,"settings.applied":`设置已应用。请重启受影响的守护进程以重新加载进程级设置。`,"settings.footer":`上方汇总了角色覆盖配置。可使用“高级设置”指定覆盖项;完整配置仍可通过以下命令查看:`,"identity.title":`身份`,"identity.subtitle":`本项目中 Argus 服务的对象`,"identity.placeholder":`描述 Argus 正在为谁工作,以及需要长期遵循的偏好…`,"identity.save":`保存身份`,"identity.saved":`身份已保存。`,"transcript.title":`对话记录`,"transcript.subtitle":`近期操作者 ↔ Argus 对话 · 请从输入框继续回复`,"transcript.empty":`暂无对话记录`,"transcript.operator":`操作者`,"new.createDaemon":`创建守护进程`,"new.subtitle":`创建隔离的时间线和 Manager 上下文。`,"new.close":`关闭创建会话窗口`,"new.name":`名称`,"new.optional":`(可选)`,"new.namePlaceholder":`例如:AAAI 具身智能论文`,"new.workdir":`输出工作目录`,"new.workdirHint":`Agent 会在这里写入代码、论文、报告和实验结果。内部记忆仍保存在会话状态目录中。`,"new.objective":`目标`,"new.objectivePlaceholder":`留空则从对话开始,也可以填写一个立即启动的持续任务。`,"new.startsAfterCreate":`创建会话后立即启动任务`,"new.idleUntilMessage":`收到第一条消息前保持空闲`,"new.startsHint":`会话会立即打开;Manager 交接和执行器启动将在后台继续。`,"new.idleHint":`暂时不会启动执行器。Manager 会在收到第一条消息后回复或分派工作。`,"new.shortcut":`按 Ctrl/⌘+Enter 创建`,"new.creating":`正在创建…`,"new.createAndStart":`创建并启动`,"manage.daemon":`管理守护进程`,"manage.displayName":`显示名称`,"manage.executor":`执行器`,"manage.running":`运行中`,"manage.runningExternally":`由外部运行`,"manage.paused":`已暂停`,"manage.pauseHint":`中断当前操作并保留可恢复的进度。`,"manage.externalHint":`此守护进程由 Web 主机 PID 命名空间之外的 supervisor 管理。`,"manage.resumeHint":`继续执行队列中的研究工作。`,"manage.working":`处理中…`,"manage.resume":`继续`,"manage.deleteSession":`删除会话`,"manage.deleteHint":`删除的会话会移入 projects_trash,之后仍可恢复。请先暂停执行器。`,"manage.delete":`删除…`,"manage.confirmQuestion":`将此会话移入回收站?`,"manage.confirmDelete":`确认删除`,"decision.operator":`操作者决策`,"decision.required":`需要你的决策`,"decision.whyBlocked":`工作被阻塞的原因`,"decision.evidence":`证据`,"decision.notePlaceholder":`添加 Manager 应采用的指导…`,"decision.resumeHint":`Manager 会在恢复工作前应用你的选择。`,"decision.later":`稍后处理`,"decision.applying":`正在应用…`,"decision.stopCampaign":`停止持续任务`,"decision.useOption":`使用此选项`,"decision.sendAnswer":`发送回答`,"decision.noteRequired":`这个选项需要补充说明后才能提交。`,"artifact.preview":`产物预览`,"artifact.title":`产物`,"artifact.approvedEvidence":`Reviewer 批准的证据`,"artifact.downloading":`正在下载…`,"artifact.download":`下载`,"artifact.open":`打开`,"artifact.close":`关闭产物预览`,"artifact.unavailable":`无法预览`,"artifact.empty":`(空文件)`,"artifact.truncated":`预览已截断 · 请下载完整文件查看`,"artifact.htmlTooLarge":`HTML 文件过大,无法安全预览。请下载完整文件。`,"artifact.pdfDisabled":`此浏览器已禁用内嵌 PDF 预览。`,"artifact.openPdf":`打开 PDF`,"artifact.noPreview":`此文件类型无法安全地在线预览。`,"artifact.downloadHint":`请下载后使用本地应用查看。`,"task.details":`任务详情`,"task.stopLoop":`停止循环`,"task.done":`完成`,"task.skip":`跳过`,"task.close":`关闭任务详情`,"task.waitingOnYou":`等待你的回复`,"task.objective":`目标`,"task.noObjective":`(未记录目标)`,"task.priority":`优先级`,"task.started":`开始时间`,"task.finished":`完成时间`,"task.outcome":`结果`,"task.iteration":`迭代`,"task.mode":`模式`,"task.autoIterate":`自动迭代`,"task.singlePass":`单次执行`,"task.cycles":`轮次`,"task.cost":`成本`,"task.lastError":`最近错误`,"task.notes":`备注`,"task.dependsOn":`依赖`,"mission.achievement":`Argus 成果`,"mission.elapsed":`耗时`,"mission.rejectedAttempts":`{count} 次方案被拒绝`,"mission.skillsLearned":`学习了 {count} 个 Skill`,"mission.artifacts":`{count} 个产物`,"mission.waiting":`等待任务`,"mission.control":`任务控制`,"mission.showObjective":`显示完整目标`,"mission.stage":`阶段`,"mission.campaign":`持续任务`,"mission.totalElapsed":`总耗时`,"mission.round":`轮次`,"mission.mode":`模式`,"mission.summary":`本次完成`,"mission.team":`AI 研究团队`,"mission.waitingShort":`等待中`,"mission.roleWork":`角色工作`,"mission.filteredBy":`按 {task} 筛选 · 清除`,"mission.allVisible":`全部可见任务`,"mission.roundNumber":`第 {count} 轮`,"mission.noRoleWork":`当前筛选下还没有持久化的 {role} 工作记录。`,"mission.researchDag":`研究 DAG`,"mission.active":`进行中`,"mission.noDag":`Planner 尚未添加 DAG 节点。`,"mission.acceptance":`验收标准`,"mission.nonGoals":`非目标`,"mission.capabilities":`能力`,"mission.capabilitiesUnlocked":`已解锁能力`,"mission.skillUnavailable":`当前快照中没有此 Skill 的内容。`,"mission.knowledgeRetained":`已保留知识`,"mission.selfEvolution":`自进化存储`,"mission.replay":`任务回放`,"mission.replayTimeline":`回放任务时间线`,"mission.waitingEvents":`等待结构化研究事件。`,"research.currentWork":`当前工作`,"research.dagProgress":`DAG 进度`,"research.verifiedOutputs":`已验证输出`,"research.recentMilestones":`近期里程碑`,"research.liveProgress":`实时进度`,"research.artifact":`研究产物`,"research.canvas":`Manager 实时研究面板`,"research.previewArtifact":`预览产物`,"research.openLarge":`打开大尺寸预览`,"research.collapse":`收起预览`,"research.unavailable":`Manager 实时视图暂时不可用。`,"research.noPreview":`暂无预览`,"research.waiting":`等待中…`,"research.updating":`正在更新…`,"research.fileUnavailable":`此文件无法预览。`,"research.eventSourced":`基于事件的任务状态`,"research.downloadFailed":`下载失败`,"operations.title":`运行控制`,"operations.work":`工作`,"operations.runtime":`运行时`,"operations.system":`系统`,"operations.recovery":`恢复`,"operations.workInput":`工作输入`,"operations.workHint":`加入工作、指导当前任务、保存备注,或仅预览计划而不分派。`,"operations.planPlaceholder":`要预览的目标;预览不会加入任务队列`,"operations.actionPlaceholder":`输入 {action} 内容`,"operations.previewPlan":`预览计划`,"operations.submitAction":`提交 {action}`,"operations.runtimeHint":`更改会话运行位置、重置 Manager 上下文,或安全重载守护进程。`,"operations.workdir":`工作目录`,"operations.workdirUpdated":`工作目录已更新。`,"operations.applyWorkdir":`应用工作目录`,"operations.replaceSlot":`替换正在运行的守护进程槽位`,"operations.skills":`Skills`,"operations.runSkill":`运行 Skill 命令`,"operations.metrics":`系统指标`,"operations.trash":`可恢复的回收站`,"operations.searchTrash":`搜索回收站`,"operations.trashEmpty":`回收站为空。`};function zr(){try{let e=localStorage.getItem(Ir);if(e===`en`||e===`zh-CN`)return e}catch{}return navigator.language.toLowerCase().startsWith(`zh`)?`zh-CN`:`en`}function Br(e,t={},n=zr()){return((n===`zh-CN`?Rr[e]:Lr[e])??e).replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??`{${n}}`))}var Vr=(0,M.createContext)({locale:`en`,setLocale:()=>void 0,t:(e,t)=>Br(e,t,`en`)});function Hr({children:e}){let[t,n]=(0,M.useState)(zr),r=e=>{try{localStorage.setItem(Ir,e)}catch{}n(e)};(0,M.useEffect)(()=>{document.documentElement.lang=t},[t]);let i=(0,M.useMemo)(()=>({locale:t,setLocale:r,t:(e,n)=>Br(e,n,t)}),[t]);return(0,K.jsx)(Vr.Provider,{value:i,children:e})}function q(){return(0,M.useContext)(Vr)}var Ur=new Set([`running`,`in_progress`,`claimed`]);function Wr(e){return e.find(e=>e.active)??e.find(e=>e.role===`manager`)}function Gr({snap:e,streamOk:t,onStart:n,onStop:r,onManage:i,onOpenSessions:a,mobileView:s,onToggleMobileView:c,busy:u,snapshotStale:d=!1,readOnly:f=!1,missionView:p}){let{t:m}=q(),h=Wr(e.roles),g=p?.roles.find(e=>e.role===p.active_role),_=g?.role||h?.role||`manager`,v=g?g.status===`active`:!!h?.active,y=e.backlog.find(e=>Ur.has(e.status)),b=g?.label||y?.title||y?.objective||e.session.objective||m(`common.ready`),x=!!(e.partial||e.observability?.slo.status===`degraded`),S=e.daemon.alive&&e.daemon.control_available===!1,C=S?m(`topbar.externallyManaged`):e.daemon.alive?m(`topbar.pauseDaemon`):m(`topbar.runDaemon`),w=x?[...(e.diagnostics??[]).map(e=>`${e.section}: ${e.message}`),...e.observability?.slo.violations??[]].join(` +`)||m(`common.degraded`):m(d?`common.stale`:t?`common.live`:`common.reconnecting`);return(0,K.jsxs)(`header`,{className:`glass-panel glass-panel--raised flex h-12 min-w-0 shrink-0 items-center gap-2 border-b px-3 sm:gap-3 sm:px-4`,children:[a?(0,K.jsx)(`button`,{type:`button`,onClick:a,"aria-label":m(`topbar.openSessions`),className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ink-faint hover:bg-bg hover:text-ink lg:hidden`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:(0,K.jsx)(`path`,{d:`M2.5 4h11M2.5 8h11M2.5 12h11`})})}):null,(0,K.jsx)(`div`,{className:`hidden min-w-0 max-w-28 truncate text-sm font-semibold text-ink sm:block`,children:e.session.display_name||e.session.id}),(0,K.jsx)(`span`,{className:`hidden h-4 w-px shrink-0 bg-line/40 sm:block`}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${v?`animate-pulse`:``}`,style:{background:z.role[_]||`rgb(var(--ink-faint))`}}),(0,K.jsx)(`span`,{className:`hidden shrink-0 text-xs font-semibold capitalize text-ink-dim sm:inline`,children:_}),(0,K.jsx)(`span`,{className:`truncate text-xs text-ink-faint`,children:b})]}),(0,K.jsx)(`span`,{title:w,className:`h-2 w-2 shrink-0 rounded-full transition-shadow duration-150 ${x||d?`bg-err ring-1 ring-err/30 ring-offset-1 ring-offset-panel`:t?`bg-ok ring-1 ring-ok/30 ring-offset-1 ring-offset-panel`:`bg-ink-faint/50`}`}),(0,K.jsx)(Fr,{settledUsd:e.spend_usd,knownUsd:e.usage_summary?.known_cost_usd,status:e.spend_status,calls:e.usage_summary?.call_count,premiumRequests:e.usage_summary?.premium_requests,live:e.daemon.alive,compact:!0}),c?(0,K.jsx)(`button`,{type:`button`,onClick:c,"aria-label":m(s===`activity`?`topbar.showPreview`:`topbar.showActivity`),title:m(s===`activity`?`topbar.showPreview`:`topbar.showActivity`),className:`icon-control flex h-8 w-8 shrink-0 items-center justify-center lg:hidden`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:s===`activity`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`rect`,{x:`2`,y:`2.5`,width:`12`,height:`11`,rx:`1.5`}),(0,K.jsx)(`path`,{d:`M9.5 2.75v10.5`})]}):(0,K.jsx)(`path`,{d:`M3 4h10M3 8h10M3 12h7`})})}):null,f?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{type:`button`,disabled:u||S,onClick:e.daemon.alive?r:n,"aria-label":C,title:S?m(`topbar.externalDaemonHint`):C,className:`compact-control flex h-8 shrink-0 items-center gap-1 px-2 disabled:opacity-40`,children:[(0,K.jsx)(o,{icon:e.daemon.alive?E:l,className:`h-3 w-3`}),(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:S?m(`common.external`):e.daemon.alive?m(`common.pause`):m(`common.run`)})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":m(`topbar.manageSession`),title:m(`topbar.manageSession`),onClick:i,className:`icon-control flex h-8 w-8 shrink-0 items-center justify-center text-sm tracking-widest`,children:`···`})]})]})}var Kr=`modulepreload`,qr=function(e){return`/`+e},Jr={},Yr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=qr(t,n),t=s(t),t in Jr)return;Jr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Kr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Xr={fast:.18,normal:.28},Zr={magnetic:5},Qr={all:`(min-width: 0px)`,reduceMotion:`(prefers-reduced-motion: reduce)`};function $r(e,t,n=[]){let r=(0,M.useRef)(t);r.current=t,(0,M.useEffect)(()=>{let t=!1,n=null;return Yr(()=>import(`./motion-sqs9Ax-g.js`).then(e=>e.t).then(i=>{if(t||!e.current)return;let a=i.gsap;n=a.matchMedia(),n.add(Qr,e=>r.current(a,!!e.conditions?.reduceMotion),e.current)}),__vite__mapDeps([0,1])),()=>{t=!0,n?.revert()}},n)}function ei(e,t=!0){$r(e,(n,r)=>{let i=e.current;if(!t||r||!i||!window.matchMedia(`(hover: hover) and (pointer: fine)`).matches)return;let a=n.quickTo(i,`x`,{duration:Xr.fast,ease:`power2.out`}),o=n.quickTo(i,`y`,{duration:Xr.fast,ease:`power2.out`}),s=null,c=()=>{s=i.getBoundingClientRect()},l=e=>{if(s||c(),!s)return;let t=((e.clientX-s.left)/s.width-.5)*Zr.magnetic*2,n=((e.clientY-s.top)/s.height-.5)*Zr.magnetic*2;a(t),o(n)},u=()=>{a(0),o(0)};return i.addEventListener(`pointerenter`,c),i.addEventListener(`pointermove`,l,{passive:!0}),i.addEventListener(`pointerleave`,u),window.addEventListener(`resize`,c),()=>{i.removeEventListener(`pointerenter`,c),i.removeEventListener(`pointermove`,l),i.removeEventListener(`pointerleave`,u),window.removeEventListener(`resize`,c)}},[t])}function J(e){if(!e)return`—`;let t=Date.now()/1e3,n=Math.max(0,t-e);return n<5?`just now`:n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function ti(e){if(e==null||e<0)return`—`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t?`${t}d ${n}h`:n?`${n}h ${r}m`:r?`${r}m`:`${Math.floor(e)}s`}function ni(e,t=2){return e==null||!isFinite(e)?`$0.00`:`$${e.toFixed(t)}`}function ri(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r>=10||n===0?r.toFixed(0):r.toFixed(1)} ${t[n]}`}function ii(e){let t=e.ts??e.time,n=null;if(typeof t==`number`)n=t>0xe8d4a51000?t:t*1e3;else if(typeof t==`string`){let e=Date.parse(t);isNaN(e)||(n=e)}if(n==null)return``;let r=new Date(n),i=e=>String(e).padStart(2,`0`);return`${i(r.getHours())}:${i(r.getMinutes())}:${i(r.getSeconds())}`}function ai(e){return e instanceof Error?e.message:String(e||`Unknown error`)}function oi(e,t){let n=ai(e);return t?`Reply interrupted after a partial response: ${n}`:`Message failed before a response was received: ${n}`}var si=`operator console`,ci=[`No active work.`,`Event stream is idle.`,`Ready for input.`];function li(e,t=3800){return e[Math.floor(Date.now()/t)%e.length]}function ui({ok:e,pulse:t=!1,title:n}){return(0,K.jsx)(`span`,{title:n,className:`inline-block h-1.5 w-1.5 rounded-full transition-shadow duration-150 ${e?`bg-ok ring-1 ring-ok/30 ring-offset-1 ring-offset-panel`:`bg-ink-faint/50`}`,"data-live":e&&t?`true`:void 0})}function di({children:e,color:t,className:n=``}){return(0,K.jsx)(`span`,{className:`chip text-ink-dim ${n}`,style:t?{color:t,borderColor:`${t}44`}:void 0,children:e})}function fi({children:e,onClick:t,variant:n=`ghost`,disabled:r,title:i,className:a=``}){let o=(0,M.useRef)(null);return ei(o,n!==`danger`&&!r),(0,K.jsx)(`button`,{ref:o,type:`button`,title:i,disabled:r,onClick:t,className:`brand-button ${{ghost:`brand-button-ghost`,primary:`brand-button-primary`,danger:`brand-button-danger`}[n]} ${a}`,children:e})}function pi({title:e,right:t}){return(0,K.jsxs)(`div`,{className:`panel-header flex min-h-11 items-center justify-between border-b px-4`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.06em] text-ink-faint`,children:e}),t]})}function mi(){return(0,K.jsx)(`span`,{className:`inline-block h-3 w-3 animate-spin rounded-full border-2 border-line border-t-blue`})}function hi({children:e}){return(0,K.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-ink-faint`,children:e})}async function gi(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function _i({text:e,label:t,copiedLabel:n,className:r=``}){let[i,a]=(0,M.useState)(!1),o=(0,M.useRef)();(0,M.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let s=async()=>{await gi(e)&&(a(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>a(!1),1600))};return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>void s(),"aria-label":i?n:t,title:i?n:t,className:`inline-flex h-7 items-center gap-1 rounded-md border border-line/60 bg-panel/85 px-2 text-[10px] text-ink-faint shadow-sm backdrop-blur transition hover:border-blue/45 hover:text-blue focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue/50 ${r}`,children:[i?(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,K.jsx)(`path`,{d:`m3.5 8.5 2.7 2.7 6.3-6.4`})}):(0,K.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,children:[(0,K.jsx)(`rect`,{x:`5.2`,y:`5.2`,width:`7.2`,height:`7.2`,rx:`1.2`}),(0,K.jsx)(`path`,{d:`M10.8 5.2V3.8a1.2 1.2 0 0 0-1.2-1.2H3.8a1.2 1.2 0 0 0-1.2 1.2v5.8a1.2 1.2 0 0 0 1.2 1.2h1.4`})]}),(0,K.jsx)(`span`,{children:i?n:t})]})}function vi(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(vi).join(``):(0,M.isValidElement)(e)?vi(e.props.children):``}function yi({src:e,alt:t}){let[n,r]=(0,M.useState)(!1);return n||!e?(0,K.jsxs)(`span`,{className:`text-xs text-ink-faint`,children:[`Image unavailable`,t?` · ${t}`:``]}):(0,K.jsx)(`img`,{src:e,alt:t||``,loading:`lazy`,decoding:`async`,onError:()=>r(!0),className:`my-2 h-auto max-w-full rounded-lg`})}function bi({children:e}){let{t}=q();return(0,K.jsx)(ge,{remarkPlugins:[_e],components:{h1:({children:e})=>(0,K.jsx)(`h1`,{className:`mb-2 mt-3 text-base font-semibold text-ink first:mt-0`,children:e}),h2:({children:e})=>(0,K.jsx)(`h2`,{className:`mb-1.5 mt-3 text-sm font-semibold text-ink first:mt-0`,children:e}),h3:({children:e})=>(0,K.jsx)(`h3`,{className:`mb-1 mt-2 text-sm font-medium text-ink first:mt-0`,children:e}),p:({children:e})=>(0,K.jsx)(`p`,{className:`my-1.5 whitespace-pre-wrap break-words leading-[1.625] first:mt-0 last:mb-0`,children:e}),ul:({children:e})=>(0,K.jsx)(`ul`,{className:`my-2 list-disc space-y-1 pl-5`,children:e}),ol:({children:e})=>(0,K.jsx)(`ol`,{className:`my-2 list-decimal space-y-1 pl-5`,children:e}),li:({children:e})=>(0,K.jsx)(`li`,{className:`pl-0.5`,children:e}),blockquote:({children:e})=>(0,K.jsx)(`blockquote`,{className:`my-2 border-l border-blue/50 pl-3 text-ink-dim`,children:e}),hr:()=>(0,K.jsx)(`hr`,{className:`my-3 border-line/60`}),a:({href:e,children:t})=>(0,K.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`text-blue underline decoration-blue/35 underline-offset-2 hover:decoration-blue`,children:t}),code:({className:e,children:t,...n})=>{let r=!!e||String(t).includes(` +`);return(0,K.jsx)(`code`,{...n,className:r?`block min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-ink ${e??``}`:`break-all rounded bg-bg px-1.5 py-0.5 font-mono text-xs text-ink`,children:t})},pre:({children:e})=>(0,K.jsxs)(`pre`,{className:`group/code relative my-2 max-w-full overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-line/50 bg-bg px-3 pb-3 pt-10`,children:[(0,K.jsx)(_i,{text:M.Children.toArray(e).map(vi).join(``),label:t(`copy.code`),copiedLabel:t(`copy.copied`),className:`absolute right-2 top-2`}),e]}),table:({children:e})=>(0,K.jsx)(`table`,{className:`my-2 w-full table-fixed border-collapse text-left text-xs`,children:e}),th:({children:e})=>(0,K.jsx)(`th`,{className:`break-words border border-line/60 bg-bg px-2 py-1.5 font-semibold text-ink`,children:e}),td:({children:e})=>(0,K.jsx)(`td`,{className:`break-words border border-line/60 px-2 py-1.5 align-top`,children:e}),strong:({children:e})=>(0,K.jsx)(`strong`,{className:`font-semibold text-ink`,children:e}),img:({src:e,alt:t})=>(0,K.jsx)(yi,{src:e,alt:t})},children:e})}function xi(e){return`${e}-${(0,M.useId)().replaceAll(`:`,``)}`}function Si({size:e,className:t=`text-ink`}){let n=xi(`argus-rounded-mark`);return(0,K.jsxs)(`svg`,{"data-logo":`rounded-mark`,viewBox:`0 0 512 512`,role:`img`,"aria-label":`Argus`,style:{width:e,height:e},className:`shrink-0 ${t}`,children:[(0,K.jsx)(`defs`,{children:(0,K.jsxs)(`linearGradient`,{id:n,gradientUnits:`userSpaceOnUse`,x1:`66`,y1:`0`,x2:`440`,y2:`0`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`rgb(var(--spectral-blue))`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`rgb(var(--spectral-gold))`})]})}),(0,K.jsx)(`path`,{d:`M352 112q0-30 30-30h28q30 0 30 30v320h-88v-52q-46 62-129 62Q66 442 66 266T228 88q80 0 124 56v-32ZM140 266q46-80 102-80t110 80q-54 80-110 80t-102-80Z`,fill:`url(#${n})`,fillRule:`evenodd`}),(0,K.jsx)(`path`,{d:`M286 266A42 42 0 1 0 202 266A42 42 0 1 0 286 266ZM274 248A12 12 0 1 0 250 248A12 12 0 1 0 274 248Z`,fill:`url(#${n})`,fillRule:`evenodd`})]})}function Ci({size:e}){let t=xi(`argus-rounded-horizontal`);return(0,K.jsxs)(`svg`,{"data-logo":`rounded-horizontal`,viewBox:`150 40 1160 390`,role:`img`,"aria-label":`Argus`,style:{width:e*2.75,height:e},className:`shrink-0`,children:[(0,K.jsx)(`defs`,{children:(0,K.jsxs)(`linearGradient`,{id:t,gradientUnits:`userSpaceOnUse`,x1:`180`,y1:`0`,x2:`1280`,y2:`0`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`rgb(var(--spectral-blue))`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`rgb(var(--spectral-gold))`})]})}),(0,K.jsxs)(`g`,{transform:`translate(180 92) scale(.54)`,children:[(0,K.jsx)(`path`,{d:`M352 112q0-30 30-30h28q30 0 30 30v320h-88v-52q-46 62-129 62Q66 442 66 266T228 88q80 0 124 56v-32ZM140 266q46-80 102-80t110 80q-54 80-110 80t-102-80Z`,fill:`url(#${t})`,fillRule:`evenodd`}),(0,K.jsx)(`path`,{d:`M286 266A42 42 0 1 0 202 266A42 42 0 1 0 286 266ZM274 248A12 12 0 1 0 250 248A12 12 0 1 0 274 248Z`,fill:`url(#${t})`,fillRule:`evenodd`})]}),(0,K.jsxs)(`g`,{fill:`url(#${t})`,children:[(0,K.jsx)(`path`,{d:`M383 556Q394 556 409 555Q424 554 433 552L422 412Q415 414 401.5 415.5Q388 417 378 417Q340 417 305 403.5Q270 390 248.5 360Q227 330 227 278V0H78V546H191L213 454H220Q244 496 286 526Q328 556 383 556Z`,transform:`translate(444 334) scale(.36 -.36)`}),(0,K.jsx)(`path`,{d:`M255 556Q356 556 413 476H417L429 546H555V-1Q555-118 486-179Q417-240 282-240Q224-240 174.5-233Q125-226 78-208V-89Q179-131 291-131Q406-131 406-7V4Q406 21 407.5 39Q409 57 410 71H406Q378 28 339 9Q300-10 251-10Q154-10 99.5 64.5Q45 139 45 272Q45 406 101 481Q157 556 255 556ZM302 435Q197 435 197 270Q197 107 304 107Q361 107 388.5 139.5Q416 172 416 253V271Q416 359 389 397Q362 435 302 435Z`,transform:`translate(617.52 334) scale(.36 -.36)`}),(0,K.jsx)(`path`,{d:`M579 546V0H465L445 70H437Q411 28 365.5 9Q320-10 269-10Q181-10 128 37.5Q75 85 75 190V546H224V227Q224 169 245 139Q266 109 312 109Q380 109 405 155.5Q430 202 430 289V546Z`,transform:`translate(855.48 334) scale(.36 -.36)`}),(0,K.jsx)(`path`,{d:`M459 162Q459 79 400.5 34.5Q342-10 226-10Q169-10 128-2.5Q87 5 46 22V145Q90 125 141 112Q192 99 231 99Q275 99 293.5 112Q312 125 312 146Q312 160 304.5 171Q297 182 272 196Q247 210 194 232Q143 254 110 275.5Q77 297 61 327.5Q45 358 45 404Q45 480 104 518Q163 556 261 556Q312 556 358 546Q404 536 453 513L408 406Q368 423 332 434.5Q296 446 259 446Q193 446 193 410Q193 397 201.5 386.5Q210 376 234.5 364Q259 352 307 332Q354 313 388 292.5Q422 272 440.5 241.5Q459 211 459 162Z`,transform:`translate(1102.08 334) scale(.36 -.36)`})]})]})}function wi({size:e=20,tag:t,compact:n=!1}){return(0,K.jsxs)(`span`,{className:`inline-flex select-none items-center gap-2.5`,children:[n?(0,K.jsx)(Si,{size:e}):(0,K.jsx)(Ci,{size:e}),t&&!n?(0,K.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-ink-faint`,children:t}):null]})}var Ti=[`manager`,`planner`,`engineer`,`reviewer`],Ei=/Info: (?:Operation cancelled by user|Response was interrupted due to a server error\. Retrying\.\.\.)/gi;function Di(e){let t=new Map;return e.forEach(e=>{let n=String(e.type??``);if(n===`life.mission.completed`||n===`mission.completed`){t.clear();return}let r=String(e.call_id??``);r&&(n===`provider.request.started`?t.set(r,e):(n===`provider.request.completed`||n===`provider.request.denied`)&&t.delete(r))}),Array.from(t.values()).at(-1)??null}function Oi({ev:e,r:t,first:n,last:r}){let i=z.role[t.role]??z.inkFaint,a=nr(t.tone);return(0,K.jsxs)(`div`,{className:`group relative grid grid-cols-[16px_minmax(0,1fr)] gap-3 px-4 py-3 transition-colors hover:bg-bg/70 ${r?`animate-appear`:``} ${t.reasoning?`opacity-60`:``}`,style:t.rule?{marginTop:4}:void 0,children:[(0,K.jsxs)(`div`,{className:`relative flex justify-center`,children:[n?null:(0,K.jsx)(`span`,{className:`absolute -top-2.5 h-4 w-px bg-line/60`}),r?null:(0,K.jsx)(`span`,{className:`absolute -bottom-2.5 top-2 w-px bg-line/60`}),(0,K.jsx)(`span`,{className:`relative z-10 mt-1.5 h-2 w-2 rounded-full border-2 border-panel`,style:{backgroundColor:i,boxShadow:`0 0 0 1px ${i}55`}})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-semibold uppercase tracking-[0.06em]`,style:{color:i},title:t.label,children:t.label}),(0,K.jsx)(`span`,{className:`text-xs`,style:{color:a},children:t.glyph}),(0,K.jsx)(`time`,{className:`ml-auto font-mono text-xs tabular-nums text-ink-faint opacity-0 transition-opacity group-hover:opacity-100`,children:ii(e)})]}),(0,K.jsx)(`div`,{className:`mt-0.5 whitespace-pre-wrap break-words text-sm leading-5 ${t.reasoning?`italic`:``}`,style:{color:a},children:t.text})]})]})}function ki({ev:e,r:t}){let{t:n}=q(),r=String(e.type)===`ui.operator`,i=Number(e.response_latency_ms??0),a=!r&&i>=100?` · ${(i/1e3).toFixed(1)}s`:``,o=(0,M.useRef)(null);return $r(o,(e,t)=>{o.current&&(t||e.fromTo(o.current,{autoAlpha:0,x:r?12:0,y:r?0:8},{autoAlpha:1,x:0,y:0,duration:.28,ease:`power2.out`,clearProps:`transform,opacity,visibility`}))}),(0,K.jsx)(`article`,{ref:o,className:`group mx-auto w-full max-w-full px-4 py-3 sm:px-6 lg:max-w-[61.8vw]`,children:r?(0,K.jsxs)(`div`,{className:`flex items-end justify-end gap-2`,children:[(0,K.jsx)(_i,{text:t.text,label:n(`copy.message`),copiedLabel:n(`copy.copied`),className:`opacity-60 sm:opacity-0 sm:group-hover:opacity-100`}),(0,K.jsx)(`time`,{className:`shrink-0 pb-1 font-mono text-[10px] tabular-nums text-ink-faint`,children:ii(e)}),(0,K.jsx)(`div`,{className:`max-w-[calc(100%_-_3rem)] rounded-[18px] bg-conversation-user px-4 py-2.5 text-[15px] leading-relaxed text-ink ring-1 ring-line/35 sm:max-w-[82%]`,children:(0,K.jsx)(bi,{children:t.text})})]}):(0,K.jsxs)(`div`,{className:`flex gap-3`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center`,children:(0,K.jsx)(Si,{size:26,className:`text-blue`})}),(0,K.jsxs)(`div`,{className:`relative min-w-0 flex-1 text-[15px] leading-relaxed text-ink`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-blue`,children:`Argus`}),(0,K.jsx)(_i,{text:t.text,label:n(`copy.message`),copiedLabel:n(`copy.copied`),className:`ml-auto opacity-60 sm:opacity-0 sm:group-hover:opacity-100`}),(0,K.jsxs)(`time`,{className:`font-mono text-[10px] tabular-nums text-ink-faint`,children:[ii(e),a]})]}),(0,K.jsx)(bi,{children:t.text})]})]})})}function Ai({role:e,rows:t,open:n,active:r,onToggle:i}){let a=z.role[e],o=(0,M.useRef)(null),s=t[t.length-1]?.r.text.length??0;return(0,M.useEffect)(()=>{if(!n)return;let e=window.requestAnimationFrame(()=>{o.current&&o.current.scrollHeight>o.current.clientHeight&&(o.current.scrollTop=o.current.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[n,t.length,s]),(0,K.jsxs)(`section`,{className:`role-log-group border-b border-line/50`,"data-role":e,"data-open":n?`true`:`false`,"data-active":r?`true`:`false`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":n,className:`group flex h-11 w-full items-center gap-2 px-4 text-left transition-colors hover:bg-bg/60`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 rounded-full ${r?`animate-pulse`:`opacity-55`}`,style:{background:a}}),(0,K.jsx)(`span`,{className:`text-xs font-semibold capitalize text-ink-dim`,children:e}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-ink-faint`,children:t.length}),t.length>0?(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-ink-faint`,children:t[t.length-1].r.text}):(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-ink-faint transition-transform duration-panel ease-panel ${n?`rotate-90`:``}`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,K.jsx)(`path`,{d:`m6 3.5 4.5 4.5L6 12.5`})})]}),(0,K.jsx)(`div`,{className:`grid transition-[grid-template-rows] duration-panel ease-panel ${n?`grid-rows-[1fr]`:`grid-rows-[0fr]`}`,children:(0,K.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:(0,K.jsx)(`div`,{ref:o,className:`max-h-72 overflow-x-hidden overflow-y-auto border-t border-line/40 scroll-thin`,children:t.length>0?t.map(({ev:e,r:n,key:r},i)=>(0,K.jsx)(Oi,{ev:e,r:n,first:i===0,last:i===t.length-1},r)):(0,K.jsx)(`div`,{className:`px-4 py-3 text-xs text-ink-faint`,children:`No logs`})})})})]})}function ji(e){let t={manager:[],planner:[],engineer:[],reviewer:[]},n=[];return e.forEach(e=>{Ti.includes(e.r.role)?t[e.r.role].push(e):n.push(e)}),{roleRows:t,systemRows:n,lastRole:[...e].reverse().find(e=>Ti.includes(e.r.role))?.r.role??``}}function Mi({rows:e,live:t}){let{roleRows:n,systemRows:r,lastRole:i}=(0,M.useMemo)(()=>ji(e),[e]),[a,o]=(0,M.useState)(()=>new Set(t&&i?[i]:[])),s=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{!t||!i||s.current||o(new Set([i]))},[i,t]),(0,K.jsxs)(`div`,{className:`bg-bg/25`,children:[Ti.map(e=>(0,K.jsx)(Ai,{role:e,rows:n[e],open:a.has(e),active:i===e,onToggle:()=>{s.current=!0,o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}},e)),r.length>0?(0,K.jsxs)(`details`,{className:`border-b border-line/50`,children:[(0,K.jsxs)(`summary`,{className:`flex h-10 cursor-pointer list-none items-center gap-2 px-4 text-xs text-ink-faint hover:bg-bg/60`,children:[(0,K.jsx)(`span`,{children:`System`}),(0,K.jsx)(`span`,{className:`font-mono`,children:r.length})]}),(0,K.jsx)(`div`,{className:`border-t border-line/40`,children:r.map(({ev:e,r:t,key:n},i)=>(0,K.jsx)(Oi,{ev:e,r:t,first:i===0,last:i===r.length-1},n))})]}):null]})}function Ni({group:e,latest:t}){let n=e=>e.ev.type===`ui.argus`&&/^(info:|operation cancelled|cancelled\b)/i.test(e.r.text.trim()),r=e.rows.filter(e=>e.ev.type===`ui.argus`).map(e=>{let t=e.r.text.match(Ei)??[],r=e.r.text.replace(Ei,``).trim();return{reply:r&&!n(e)?{...e,r:{...e.r,text:r}}:null,messages:n(e)&&t.length===0?[e.r.text]:t}}),i=r.flatMap(e=>e.reply?[e.reply]:[]),a=r.flatMap(e=>e.messages),o=e.rows.filter(({ev:e})=>e.type!==`ui.argus`);return(0,K.jsxs)(`section`,{className:`border-b border-line/60`,children:[(0,K.jsx)(ki,{ev:e.operator.ev,r:e.operator.r}),i.map(e=>(0,K.jsx)(ki,{ev:e.ev,r:e.r},e.key)),a.map((t,n)=>(0,K.jsx)(`div`,{className:`mx-auto w-full max-w-full px-6 py-1.5 text-center text-xs text-ink-faint lg:max-w-[61.8vw]`,children:t},`${e.key}-system-${n}`)),o.length>0?(0,K.jsx)(`div`,{className:`mx-auto w-full max-w-full border-t border-line/40 lg:max-w-[61.8vw]`,children:(0,K.jsx)(Mi,{rows:o,live:t})}):null]})}function Pi({events:e,connected:t,showReasoning:n,onToggleReasoning:r,embedded:i=!1,filter:a=`all`,query:o=``,skipFirst:s=0}){let{locale:c,t:l}=q(),[u,d]=(0,M.useState)(!0),[f,p]=(0,M.useState)(()=>Date.now()),m=(0,M.useRef)(null),h=(0,M.useMemo)(()=>Di(e),[e]);(0,M.useEffect)(()=>{if(!h)return;p(Date.now());let e=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(e)},[h]);let g=h?Math.max(0,Math.floor((f-Number(h.ts??0)*1e3)/1e3)):0,_=(0,M.useMemo)(()=>{let t=[],r=new Map,i=0;return(s>0?e.slice(s):e).forEach((e,s)=>{let l=rr(e,c);if(!l)return;if(l.reasoning&&!n){i++;return}if(!At(e,l,a,o))return;let u=e,d=String(u.message_id??``),f=!!d&&String(u.type)===`engineer.progress`&&[`assistant_message`,`agent_message`,`message`].includes(String(u.kind));if(f&&r.has(d)){let n=r.get(d);t[n]={...t[n],ev:{...t[n].ev,...e},r:{...t[n].r,...l,text:Dt(t[n].r.text,l.text,Tt(e))}};return}let p={ev:e,r:l,key:ir(e,s)};f&&r.set(d,t.length),t.push(p)}),{list:t,hiddenReasoning:i}},[e,n,a,o,s,c]),v=(0,M.useMemo)(()=>{let e=[],t=[],n=null;return _.list.forEach(r=>{r.ev.type===`ui.operator`?(n={key:r.key,operator:r,rows:[]},e.push(n)):n?n.rows.push(r):t.push(r)}),{groups:e,earlier:t}},[_.list]),y=(0,M.useMemo)(()=>e.filter(xt).length,[e]),b=(0,M.useMemo)(()=>_.list.slice(-20).reduce((e,t)=>e+t.r.text.length,0),[_.list]);return(0,M.useEffect)(()=>{u&&m.current&&(m.current.scrollTop=m.current.scrollHeight)},[_.list.length,b,u]),(0,M.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>d(e.scrollHeight-e.scrollTop-e.clientHeight<40);return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]),(0,K.jsxs)(`section`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden bg-panel ${i?``:`rounded-lg border border-line/80`}`,children:[(0,K.jsx)(pi,{title:l(`panel.activity`),right:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(`button`,{onClick:r,className:`rounded px-1.5 py-0.5 text-xs transition-colors ${n?`text-blue-sky`:`text-ink-faint hover:text-ink-dim`}`,title:`toggle agent reasoning (⌘T)`,children:[`reasoning`,y?` ·${y}`:``]}),(0,K.jsx)(`span`,{className:`text-xs ${t?`text-ok`:`text-ink-faint`}`,children:t?`● live`:`○ reconnecting`})]})}),h?(0,K.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line/60 bg-blue-deep/5 px-4 text-xs text-ink-dim`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-blue-sky`}),(0,K.jsxs)(`span`,{className:`truncate`,children:[String(h.run_label??`provider call`),` · working`]}),(0,K.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono tabular-nums text-ink-faint`,children:[g,`s`]})]}):null,(0,K.jsx)(`div`,{ref:m,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto pb-6 pt-1.5 scroll-thin`,children:_.list.length===0?(0,K.jsx)(hi,{children:li(ci)}):(0,K.jsxs)(K.Fragment,{children:[v.earlier.length>0?(0,K.jsxs)(`section`,{className:`mx-auto w-full max-w-full border-b border-line/60 lg:max-w-[61.8vw]`,children:[(0,K.jsxs)(`div`,{className:`flex h-10 items-center gap-2 border-b border-line/40 px-4 text-[10px] font-semibold uppercase tracking-[0.12em] text-ink-faint`,children:[`Autonomous activity`,(0,K.jsx)(`span`,{className:`font-mono font-normal tracking-normal`,children:v.earlier.length})]}),(0,K.jsx)(Mi,{rows:v.earlier,live:v.groups.length===0})]}):null,v.groups.map((e,t)=>(0,K.jsx)(Ni,{group:e,latest:t===v.groups.length-1},e.key))]})}),!u&&(0,K.jsx)(`button`,{onClick:()=>{d(!0),m.current?.scrollTo({top:m.current.scrollHeight,behavior:`smooth`})},"aria-label":l(`stream.jumpToLatest`),title:l(`stream.jumpToLatest`),className:`absolute bottom-4 left-1/2 flex h-8 w-8 -translate-x-1/2 items-center justify-center rounded-full border border-line/60 bg-panel text-sm text-ink-dim shadow-glow transition-all duration-200 hover:border-ink-faint hover:text-ink`,children:`↓`})]})}function Fi(e){return e.nativeEvent.isComposing||e.keyCode===229}var Ii={Everyday:`常用`,"Task management":`任务管理`,"Sessions & diagnostics":`会话与诊断`,Configuration:`配置`,Other:`其他`},Li={status:`查看角色、队列、日志和健康状态`,roles:`查看各角色的后端、模型、推理强度和实时活动`,journal:`查看近期日志(默认 10 条)`,backlog:`查看待处理任务(all 包含已完成和已跳过)`,artifacts:`查看 Reviewer 批准的结果文件(按 Enter 预览)`,artifact:`预览一个已批准的结果文件`,events:`搜索动态:all / watch / milestones / messages`,find:`搜索当前事件缓冲区`,cancel:`停止等待当前 Manager 回复`,ask:`直接回答,不排任务、不走 Planner/Engineer/Reviewer`,task:`直接加入任务队列`,plan:`预览 Planner 编写的执行计划`,rewrite:`让 Manager 在发送前改写提示词`,nudge:`向正在运行的任务注入指导`,abort:`立即终止正在运行的任务`,note:`向时间线添加手动备注`,done:`将任务标记为完成`,skip:`跳过任务`,stop:`停止任务的自动迭代`,item:`查看完整任务契约`,run:`返回持续更新的任务动态`,new:`检查、创建并切换到新会话`,daemons:`查找全部会话并切换或创建`,resume:`切换到其他项目或会话`,attach:`跟随其他项目并读取其动态`,rename:`重命名当前会话`,doctor:`诊断为什么没有任务运行`,backend:`查看或更改共享 Runner 后端`,config:`查看或更改运行时设置`,identity:`查看或替换操作者身份卡`,reset:`清除 Manager 的热会话上下文`,skills:`查看或提升运行时 Skill`,clear:`清空事件动态视图`,reconnect:`重新连接实时事件流`,help:`查看快捷键和完整命令参考`,quit:`离开控制台(后台工作继续运行)`};function Ri(e,t){return t===`zh-CN`?Li[e.id]:e.desc}function zi(e,t){return t===`zh-CN`?Ii[e.group]:e.group}function Y(e,t){let n=new Map;for(let r of e){let e=zi(r,t),i=r.aliases?.length?` (= ${r.aliases.join(`, `)})`:``,a=`${r.name}${r.arg?` ${r.arg}`:``}${i}`;n.has(e)||n.set(e,[]),n.get(e).push({label:a,desc:Ri(r,t)})}return[...n.entries()].map(([e,t])=>({group:e,rows:t}))}var X=`slash-completion-listbox`;function Bi(e,t){return t<=0?0:Math.max(0,Math.min(e,t-1))}function Vi(e){return`slash-completion-option-${e}`}function Hi({query:e,selected:t,onSelect:n}){let{locale:r,t:i}=q(),a=Lt(e);if(a.length===0)return null;let o=a.slice(0,8),s=Bi(t,o.length);return(0,K.jsx)(`div`,{id:X,role:`listbox`,"aria-label":i(`slash.suggestions`),className:`slash-completion-menu scroll-thin border-b border-line/40`,children:o.map((e,t)=>(0,K.jsxs)(`button`,{id:Vi(e.id),type:`button`,role:`option`,"aria-selected":t===s,onPointerDown:e=>{e.preventDefault(),n(t)},className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm transition-colors ${t===s?`bg-blue/10 text-ink`:`text-ink-dim hover:bg-line/20`}`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-blue`,children:e.name}),e.arg?(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-ink-faint`,children:e.arg}):null,(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-ink-faint`,children:Ri(e,r)})]},e.id))})}var Ui=10485760,Wi=26214400,Gi=[`.png`,`.jpg`,`.jpeg`,`.webp`,`.pdf`,`.md`,`.markdown`,`.txt`,`.json`,`.csv`].join(`,`),Ki={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".webp":`image/webp`,".pdf":`application/pdf`,".md":`text/markdown`,".markdown":`text/markdown`,".txt":`text/plain`,".json":`application/json`,".csv":`text/csv`};function qi(e){let t=String(e||``).trim().toLowerCase(),n=t.lastIndexOf(`.`);return n>=0?t.slice(n):``}function Ji(e){return Ki[qi(e.name)]||String(e.type||``).split(`;`,1)[0].trim()||`application/octet-stream`}function Yi(e){return Object.hasOwn(Ki,qi(e.name))}function Xi(e){return Ji(e).startsWith(`image/`)}function Zi(e){return[e.name,String(e.size),Ji(e),String(e.lastModified??``)].join(`::`)}function Qi(e,t){let n=[],r=[],i=new Set(e.map(Zi)),a=e.reduce((e,t)=>e+Math.max(0,t.size||0),0),o=e.length;for(let e of t){let t=Zi(e);if(!i.has(t)){if(i.add(t),!Yi(e)){r.push({code:`unsupported`,fileName:e.name});continue}if(o>=5){r.push({code:`too-many`,limitCount:5});continue}if(e.size>10485760){r.push({code:`too-large`,fileName:e.name,limitBytes:Ui});continue}if(a+e.size>26214400){r.push({code:`too-large-total`,limitBytes:Wi});continue}n.push(e),a+=e.size,o+=1}}return{accepted:n,issues:r}}function $i(e){return e?Array.from(e):[]}function ea(e){return $i(e?.types).map(e=>String(e)).includes(`Files`)||ta(e).length>0}function ta(e){let t=$i(e?.files).filter(e=>e instanceof File);if(t.length)return t;let n=[];for(let t of $i(e?.items)){if(String(t?.kind||``)!==`file`||typeof t?.getAsFile!=`function`)continue;let e=t.getAsFile();e instanceof File&&n.push(e)}return n}function na({file:e,removeLabel:t,onRemove:n}){let[r,i]=(0,M.useState)(``);return(0,M.useEffect)(()=>{if(!Xi(e)||typeof URL>`u`||typeof URL.createObjectURL!=`function`){i(``);return}let t=URL.createObjectURL(e);return i(t),()=>URL.revokeObjectURL(t)},[e]),(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-2xl border border-line/50 bg-panel/80 px-2.5 py-2 text-xs shadow-[0_10px_24px_-20px_rgb(var(--spectral-blue)/0.8)]`,children:[r?(0,K.jsx)(`img`,{src:r,alt:``,className:`h-10 w-10 shrink-0 rounded-xl border border-line/40 object-cover`}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate font-medium text-ink`,title:e.name,children:e.name}),(0,K.jsxs)(`div`,{className:`truncate text-ink-faint`,children:[ri(e.size),` · `,Ji(e)]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":t,title:t,className:`send-control h-8 w-8 shrink-0 rounded-full border-line/60 text-ink-faint hover:border-err/50 hover:bg-err/10 hover:text-err`,children:`×`})]})}function ra(e,t){if(!t.onRewrite||!Zn(e.key,e.ctrlKey,e.metaKey))return!1;e.preventDefault();let n=t.value.trim();return n&&!t.disabled&&!t.pending&&!t.rewriting&&t.onRewrite(n),!0}function ia({value:e,onChange:t,onSend:n,onCancel:r,disabled:i,pending:a,focusSignal:o,embedded:s=!1,phase:c=``,heartbeat:l=!1,quietS:u=0,startedAt:d=0,steps:f=[],onRewrite:p,rewriting:m=!1,slashSelection:h,onSlashSelectionChange:g}){let{t:_}=q(),v=(0,M.useRef)(null),y=(0,M.useRef)(null),[b,x]=(0,M.useState)(0),[S,C]=(0,M.useState)(!1),[w,T]=(0,M.useState)([]),[ee,te]=(0,M.useState)(``),[E,ne]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!a&&!m)return;x(e=>e+1);let e=setInterval(()=>x(e=>e+1),120);return()=>clearInterval(e)},[a,m]);let re=Un(c,b,l,u),ie=d?Math.max(0,Math.floor((Date.now()-d)/1e3)):0,ae=Jn(f),D=Date.now()/1e3;(0,M.useEffect)(()=>{o&&!i&&v.current?.focus()},[o,i]);let O=Lt(e).slice(0,8),oe=O.length>0&&!S,se=oe?Bi(h,O.length):0,ce=oe?O[se]:void 0,k=e=>{let n=O[e];n&&(t(zt(n)),n.argument===`none`&&C(!0),g(0),v.current?.focus())},le=async()=>{let r=e.trim();!r||a||i||await n(r,w.map(e=>e.file))&&(t(``),g(0),C(!1),T([]),te(``))},A=(e,t)=>_(e===`unsupported`?`chat.attachUnsupported`:e===`too-large`?`chat.attachTooLarge`:e===`too-many`?`chat.attachTooMany`:`chat.attachTotalTooLarge`,t),ue=e=>{if(!e.length||i||a)return;let{accepted:t,issues:n}=Qi(w.map(e=>e.file),e);t.length&&T(e=>[...e,...t.map(e=>({id:globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random()}`,file:e}))]),te(n.map(e=>e.code===`unsupported`?A(e.code,{name:e.fileName}):e.code===`too-large`?A(e.code,{name:e.fileName,size:ri(e.limitBytes)}):e.code===`too-many`?A(e.code,{count:e.limitCount}):A(e.code,{size:ri(e.limitBytes)})).join(` `))};return(0,K.jsxs)(`div`,{onDragEnter:e=>{ea(e.dataTransfer)&&(e.preventDefault(),ne(e=>e+1))},onDragOver:e=>{ea(e.dataTransfer)&&e.preventDefault()},onDragLeave:e=>{ea(e.dataTransfer)&&(e.preventDefault(),ne(e=>Math.max(0,e-1)))},onDrop:e=>{ea(e.dataTransfer)&&(e.preventDefault(),ne(0),ue(ta(e.dataTransfer)))},className:`glass-card glass-panel--raised flex flex-col overflow-hidden rounded-2xl ${s?`shadow-[0_12px_36px_-22px_rgb(var(--spectral-violet)/0.7)] backdrop-blur-md`:``} ${E>0?`ring-2 ring-manager/60 ring-offset-0`:``}`,children:[a?(0,K.jsxs)(`div`,{className:`border-b border-line/40 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`font-mono text-manager`,children:Hn(b)}),(0,K.jsx)(`span`,{className:`shrink-0 font-semibold text-manager`,children:_(`chat.yourMessage`)}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-blue`,title:re,children:re}),(0,K.jsxs)(`span`,{className:`shrink-0 font-mono tabular-nums text-ink-faint`,children:[ie,`s`]})]}),ae.length?(0,K.jsx)(`ol`,{className:`mt-1.5 space-y-0.5`,children:ae.map((e,t)=>{let n=t===ae.length-1&&!e.endedTs,r=Xn(Yn(e,D));return(0,K.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono ${n?`text-manager`:`text-ok`}`,children:n?Hn(b):`✓`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono ${n?`text-ink`:`text-ink-faint`}`,title:e.detail||e.label,children:e.label}),r?(0,K.jsx)(`span`,{className:`shrink-0 font-mono tabular-nums text-ink-faint`,children:r}):null]},e.id)})}):null,(0,K.jsx)(`div`,{className:`mt-1 text-xs text-ink-faint`,children:_(`chat.stopWaitingHint`)})]}):null,oe?(0,K.jsx)(Hi,{query:e,selected:se,onSelect:k}):null,w.length||ee||E>0?(0,K.jsxs)(`div`,{className:`border-b border-line/30 px-3 py-2`,children:[E>0?(0,K.jsx)(`div`,{className:`mb-2 text-xs font-medium text-manager`,children:_(`chat.attachDrop`)}):null,w.length?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.map(e=>(0,K.jsx)(na,{file:e.file,removeLabel:_(`chat.attachRemove`,{name:e.file.name}),onRemove:()=>{T(t=>t.filter(t=>t.id!==e.id)),te(``)}},e.id))}):null,(0,K.jsx)(`div`,{className:`mt-2 text-xs ${ee?`text-err`:`text-ink-faint`}`,children:ee||_(`chat.attachHint`,{count:5,perFile:ri(10485760),total:ri(26214400)})})]}):null,(0,K.jsxs)(`div`,{className:`flex items-end gap-2 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`pb-2 font-mono text-lg text-blue`,title:_(`chat.messageArgus`),children:`›`}),(0,K.jsx)(`input`,{ref:y,type:`file`,multiple:!0,accept:Gi,onChange:e=>{ue(Array.from(e.target.files??[])),e.target.value=``},className:`hidden`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>y.current?.click(),disabled:i||a,title:`${_(`chat.attach`)} · ${_(`chat.attachHint`,{count:5,perFile:ri(Ui),total:ri(Wi)})}`,"aria-label":_(`chat.attach`),className:`send-control h-9 w-9 shrink-0 rounded-full border-line/70 bg-panel/80 text-base text-ink-faint hover:border-blue/50 hover:bg-blue/10 hover:text-blue disabled:opacity-40`,children:`📎`}),(0,K.jsx)(`textarea`,{ref:v,value:e,onChange:e=>{t(e.target.value),g(0),C(!1)},onPaste:e=>{let t=ta(e.clipboardData);t.length&&(e.preventDefault(),ue(t))},onKeyDown:t=>{Fi(t)||ra(t,{value:e,disabled:i,pending:a,rewriting:m,onRewrite:p})||(oe?t.key===`ArrowDown`?(t.preventDefault(),g(Bi(se+1,O.length))):t.key===`ArrowUp`?(t.preventDefault(),g(Bi(se-1,O.length))):t.key===`Tab`||t.key===`Enter`&&!t.shiftKey?(t.preventDefault(),k(se)):t.key===`Escape`&&(t.preventDefault(),C(!0)):t.key===`Escape`&&a?(t.preventDefault(),r()):t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),le()))},"aria-keyshortcuts":`Control+R Meta+R`,rows:1,disabled:i,"aria-controls":oe?X:void 0,"aria-expanded":oe,"aria-activedescendant":ce?Vi(ce.id):void 0,placeholder:_(i?`chat.selectSession`:`chat.placeholder`),className:`max-h-48 min-h-[38px] min-w-0 flex-1 resize-none bg-transparent py-2 font-sans text-[15px] text-ink outline-none placeholder:text-ink-faint`,style:{fieldSizing:`content`}}),p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>p(e.trim()),disabled:i||a||m||!e.trim(),title:`Ctrl/⌘+R · ${_(`chat.rewriteHint`)}`,"aria-label":_(`chat.rewriteLabel`),"aria-keyshortcuts":`Control+R Meta+R`,className:`send-control h-9 shrink-0 rounded-full border-manager/70 bg-manager/10 px-3 text-xs font-medium text-manager hover:border-manager hover:bg-manager/20 disabled:opacity-40`,children:m?`${Hn(b)} ${_(`chat.rewriting`)}`:_(`chat.rewrite`)}):null,(0,K.jsx)(`button`,{type:`button`,onClick:a?r:()=>void le(),disabled:i||!a&&!e.trim(),title:a?_(`chat.stopWaitingTitle`):void 0,"aria-label":_(a?`chat.stopWaiting`:`chat.send`),className:`send-control h-9 w-9 shrink-0 rounded-full text-sm font-medium disabled:opacity-40 ${a?`border-line text-warn hover:border-warn/60 hover:bg-warn/10`:`border-blue/70 bg-blue/10 text-blue hover:border-blue hover:bg-blue/20`}`,children:a?`■`:`↑`})]})]})}function aa({open:e,onClose:t,children:n,label:r,width:i=`max-w-2xl`,align:a=`center`}){let o=(0,M.useRef)(null),s=(0,M.useRef)(null),c=(0,M.useRef)(t);return c.current=t,$r(o,(t,n)=>{if(!(!e||!o.current||!s.current)){if(n){t.set([s.current,o.current],{clearProps:`all`});return}t.timeline({defaults:{overwrite:`auto`}}).fromTo(s.current,{autoAlpha:0},{autoAlpha:1,duration:.18,ease:`power1.out`},0).fromTo(o.current,{autoAlpha:0,y:a===`top`?-10:12,scale:.985},{autoAlpha:1,y:0,scale:1,duration:.28,ease:`power3.out`,clearProps:`transform,opacity,visibility`},.03)}},[e,a]),(0,M.useEffect)(()=>{if(!e)return;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=window.requestAnimationFrame(()=>{(o.current?.querySelector(`[data-autofocus]`)??o.current?.querySelector(`input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])`)??o.current)?.focus()}),r=e=>{if(e.key===`Escape`){e.preventDefault(),c.current();return}if(e.key!==`Tab`||!o.current)return;let t=Array.from(o.current.querySelectorAll(`input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])`)).filter(e=>e.getAttribute(`aria-hidden`)!==`true`);if(t.length===0){e.preventDefault(),o.current.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&(document.activeElement===n||!o.current.contains(document.activeElement))?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,r),()=>{window.cancelAnimationFrame(n),window.removeEventListener(`keydown`,r),t?.isConnected&&t.focus()}},[e]),e?(0,K.jsxs)(`div`,{className:`fixed inset-0 z-50 flex ${a===`top`?`items-start pt-4 sm:pt-16`:`items-center`} justify-center p-4`,onMouseDown:t,children:[(0,K.jsx)(`div`,{ref:s,className:`absolute inset-0 bg-[rgb(4_11_24_/_0.58)] backdrop-blur-md`}),(0,K.jsx)(`div`,{ref:o,role:`dialog`,"aria-modal":`true`,"aria-label":r,tabIndex:-1,className:`brand-modal glass-panel glass-panel--raised relative z-10 w-full ${i} max-h-[calc(100dvh-2rem)] overflow-x-hidden overflow-y-auto rounded-xl border shadow-glow scroll-thin sm:max-h-[88dvh]`,onMouseDown:e=>e.stopPropagation(),children:n})]}):null}function oa({title:e,sub:t}){return(0,K.jsxs)(`div`,{className:`border-b border-line px-5 py-3`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-ink`,children:e}),t&&(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-faint`,children:t})]})}function sa(e,t,n,r=`en`){return e.map(e=>({id:`command-${e.id}`,label:Ri(e,r),hint:`${e.name}${e.arg?` ${e.arg}`:``}`,group:zi(e,r),keywords:[e.name,...e.aliases??[]].join(` `),run:()=>Nt(e)?n(`${e.name} `):t(e.name)}))}function ca(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);return n.length?e.filter(e=>{let t=`${e.label} ${e.group} ${e.hint??``} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))}):e}function la({open:e,onClose:t,items:n}){let{t:r}=q(),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(0),c=(0,M.useRef)(null),l=(0,M.useRef)(null);(0,M.useEffect)(()=>{e&&(a(``),s(0),setTimeout(()=>c.current?.focus(),0))},[e]);let u=(0,M.useMemo)(()=>ca(n,i),[i,n]);(0,M.useEffect)(()=>{o>=u.length&&s(Math.max(0,u.length-1))},[u.length,o]),(0,M.useEffect)(()=>{l.current?.scrollIntoView({block:`nearest`})},[e,i,o]);let d=e=>{e&&(t(),e.run())},f=e=>{Fi(e)||(e.key===`ArrowDown`?(e.preventDefault(),u.length&&s(e=>Math.min(u.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(0,e-1))):e.key===`Enter`&&(e.preventDefault(),d(u[o])))},p=[];for(let e of u){let t=p.find(t=>t.name===e.group);t||(t={name:e.group,items:[]},p.push(t)),t.items.push(e)}let m=-1;return(0,K.jsxs)(aa,{open:e,onClose:t,label:r(`help.palette`),width:`max-w-xl`,align:`top`,children:[(0,K.jsx)(`div`,{className:`border-b border-line px-4 py-3`,children:(0,K.jsx)(`input`,{ref:c,value:i,onChange:e=>a(e.target.value),onKeyDown:f,placeholder:r(`palette.placeholder`),role:`combobox`,"aria-expanded":e,"aria-autocomplete":`list`,"aria-controls":`command-palette-results`,"aria-activedescendant":u[o]?`palette-${u[o].id}`:void 0,className:`w-full bg-transparent font-mono text-sm text-ink outline-none placeholder:text-ink-faint`})}),(0,K.jsxs)(`div`,{id:`command-palette-results`,role:`listbox`,className:`max-h-[52vh] overflow-y-auto scroll-thin py-1.5`,children:[u.length===0&&(0,K.jsx)(`div`,{className:`px-4 py-6 text-center text-xs text-ink-faint`,children:r(`palette.noMatches`)}),p.map(e=>(0,K.jsxs)(`div`,{className:`mb-1`,children:[(0,K.jsx)(`div`,{className:`px-4 py-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:e.name}),e.items.map(e=>{m++;let t=m===o;return(0,K.jsxs)(`button`,{id:`palette-${e.id}`,ref:t?l:void 0,role:`option`,"aria-selected":t,onMouseEnter:()=>s(u.indexOf(e)),onClick:()=>d(e),className:`flex w-full items-center justify-between px-4 py-1.5 text-left text-sm transition-colors ${t?`bg-blue-deep/20 text-ink`:`text-ink-dim hover:bg-panel/60`}`,children:[(0,K.jsx)(`span`,{children:e.label}),e.hint&&(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-ink-faint`,children:e.hint})]},e.id)})]},e.name))]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-line px-4 py-1.5 text-[10px] text-ink-faint`,children:[(0,K.jsx)(`span`,{children:r(`palette.navigate`)}),(0,K.jsx)(`span`,{children:r(`palette.run`)}),(0,K.jsx)(`span`,{children:r(`palette.close`)})]})]})}var ua=[{keys:`⌘K / Ctrl+K`,desc:`help.palette`},{keys:`⌘B / Ctrl+B`,desc:`help.sessions`},{keys:`⌘J / Ctrl+J`,desc:`help.managerChat`},{keys:`⌘R / Ctrl+R`,desc:`help.rewrite`},{keys:`⌘T / Ctrl+T`,desc:`help.reasoning`},{keys:`⌘. / Ctrl+.`,desc:`help.kiosk`},{keys:`/`,desc:`help.composer`},{keys:`↵ Enter`,desc:`help.send`},{keys:`Shift+Enter`,desc:`help.newline`},{keys:`?`,desc:`help.thisHelp`},{keys:`Esc`,desc:`help.escape`}];function da({open:e,onClose:t}){let{locale:n,t:r}=q(),i=Y(jt,n);return(0,K.jsxs)(aa,{open:e,onClose:t,label:r(`help.title`),width:`max-w-2xl`,children:[(0,K.jsx)(oa,{title:r(`help.title`)}),(0,K.jsxs)(`div`,{className:`max-h-[70dvh] overflow-y-auto scroll-thin`,children:[(0,K.jsx)(`div`,{className:`p-4`,children:ua.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between py-1.5`,children:[(0,K.jsx)(`span`,{className:`text-sm text-ink-dim`,children:r(e.desc)}),(0,K.jsx)(`kbd`,{className:`rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-ink`,children:e.keys})]},e.keys))}),(0,K.jsxs)(`div`,{className:`border-t border-line px-4 pb-4 pt-3`,children:[(0,K.jsx)(`p`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-ink-faint`,children:r(`help.commands`)}),i.map(e=>(0,K.jsxs)(`div`,{className:`mb-4`,children:[(0,K.jsx)(`p`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:e.group}),e.rows.map(e=>(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-1`,children:[(0,K.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-ink`,children:e.label}),(0,K.jsx)(`span`,{className:`text-right text-xs text-ink-dim`,children:e.desc})]},e.label))]},e.group))]})]})]})}var fa=[{name:`ARGUS_SKILL_MAX_ACTIVE_DAEMONS`,group:`Limits`,label:`Active daemon limit`,description:`Maximum background sessions running on this host.`},{name:`ARGUS_SKILL_UNPRICED_COST_POLICY`,group:`Safety`,label:`Unpriced calls`,description:`Whether calls with unresolved pricing are blocked or allowed.`},{name:`ARGUS_SKILL_SAFE_MODE`,group:`Safety`,label:`Safe mode`,description:`Enable extra-conservative runtime guardrails.`},{name:`ARGUS_SKILL_ENABLE_TELEGRAM`,group:`Interface`,label:`Telegram`,description:`Enable the Telegram notification bridge.`},{name:`ARGUS_SKILL_SHOW_REASONING`,group:`Interface`,label:`Show reasoning`,description:`Stream role reasoning into the cockpit activity view.`}];function pa(e){let t=new Map(e.map(e=>[e.name,e]));return fa.flatMap(e=>{let n=t.get(e.name);return n?[{...n,group:e.group,label:e.label,doc:e.description}]:[]})}function ma(e){let t=e.trim();if(!t)return``;if(t===`not applicable for this model`)return`n/a`;if(t.startsWith(`capability vault`))return`vault / default`;if(t.startsWith(`default:`))return`default`;let n=t.startsWith(`persisted:`),r=n?t.slice(10):t;return r.startsWith(`ARGUS_SKILL_`)?`${r.slice(12).toLowerCase().replaceAll(`_`,` `)}${n?` · persisted`:` · env`}`:t}function ha(e,t){let n=new URL(e),r=n.protocol===`https:`?`wss:`:`ws:`,i=encodeURIComponent(t);return{webApi:`${n.origin}/api`,eventStream:`${r}//${n.host}/api/projects/${i}/stream`,daemon:`local process · events.jsonl · no TCP port`}}var ga=[{alias:`global_daily_cap`,env:`ARGUS_SKILL_GLOBAL_DAILY_CAP_USD`,label:`settings.budget.global`,unit:`USD`},{alias:`codex_daily_requests`,env:`ARGUS_SKILL_CODEX_DAILY_CALL_CAP`,label:`settings.budget.codex`,unit:`calls`},{alias:`copilot_daily_requests`,env:`ARGUS_SKILL_COPILOT_DAILY_CALL_CAP`,label:`settings.budget.copilot`,unit:`calls`},{alias:`copilot_daily_premium`,env:`ARGUS_SKILL_COPILOT_DAILY_PREMIUM_CAP`,label:`settings.budget.premium`,unit:`requests`}];function _a({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a}=_r(e,t);return(0,K.jsxs)(aa,{open:t,onClose:n,label:r(`doctor.title`),width:`max-w-3xl`,children:[(0,K.jsx)(oa,{title:r(`doctor.title`),sub:r(`doctor.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-4`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(mi,{})}),i?.recommended&&(0,K.jsxs)(`div`,{className:`mb-4 rounded-lg border border-gold/40 bg-gold/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-gold`,children:r(`doctor.recommended`)}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-ink`,children:i.recommended.name}),(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-ink-dim`,children:i.recommended.detail}),i.recommended.fix&&(0,K.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words rounded bg-bg p-2 font-mono text-xs text-blue-sky`,children:i.recommended.fix})]}),(0,K.jsx)(`div`,{className:`space-y-1.5`,children:(i?.checks??[]).map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-line/60 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:e.ok?`text-ok`:`text-err`,children:e.ok?`✓`:`✗`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium text-ink`,children:e.name}),e.detail&&(0,K.jsx)(`div`,{className:`mt-0.5 text-[11px] text-ink-dim`,children:e.detail}),!e.ok&&e.fix&&(0,K.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words rounded bg-bg p-1.5 font-mono text-xs text-ink-dim`,children:e.fix})]})]},t))}),i?.log_tail&&(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-ink-faint`,children:`daemon.log`}),(0,K.jsx)(`pre`,{className:`max-h-48 overflow-x-hidden overflow-y-auto whitespace-pre-wrap break-words rounded-lg bg-bg p-3 font-mono text-xs leading-relaxed text-ink-dim scroll-thin`,children:i.log_tail})]})]})]})}function Z({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a,refetch:s}=vr(e,t),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(``),[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(``),[g,_]=(0,M.useState)(!1),[v,b]=(0,M.useState)(``),[x,S]=(0,M.useState)({});(0,M.useEffect)(()=>{if(!t||!i)return;let e=new Map(i.operator_knobs.map(e=>[e.name,e.value]));S(Object.fromEntries(ga.map(t=>[t.alias,e.get(t.env)??``])))},[i,t]);let C=async()=>{if(!g){_(!0),b(``);try{let t=Object.fromEntries(ga.map(e=>{let t=String(x[e.alias]??``).trim();if(!t)throw Error(r(`settings.required`,{field:r(e.label)}));return[e.alias,t]}));await R.setBudgets(e,t),await s(),b(r(`settings.budgetSaved`))}catch(e){b(e instanceof Error?e.message:String(e))}finally{_(!1)}}},T=async t=>{if(t.preventDefault(),!(!c.trim()||!u.trim()||f)){p(!0),h(``);try{await R.setConfig(e,c.trim(),u.trim()),await s(),h(r(`settings.applied`))}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}}},ee=pa(i?.operator_knobs??[]).reduce((e,t)=>((e[t.group]??=[]).push(t),e),{}),te=ha(window.location.origin,e);return(0,K.jsxs)(aa,{open:t,onClose:n,label:r(`common.settings`),width:`max-w-4xl`,children:[(0,K.jsx)(oa,{title:r(`common.settings`),sub:r(`settings.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-4`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(mi,{})}),(0,K.jsxs)(`section`,{className:`mb-4 rounded-lg border border-line bg-surface p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-ink-faint`,children:r(`settings.connection`)}),(0,K.jsxs)(`div`,{className:`mt-2 grid gap-2 text-[10px] sm:grid-cols-[100px_minmax(0,1fr)]`,children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:r(`settings.webApi`)}),(0,K.jsx)(`code`,{className:`min-w-0 break-all text-ink-dim`,children:te.webApi}),(0,K.jsx)(`span`,{className:`text-ink-faint`,children:r(`settings.eventStream`)}),(0,K.jsx)(`code`,{className:`min-w-0 break-all text-ink-dim`,children:te.eventStream}),(0,K.jsx)(`span`,{className:`text-ink-faint`,children:r(`settings.taskDaemon`)}),(0,K.jsx)(`span`,{className:`text-ink-dim`,children:te.daemon})]})]}),(0,K.jsxs)(`section`,{className:`mb-4 rounded-lg border border-gold/40 bg-gold/5 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-gold`,children:r(`settings.budgetTitle`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[10px] text-ink-faint`,children:r(`settings.budgetHint`)})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void C(),disabled:g||a,title:r(`settings.saveBudgets`),"aria-label":r(`settings.saveBudgets`),className:`flex h-9 w-9 items-center justify-center rounded bg-gold text-xs font-semibold text-bg disabled:opacity-40`,children:g?`…`:(0,K.jsx)(o,{icon:w})})]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2 lg:grid-cols-3`,children:ga.map(e=>(0,K.jsxs)(`label`,{className:`rounded border border-line/70 bg-bg/60 p-2`,children:[(0,K.jsx)(`span`,{className:`block text-[10px] text-ink-faint`,children:r(e.label)}),(0,K.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`number`,min:`0`,step:e.unit===`USD`?`0.1`:`1`,value:x[e.alias]??``,onChange:t=>S(n=>({...n,[e.alias]:t.target.value})),className:`h-8 min-w-0 flex-1 bg-transparent font-mono text-sm text-ink outline-none`}),(0,K.jsx)(`span`,{className:`text-[9px] text-ink-faint`,children:e.unit})]})]},e.alias))}),v?(0,K.jsx)(`div`,{className:`mt-2 text-xs text-ink-dim`,children:v}):null]}),(0,K.jsxs)(`form`,{onSubmit:e=>void T(e),className:`mb-4 rounded-lg border border-blue/30 bg-blue/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-blue`,children:r(`settings.advanced`)}),(0,K.jsxs)(`div`,{className:`mt-2 grid gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,K.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:r(`settings.namePlaceholder`),className:`h-9 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:r(`settings.valuePlaceholder`),className:`h-9 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{disabled:f||!c.trim()||!u.trim(),title:r(`settings.applyAdvanced`),"aria-label":r(`settings.applyAdvanced`),className:`flex h-9 w-9 items-center justify-center rounded bg-blue-deep text-xs font-medium text-white disabled:opacity-40`,children:f?`…`:(0,K.jsx)(o,{icon:y})})]}),m?(0,K.jsx)(`div`,{className:`mt-2 text-xs text-ink-dim`,children:m}):null]}),(0,K.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(i?.roles??[]).map(e=>(0,K.jsxs)(`div`,{className:`rounded-lg border border-line bg-surface p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold capitalize text-ink`,children:e.role}),(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:e.backend_label})]}),(0,K.jsx)(`div`,{className:`mt-2 truncate font-mono text-[11px] text-ink-dim`,title:e.model,children:e.model}),(0,K.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`truncate`,title:e.model_source,children:ma(e.model_source)}),e.reasoning_effort&&(0,K.jsx)(`span`,{className:`ml-auto shrink-0`,style:{color:dt(e.reasoning_effort)},children:e.reasoning_effort})]}),e.description?(0,K.jsx)(`p`,{className:`mt-2 text-[10px] leading-relaxed text-ink-faint`,children:e.description}):null]},e.role))}),Object.entries(ee).map(([e,t])=>(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`mb-1.5 text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:e}),(0,K.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-line`,children:t.map((e,t)=>(0,K.jsxs)(`div`,{className:`grid gap-1 px-3 py-2.5 sm:grid-cols-[minmax(0,1fr)_auto] ${t?`border-t border-line/60`:``}`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium text-ink-dim`,title:e.name,children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[10px] leading-relaxed text-ink-faint`,children:e.doc})]}),(0,K.jsxs)(`div`,{className:`text-left sm:text-right`,children:[(0,K.jsx)(`div`,{className:`font-mono text-[11px] text-ink`,children:e.value}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[9px] text-ink-faint`,children:ma(e.source)})]})]},e.name))})]},e)),(0,K.jsxs)(`p`,{className:`mt-4 text-[10px] text-ink-faint`,children:[r(`settings.footer`),` `,(0,K.jsx)(`code`,{children:`argus-skill --config-help`}),`.`]})]})]})}function va({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a,refetch:s}=yr(e,t),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(!1),[f,p]=(0,M.useState)(``);(0,M.useEffect)(()=>{t&&i!=null&&l(i)},[i,t]);let m=async()=>{if(!u){d(!0),p(``);try{await R.setIdentity(e,c),await s(),p(r(`identity.saved`))}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,K.jsxs)(aa,{open:t,onClose:n,label:r(`identity.title`),width:`max-w-2xl`,children:[(0,K.jsx)(oa,{title:r(`identity.title`),sub:r(`identity.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-5`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(mi,{})}),a?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),rows:12,className:`w-full resize-y rounded-lg border border-line bg-bg p-3 font-sans text-sm leading-relaxed text-ink outline-none focus:border-blue`,placeholder:r(`identity.placeholder`)}),(0,K.jsxs)(`div`,{className:`mt-3 flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-xs text-ink-faint`,children:f}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:u||c===(i??``),title:r(`identity.save`),"aria-label":r(`identity.save`),className:`flex h-9 w-9 items-center justify-center rounded bg-blue-deep text-xs font-medium text-white disabled:opacity-40`,children:u?`…`:(0,K.jsx)(o,{icon:w})})]})]})]})]})}function ya({sid:e,open:t,onClose:n}){let{t:r}=q(),{data:i,isLoading:a}=br(e,t),o=i??[];return(0,K.jsxs)(aa,{open:t,onClose:n,label:r(`transcript.title`),width:`max-w-2xl`,children:[(0,K.jsx)(oa,{title:r(`transcript.title`),sub:r(`transcript.subtitle`)}),(0,K.jsxs)(`div`,{className:`max-h-[64vh] overflow-y-auto scroll-thin p-4`,children:[a&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(mi,{})}),!a&&o.length===0&&(0,K.jsx)(hi,{children:r(`transcript.empty`)}),o.map((e,t)=>{let n=e.role===`operator`;return(0,K.jsxs)(`div`,{className:`grid grid-cols-[72px_minmax(0,1fr)] border-b border-line/50 py-2.5 last:border-b-0`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-mono text-[10px] font-semibold uppercase tracking-wide ${n?`text-ink-faint`:`text-blue-sky`}`,children:n?r(`transcript.operator`):`argus`}),(0,K.jsx)(`div`,{className:`mt-0.5 text-[9px] text-ink-faint`,children:J(e.ts)})]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-ink-dim`,children:e.text})]},t)})]})]})}function ba({questions:e,backlog:t,onAnswer:n}){let r=B(e,t);if(!r.length)return null;let i=r[0];return(0,K.jsxs)(`div`,{className:`mb-2 flex min-h-11 items-center gap-3 rounded-md border border-gold/40 bg-gold/5 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium text-gold`,children:i.title}),(0,K.jsx)(`div`,{className:`truncate text-xs text-ink-dim`,title:i.reason||i.question,children:i.reason||i.question})]}),r.length>1?(0,K.jsxs)(`span`,{className:`font-mono text-xs text-ink-faint`,children:[`+`,r.length-1]}):null,(0,K.jsx)(`button`,{onClick:n,className:`shrink-0 text-xs font-medium text-gold hover:text-gold-soft`,children:`Decide`})]})}function xa({reply:e,open:t,busy:n,onClose:r,onSubmit:i}){let{t:a}=q(),o=(0,M.useMemo)(()=>e?.options[0]?.id??`custom`,[e]),[s,c]=(0,M.useState)(o),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(``);if((0,M.useEffect)(()=>{t&&(c(o),u(``),f(``))},[o,t,e?.id]),!e)return null;let p=e.options.length===0,m=e.options.find(e=>e.id===s),h=p?!!l.trim():!!(m&&(!m.requires_note||l.trim())),g=()=>{if(!n){if(!h){f(a(`decision.noteRequired`));return}f(``),i(p?`custom`:s,l.trim())}};return(0,K.jsxs)(aa,{open:t,onClose:n?()=>void 0:r,label:a(`decision.operator`),width:`max-w-2xl`,children:[(0,K.jsx)(oa,{title:a(`decision.required`),sub:e.title}),(0,K.jsxs)(`div`,{className:`space-y-4 px-5 py-4`,children:[e.reason?(0,K.jsxs)(`section`,{className:`rounded-md border border-gold/30 bg-gold/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-gold`,children:a(`decision.whyBlocked`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm leading-relaxed text-ink`,children:e.reason})]}):null,e.evidence.length?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-2 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:a(`decision.evidence`)}),(0,K.jsx)(`div`,{className:`space-y-2`,children:e.evidence.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded border border-line/70 bg-bg/40 p-2.5`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium text-ink`,children:e.label}),e.summary?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-ink-dim`,children:e.summary}):null,e.path?(0,K.jsx)(`div`,{className:`mt-1 break-all font-mono text-[10px] text-blue-sky`,children:e.path}):null]},`${e.path}:${t}`))})]}):null,(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-ink`,children:e.question}),e.options.length?(0,K.jsx)(`div`,{className:`space-y-2`,children:e.options.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{c(e.id),f(``)},disabled:n,className:`w-full rounded-md border p-3 text-left ${s===e.id?`border-blue bg-blue/5`:`border-line bg-bg/30`}`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-ink`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-1 text-xs leading-relaxed text-ink-dim`,children:e.description})]},e.id))}):null,p||m?.requires_note||l?(0,K.jsx)(`textarea`,{"data-autofocus":!0,value:l,onChange:e=>{u(e.target.value),f(``)},onKeyDown:e=>{Fi(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())},rows:3,disabled:n,placeholder:a(`decision.notePlaceholder`),className:`w-full resize-y rounded-lg border border-line bg-bg px-3 py-2 text-sm leading-relaxed text-ink outline-none focus:border-blue disabled:opacity-60`}):null,d?(0,K.jsx)(`p`,{role:`alert`,className:`text-xs text-err`,children:d}):null,(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-ink-faint`,children:a(`decision.resumeHint`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`rounded-md px-3 py-2 text-xs text-ink-dim hover:bg-bg disabled:opacity-50`,children:a(`decision.later`)}),(0,K.jsx)(`button`,{type:`button`,onClick:g,disabled:n,className:`rounded-md bg-blue-deep px-3 py-2 text-xs font-medium text-white hover:bg-blue-deep/85 disabled:opacity-50`,children:a(n?`decision.applying`:p||s===`custom`?`decision.sendAnswer`:s===`stop`?`decision.stopCampaign`:`decision.useOption`)})]})]})]})]})}function Sa({alert:e}){if(!e)return null;let t=e.tone===`block`,n=e.kind===`budget`;return(0,K.jsxs)(`div`,{className:`mx-3 mt-3 flex items-center gap-2.5 rounded-lg border px-3.5 py-2 text-[13px] ${t?`border-err/50 bg-err/10 text-err`:`border-warn/50 bg-warn/10 text-warn`}`,role:t?`alert`:`status`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs font-bold leading-none`,children:n?`$`:t?`!`:`i`}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] font-semibold uppercase tracking-wide`,children:n?`budget alarm`:t?`action required`:`notice`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.text,children:e.text})]})}function Ca({html:e,title:t,className:n=``}){return(0,K.jsx)(`iframe`,{title:t,srcDoc:e,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,className:`min-h-0 w-full flex-1 border-0 bg-white ${n}`})}function wa(e){let t=e.trim();if(!t)return``;try{return JSON.stringify(JSON.parse(t),null,2)}catch{try{return t.split(/\r?\n/).filter(Boolean).map(e=>JSON.parse(e)).map(e=>JSON.stringify(e,null,2)).join(` +`)}catch{return e}}}function Ta(e,t){let n=[],r=[],i=``,a=!1;for(let o=0;oe.some(e=>e.length>0))}function Ea({value:e}){return(0,K.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words p-5 font-mono text-xs leading-6 text-ink-dim scroll-thin`,children:wa(e)||`(empty data)`})}function Da({value:e,delimiter:t}){let n=Ta(e,t).slice(0,200),r=n[0]??[];return(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4 scroll-thin`,children:n.length?(0,K.jsxs)(`table`,{className:`w-full border-collapse text-left text-xs`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsx)(`tr`,{children:r.slice(0,40).map((e,t)=>(0,K.jsx)(`th`,{className:`border border-line/60 bg-surface px-2 py-1.5 font-semibold text-ink`,children:e},t))})}),(0,K.jsx)(`tbody`,{children:n.slice(1).map((e,t)=>(0,K.jsx)(`tr`,{children:r.slice(0,40).map((t,n)=>(0,K.jsx)(`td`,{className:`border border-line/50 px-2 py-1.5 align-top text-ink-dim`,children:e[n]??``},n))},t))})]}):(0,K.jsx)(`div`,{className:`text-sm text-ink-faint`,children:`(empty table)`})})}function Oa({sid:e,path:t,onClose:n}){let{t:r}=q(),i=Sr(e,t),a=i.data,[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(!1);(0,M.useEffect)(()=>{if(s(null),l(``),!e||!t||!a||![`image`,`pdf`,`audio`,`video`].includes(a.kind))return;let n=!0,r=``,i=new AbortController;return R.artifactBlob(e,t,!1,i.signal).then(e=>{n&&(r=URL.createObjectURL(e),s(r))},e=>n&&l(e.message)),()=>{n=!1,i.abort(),r&&URL.revokeObjectURL(r)}},[e,t,a?.kind]);let f=async()=>{if(!(!e||!t||!a)){d(!0),l(``);try{let n=await R.artifactBlob(e,t,!0),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=a.name,document.body.appendChild(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}catch(e){l(e.message)}finally{d(!1)}}};return(0,K.jsxs)(aa,{open:!!t,onClose:n,label:r(`artifact.preview`),width:`max-w-5xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-line px-4 py-3 sm:px-5`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h2`,{className:`truncate font-mono text-sm font-semibold text-ink`,title:a?.path??t??``,children:a?.name??t??r(`artifact.title`)}),(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-[11px] text-ink-faint`,children:a?`${a.kind} · ${ri(a.size)} · ${a.mime}`:r(`artifact.approvedEvidence`)})]}),(0,K.jsx)(`button`,{type:`button`,disabled:!a||u,onClick:()=>void f(),className:`rounded-md border border-blue-deep/60 bg-blue-deep/10 px-3 py-1.5 text-xs text-blue-sky transition-colors hover:bg-blue-deep/20 disabled:cursor-wait disabled:opacity-50`,children:r(u?`artifact.downloading`:`artifact.download`)}),a?.kind===`pdf`&&o?(0,K.jsx)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,className:`rounded-md border border-line px-3 py-1.5 text-xs text-ink-dim transition-colors hover:border-ink-faint hover:bg-surface hover:text-ink`,children:r(`artifact.open`)}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":r(`artifact.close`),onClick:n,className:`rounded-md px-2 py-1 text-lg leading-none text-ink-faint hover:bg-surface hover:text-ink`,children:`×`})]}),(0,K.jsxs)(`div`,{className:`flex min-h-64 max-h-[72vh] flex-col overflow-x-hidden overflow-y-auto bg-bg/40 p-3 scroll-thin sm:p-4`,children:[i.isLoading?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(mi,{})}):null,i.isError?(0,K.jsxs)(`div`,{className:`m-auto text-sm text-err`,children:[r(`artifact.unavailable`),` · `,i.error.message]}):null,a?.why?(0,K.jsxs)(`div`,{className:`mb-3 rounded-md border border-line bg-surface px-3 py-2 text-xs text-ink-dim`,children:[(0,K.jsx)(`span`,{className:`mr-1 text-ink-faint`,children:`Reviewer:`}),a.why]}):null,a?.kind===`text`?(0,K.jsxs)(`pre`,{className:`min-h-52 overflow-x-hidden overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-bg p-4 font-mono text-xs leading-relaxed text-ink-dim scroll-thin`,children:[a.preview||r(`artifact.empty`),a.truncated?`\n\n… ${r(`artifact.truncated`)}`:``]}):null,a?.kind===`markdown`?(0,K.jsx)(`div`,{className:`min-h-52 overflow-auto rounded-lg border border-line bg-bg p-4 text-sm text-ink-dim scroll-thin`,children:(0,K.jsx)(bi,{children:a.preview||r(`artifact.empty`)})}):null,a?.kind===`json`?(0,K.jsx)(Ea,{value:a.preview||``}):null,a?.kind===`table`?(0,K.jsx)(Da,{value:a.preview||``,delimiter:a.name.endsWith(`.tsv`)?` `:`,`}):null,a?.kind===`html`&&!a.truncated?(0,K.jsx)(`div`,{className:`flex min-h-[60vh] overflow-hidden rounded-lg border border-line`,children:(0,K.jsx)(Ca,{html:a.preview||``,title:`HTML preview: ${a.name}`})}):null,a?.kind===`html`&&a.truncated?(0,K.jsx)(`div`,{className:`m-auto text-sm text-warn`,children:r(`artifact.htmlTooLarge`)}):null,a?.kind===`image`&&o?(0,K.jsx)(`div`,{className:`flex min-h-64 flex-1 items-center justify-center rounded border border-line bg-bg/50`,children:(0,K.jsx)(`img`,{src:o,alt:a.why||a.name,className:`max-h-[62vh] max-w-full object-contain`})}):null,a?.kind===`pdf`&&o?(0,K.jsx)(`object`,{data:`${o}#toolbar=1&navpanes=0&view=FitH`,type:`application/pdf`,"aria-label":`PDF preview: ${a.name}`,className:`h-[62vh] w-full rounded-lg border border-line bg-white`,children:(0,K.jsxs)(`div`,{className:`flex h-full min-h-64 flex-col items-center justify-center gap-2 text-center text-sm text-ink-dim`,children:[(0,K.jsx)(`span`,{children:r(`artifact.pdfDisabled`)}),(0,K.jsx)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,className:`text-blue underline underline-offset-2`,children:r(`artifact.openPdf`)})]})}):null,a?.kind===`audio`&&o?(0,K.jsx)(`div`,{className:`m-auto w-full max-w-xl`,children:(0,K.jsx)(`audio`,{controls:!0,preload:`metadata`,src:o,className:`w-full`})}):null,a?.kind===`video`&&o?(0,K.jsx)(`div`,{className:`flex min-h-64 flex-1 items-center justify-center rounded border border-line bg-black`,children:(0,K.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,src:o,className:`max-h-[62vh] max-w-full`})}):null,a&&[`image`,`pdf`,`audio`,`video`].includes(a.kind)&&!o&&!c?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(mi,{})}):null,a?.kind===`binary`?(0,K.jsxs)(`div`,{className:`m-auto max-w-md text-center`,children:[(0,K.jsx)(`div`,{className:`text-3xl text-ink-faint`,children:`◇`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-ink-dim`,children:r(`artifact.noPreview`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-faint`,children:r(`artifact.downloadHint`)})]}):null,c?(0,K.jsx)(`div`,{className:`mt-3 text-center text-xs text-err`,children:c}):null]})]})}var ka=`__argus_live_progress__`;function Aa(e){return(e??[]).filter(e=>e.source===`manager_live`)}function ja(e){return Aa(e).filter(e=>e.exists)[0]??null}function Ma(e){let t=e??[],n={markdown:0,pdf:1,html:2,text:3,table:4,json:5,image:6,video:7,audio:8,binary:9},r=t.filter(e=>e.exists&&e.source===`manager_live`),i=t.filter(e=>e.exists&&e.source!==`manager_live`);return i.length?[...r,...[...i].sort((e,t)=>(n[e.kind]??99)-(n[t.kind]??99))]:r}function Na(e){return Ma(e).find(e=>e.exists)??null}function Pa(e){let t=e.path.split(`/`);return t[t.length-1]||e.path}function Fa(e,t){let n=ja(t);return n?n.path:e?ka:Na(t)?.path??``}var Ia={manager:`Manager`,planner:`Planner`,engineer:`Engineer`,reviewer:`Reviewer`};function La(e){let t=String(e.agent_layer??e.actor??``);if(t===`main`)return`engineer`;if(t)return t;let n=String(e.type??``);return n.startsWith(`round.review`)||n.startsWith(`reviewer`)?`reviewer`:n.startsWith(`life.planner`)?`planner`:n.startsWith(`life.manager`)||n.startsWith(`manager`)?`manager`:n.startsWith(`engineer`)||n.startsWith(`round.`)?`engineer`:``}function Ra(e,t=[]){let n=String(e?.active_role??``);if(!n)return null;let r=e?.roles.find(e=>e.role===n),i=``;for(let e=t.length-1;e>=0;--e){let r=t[e];if(La(r)!==n||String(r.kind??``)===`reasoning`)continue;let a=String(r.text??r.action_summary??``).trim();if(!(!a||a.startsWith(`{`))){i=a.split(` +`)[0].slice(0,240);break}}return{role:n,roleLabel:Ia[n]??n,label:r?.label||`Working`,detail:i}}function za(e){let t=e.dag.find(e=>[`running`,`in_progress`,`claimed`].includes(e.status)),n=e.dag.filter(e=>[`done`,`completed`].includes(e.status)).length,r=e.dag.length,i=`Awaiting Planner`;return e.mission.status===`idle`?i=`Ready for a new mission`:e.mission.status===`complete`&&(i=`Mission complete`),{title:On(t?.title||e.mission.title||i),dagProgress:r>0?`${n} / ${r} complete`:`Not planned`}}function Ba({view:e,liveStatus:t,artifacts:n=[],onOpenArtifact:r}){let{t:i}=q(),a=za(e),o=[...n].filter(e=>e.exists&&e.source!==`manager_live`).sort((e,t)=>Number(t.mtime??0)-Number(e.mtime??0)).slice(0,4),s=e.timeline.slice(-6).reverse(),c=e=>e===`done`?`text-ok`:[`running`,`in_progress`,`claimed`].includes(e)?`text-blue-sky`:[`failed`,`blocked`,`rejected`].includes(e)?`text-err`:`text-ink-faint`;return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 text-sm text-ink-dim scroll-thin`,children:[(0,K.jsxs)(`section`,{className:`rounded-lg border border-blue-deep/30 bg-blue-deep/10 p-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-blue-sky`,children:i(`research.currentWork`)}),(0,K.jsx)(`h3`,{className:`mt-2 text-base font-semibold leading-snug text-ink`,children:a.title}),t?.detail?(0,K.jsx)(`p`,{className:`mt-2 leading-6 text-ink-dim`,children:t.detail}):null,(0,K.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 text-xs`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`mission.stage`)}),(0,K.jsx)(`div`,{className:`mt-1 font-medium capitalize text-blue-sky`,children:e.stage.label||e.stage.id||`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`mission.campaign`)}),(0,K.jsx)(`div`,{className:`mt-1 font-mono text-ink`,children:kn(e.mission.campaign_elapsed_seconds)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`mission.round`)}),(0,K.jsxs)(`div`,{className:`mt-1 font-mono text-ink`,children:[e.round.current||`—`,e.round.max?` / ${e.round.max}`:``]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-ink-faint`,children:i(`research.dagProgress`)}),(0,K.jsx)(`div`,{className:`mt-1 font-mono text-ink`,children:a.dagProgress})]})]})]}),(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:i(`mission.researchDag`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.dag.map(e=>(0,K.jsx)(`div`,{className:`rounded-md border border-line/60 bg-panel px-3 py-2.5`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 shrink-0 font-mono text-xs ${c(e.status)}`,children:e.status===`done`?`✓`:[`running`,`in_progress`,`claimed`].includes(e.status)?`●`:`○`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium leading-5 text-ink`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] ${c(e.status)}`,children:e.status})]})]})},e.id))})]}),o.length?(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:i(`research.verifiedOutputs`)}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:o.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),className:`rounded border border-line/70 bg-panel px-2.5 py-1.5 font-mono text-[10px] text-blue-sky hover:border-blue/60`,children:[Pa(e),` ↗`]},e.path))})]}):null,s.length?(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint`,children:i(`research.recentMilestones`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-2 border-l border-line/70 pl-3`,children:s.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs font-medium text-ink`,children:e.title}),e.detail?(0,K.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs leading-5 text-ink-faint`,children:e.detail}):null]},e.id))})]}):null]})}function Va({sid:e,artifacts:t,error:n=!1,onExpand:r,className:i=``,embedded:a=!1,onCollapse:s,missionView:c,activityEvents:l=[]}){let{t:u}=q(),d=(0,M.useMemo)(()=>Ma(t),[t]),f=(0,M.useMemo)(()=>Na(t),[t]),[p,m]=(0,M.useState)(null);(0,M.useEffect)(()=>m(null),[e]);let h=p??Fa(c,t),g=h===ka,_=g?null:d.find(e=>e.path===h)??f,y=Sr(e,_?.exists?_.path:null,_?.mtime??null),b=y.data,[x,S]=(0,M.useState)(null),[C,w]=(0,M.useState)(``),[T,ee]=(0,M.useState)(!1),te=(0,M.useRef)(null),[E,ne]=(0,M.useState)(``),re=(0,M.useMemo)(()=>Ra(c,l),[l,c]);(0,M.useEffect)(()=>{if(S(null),w(``),!e||!_||!b||![`image`,`pdf`,`audio`,`video`].includes(b.kind))return;let t=!0,n=``,r=new AbortController;return R.artifactBlob(e,_.path,!1,r.signal).then(e=>{t&&(n=URL.createObjectURL(e),S(n))},e=>t&&w(e.message)),()=>{t=!1,r.abort(),n&&URL.revokeObjectURL(n)}},[e,_?.path,b?.kind,b?.mtime]);let ie=g?u(`research.liveProgress`):d[0]?.group_title||u(`research.artifact`),ae=async()=>{if(!(!e||!_)){ee(!0),ne(``);try{let t=await R.artifactBlob(e,_.path,!0),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=_.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),0)}catch(e){ne(e.message)}finally{ee(!1)}}};return $r(te,(e,t)=>{te.current&&(t||e.fromTo(te.current,{autoAlpha:0,y:6,scale:.995},{autoAlpha:1,y:0,scale:1,duration:.3,ease:`power2.out`,clearProps:`transform,opacity,visibility`}))},[g,_?.path,b?.kind]),(0,K.jsxs)(`section`,{className:`glass-panel glass-panel--side flex min-h-0 flex-col overflow-hidden ${a?``:`rounded-lg border`} ${i}`,"aria-label":u(`research.canvas`),children:[(0,K.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b border-line/50 bg-panel px-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-blue`}),(0,K.jsx)(`h2`,{className:`max-w-24 truncate text-sm font-semibold text-ink sm:max-w-48`,children:ie})]}),c||d.length>0?(0,K.jsxs)(`label`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:u(`research.previewArtifact`)}),(0,K.jsxs)(`select`,{value:g?ka:_?.path??``,onChange:e=>m(e.target.value),className:`h-8 w-full min-w-0 max-w-64 truncate rounded-md border border-line/50 bg-bg px-2 font-mono text-xs text-ink-dim outline-none focus:border-blue/60`,children:[c?(0,K.jsx)(`option`,{value:ka,children:u(`research.liveProgress`)}):null,d.map(e=>(0,K.jsxs)(`option`,{value:e.path,disabled:!e.exists,children:[e.source===`manager_live`?`Checkpoint · `:``,Pa(e),e.exists?``:` · pending`]},e.path))]})]}):(0,K.jsx)(`div`,{className:`flex-1`}),(0,K.jsx)(`div`,{className:`shrink-0`,children:_?(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>void ae(),disabled:T||!_.exists,title:u(`artifact.download`),"aria-label":u(`artifact.download`),className:`flex h-7 w-7 items-center justify-center rounded-md text-ink-faint hover:bg-surface hover:text-ink disabled:opacity-40`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:(0,K.jsx)(`path`,{d:`M8 2.25v7.5M5.25 7.5 8 10.25 10.75 7.5M3 13.25h10`})})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>r(_.path),title:u(`research.openLarge`),"aria-label":u(`research.openLarge`),className:`flex h-7 w-7 items-center justify-center rounded-md text-ink-faint hover:bg-surface hover:text-ink`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`h-4 w-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:(0,K.jsx)(`path`,{d:`M6 3H3v3M10 3h3v3M6 13H3v-3M10 13h3v-3`})})})]}):null}),s?(0,K.jsx)(`button`,{type:`button`,onClick:s,"aria-label":u(`research.collapse`),title:u(`research.collapse`),className:`hidden h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line/50 bg-bg/40 text-ink-faint hover:border-blue/50 hover:text-ink lg:flex`,children:(0,K.jsx)(o,{icon:v,className:`h-3.5 w-3.5`})}):null]}),re?(0,K.jsxs)(`div`,{className:`shrink-0 border-b border-line/50 bg-blue-deep/10 px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-blue`}),(0,K.jsx)(`span`,{className:`font-semibold text-ink`,children:re.roleLabel}),(0,K.jsx)(`span`,{className:`text-blue-sky`,children:u(`mission.active`)}),(0,K.jsxs)(`span`,{className:`truncate text-ink-faint`,children:[`· `,re.label]})]}),re.detail?(0,K.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-ink-dim`,children:re.detail}):null]}):null,(0,K.jsxs)(`div`,{ref:te,className:`relative flex min-h-0 flex-1 flex-col bg-bg`,children:[g&&c?(0,K.jsx)(Ba,{view:c,liveStatus:re,artifacts:t,onOpenArtifact:r}):null,!g&&n?(0,K.jsx)(`div`,{className:`m-auto max-w-sm px-6 text-center text-sm text-warn`,children:u(`research.unavailable`)}):null,!g&&!n&&d.length===0?(0,K.jsxs)(`div`,{className:`m-auto max-w-sm px-8 text-center`,children:[(0,K.jsx)(`div`,{className:`text-3xl text-ink-faint`,children:`◇`}),(0,K.jsx)(`h3`,{className:`mt-3 text-xs text-ink-faint`,children:u(`research.noPreview`)})]}):null,!g&&!n&&d.length>0&&!_?(0,K.jsxs)(`div`,{className:`m-auto max-w-sm px-8 text-center`,children:[(0,K.jsx)(mi,{}),(0,K.jsx)(`p`,{className:`mt-3 text-xs text-ink-faint`,children:u(`research.waiting`)})]}):null,_&&!_.exists?(0,K.jsxs)(`div`,{className:`m-auto max-w-sm px-8 text-center`,children:[(0,K.jsx)(mi,{}),(0,K.jsx)(`p`,{className:`mt-3 text-xs text-ink-faint`,children:u(`research.updating`)})]}):null,_?.exists&&y.isLoading?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(mi,{})}):null,_?.exists&&y.isError?(0,K.jsxs)(`div`,{className:`m-auto px-6 text-center text-sm text-err`,children:[u(`artifact.unavailable`),` · `,y.error.message]}):null,b?.kind===`text`?(0,K.jsxs)(`pre`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto whitespace-pre-wrap break-words p-5 font-mono text-xs leading-6 text-ink-dim scroll-thin`,children:[b.preview||`(empty file)`,b.truncated?` + +… live preview truncated · expand to inspect the complete file`:``]}):null,b?.kind===`markdown`?(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-5 text-sm text-ink-dim scroll-thin`,children:(0,K.jsx)(bi,{children:b.preview||`(empty file)`})}):null,b?.kind===`json`?(0,K.jsx)(Ea,{value:b.preview||``}):null,b?.kind===`table`?(0,K.jsx)(Da,{value:b.preview||``,delimiter:b.name.endsWith(`.tsv`)?` `:`,`}):null,b?.kind===`html`&&!b.truncated?(0,K.jsx)(Ca,{html:b.preview||``,title:`Live HTML preview: ${b.name}`}):null,b?.kind===`html`&&b.truncated?(0,K.jsx)(`div`,{className:`m-auto max-w-sm px-8 text-center text-sm text-warn`,children:u(`artifact.htmlTooLarge`)}):null,b?.kind===`image`&&x?(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4`,children:(0,K.jsx)(`img`,{src:x,alt:b.why||b.name,className:`max-h-full max-w-full object-contain`})}):null,b?.kind===`pdf`&&x?(0,K.jsx)(`embed`,{src:`${x}#toolbar=0&navpanes=0&scrollbar=0&view=FitH`,type:`application/pdf`,"aria-label":`Live PDF preview: ${b.name}`,className:`min-h-0 flex-1 bg-white`}):null,b?.kind===`audio`&&x?(0,K.jsx)(`div`,{className:`m-auto w-full max-w-xl px-6`,children:(0,K.jsx)(`audio`,{controls:!0,preload:`metadata`,src:x,className:`w-full`})}):null,b?.kind===`video`&&x?(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden bg-black p-2`,children:(0,K.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,src:x,className:`max-h-full max-w-full`})}):null,b?.kind===`binary`?(0,K.jsx)(`div`,{className:`m-auto max-w-sm px-8 text-center text-sm text-ink-dim`,children:u(`research.fileUnavailable`)}):null,b&&[`image`,`pdf`,`audio`,`video`].includes(b.kind)&&!x&&!C?(0,K.jsx)(`div`,{className:`m-auto`,children:(0,K.jsx)(mi,{})}):null,C?(0,K.jsx)(`div`,{className:`m-auto px-6 text-center text-sm text-err`,children:C}):null]},g?ka:_?.path??`empty`),g?(0,K.jsxs)(`footer`,{className:`flex h-9 items-center gap-2 border-t border-line px-4 font-mono text-xs text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:u(`research.eventSourced`)}),(0,K.jsx)(`span`,{className:`shrink-0 text-ok`,children:u(`common.live`)})]}):b?(0,K.jsxs)(`footer`,{className:`flex h-9 items-center gap-2 border-t border-line px-4 font-mono text-xs text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:b.path}),E?(0,K.jsx)(`span`,{className:`ml-auto truncate text-err`,title:E,children:u(`research.downloadFailed`)}):null,(0,K.jsxs)(`span`,{className:`shrink-0`,children:[b.kind,` · `,ri(b.size)]}),(0,K.jsx)(`span`,{className:`shrink-0 text-ok`,children:u(`common.live`)})]}):null]})}function Ha({notice:e,onClose:t}){if((0,M.useEffect)(()=>{if(!e)return;let n=window.setTimeout(t,e.tone===`error`?8e3:4e3);return()=>window.clearTimeout(n)},[e,t]),!e)return null;let n=e.tone===`error`?`border-err/60 bg-err/10 text-err`:e.tone===`success`?`border-ok/60 bg-ok/10 text-ok`:`border-blue-deep/60 bg-panel text-blue-sky`;return(0,K.jsxs)(`div`,{role:e.tone===`error`?`alert`:`status`,"aria-live":e.tone===`error`?`assertive`:`polite`,className:`fixed bottom-4 left-4 right-4 z-[70] flex items-start gap-2 rounded-md border px-3 py-2.5 shadow-glow sm:left-auto sm:max-w-md ${n}`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mt-px shrink-0`,children:e.tone===`error`?`!`:e.tone===`success`?`✓`:`i`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-xs leading-relaxed text-ink-dim`,children:e.message}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`dismiss notification`,onClick:t,className:`shrink-0 rounded px-1 text-base leading-none opacity-70 hover:bg-white/5 hover:opacity-100`,children:`×`})]})}function Ua({open:e,busy:t,onClose:n,onCreate:r}){let{t:i}=q(),[a,o]=(0,M.useState)(``),[s,c]=(0,M.useState)(``),[l,u]=(0,M.useState)(``),d=(0,M.useRef)(null);(0,M.useEffect)(()=>{e&&(o(``),c(``),u(``))},[e]);let f=()=>{t||n()},p=async e=>{e.preventDefault(),!t&&await r(a.trim(),s.trim(),l.trim())&&n()},m=e=>{Fi(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d.current?.requestSubmit())},h=!!s.trim();return(0,K.jsx)(aa,{open:e,onClose:f,label:i(`new.createDaemon`),width:`max-w-xl`,children:(0,K.jsxs)(`form`,{ref:d,onSubmit:e=>void p(e),children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-line px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold text-ink`,children:i(`landing.new`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-ink-faint`,children:i(`new.subtitle`)})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":i(`new.close`),onClick:f,disabled:t,className:`rounded px-2 py-1 text-lg leading-none text-ink-faint hover:bg-surface hover:text-ink disabled:opacity-40`,children:`×`})]}),(0,K.jsxs)(`div`,{className:`space-y-4 p-5`,children:[(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsxs)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:[i(`new.name`),` `,(0,K.jsx)(`span`,{className:`normal-case tracking-normal`,children:i(`new.optional`)})]}),(0,K.jsx)(`input`,{"data-autofocus":!0,value:a,onChange:e=>o(e.target.value),maxLength:80,disabled:t,placeholder:i(`new.namePlaceholder`),className:`h-10 w-full rounded border border-line bg-bg/50 px-3 text-sm text-ink outline-none placeholder:text-ink-faint focus:border-blue-deep disabled:opacity-50`})]}),(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsxs)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:[i(`new.workdir`),` `,(0,K.jsx)(`span`,{className:`normal-case tracking-normal`,children:i(`new.optional`)})]}),(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),disabled:t,placeholder:i(`newDaemon.workdirPlaceholder`),className:`h-10 w-full rounded border border-line bg-bg/50 px-3 font-mono text-xs text-ink outline-none placeholder:text-ink-faint focus:border-blue-deep disabled:opacity-50`}),(0,K.jsx)(`span`,{className:`mt-1 block text-[10px] leading-relaxed text-ink-faint`,children:i(`new.workdirHint`)})]}),(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsxs)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:[i(`new.objective`),` `,(0,K.jsx)(`span`,{className:`normal-case tracking-normal`,children:i(`new.optional`)})]}),(0,K.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),onKeyDown:m,maxLength:4e3,disabled:t,rows:4,placeholder:i(`new.objectivePlaceholder`),className:`w-full resize-y rounded border border-line bg-bg/50 px-3 py-2.5 text-sm leading-relaxed text-ink outline-none placeholder:text-ink-faint focus:border-blue-deep disabled:opacity-50`})]}),(0,K.jsxs)(`div`,{className:`rounded border p-3 ${h?`border-gold/40 bg-gold/5`:`border-line bg-bg/30`}`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium ${h?`text-gold`:`text-blue-sky`}`,children:i(h?`new.startsAfterCreate`:`new.idleUntilMessage`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-ink-faint`,children:i(h?`new.startsHint`:`new.idleHint`)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-line px-5 py-3`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:i(`new.shortcut`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:f,disabled:t,className:`rounded border border-line px-3 py-1.5 text-xs text-ink-dim hover:bg-surface disabled:opacity-40`,children:i(`common.cancel`)}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`rounded border border-blue-deep bg-blue-deep px-3 py-1.5 text-xs font-medium text-ink hover:bg-blue-deep/80 disabled:cursor-wait disabled:opacity-50`,children:i(t?`new.creating`:h?`new.createAndStart`:`sidebar.create`)})]})]})]})})}function Wa({open:e,sid:t,name:n,alive:r,controlAvailable:i=!0,busy:a,onClose:o,onRename:s,onStart:c,onPause:l,onDelete:u}){let{t:d}=q(),[f,p]=(0,M.useState)(n),[m,h]=(0,M.useState)(!1);(0,M.useEffect)(()=>{e&&(p(n),h(!1))},[e,n,t]);let g=async e=>{e.preventDefault(),await s(f.trim())};return(0,K.jsxs)(aa,{open:e,onClose:()=>!a&&o(),label:d(`manage.daemon`),width:`max-w-lg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-line px-5 py-4`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold text-ink`,children:d(`topbar.manageSession`)}),(0,K.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px] text-ink-faint`,children:t})]}),(0,K.jsx)(`form`,{onSubmit:e=>void g(e),className:`border-b border-line p-5`,children:(0,K.jsxs)(`label`,{className:`block`,children:[(0,K.jsx)(`span`,{className:`mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:d(`manage.displayName`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),maxLength:80,disabled:a,className:`h-9 min-w-0 flex-1 rounded border border-line bg-bg/50 px-3 text-sm text-ink outline-none focus:border-blue-deep disabled:opacity-50`}),(0,K.jsx)(`button`,{type:`submit`,disabled:a||f.trim()===n,className:`rounded border border-line px-3 text-xs text-ink-dim hover:bg-surface disabled:opacity-40`,children:d(`common.save`)})]})]})}),(0,K.jsxs)(`div`,{className:`border-b border-line p-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:d(`manage.executor`)}),(0,K.jsxs)(`div`,{className:`mt-2 flex items-center justify-between rounded border border-line bg-bg/30 p-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm text-ink`,children:d(r?i?`manage.running`:`manage.runningExternally`:`manage.paused`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[11px] text-ink-faint`,children:d(r?i?`manage.pauseHint`:`manage.externalHint`:`manage.resumeHint`)})]}),(0,K.jsx)(`button`,{type:`button`,disabled:a||!i,onClick:()=>void(r?l():c()),className:`rounded border px-3 py-1.5 text-xs disabled:cursor-wait disabled:opacity-50 ${r?`border-warn/50 text-warn hover:bg-warn/10`:`border-blue-deep bg-blue-deep text-white hover:bg-blue-deep/80`}`,children:d(a?`manage.working`:i?r?`common.pause`:`manage.resume`:`common.external`)})]})]}),(0,K.jsxs)(`div`,{className:`p-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-err`,children:d(`manage.deleteSession`)}),(0,K.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-ink-faint`,children:d(`manage.deleteHint`)}),m?(0,K.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 rounded border border-err/40 bg-err/5 p-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-ink-dim`,children:d(`manage.confirmQuestion`)}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(!1),className:`rounded px-2 py-1 text-xs text-ink-faint hover:bg-surface`,children:d(`common.cancel`)}),(0,K.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>void u(),className:`rounded bg-err px-3 py-1 text-xs font-medium text-bg disabled:opacity-50`,children:d(`manage.confirmDelete`)})]})]}):(0,K.jsx)(`button`,{type:`button`,disabled:a||r,onClick:()=>h(!0),className:`mt-3 rounded border border-err/40 px-3 py-1.5 text-xs text-err hover:bg-err/10 disabled:cursor-not-allowed disabled:opacity-40`,children:d(`manage.delete`)})]})]})}function Ga(e,t,n){if(e.length===0)return`local`;let r=n.trim(),i=r?e.filter(e=>e.launch_cwd?.trim()===r):[];return i.length===0||t&&!i.some(e=>e.id===t)?`all`:`local`}function Ka({projects:e,activeId:t,localCwd:n,onSelect:r,onPrefetch:i,onManage:s,onOpenPanel:c,onNew:l,loading:m,creating:h=!1,error:g,onRetry:_,mobileOpen:y=!1,collapsed:b=!1,onToggleCollapse:x,themeMode:S,onCycleTheme:w,expandedWidth:T=256}){let{locale:ee,setLocale:te,t:E}=q(),[ne,re]=(0,M.useState)(`local`),ie=(0,M.useRef)(!1),[ae,D]=(0,M.useState)(``),O=b&&!y,oe=n.trim(),se=(0,M.useMemo)(()=>oe?e.filter(e=>e.launch_cwd?.trim()===oe):[],[oe,e]);(0,M.useEffect)(()=>{ie.current||m||e.length===0||(ie.current=!0,re(Ga(e,t,oe)))},[t,m,oe,e]);let ce=ne===`local`?se:e,k=ae.trim()?Xt(ce,ae):ce,le=(0,M.useMemo)(()=>{if(ne===`local`)return k.length>0?[[oe||`Local`,k]]:[];let e=new Map;return k.forEach(t=>{let n=t.launch_cwd?.trim()||E(`common.unassigned`),r=e.get(n)??[];r.push(t),e.set(n,r)}),[...e.entries()]},[oe,ne,k]),A=S===`light`?a:p,ue=S===`light`?`dark`:`light`;return(0,K.jsxs)(`aside`,{"data-state":O?`collapsed`:`expanded`,style:{"--sidebar-width":`${T}px`},className:`glass-panel glass-panel--side fixed inset-y-0 left-0 z-40 flex h-full shrink-0 flex-col border-r transition-[width,transform,visibility] duration-panel ease-panel lg:visible lg:static lg:z-auto lg:translate-x-0 ${O?`w-14`:`w-64 lg:w-[var(--sidebar-width)]`} ${y?`visible translate-x-0`:`invisible -translate-x-full`}`,children:[(0,K.jsx)(`div`,{className:`flex h-12 shrink-0 items-center border-b border-line/50 ${O?`justify-center`:`justify-between px-4`}`,children:O?(0,K.jsx)(wi,{size:22,compact:!0}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(wi,{size:24}),(0,K.jsx)(`button`,{type:`button`,onClick:x,"aria-label":E(`sidebar.collapse`),title:`${E(`sidebar.collapse`)} · Ctrl/⌘ B`,className:`icon-control flex h-8 w-8 shrink-0 items-center justify-center`,children:(0,K.jsx)(o,{icon:C,className:`h-3.5 w-3.5`})})]})}),O?(0,K.jsx)(`div`,{className:`flex h-12 shrink-0 items-center justify-center`,children:(0,K.jsx)(`button`,{type:`button`,onClick:x,"aria-label":E(`sidebar.expand`),title:`${E(`sidebar.expand`)} · Ctrl/⌘ B`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line/50 bg-bg/40 text-ink-faint hover:border-blue/50 hover:text-ink`,children:(0,K.jsx)(o,{icon:v,className:`h-3.5 w-3.5`})})}):null,O?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-1 border-b border-line/50 px-3`,children:[[`local`,`all`].map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>re(t),className:`h-8 rounded-md px-3 text-xs font-medium capitalize transition-colors ${ne===t?`bg-bg text-ink`:`text-ink-faint hover:text-ink-dim`}`,children:[E(`common.${t}`),(0,K.jsx)(`span`,{className:`ml-1.5 font-mono text-ink-faint`,children:t===`local`?se.length:e.length})]},t)),(0,K.jsx)(`button`,{type:`button`,onClick:l,disabled:h,"aria-label":E(`sidebar.create`),title:E(`sidebar.create`),className:`ml-auto flex h-8 w-8 items-center justify-center rounded-md text-lg text-blue hover:bg-bg disabled:opacity-40`,children:h?`…`:`+`})]}),(0,K.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,K.jsx)(`label`,{className:`sr-only`,htmlFor:`daemon-search`,children:E(`sidebar.find`)}),(0,K.jsxs)(`div`,{className:`flex items-center rounded-md border border-line/60 bg-bg/60 px-2 focus-within:border-blue/60`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mr-1.5 text-xs text-ink-faint`,children:`/`}),(0,K.jsx)(`input`,{id:`daemon-search`,value:ae,onChange:e=>D(e.target.value),placeholder:E(`sidebar.find`),className:`h-8 min-w-0 flex-1 bg-transparent text-xs text-ink outline-none placeholder:text-ink-faint`}),ae?(0,K.jsx)(`button`,{type:`button`,"aria-label":E(`sidebar.clearSearch`),onClick:()=>D(``),className:`px-1 text-sm text-ink-faint hover:text-ink`,children:`×`}):null]})]}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-3 pb-3 scroll-thin`,children:[m&&e.length===0?(0,K.jsx)(`div`,{className:`px-1 py-3 text-xs text-ink-faint`,children:E(`common.loading`)}):null,g?(0,K.jsx)(`button`,{type:`button`,onClick:_,className:`mb-2 w-full rounded-md bg-err/5 px-3 py-2 text-left text-xs text-err`,children:E(`sidebar.refreshFailed`)}):null,!m&&!g&&k.length===0?(0,K.jsx)(`div`,{className:`px-1 py-4 text-xs text-ink-faint`,children:E(`sidebar.noSessions`)}):null,le.map(([e,n])=>(0,K.jsxs)(`section`,{className:`mb-4 last:mb-0`,children:[(0,K.jsx)(`div`,{className:`mb-1 truncate px-1 font-mono text-xs text-ink-faint`,title:e,children:e}),n.map(e=>{let n=e.id===t;return(0,K.jsxs)(`div`,{"data-active":n?`true`:`false`,onPointerEnter:()=>{n||i?.(e.id)},className:`session-card group relative mb-1 w-full rounded-md transition-colors duration-150 ease-panel ${n?`text-ink`:`text-ink-dim hover:text-ink`}`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`absolute left-0 transition-colors ${n?`inset-y-1 w-px bg-blue`:`inset-y-2 w-px bg-transparent group-hover:bg-ink-faint/30`}`}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),onFocus:()=>{n||i?.(e.id)},"aria-current":n?`page`:void 0,title:`${e.label||e.id}${e.objective?` — ${e.objective}`:``}`,className:`w-full min-w-0 px-3 py-2.5 pr-10 text-left`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(ui,{ok:e.daemon_alive,title:e.daemon_alive?E(`sidebar.daemonAlive`):E(`sidebar.stopped`)}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.label||e.id})]}),(0,K.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center justify-between gap-2 pl-4 text-xs text-ink-faint`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.daemon_alive?E(`sidebar.runningFor`,{uptime:ti(e.uptime_seconds)}):J(e.last_active)}),(0,K.jsx)(Fr,{settledUsd:e.spend_usd,knownUsd:e.known_cost_usd,status:e.spend_status,calls:e.usage_calls,premiumRequests:e.premium_requests,live:e.daemon_alive})]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>s(e.id),"aria-label":E(`sidebar.manage`,{name:e.label||e.id}),title:E(`sidebar.manageHint`),className:`absolute right-1.5 top-1.5 flex h-8 w-8 items-center justify-center rounded-md text-ink-faint opacity-100 transition-opacity hover:bg-panel-raised hover:text-ink sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,K.jsx)(o,{icon:u,className:`h-4 w-4`})})]},e.id)})]},e))]}),(0,K.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between border-t border-line/50 px-4 py-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(`config`),className:`icon-control flex h-8 w-8 items-center justify-center`,"aria-label":E(`sidebar.openSettings`),title:E(`common.settings`),children:(0,K.jsx)(o,{icon:d,className:`h-3.5 w-3.5`})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>te(ee===`zh-CN`?`en`:`zh-CN`),title:E(`language.switchTo`,{language:E(ee===`zh-CN`?`language.english`:`language.chinese`)}),"aria-label":E(`language.switchTo`,{language:E(ee===`zh-CN`?`language.english`:`language.chinese`)}),className:`icon-control flex h-8 w-8 items-center justify-center`,children:(0,K.jsx)(o,{icon:f,className:`h-3.5 w-3.5`})}),(0,K.jsx)(`button`,{type:`button`,onClick:w,title:E(`sidebar.theme`,{current:S,next:ue}),"aria-label":E(`sidebar.theme`,{current:S,next:ue}),className:`icon-control flex h-8 w-8 items-center justify-center`,children:(0,K.jsx)(o,{icon:A,className:`h-3.5 w-3.5`})})]})]})]})}var qa={in_progress:`#8fa7b8`,running:`#8fa7b8`,pending:`#7e7d75`,queued:`#7e7d75`,done:`#7fa386`,completed:`#7fa386`,blocked:`#c77b72`,failed:`#c77b72`};function Ja({items:e,onDispose:t,onStop:n,onInspect:r,busy:i,readOnly:a=!1}){let{t:o}=q(),[s,c]=(0,M.useState)(!1),l=Rn(e,!1),u=Rn(e,!0),d=s?u:l;return(0,K.jsxs)(`section`,{className:`card flex flex-col ${d.length>0?`min-h-0 flex-1`:`shrink-0`}`,children:[(0,K.jsx)(pi,{title:o(`panel.backlog`),right:(0,K.jsx)(`button`,{className:`text-[10px] text-ink-faint transition-colors hover:text-ink`,onClick:()=>c(e=>!e),children:s?`active · ${l.length}`:`history · ${u.length}`})}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto scroll-thin`,children:[d.length===0&&(0,K.jsx)(hi,{children:s?`no completed runs yet`:`nothing queued — Argus is standing by`}),d.map(e=>{let o=qa[e.status]??`#8a93a6`,s=e.iterate;return(0,K.jsx)(`div`,{className:`group border-b border-line/60 px-3 py-2 last:border-0`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>r?.(e.id),disabled:!r,className:`block max-w-full truncate text-left text-xs font-medium text-ink enabled:hover:text-blue-sky enabled:focus-visible:outline-none enabled:focus-visible:underline`,title:r?`view full task details`:void 0,children:e.title||e.objective}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-ink-faint`,children:e.id.slice(0,8)}),(0,K.jsx)(di,{color:o,children:e.status}),typeof e.priority==`number`&&(0,K.jsxs)(`span`,{className:`text-[10px] text-ink-faint`,children:[`p`,e.priority]}),s&&(0,K.jsx)(`span`,{className:`text-[10px] text-blue-sky`,children:`↻ iterating`})]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100`,children:[!a&&s&&(0,K.jsx)(fi,{variant:`ghost`,onClick:()=>n(e.id),disabled:i,title:`stop iterating`,children:`stop`}),!a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(fi,{variant:`ghost`,onClick:()=>t(e.id,`done`),disabled:i,title:`mark done`,children:`✓`}),(0,K.jsx)(fi,{variant:`ghost`,onClick:()=>t(e.id,`rm`),disabled:i,title:`remove`,children:`✕`})]})]})]})},e.id)})]})]})}var Ya={win:`#7fa386`,milestone:`#c7a66a`,insight:`#8fa7b8`,decision:`#a69daf`,failure:`#c77b72`,note:`#7e7d75`};function Xa({entries:e}){let{t}=q(),n=[...e].reverse();return(0,K.jsxs)(`section`,{className:`card flex min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(pi,{title:t(`panel.journal`),right:(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:e.length})}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto scroll-thin`,children:[e.length===0&&(0,K.jsx)(hi,{children:`no journal entries yet`}),n.map(e=>{let t=Ya[e.kind]??`#8a93a6`,n=String(e.extra?.pricing_status??``),r=e.extra&&Object.prototype.hasOwnProperty.call(e.extra,`cost_usd`)?e.extra.cost_usd:e.cost_usd,i=typeof r==`number`&&r>0?`${ni(r)}${n===`partial`||n===`unpriced`?`+`:``}`:n===`partial`||n===`unpriced`?n:``;return(0,K.jsxs)(`div`,{className:`border-b border-line/60 px-3 py-2 last:border-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full`,style:{background:t}}),(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide`,style:{color:t},children:e.kind}),(0,K.jsx)(`span`,{className:`ml-auto text-[10px] text-ink-faint`,children:J(e.ts)})]}),(0,K.jsx)(`div`,{className:`mt-1 text-xs font-medium text-ink`,children:e.title}),e.summary&&(0,K.jsx)(`div`,{className:`mt-0.5 text-[11px] leading-snug text-ink-dim`,children:e.summary}),(0,K.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:[(e.tags??[]).slice(0,4).map(e=>(0,K.jsx)(`span`,{className:`rounded bg-line/60 px-1 text-[9px] text-ink-faint`,children:e},e)),i?(0,K.jsx)(`span`,{className:`ml-auto text-[10px] text-ink-faint`,children:i}):null]})]},e.id)})]})]})}var Za=[`manager`,`planner`,`engineer`,`reviewer`];function Qa(e){return e==null?``:e<3?`now`:e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m`:`${Math.floor(e/3600)}h`}function $a({roles:e}){let{t}=q(),n=new Map(e.map(e=>[e.role,e])),r=Za.map(e=>n.get(e)).filter(Boolean),i=e.filter(e=>!Za.includes(e.role)),a=[...r,...i];return(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(pi,{title:t(`panel.roles`)}),(0,K.jsx)(`div`,{children:a.map(e=>{let t=z.role[e.role]??z.info;return(0,K.jsxs)(`div`,{className:`grid grid-cols-[84px_minmax(0,1fr)_auto] items-center gap-2 border-b border-line/60 px-3 py-2 last:border-b-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full`,style:{background:e.active?t:`rgb(var(--ink-faint))`}}),(0,K.jsx)(`span`,{className:`text-[11px] font-medium capitalize`,style:{color:e.active?t:z.inkDim},children:e.role})]}),(0,K.jsx)(`div`,{className:`min-w-0 truncate font-mono text-[10px] text-ink-faint`,title:e.model,children:e.model||`—`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 text-right`,children:[(0,K.jsx)(`span`,{className:`text-[10px]`,style:{color:e.active?z.ink:z.inkFaint},children:e.active?e.status||`active`:`idle`}),e.active&&Qa(e.age_s)&&(0,K.jsxs)(`span`,{className:`text-[10px] tabular-nums text-ink-faint`,children:[`· `,Qa(e.age_s)]}),e.effort&&(0,K.jsxs)(`span`,{className:`text-[10px]`,style:{color:dt(e.effort)},children:[`· `,e.effort]})]})]},e.role)})})]})}function eo({open:e,snap:t,journal:n,busy:r,onClose:i,onDispose:a,onStop:o,onInspect:s}){let{t:c}=q();return(0,K.jsxs)(aa,{open:e,onClose:i,label:`Project inspector`,width:`max-w-6xl`,children:[(0,K.jsx)(oa,{title:c(`panel.project`),sub:t.session.display_name||t.session.id}),(0,K.jsxs)(`div`,{className:`h-[68vh] min-h-0 space-y-3 overflow-y-auto bg-bg p-3 scroll-thin lg:grid lg:grid-cols-[minmax(0,1.4fr)_minmax(300px,0.8fr)] lg:gap-3 lg:space-y-0 lg:overflow-hidden`,children:[(0,K.jsx)(Ja,{items:t.backlog,onDispose:a,onStop:o,onInspect:s,busy:r}),(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,K.jsx)($a,{roles:t.roles}),(0,K.jsx)(Xa,{entries:n})]})]})]})}var to=e=>e?new Date(e*1e3).toLocaleString():`—`;function no({label:e,value:t}){return(0,K.jsxs)(`div`,{className:`rounded-md border border-line/70 bg-bg/40 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[9px] font-semibold uppercase tracking-wider text-ink-faint`,children:e}),(0,K.jsx)(`div`,{className:`mt-0.5 text-xs text-ink-dim`,children:t})]})}function ro({sid:e,itemId:t,onClose:n,onDone:r,onSkip:i,onStop:a,busy:o,readOnly:s=!1}){let{t:c}=q(),l=wr(e,t),u=l.data,d=u?Ln(u):!1,f=ln(u?.outcome);return(0,K.jsxs)(aa,{open:!!t,onClose:n,label:c(`task.details`),width:`max-w-3xl`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3 border-b border-line px-4 py-3 sm:flex-nowrap sm:px-5`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`truncate text-sm font-semibold text-ink`,children:u?.title||c(`task.details`)}),u?(0,K.jsx)(di,{children:u.status}):null]}),(0,K.jsx)(`p`,{className:`mt-0.5 font-mono text-[10px] text-ink-faint`,children:t})]}),!s&&u&&!d?(0,K.jsxs)(`div`,{className:`order-3 flex w-full shrink-0 items-center justify-end gap-1 sm:order-none sm:w-auto`,children:[u.iterate?(0,K.jsx)(fi,{onClick:()=>a(u.id),disabled:o,children:c(`task.stopLoop`)}):null,(0,K.jsx)(fi,{onClick:()=>r(u.id),disabled:o,children:c(`task.done`)}),(0,K.jsx)(fi,{variant:`danger`,onClick:()=>i(u.id),disabled:o,children:c(`task.skip`)})]}):null,(0,K.jsx)(`button`,{type:`button`,"aria-label":c(`task.close`),onClick:n,className:`order-2 rounded-md px-2 py-1 text-lg leading-none text-ink-faint hover:bg-surface hover:text-ink sm:order-none`,children:`×`})]}),(0,K.jsxs)(`div`,{className:`max-h-[70vh] overflow-y-auto p-4 scroll-thin sm:p-5`,children:[l.isLoading?(0,K.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,K.jsx)(mi,{})}):null,l.isError?(0,K.jsx)(`div`,{className:`rounded-md border border-err/40 bg-err/5 p-3 text-xs text-err`,children:l.error.message}):null,u?(0,K.jsxs)(`div`,{className:`space-y-4`,children:[u.pending_question?(0,K.jsxs)(`div`,{className:`rounded-lg border border-warn/40 bg-warn/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-warn`,children:c(`task.waitingOnYou`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm leading-relaxed text-ink`,children:u.pending_question})]}):null,(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.objective`)}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap rounded-lg border border-line bg-bg/50 p-3 text-sm leading-relaxed text-ink-dim`,children:u.objective||u.original_objective||c(`task.noObjective`)})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,K.jsx)(no,{label:c(`task.priority`),value:`p${u.priority}`}),(0,K.jsx)(no,{label:c(`task.started`),value:to(u.started_ts)}),(0,K.jsx)(no,{label:c(`task.finished`),value:to(u.finished_ts)})]}),f.length?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.outcome`)}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:f.map(e=>(0,K.jsx)(di,{children:e},e))})]}):null,u.iterate||u.iteration_cycles_done||u.iteration_cost_usd?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.iteration`)}),(0,K.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,K.jsx)(no,{label:c(`task.mode`),value:u.iterate?c(`task.autoIterate`):c(`task.singlePass`)}),(0,K.jsx)(no,{label:c(`task.cycles`),value:`${u.iteration_cycles_done??0}/${u.iteration_max_cycles??`—`}`}),(0,K.jsx)(no,{label:c(`task.cost`),value:`$${(u.iteration_cost_usd??0).toFixed(2)}`})]})]}):null,u.last_error?(0,K.jsxs)(`section`,{className:`rounded-lg border border-err/30 bg-err/5 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-err`,children:c(`task.lastError`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap font-mono text-xs leading-relaxed text-ink-dim`,children:u.last_error})]}):null,u.notes?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wider text-ink-faint`,children:c(`task.notes`)}),(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-xs leading-relaxed text-ink-dim`,children:u.notes})]}):null,u.tags?.length||u.deps?.length?(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(u.tags??[]).map(e=>(0,K.jsxs)(di,{children:[`#`,e]},`tag-${e}`)),(u.deps??[]).map(e=>(0,K.jsxs)(di,{children:[c(`task.dependsOn`),` `,e]},`dep-${e}`))]}):null]}):null]})]})}function io({onPointerDown:e,onReset:t,onNudge:n,value:r,min:i=240,max:a=600,label:o=`Resize panel`}){return(0,K.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":o,"aria-valuenow":r,"aria-valuemin":i,"aria-valuemax":a,tabIndex:0,onPointerDown:e,onDoubleClick:t,onKeyDown:e=>{e.key===`ArrowLeft`?(e.preventDefault(),n(-16)):e.key===`ArrowRight`?(e.preventDefault(),n(16)):e.key===`Home`&&(e.preventDefault(),t())},className:`group relative hidden w-2 shrink-0 cursor-col-resize items-center justify-center outline-none lg:flex`,children:(0,K.jsx)(`span`,{className:`h-full w-px bg-line/30 transition-colors duration-150 group-hover:bg-blue/70 group-focus:bg-blue/70`})})}var ao=[`manager`,`planner`,`engineer`,`reviewer`];function oo(e){let t=[...e.dag],n=[],r=new Set;for(;t.length;){let i=t.findIndex(t=>t.deps.every(t=>r.has(t)||!e.dag.some(e=>e.id===t))),[a]=t.splice(i>=0?i:0,1);n.push(a),r.add(a.id)}return n}function so(e,t=16){let n=oo(e);if(n.length<=t)return{nodes:n,hidden:[]};let r=new Set(n.slice(-t).map(e=>e.id)),i=n.find(e=>[`running`,`in_progress`,`claimed`].includes(e.status)),a=new Map(n.map(e=>[e.id,e])),o=i?[i]:[];for(;o.length;){let e=o.pop();r.has(e.id)||(r.add(e.id),e.deps.forEach(e=>{let t=a.get(e);t&&o.push(t)}))}return{nodes:n.filter(e=>r.has(e.id)),hidden:n.filter(e=>!r.has(e.id))}}function co({view:e}){let{t}=q(),n=e.achievement;return n?(0,K.jsxs)(`section`,{className:`border-b border-ok/35 bg-ok/5 px-5 py-4 animate-appear`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ok`,children:t(`mission.achievement`)}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-ink`,children:n.title}),n.summary?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-ink-dim`,children:n.summary}):null,(0,K.jsxs)(`div`,{className:`mt-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`text-ink-faint`,children:[t(`mission.elapsed`),` `]}),(0,K.jsx)(`span`,{className:`font-mono text-ink`,children:kn(n.elapsed_seconds??0)})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[11px] text-ink-dim`,children:[(0,K.jsx)(`span`,{children:t(`mission.rejectedAttempts`,{count:n.rejected_attempts??0})}),(0,K.jsx)(`span`,{children:t(`mission.skillsLearned`,{count:n.skills_learned??0})}),(0,K.jsx)(`span`,{children:t(`mission.artifacts`,{count:n.artifacts??0})})]})]}):null}function lo({view:e,onOpenArtifact:t,gitDiff:n}){let{t:r}=q(),i=new Map(e.roles.map(e=>[e.role,e])),a=e.dag.find(e=>[`running`,`in_progress`,`claimed`].includes(e.status)),o=so(e),s=o.nodes,c=On(e.mission.objective||e.mission.title||r(`mission.waiting`)),[l,u]=(0,M.useState)(Math.max(0,e.timeline.length-1)),[d,f]=(0,M.useState)(e.active_role||`planner`),[p,m]=(0,M.useState)(a?.id||``),h=ln(e.outcome),g=hn(e.routing);(0,M.useEffect)(()=>u(Math.max(0,e.timeline.length-1)),[e.timeline.length]),(0,M.useEffect)(()=>{a?.id&&m(a.id)},[a?.id]);let _=e.timeline.slice(0,l+1).slice(-12).reverse(),v=e.dag.find(e=>e.id===p),y=e.role_work.filter(e=>e.role===d).filter(e=>!p||!e.item_id||e.item_id===p).slice(-40).reverse();return(0,K.jsxs)(`section`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto bg-panel scroll-thin`,"aria-label":r(`mission.control`),children:[(0,K.jsxs)(`header`,{className:`border-b border-line/60 px-5 py-5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mobile.mission`)}),(0,K.jsx)(`div`,{role:`heading`,"aria-level":1,className:`mt-1 line-clamp-4 max-w-4xl text-lg font-semibold leading-snug text-ink`,title:c,children:(0,K.jsx)(bi,{children:c})}),c.length>600?(0,K.jsxs)(`details`,{className:`mt-2 text-xs text-ink-faint`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer hover:text-ink`,children:r(`mission.showObjective`)}),(0,K.jsx)(`div`,{className:`mt-2 text-ink-dim`,children:(0,K.jsx)(bi,{children:c})})]}):null,(0,K.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-x-6 gap-y-3 text-xs sm:grid-cols-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(`mission.stage`)}),(0,K.jsx)(`div`,{className:`mt-0.5 font-medium capitalize text-blue-sky`,children:e.stage.label||e.stage.id||`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(e.routing.open_ended?`mission.campaign`:`mission.totalElapsed`)}),(0,K.jsx)(`div`,{className:`mt-0.5 font-mono text-ink`,children:kn(e.mission.campaign_elapsed_seconds)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(`mission.round`)}),(0,K.jsxs)(`div`,{className:`mt-0.5 font-mono text-ink`,children:[e.round.current||`—`,e.round.max?` / ${e.round.max}`:``]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-ink-faint`,children:r(`mission.mode`)}),(0,K.jsx)(`div`,{className:`mt-0.5 font-mono text-ink`,children:g||`—`})]})]}),h.length?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-x-3 gap-y-1 font-mono text-[10px] text-ink-dim`,children:h.map(e=>(0,K.jsx)(`span`,{children:e},e))}):null,e.mission.summary?(0,K.jsxs)(`div`,{className:`mt-3 rounded border border-ok/25 bg-ok/5 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em] text-ok`,children:r(`mission.summary`)}),(0,K.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-xs leading-relaxed text-ink-dim`,children:e.mission.summary})]}):null,e.frontier.change?(0,K.jsxs)(`div`,{className:`mt-3 rounded border border-blue/25 bg-blue/5 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em] text-blue-sky`,children:[`Task frontier · `,e.frontier.change.replaceAll(`_`,` `)]}),e.frontier.summary?(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-dim`,children:e.frontier.summary}):null]}):null]}),(0,K.jsx)(co,{view:e}),(0,K.jsxs)(`section`,{className:`border-b border-line/60 px-5 py-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.team`)}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2 xl:grid-cols-4`,children:ao.map(e=>{let t=i.get(e),n=t?.status===`active`,a=t?.status===`rejected`||t?.status===`error`,o=z.role[e]??z.inkFaint;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>f(e),className:`min-w-0 border-l-2 pl-3 text-left ${d===e?`bg-white/[0.03]`:``}`,style:{borderColor:n||t?.status===`done`?o:`rgb(var(--line))`},children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 rounded-full ${n?`animate-pulse motion-reduce:animate-none`:``}`,style:{background:a?z.error:n||t?.status===`done`?o:z.inkFaint}}),(0,K.jsx)(`span`,{className:`text-xs font-semibold capitalize`,style:{color:o},children:e})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate text-xs ${a?`text-err`:`text-ink-dim`}`,children:t?.label||r(`mission.waitingShort`)})]},e)})})]}),(0,K.jsxs)(`section`,{className:`border-b border-line/60 px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:[r(`mission.roleWork`),` · `,(0,K.jsx)(`span`,{className:`text-blue-sky`,children:d})]}),v?(0,K.jsx)(`button`,{type:`button`,onClick:()=>m(``),className:`text-[10px] text-ink-faint hover:text-ink`,children:r(`mission.filteredBy`,{task:v.title||v.id})}):(0,K.jsx)(`span`,{className:`text-[10px] text-ink-faint`,children:r(`mission.allVisible`)})]}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 lg:grid-cols-2`,children:[y.map(e=>(0,K.jsxs)(`article`,{className:`min-w-0 rounded border border-line/60 bg-bg/35 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-medium text-ink`,children:e.title}),(0,K.jsx)(`time`,{className:`shrink-0 font-mono text-[10px] text-ink-faint`,children:new Date(e.ts*1e3).toISOString().slice(11,19)})]}),(0,K.jsxs)(`div`,{className:`mt-1 flex gap-2 font-mono text-[10px] text-ink-faint`,children:[(0,K.jsx)(`span`,{children:e.kind}),e.status?(0,K.jsx)(`span`,{children:e.status}):null,e.round_index==null?null:(0,K.jsx)(`span`,{children:r(`mission.roundNumber`,{count:e.round_index})})]}),e.detail?(0,K.jsx)(`p`,{className:`mt-2 max-h-36 overflow-auto whitespace-pre-wrap text-[11px] leading-5 text-ink-dim scroll-thin`,children:e.detail}):null]},e.id)),y.length?null:(0,K.jsx)(`div`,{className:`col-span-full py-8 text-center text-xs text-ink-faint`,children:r(`mission.noRoleWork`,{role:d})})]})]}),(0,K.jsxs)(`div`,{className:`grid min-h-[320px] border-b border-line/60 lg:grid-cols-[minmax(0,1.15fr)_minmax(260px,0.85fr)]`,children:[(0,K.jsxs)(`section`,{className:`min-w-0 border-b border-line/60 px-5 py-4 lg:border-b-0 lg:border-r`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.researchDag`)}),a?(0,K.jsxs)(`span`,{className:`max-w-48 truncate text-[10px] text-blue-sky`,children:[r(`mission.active`),` · `,a.title]}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-0`,children:[o.hidden.length?(0,K.jsxs)(`div`,{className:`mb-3 rounded border border-line/60 bg-bg/50 px-3 py-2 text-[10px] text-ink-faint`,children:[o.hidden.length,` earlier tasks collapsed · `,o.hidden.filter(e=>[`failed`,`blocked`].includes(e.status)).length,` failed · `,o.hidden.filter(e=>e.status===`skipped`).length,` skipped`]}):null,s.length?s.map((e,t)=>{let n=e.id===a?.id,r=[`done`,`completed`].includes(e.status),i=[`failed`,`blocked`].includes(e.status);return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>m(e.id),className:`relative flex w-full min-w-0 gap-3 pb-3 text-left last:pb-0 ${p===e.id?`bg-white/[0.03]`:``}`,children:[t(0,K.jsx)(`li`,{children:e},e))})]}):null]}):null]}),(0,K.jsxs)(`section`,{className:`min-w-0 px-5 py-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.capabilities`)}),e.learned_skills.length?(0,K.jsxs)(`div`,{className:`mt-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-[0.12em] text-ok`,children:r(`mission.capabilitiesUnlocked`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.learned_skills.filter(e=>e.status===`active`).slice(-8).map(e=>(0,K.jsxs)(`details`,{className:`rounded border border-ok/35 bg-ok/5 px-2 py-1.5`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer text-[10px] text-ok`,children:String(e.name||e.id)}),(0,K.jsxs)(`div`,{className:`mt-2 space-y-1 font-mono text-[9px] text-ink-faint`,children:[e.mission_title?(0,K.jsxs)(`div`,{children:[`evolved during · `,e.mission_title]}):null,e.path?(0,K.jsxs)(`div`,{className:`break-all`,children:[`path · `,e.path]}):null,(0,K.jsxs)(`div`,{children:[`version · `,e.version,` · scope · `,e.scope||`project`]})]}),e.content?(0,K.jsxs)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap border-t border-ok/20 pt-2 font-mono text-[10px] leading-5 text-ink-dim scroll-thin`,children:[e.content,e.content_truncated?` +… content truncated`:``]}):(0,K.jsx)(`div`,{className:`mt-2 text-[10px] text-ink-faint`,children:r(`mission.skillUnavailable`)})]},String(e.id)))})]}):null,e.learned_wiki_pages.some(e=>e.status!==`retired`)?(0,K.jsxs)(`div`,{className:`mt-4 border-t border-line/50 pt-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-[0.12em] text-blue-sky`,children:r(`mission.knowledgeRetained`)}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.learned_wiki_pages.filter(e=>e.status!==`retired`).slice(-6).map(e=>(0,K.jsx)(`span`,{className:`rounded border border-blue/35 bg-blue/5 px-2 py-1 text-[10px] text-blue-sky`,children:String(e.title||e.id)},String(e.id)))})]}):null,e.storage.project_skill_dir||e.storage.global_skill_dir||e.storage.wiki_paths.length||e.storage.skill_history_compressed||e.storage.wiki_retired_compressed?(0,K.jsxs)(`div`,{className:`mt-4 border-t border-line/50 pt-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-[0.12em] text-ink-faint`,children:r(`mission.selfEvolution`)}),(0,K.jsxs)(`div`,{className:`mt-2 space-y-1 font-mono text-[10px] text-ink-dim`,children:[e.storage.project_skill_dir?(0,K.jsxs)(`div`,{className:`break-all`,children:[`project skills (`,e.storage.project_skill_count,`) · `,e.storage.project_skill_dir]}):null,e.storage.global_skill_dir?(0,K.jsxs)(`div`,{className:`break-all`,children:[`global skills (`,e.storage.global_skill_count,`) · `,e.storage.global_skill_dir]}):null,e.storage.wiki_paths.map(e=>(0,K.jsxs)(`div`,{className:`break-all`,children:[`project wiki · `,e]},e)),e.storage.skill_history_compressed||e.storage.wiki_retired_compressed?(0,K.jsxs)(`div`,{children:[`cold history · skill `,e.storage.skill_history_compressed,` · wiki `,e.storage.wiki_retired_compressed,` · `,ri(e.storage.skill_history_bytes_saved+e.storage.wiki_retired_bytes_saved),` saved`]}):null]})]}):null]})]}),(0,K.jsxs)(`section`,{className:`px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-ink-faint`,children:r(`mission.replay`)}),e.timeline.length>1?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{type:`range`,min:0,max:e.timeline.length-1,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":r(`mission.replayTimeline`),className:`h-1 min-w-32 flex-1 accent-blue`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-ink-faint`,children:[l+1,`/`,e.timeline.length]})]}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[_.map(e=>(0,K.jsxs)(`div`,{className:`grid grid-cols-[44px_10px_minmax(0,1fr)] gap-2 text-xs`,children:[(0,K.jsx)(`time`,{className:`font-mono text-[10px] text-ink-faint`,children:new Date(e.ts*1e3).toISOString().slice(11,16)}),(0,K.jsx)(`span`,{className:`mt-1 h-2 w-2 rounded-full ${e.tone===`error`?`bg-err`:e.tone===`success`||e.tone===`metric`||e.tone===`skill`?`bg-ok`:`bg-blue`}`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`font-medium text-ink`,children:e.title}),e.detail?(0,K.jsxs)(`span`,{className:`text-ink-dim`,children:[` · `,e.detail]}):null]})]},e.id)),e.timeline.length?null:(0,K.jsx)(`div`,{className:`py-10 text-center text-xs text-ink-faint`,children:r(`mission.waitingEvents`)})]}),e.artifacts.length?(0,K.jsx)(`div`,{className:`mt-5 flex flex-wrap gap-2 border-t border-line/50 pt-4`,children:e.artifacts.slice(-8).map(e=>{let n=String(e.path||``);return(0,K.jsx)(`button`,{type:`button`,disabled:!n||!t,onClick:()=>n&&t?.(n),className:`rounded border border-line px-2 py-1 font-mono text-[10px] text-blue-sky hover:border-blue-sky/50 disabled:text-ink-faint`,children:String(e.title||n)},String(e.id||n))})}):null,n?.available&&(n.status||n.diff)?(0,K.jsxs)(`details`,{className:`mt-5 border-t border-line/50 pt-4`,children:[(0,K.jsxs)(`summary`,{className:`cursor-pointer text-[10px] font-semibold uppercase tracking-[0.14em] text-ink-faint hover:text-ink`,children:[`Git changes`,n.branch?` · ${n.branch}`:``]}),n.stat?(0,K.jsx)(`pre`,{className:`mt-3 overflow-x-auto whitespace-pre-wrap font-mono text-[10px] leading-5 text-ink-dim`,children:n.stat}):null,n.diff?(0,K.jsxs)(`pre`,{className:`mt-3 max-h-80 overflow-auto whitespace-pre font-mono text-[10px] leading-5 text-ink-dim scroll-thin`,children:[n.diff,n.truncated?` +… diff truncated`:``]}):null]}):null]})]})}var uo=e=>e instanceof Error?e.message:String(e||`Unknown error`);async function fo(e){let t=await e,n=t&&typeof t==`object`?t:{},r=String(n.command_status??``);if(Number(n.rc??0)!==0||r===`failed`||r===`rejected`)throw Error(String(n.error||`daemon command ${r||`failed`}`));return t}function po({open:e,sid:t,snap:r,onClose:i,onChanged:a,onRestored:u}){let{t:f}=q(),[p,h]=(0,M.useState)(`task`),[g,_]=(0,M.useState)(``),[v,C]=(0,M.useState)(r.session.workdir??r.session.cwd??``),[w,ee]=(0,M.useState)(`ls`),[E,ne]=(0,M.useState)(``),[re,ie]=(0,M.useState)(``),[ae,D]=(0,M.useState)(null),[O,oe]=(0,M.useState)([]),[se,ce]=(0,M.useState)(0),[k,le]=(0,M.useState)(``),[A,ue]=(0,M.useState)(``),[de,fe]=(0,M.useState)(`work`);(0,M.useEffect)(()=>{e&&(C(r.session.workdir??r.session.cwd??``),Promise.all([R.metrics(),R.trash()]).then(([e,t])=>{D(e),oe(t.entries),ce(t.total)},e=>ne(uo(e))))},[e,r.session.cwd,r.session.workdir]);let j=async(e,t,n)=>{if(!A){ue(e),ne(``);try{let e=await t();n!==null&&ne(n||JSON.stringify(e,null,2)),a()}catch(e){ne(uo(e))}finally{ue(``)}}},pe=async()=>{let e=g.trim();if(e){if(p===`plan`){await j(`quick`,async()=>{let n=await R.previewPlan(t,e);return ne([...n.steps.map((e,t)=>`${t+1}. ${e.title}${e.detail?` — ${e.detail}`:``}`),...n.notes.map(e=>`Note: ${e}`),...n.error?[`Error: ${n.error}`]:[]].join(` +`)),n},null);return}await j(`quick`,p===`task`?()=>R.addTask(t,e):p===`nudge`?()=>R.nudge(t,e):()=>R.note(t,e),`${p} submitted.`),_(``)}},me=async e=>{await j(`restore:${e.trash_id}`,async()=>{let t=await R.restoreTrash(e.trash_id);return oe(t=>t.filter(t=>t.trash_id!==e.trash_id)),ce(e=>Math.max(0,e-1)),await u(t.sid),t},`Restored ${e.label}.`)},he=r.daemon.alive&&r.daemon.protocol_compatible===!1,ge=r.daemon.alive&&r.daemon.control_available===!1,_e=r.daemon_admission?.running_daemons??[],ve=p===`task`?b:p===`nudge`?T:p===`note`?s:S,ye=async()=>{await j(`trash-search`,async()=>{let e=await R.trash(k);return oe(e.entries),ce(e.total),e},null)};return(0,K.jsxs)(aa,{open:e,onClose:()=>!A&&i(),label:f(`operations.title`),width:`max-w-5xl`,children:[(0,K.jsx)(oa,{title:f(`operations.title`),sub:r.session.display_name||t}),(0,K.jsx)(`div`,{className:`flex gap-1 border-b border-line bg-panel px-4 py-2`,children:[[`work`,f(`operations.work`),b],[`runtime`,f(`operations.runtime`),d],[`system`,f(`operations.system`),c],[`recovery`,f(`operations.recovery`),n]].map(([e,t,n])=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>{fe(e),ne(``)},title:t,"aria-label":t,className:`flex h-8 w-9 items-center justify-center rounded-md text-xs ${de===e?`bg-blue-deep text-white`:`text-ink-faint hover:bg-bg hover:text-ink`}`,children:(0,K.jsx)(o,{icon:n})},e))}),(0,K.jsxs)(`div`,{className:`grid max-h-[76vh] gap-3 overflow-y-auto bg-bg p-3 scroll-thin lg:grid-cols-2`,children:[de===`work`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4 lg:col-span-2`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.workInput`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-faint`,children:f(`operations.workHint`)}),(0,K.jsx)(`div`,{className:`mt-3 flex gap-1`,children:[[`task`,b],[`nudge`,T],[`note`,s],[`plan`,S]].map(([e,t])=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(e),title:e,"aria-label":e,className:`flex h-8 w-9 items-center justify-center rounded text-xs capitalize ${p===e?`bg-blue-deep text-white`:`bg-bg text-ink-dim`}`,children:(0,K.jsx)(o,{icon:t})},e))}),(0,K.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value),rows:5,placeholder:p===`plan`?f(`operations.planPlaceholder`):f(`operations.actionPlaceholder`,{action:p}),className:`mt-3 w-full resize-y rounded border border-line bg-bg p-3 text-sm text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void pe(),disabled:!!A||!g.trim(),title:p===`plan`?f(`operations.previewPlan`):f(`operations.submitAction`,{action:p}),"aria-label":p===`plan`?f(`operations.previewPlan`):f(`operations.submitAction`,{action:p}),className:`mt-2 flex h-9 w-9 items-center justify-center rounded bg-blue-deep text-xs font-medium text-white disabled:opacity-40`,children:A===`quick`?`…`:(0,K.jsx)(o,{icon:ve})})]}):null,de===`runtime`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4 lg:col-span-2`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.runtime`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-ink-faint`,children:f(`operations.runtimeHint`)}),(0,K.jsx)(`label`,{className:`mt-3 block text-[10px] uppercase tracking-wide text-ink-faint`,children:f(`operations.workdir`)}),(0,K.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,K.jsx)(`input`,{value:v,onChange:e=>C(e.target.value),className:`h-9 min-w-0 flex-1 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void j(`cwd`,()=>R.setWorkdir(t,v),f(`operations.workdirUpdated`)),disabled:!!A||!v.trim(),title:f(`operations.applyWorkdir`),"aria-label":f(`operations.applyWorkdir`),className:`flex h-9 w-9 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:y})})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>void j(`reset`,()=>R.resetManager(t),`Manager context reset.`),disabled:!!A,title:f(`operations.resetManager`),"aria-label":f(`operations.resetManager`),className:`flex h-9 w-9 items-center justify-center rounded border border-line text-xs text-ink-dim disabled:opacity-40`,children:(0,K.jsx)(o,{icon:te})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void j(`upgrade`,()=>fo(R.upgradeDaemon(t,r.daemon_commands?.revision)),`Current-release daemon started after safely draining active work.`),disabled:!!A||ge,title:ge?`Externally supervised daemon cannot be restarted from this Web host`:he?`Upgrade incompatible daemon`:`Restart on current release`,"aria-label":ge?`Externally supervised daemon`:he?`Upgrade incompatible daemon`:`Restart on current release`,className:`flex h-9 w-9 items-center justify-center rounded border text-xs disabled:opacity-40 ${he?`border-err/60 bg-err/10 text-err`:`border-line text-ink-dim`}`,children:(0,K.jsx)(o,{icon:x})})]}),r.daemon.protocol_error?(0,K.jsx)(`p`,{className:`mt-2 text-xs text-err`,children:r.daemon.protocol_error}):null,_e.length?(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-ink-faint`,children:f(`operations.replaceSlot`)}),(0,K.jsx)(`div`,{className:`mt-2 space-y-1`,children:_e.map(e=>(0,K.jsxs)(`button`,{type:`button`,disabled:!!A,onClick:()=>void j(`replace:${e.id}`,()=>fo(R.replaceDaemon(t,e.id,!!r.continuous?.enabled,r.daemon_commands?.revision)),`Parked ${e.label||e.id} and started this session.`),title:`Replace ${e.label||e.id}`,"aria-label":`Replace ${e.label||e.id}`,className:`flex w-full items-center justify-between rounded border border-line bg-bg px-2 py-1.5 text-left text-xs text-ink-dim disabled:opacity-40`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.label||e.id}),(0,K.jsx)(o,{icon:x,className:`ml-2 text-warn`})]},e.id))})]}):null]}):null,de===`system`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.skills`)}),(0,K.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,K.jsx)(`input`,{value:w,onChange:e=>ee(e.target.value),className:`h-9 min-w-0 flex-1 rounded border border-line bg-bg px-2 font-mono text-xs text-ink outline-none focus:border-blue`,placeholder:`ls, stats, show NAME…`}),(0,K.jsx)(`button`,{type:`button`,disabled:!!A,onClick:()=>void j(`skills`,async()=>{let e=await R.skills(t,w);return ie(e),e},null),title:f(`operations.runSkill`),"aria-label":f(`operations.runSkill`),className:`flex h-9 w-9 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:l})})]}),re?(0,K.jsx)(`pre`,{className:`mt-3 max-h-48 overflow-auto whitespace-pre-wrap rounded bg-bg p-3 font-mono text-xs text-ink-dim scroll-thin`,children:re}):null]}):null,de===`system`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:f(`operations.metrics`)}),(0,K.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`rounded px-2 py-1 text-xs font-semibold ${ae?.slo?.status===`healthy`?`bg-ok/10 text-ok`:`bg-warn/10 text-warn`}`,children:ae?.slo?.status??`loading`}),(0,K.jsxs)(`span`,{className:`text-xs text-ink-faint`,children:[`event validation failures: `,ae?.event_validation_failures??`—`]})]}),ae?(0,K.jsx)(`pre`,{className:`mt-3 max-h-48 overflow-auto whitespace-pre-wrap rounded bg-bg p-3 font-mono text-[10px] text-ink-dim scroll-thin`,children:JSON.stringify({web:ae.web,provider:ae.provider,cost_control:ae.cost_control},null,2)}):null]}):null,de===`recovery`?(0,K.jsxs)(`section`,{className:`rounded-lg border border-line bg-panel p-4 lg:col-span-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`h3`,{className:`mr-auto text-xs font-semibold uppercase tracking-wide text-ink-dim`,children:[f(`operations.trash`),` · `,se]}),(0,K.jsx)(`input`,{value:k,onChange:e=>le(e.target.value),onKeyDown:e=>{!Fi(e)&&e.key===`Enter`&&ye()},placeholder:f(`operations.searchTrash`),className:`h-8 min-w-52 rounded border border-line bg-bg px-2 text-xs text-ink outline-none focus:border-blue`}),(0,K.jsx)(`button`,{type:`button`,disabled:!!A,onClick:()=>void ye(),title:f(`operations.searchTrash`),"aria-label":f(`operations.searchTrash`),className:`flex h-8 w-8 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:m})})]}),O.length?(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:O.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded border border-line bg-bg p-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs text-ink`,children:e.label}),(0,K.jsx)(`div`,{className:`truncate font-mono text-[10px] text-ink-faint`,children:e.trash_path})]}),(0,K.jsx)(`button`,{type:`button`,disabled:!!A,onClick:()=>void me(e),title:`Restore ${e.label}`,"aria-label":`Restore ${e.label}`,className:`flex h-8 w-8 items-center justify-center rounded border border-blue/50 text-xs text-blue disabled:opacity-40`,children:(0,K.jsx)(o,{icon:n})})]},e.trash_id))}):(0,K.jsx)(`p`,{className:`mt-3 text-xs text-ink-faint`,children:f(`operations.trashEmpty`)}),se>O.length?(0,K.jsxs)(`p`,{className:`mt-2 text-[10px] text-ink-faint`,children:[`Showing the newest `,O.length,` matches. Narrow the search to find older sessions.`]}):null]}):null,E?(0,K.jsx)(`pre`,{className:`rounded-lg border border-line bg-panel p-3 font-mono text-xs whitespace-pre-wrap text-ink-dim lg:col-span-2`,children:E}):null]})]})}var mo=[`API`,`Protocol`,`Workspace`];function ho(){let{t:e}=q(),t=(0,M.useRef)(null);return $r(t,(e,t)=>{if(t){e.set(`[data-handshake-line], [data-handshake-node]`,{opacity:1,scale:1,clearProps:`transform`});return}e.to(`[data-handshake-mark]`,{scale:1.055,duration:.75,ease:`sine.inOut`,repeat:-1,yoyo:!0,transformOrigin:`50% 50%`}),e.timeline({repeat:-1,repeatDelay:.25}).fromTo(`[data-handshake-line]`,{scaleX:0,opacity:.25,transformOrigin:`0% 50%`},{scaleX:1,opacity:.8,duration:.9,ease:`power2.inOut`}).fromTo(`[data-handshake-node]`,{autoAlpha:.25,scale:.72},{autoAlpha:1,scale:1,duration:.28,stagger:.16,ease:`back.out(1.8)`},.12).to(`[data-handshake-node]`,{autoAlpha:.35,duration:.3,stagger:.08},`+=0.35`)}),(0,K.jsxs)(`div`,{ref:t,role:`status`,"aria-label":e(`handshake.connecting`),className:`w-full max-w-xl px-6 text-center`,children:[(0,K.jsx)(`div`,{"data-handshake-mark":!0,className:`handshake-mark glass-card mx-auto flex h-16 w-16 items-center justify-center rounded-3xl text-blue shadow-glow sm:h-20 sm:w-20`,children:(0,K.jsx)(Si,{size:48,className:`text-blue`})}),(0,K.jsxs)(`div`,{className:`relative mx-auto mt-8 h-10 max-w-sm sm:max-w-md`,children:[(0,K.jsx)(`div`,{className:`absolute left-[10%] right-[10%] top-3 h-px bg-line/80`}),(0,K.jsx)(`div`,{"data-handshake-line":!0,className:`handshake-line absolute left-[10%] right-[10%] top-3 h-px`}),(0,K.jsx)(`div`,{className:`relative flex justify-between`,children:mo.map(e=>(0,K.jsxs)(`div`,{className:`flex w-20 flex-col items-center gap-2.5`,children:[(0,K.jsx)(`span`,{"data-handshake-node":!0,className:`handshake-node h-6 w-6 rounded-full border ring-4 ring-bg`,children:(0,K.jsx)(`span`,{className:`m-auto mt-[7px] block h-2 w-2 rounded-full bg-blue`})}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-ink-faint`,children:e})]},e))})]}),(0,K.jsx)(`p`,{className:`mt-9 text-base font-medium text-ink-dim`,children:`Connecting to Argus`}),(0,K.jsx)(`p`,{className:`mt-1.5 text-sm text-ink-faint`,children:`Negotiating protocol and restoring your workspace…`})]})}function go({loading:e,hasProjects:t,error:n,onRetry:r,onNew:i,onChoose:a,canCreate:o}){let{t:s}=q();return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 text-center`,children:[e?(0,K.jsx)(ho,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(wi,{size:32,tag:si}),(0,K.jsx)(`p`,{className:`max-w-md text-sm leading-relaxed ${n?`text-err`:`text-ink-faint`}`,children:n||s(t?`landing.selectOrCreate`:`landing.noSessions`)})]}),!e&&(0,K.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[n?(0,K.jsx)(fi,{onClick:r,variant:`danger`,children:s(`common.retry`)}):null,t?(0,K.jsx)(fi,{onClick:a,children:s(`landing.select`)}):o?(0,K.jsx)(fi,{onClick:i,variant:`primary`,children:s(`landing.new`)}):null]})]})}function _o({active:e,onSelect:t,onOpenSessions:n}){let{t:r}=q(),i=[{id:`mission`,label:r(`mobile.mission`),icon:S},{id:`activity`,label:r(`mobile.activity`),icon:_},{id:`workbench`,label:r(`mobile.workbench`),icon:g},{id:`preview`,label:r(`mobile.preview`),icon:ee}];return(0,K.jsxs)(`nav`,{"aria-label":r(`mobile.views`),className:`mobile-tabbar glass-panel glass-panel--raised fixed inset-x-0 bottom-0 z-40 flex items-stretch border-t border-line/60 lg:hidden`,children:[n?(0,K.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":r(`topbar.openSessions`),className:`flex min-h-[3.25rem] flex-1 flex-col items-center justify-center gap-0.5 text-ink-faint active:bg-panel-raised`,children:[(0,K.jsx)(o,{icon:h,className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-[10px] leading-none`,children:r(`mobile.sessions`)})]}):null,i.map(n=>{let r=n.id===e;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),"aria-current":r?`page`:void 0,className:`flex min-h-[3.25rem] flex-1 flex-col items-center justify-center gap-0.5 active:bg-panel-raised ${r?`text-blue`:`text-ink-faint`}`,children:[(0,K.jsx)(o,{icon:n.icon,className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-[10px] leading-none`,children:n.label})]},n.id)})]})}function vo(){(0,M.useEffect)(()=>{let e=window.visualViewport,t=document.documentElement;if(!e)return;let n=null,r=()=>{n!=null&&window.cancelAnimationFrame(n),n=window.requestAnimationFrame(()=>{let n=window.innerHeight-e.height-e.offsetTop,r=n>24?Math.round(n):0;t.style.setProperty(`--keyboard-inset`,`${r}px`)})};return r(),e.addEventListener(`resize`,r),e.addEventListener(`scroll`,r),()=>{n!=null&&window.cancelAnimationFrame(n),e.removeEventListener(`resize`,r),e.removeEventListener(`scroll`,r),t.style.removeProperty(`--keyboard-inset`)}},[])}async function yo(e,t){let n=Bt(e.trim());if(!n)return{kind:`not-command`};if(!n.cmd){let e=Vt(n.name);return{kind:`error`,message:e?`Unknown command ${n.name}. Did you mean ${e}?`:`Unknown command ${n.name}. Use /help for the full list.`}}if(n.cmd.id===`ask`)return{kind:`not-command`};if(Nt(n.cmd)&&!n.rest)return{kind:`error`,message:`Usage: ${n.cmd.name}${n.cmd.arg?` ${n.cmd.arg}`:``}`};try{await t[n.cmd.id](n.rest)}catch(e){return{kind:`error`,message:e instanceof Error?e.message:String(e??`Command failed`)}}return{kind:`handled`}}function bo({activeSid:e,activityEventsRef:t,notify:n,onClearEvents:r,onDispose:i,onOpenConfig:a,onOpenDoctor:o,onOpenHelp:s,onOpenIdentity:c,onOpenInspector:l,onOpenNewDaemon:u,onOpenOperations:d,onOpenSidebar:f,onReconnectEvents:p,onRenameProject:m,onRewriteDraft:h,onSelectProject:g,onSetArtifactPath:_,onSetEventFilter:v,onSetEventQuery:y,onSetTaskItemId:b,onSetWorkspaceView:x,onShowArtifacts:S,onStopIteration:C,onStopWaiting:w,refetchSnapshot:T}){return{status:async()=>l(),roles:async()=>d(),journal:async()=>l(),backlog:async()=>x(`mission`),item:async e=>{e&&b(e)},artifacts:async()=>S(),artifact:async e=>{e&&_(e)},events:async e=>{x(`activity`);let{filter:t,query:n}=H(e);v(t),y(n)},find:async e=>{x(`activity`),v(`all`),y(e)},run:async()=>x(`activity`),clear:async()=>{x(`activity`),v(`all`),y(``),r(t.current.length)},cancel:async()=>w(),task:async t=>{e&&(await R.addTask(e,t),T(),n(`success`,`Task queued.`))},rewrite:async e=>{let t=e.trim();if(!t){n(`info`,`Type your prompt in the composer and press Rewrite, or use /rewrite .`);return}h(t)},plan:async t=>{if(!e)return;let r=await R.previewPlan(e,t);r.error?n(`error`,r.error):n(`info`,r.steps.map(e=>e.title).join(` +`)||`Plan preview ready.`)},nudge:async t=>{e&&(await R.nudge(e,t),n(`success`,`Guidance injected.`))},abort:async t=>{e&&(await R.abortMission(e,t||`operator abort`),n(`info`,`Abort requested.`))},note:async t=>{e&&(await R.note(e,t),n(`success`,`Note appended to timeline.`))},done:async e=>{e&&i(e,`done`)},skip:async e=>{e&&i(e,`rm`)},stop:async e=>{e&&C(e)},new:async()=>u(),daemons:async()=>f(),resume:async e=>{e&&e!==`list`?g(e):f()},attach:async e=>{e&&g(e)},rename:async t=>{!e||!t||await m(t)},doctor:async()=>o(),backend:async t=>{if(!e||!t){a();return}await R.setConfig(e,`runner_backend`,t),n(`success`,`Backend set to ${t}.`)},config:async t=>{if(!e||!t){a();return}let r=t.indexOf(`=`);r>0?(await R.setConfig(e,t.slice(0,r).trim(),t.slice(r+1).trim()),n(`success`,`Config updated.`)):a()},identity:async()=>c(),reset:async()=>{e&&(await R.resetManager(e),n(`success`,`Manager context reset.`))},skills:async t=>{e&&n(`info`,(await R.skills(e,t||`ls`)).slice(0,400))},reconnect:async()=>p(),help:async()=>s(),quit:async()=>n(`info`,`Background work continues; close this browser tab when ready.`)}}function xo(e){return e.kind===`error`?(typeof e.reply==`string`?e.reply.trim():``)||`Manager could not handle this message.`:null}function So(e,t){e.kind===`task`&&t.dispatchTask(e);let n=xo(e);n&&t.notifyError(n),t.refetchTranscript()}var Co={skipFirst:0,reconnectKey:0};function wo(e,t){return t.kind===`clear`?{...e,skipFirst:Math.max(0,t.offset)}:t.kind===`reconnect`?{skipFirst:0,reconnectKey:e.reconnectKey+1}:{...e,skipFirst:0}}var To=`local_request_id`;function Eo(e,t,n,r=Date.now()){return{type:`ui.operator`,agent_layer:`operator`,text:n,ts:r/1e3,event_id:`local-${e}-${t}-operator`,message_id:`local-${t}-operator`,[To]:t}}function Do(e,t,n,r,i,a=Date.now(),o=`auto`){let s=r.trim();if(!s)return e;let c=e.findIndex(e=>e.type===`ui.argus`&&Number(e[To])===n),l=i.endsWith(`-argus`)?`${i.slice(0,-6)}-operator`:``,u=l?e.map(e=>e.type===`ui.operator`&&Number(e[To])===n?{...e,message_id:l}:e):e,d=u.find(e=>e.type===`ui.operator`&&Number(e[To])===n),f=d?Math.max(0,a-Number(d.ts??a/1e3)*1e3):0;if(c<0)return[...u,{type:`ui.argus`,agent_layer:`manager`,text:s,ts:a/1e3,event_id:`local-${t}-${n}-argus`,message_id:i||`local-${n}-argus`,fragment_mode:o,response_latency_ms:f,[To]:n}];let p=u[c],m=[...u];return m[c]={...p,text:Dt(String(p.text??``),s,o),message_id:i||p.message_id,fragment_mode:o},m}function Oo(e,t,n){let r=new Map;e.forEach(e=>{let t=String(e.type??``);if(t!==`ui.operator`&&t!==`ui.argus`)return;let n=`${t}\u0000${String(e.text??``)}`;r.set(n,(r.get(n)??0)+1)});let i=t.map(e=>({type:e.role===`operator`?`ui.operator`:`ui.argus`,agent_layer:e.role===`operator`?`operator`:`manager`,text:e.text,ts:e.ts,message_id:`transcript-${e.ts}-${e.role}`})),a=Array(i.length).fill(!0);for(let e=i.length-1;e>=0;--e){let t=i[e],n=`${String(t.type)}\u0000${String(t.text??``)}`,o=r.get(n)??0;o>0&&(a[e]=!1,r.set(n,o-1))}let o=[...i.filter((e,t)=>a[t]),...e],s=Array(o.length).fill(!0),c=new Set,l=n.filter(e=>{let t=String(e.message_id??``),n=t?o.findIndex((e,n)=>!c.has(n)&&String(e.message_id??``)===t):-1,r=Number(e.ts??0);return n<0&&(n=o.findIndex((t,n)=>{if(c.has(n)||t.type!==e.type||t.text!==e.text)return!1;let i=Number(t.ts??0);return Math.abs(i-r)<=5})),n>=0&&(c.add(n),s[n]=!1),!0});return[...o.filter((e,t)=>s[t]),...l].sort((e,t)=>Number(e.ts??0)-Number(t.ts??0))}function ko(e,t){if(!t.length)return e;let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return t?{...e,spend_usd:t.spend_usd,known_cost_usd:t.known_cost_usd,spend_status:t.spend_status,usage_calls:t.usage_calls,premium_requests:t.premium_requests,cost_updated_at:t.updated_at}:e})}async function Ao(e,t,n,r=``){let i=await e.createDaemon(``,t,r),a=n.trim();return{created:i,startCampaign:a?()=>e.setContinuous(i.sid,!0,a):null}}var jo=e=>e instanceof Error?e.message:String(e||`Unknown error`);function Mo({localCwd:e,notify:t,onFocusComposer:n,queryClient:r,refetchProjects:i,selectProject:a}){let[o,s]=(0,M.useState)(!1),c=(0,M.useRef)(!1);return{createDaemon:async(o,l,u)=>{if(c.current)return!1;c.current=!0,s(!0);try{let{created:s,startCampaign:c}=await Ao(R,o,l,u),d=String(s.workdir||u||``);return r.setQueryData([`projects`],t=>({local_cwd:t?.local_cwd??e,projects:[{id:s.sid,label:o||s.sid,display_name:o,objective:``,launch_cwd:d,workdir:d,last_active:Date.now()/1e3,daemon_alive:!1,daemon_pid:null,uptime_seconds:null},...(t?.projects??[]).filter(e=>e.id!==s.sid)]})),a(s.sid),i(),window.setTimeout(n,0),t(c?`info`:`success`,c?`Session created and selected. Campaign is starting in the background.`:`Session created and selected.`),c&&c().then(()=>{r.invalidateQueries({queryKey:[`snapshot`,s.sid]}),i(),t(`success`,`Campaign started.`)}).catch(e=>{t(`error`,`Session was created, but the campaign could not start: ${jo(e)}`)}),!0}catch(e){return t(`error`,`Could not create session: ${jo(e)}`),!1}finally{c.current=!1,s(!1)}},creatingDaemon:o}}var No=e=>e instanceof Error?e.message:String(e||`Unknown error`);function Po({actions:e,activeSid:t,clearProjectSelection:n,continuous:r,currentSnapshotSid:i,notify:a,refetchProjects:o,selectProject:s,setDaemonManageOpen:c}){let[l,u]=(0,M.useState)(null),d=e.startDaemon.isPending||e.stopDaemon.isPending||e.updateProject.isPending||e.deleteProject.isPending,f=(0,M.useCallback)(e=>({onSuccess:()=>a(`success`,e),onError:e=>a(`error`,No(e))}),[a]),p=(0,M.useCallback)(()=>e.startDaemon.mutate(void 0,f(`Daemon start requested.`)),[f,e.startDaemon]),m=(0,M.useCallback)(()=>e.stopDaemon.mutate(!1,f(`Pause requested; the current operation is being interrupted.`)),[f,e.stopDaemon]),h=(0,M.useCallback)(async()=>{try{return await e.startDaemon.mutateAsync(),a(`success`,`Daemon resumed.`),!0}catch(e){return a(`error`,No(e)),!1}},[e.startDaemon,a]),g=(0,M.useCallback)(async()=>{try{return await e.stopDaemon.mutateAsync(!1),a(`success`,`Daemon paused. Progress remains resumable.`),!0}catch(e){return a(`error`,No(e)),!1}},[e.stopDaemon,a]),_=(0,M.useCallback)(async n=>{if(!t)return!1;try{return await e.updateProject.mutateAsync({sid:t,name:n}),a(`success`,`Session name updated.`),!0}catch(e){return a(`error`,No(e)),!1}},[e.updateProject,t,a]),v=(0,M.useCallback)(async()=>{if(!t)return!1;try{let t=await e.deleteProject.mutateAsync();c(!1),n(`replace`);let r=Gt((await o()).data?.projects??[])[0];return r&&s(r.id,`replace`),a(`success`,t.workdir_preserved?`Session moved to recoverable trash. Files remain in ${t.workdir}.`:`Session moved to recoverable trash.`),!0}catch(e){return a(`error`,No(e)),!1}},[e.deleteProject,t,n,a,o,s,c]),y=(0,M.useCallback)(e=>{if(c(!1),e===t&&i===e){u(null),c(!0);return}u(e),s(e)},[t,i,s,c]);return(0,M.useEffect)(()=>{!l||t!==l||i!==l||(u(null),c(!0))},[t,i,l,c]),{daemonBusy:d,manageDeleteProject:v,managePauseDaemon:g,manageRenameProject:_,manageStartDaemon:h,requestDispose:(0,M.useCallback)((t,n)=>e.disposeBacklog.mutate({id:t,op:n},{onSuccess:()=>a(`success`,n===`done`?`Work marked done.`:`Work removed.`),onError:e=>a(`error`,No(e))}),[e.disposeBacklog,a]),requestManageSession:y,requestStartDaemon:p,requestStopDaemon:m,requestStopIteration:(0,M.useCallback)(t=>e.stopBacklog.mutate(t,{onSuccess:()=>a(`success`,`Iteration stopped.`),onError:e=>a(`error`,No(e))}),[e.stopBacklog,a]),toggleContinuous:(0,M.useCallback)(()=>{if(!r)return;let t=!r.enabled;e.setContinuous.mutate({enabled:t,objective:r.objective},f(t?`Continuous campaign enabled.`:`Continuous campaign stopped.`))},[f,e.setContinuous,r])}}function Fo({focusComposer:e,openHelp:t,toggleKiosk:n,togglePalette:r,toggleReasoning:i,toggleSidebarCollapse:a}){(0,M.useEffect)(()=>{let o=o=>{let s=o.target,c=s?.tagName===`INPUT`||s?.tagName===`TEXTAREA`,l=o.metaKey||o.ctrlKey;l&&o.key.toLowerCase()===`k`?(o.preventDefault(),r()):l&&o.key.toLowerCase()===`t`?(o.preventDefault(),i()):l&&o.key===`.`?(o.preventDefault(),n()):l&&o.key.toLowerCase()===`b`?(o.preventDefault(),a()):l&&o.key.toLowerCase()===`j`?(o.preventDefault(),e()):!c&&o.key===`?`?(o.preventDefault(),t()):!c&&o.key===`/`&&(o.preventDefault(),e())};return window.addEventListener(`keydown`,o),()=>window.removeEventListener(`keydown`,o)},[e,t,n,r,i,a])}var Io=e=>e instanceof Error?e.message:String(e||`Unknown error`);function Lo({activeSid:e,backlog:t,notify:n,pendingQuestions:r,refetchSnapshot:i}){let[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(!1),l=(0,M.useRef)(``),u=(0,M.useMemo)(()=>{let e=(t??[]).map(e=>({...e,operator_decision:e.operator_decision}));return B(r??[],e)[0]??null},[t,r]);return(0,M.useEffect)(()=>{if(!u||!e){o(!1);return}let t=`${e}:${u.id}`;l.current!==t&&(l.current=t,o(!0))},[e,u]),{answerPendingReply:async(t,r)=>{if(!(!e||!u||s)){c(!0);try{let a=u.legacy?await R.answerPending(e,u.item_id,r):await R.resolveDecision(e,u.id,t,r);if(a.resolved===!1){n(`info`,String(a.reply||`Manager needs a more specific answer.`));return}o(!1),await i(),a.daemon&&Number(a.daemon.rc??0)!==0?n(`error`,`Answer queued, but the daemon did not start: ${a.daemon.error||`operator action required`}`):n(`success`,String(a.reply||`Manager delivered your answer to the team.`))}catch(e){await i(),n(`error`,`Could not send answer: ${Io(e)}`)}finally{c(!1)}}},pendingReply:u,pendingReplyBusy:s,pendingReplyOpen:a,setPendingReplyOpen:o}}var Ro=`argus.browser.project.v1`;function zo(){try{return window.sessionStorage.getItem(Ro)}catch{return null}}function Bo(e){try{e?window.sessionStorage.setItem(Ro,e):window.sessionStorage.removeItem(Ro)}catch{}}function Vo(e,t){let n=new URL(window.location.href);e?n.searchParams.set(`project`,e):n.searchParams.delete(`project`);let r=t===`push`?`pushState`:`replaceState`;window.history[r](window.history.state,``,n.toString())}function Ho({cancelActiveMessage:e,notify:t,projects:n,projectsError:r,projectsReady:i,queryClient:a,setArtifactPath:o,setSidebarOpen:s,setTaskItemId:c}){let l=new URLSearchParams(window.location.search),[u,d]=(0,M.useState)(l.get(`project`)||zo()),f=(0,M.useRef)(u),p=(0,M.useRef)(!1);f.current=u;let m=(0,M.useCallback)(t=>{t!==f.current&&(e(),o(null),c(null)),f.current=t,d(t),Bo(t)},[e,o,c]),h=(0,M.useCallback)((e,t=`push`)=>{let n=new URLSearchParams(window.location.search).get(`project`);m(e),n!==e&&Vo(e,t)},[m]),g=(0,M.useCallback)((e=`replace`)=>{let t=new URLSearchParams(window.location.search).get(`project`);m(null),t!=null&&Vo(null,e)},[m]),_=(0,M.useCallback)(e=>{a.prefetchQuery({queryKey:[`snapshot`,e],queryFn:({signal:t})=>R.prefetchSnapshot(e,t),staleTime:3e3})},[a]);return(0,M.useEffect)(()=>{if(!i)return;let e=p.current,r=Jt(n,f.current,e);if(!e&&(p.current=!0,r.id===f.current?Bo(r.id):m(r.id),new URLSearchParams(window.location.search).get(`project`)!==r.id&&Vo(r.id,`replace`),r.recovered)){let e=n.find(e=>e.id===r.id);t(`info`,e?`Project “${r.requested}” was not found. Switched to ${e.label||e.id}.`:`Project “${r.requested}” was not found. Create a daemon to continue.`)}},[m,t,n,i]),(0,M.useEffect)(()=>{let e=()=>{let e=new URLSearchParams(window.location.search).get(`project`);if(s(!1),!e){m(null);return}if(!i){m(e);return}let r=qt(n,e);if(m(r.id),r.recovered){Vo(r.id,`replace`);let e=n.find(e=>e.id===r.id);t(`info`,e?`Project “${r.requested}” was not found. Switched to ${e.label||e.id}.`:`Project “${r.requested}” was not found. Create a daemon to continue.`)}};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[m,t,n,i,s]),{activateProject:m,activeSid:i?u&&n.some(e=>e.id===u)?u:null:r?u:null,clearProjectSelection:g,prefetchProject:_,selectProject:h,sid:u,sidRef:f}}function Uo(e,t){let n=localStorage.getItem(e);return n==null?t:n===`true`}function Wo(){let e=new URLSearchParams(window.location.search),[t,n]=(0,M.useState)(e.get(`kiosk`)===`1`),[r,i]=(0,M.useState)(()=>Uo(`argus.reasoning.visible.v1`,!1)),[a,o]=(0,M.useState)(()=>{let e=localStorage.getItem(`argus.workspace.view`);return e===`mission`||e===`workbench`?e:`activity`}),[s,c]=(0,M.useState)(`activity`),[l,u]=(0,M.useState)(()=>Uo(`argus.preview.expanded.v5`,!0)),[d,f]=(0,M.useState)(()=>{let e=Number(localStorage.getItem(`argus.sidebar.width.v2`)||256);return Number.isFinite(e)?Math.max(220,Math.min(400,e)):256}),[p,m]=(0,M.useState)(()=>{let e=Number(localStorage.getItem(`argus.preview.width.v2`)||440);return Number.isFinite(e)?Math.max(320,Math.min(600,e)):440}),[h,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(()=>Uo(`argus.sidebar.expanded.v4`,!0)),[y,b]=(0,M.useState)(()=>{let e=localStorage.getItem(`argus.theme`);return e===`light`||e===`dark`?e:null}),[x,S]=(0,M.useState)(()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches),C=y??(x?`dark`:`light`),w=(0,M.useRef)(null),T=(0,M.useRef)(null);(0,M.useEffect)(()=>{localStorage.setItem(`argus.sidebar.expanded.v4`,String(_)),localStorage.setItem(`argus.preview.expanded.v5`,String(l)),localStorage.setItem(`argus.sidebar.width.v2`,String(d)),localStorage.setItem(`argus.preview.width.v2`,String(p))},[_,d,l,p]),(0,M.useEffect)(()=>{localStorage.setItem(`argus.workspace.view`,a)},[a]),(0,M.useEffect)(()=>{localStorage.setItem(`argus.reasoning.visible.v1`,String(r))},[r]),(0,M.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>S(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,M.useEffect)(()=>{document.documentElement.dataset.theme=C},[C]),(0,M.useEffect)(()=>{let e=()=>{document.documentElement.dataset.pageVisible=String(!document.hidden)};return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let ee=(0,M.useCallback)(()=>{let e=C===`light`?`dark`:`light`;b(e),localStorage.setItem(`argus.theme`,e)},[C]),te=(0,M.useCallback)((e,t)=>{let n=w.current;if(!n)return;t.preventDefault();let r=n.getBoundingClientRect();document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let i=t=>{T.current!=null&&window.cancelAnimationFrame(T.current),T.current=window.requestAnimationFrame(()=>{if(e===`left`){let e=l?p+8:56,n=Math.max(220,Math.min(400,r.width-e-360-8));f(Math.max(220,Math.min(n,t.clientX-r.left)))}else{let e=_?d+8:56,n=Math.max(320,Math.min(600,r.width-e-360-8));m(Math.max(320,Math.min(n,r.right-t.clientX)))}})},a=()=>{T.current!=null&&window.cancelAnimationFrame(T.current),T.current=null,document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a,{once:!0}),window.addEventListener(`pointercancel`,a,{once:!0})},[_,d,l,p]);return(0,M.useEffect)(()=>{let e=()=>{if(window.innerWidth<1024||!w.current)return;let e=w.current.clientWidth,t=_?d:56,n=l?p:56,r=(_?8:0)+(l?8:0),i=Math.max(540,e-360-r);if(t+n<=i)return;let a=l?Math.max(320,Math.min(p,i-t)):n,o=_?Math.max(220,Math.min(d,i-a)):t;o+a>i&&l&&(a=Math.max(320,i-o)),_&&f(o),l&&m(a)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[_,d,l,p]),{cycleTheme:ee,kiosk:t,leftPanelOpen:_,leftWidth:d,mobileView:s,resizeSidebar:te,rightPanelOpen:l,rightWidth:p,setKiosk:n,setLeftPanelOpen:v,setLeftWidth:f,setMobileView:c,setRightPanelOpen:u,setRightWidth:m,setShowReasoning:i,setSidebarOpen:g,setWorkspaceView:o,shellRef:w,showReasoning:r,sidebarOpen:h,themeMode:C,workspaceView:a}}function Go({error:e,onRetry:t}){let{t:n}=q(),r=Ye(e),i=e instanceof N;return!r&&!i?null:(0,K.jsxs)(`div`,{role:`alert`,className:`fixed left-1/2 top-3 z-[100] flex w-[min(92vw,42rem)] -translate-x-1/2 items-start gap-3 rounded-xl border border-err/50 bg-panel/95 px-4 py-3 text-left text-sm text-ink shadow-xl backdrop-blur`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 font-mono font-bold text-err`,children:`!`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`strong`,{className:`block text-err`,children:n(r?`connection.pairingTitle`:`connection.unreachableTitle`)}),(0,K.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-ink-dim`,children:n(r?`connection.pairingDetail`:`connection.unreachableDetail`)})]}),r?null:(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 rounded-md border border-err/40 px-2.5 py-1 text-xs text-err hover:bg-err/10`,children:n(`common.retry`)})]})}var Ko=0,qo=(0,M.lazy)(async()=>({default:(await Yr(()=>import(`./ResearchWorkbenchPanel-DpQaJ9Sz.js`),__vite__mapDeps([2,1,3,4,5,6]))).ResearchWorkbenchPanel}));function Jo(){let{locale:e,t}=q(),n=se(),r=pr(),i=mr(),a=(0,M.useMemo)(()=>Gt(ko(r.data?.projects??[],i.data?.projects??[])),[i.data?.projects,r.data?.projects]),s=r.data?.local_cwd??``,c=[r.error,i.error].find(e=>Xe(e)),[l,u]=(0,M.useState)(`none`),{cycleTheme:d,kiosk:f,leftPanelOpen:p,leftWidth:m,mobileView:h,resizeSidebar:g,rightPanelOpen:_,rightWidth:v,setKiosk:y,setLeftPanelOpen:b,setLeftWidth:x,setMobileView:S,setRightPanelOpen:w,setRightWidth:T,setShowReasoning:ee,setSidebarOpen:te,setWorkspaceView:E,shellRef:ne,showReasoning:re,sidebarOpen:ie,themeMode:ae,workspaceView:D}=Wo(),[O,oe]=(0,M.useState)(()=>D===`mission`?`mission`:`activity`),[ce,k]=(0,M.useState)(D===`workbench`);(0,M.useEffect)(()=>{if(D===`workbench`){k(!0);return}oe(D)},[D]),vo();let[le,A]=(0,M.useState)(0),[ue,de]=(0,M.useState)(``),[fe,j]=(0,M.useState)(!1),[pe,me]=(0,M.useState)(0),[he,ge]=(0,M.useState)(!1),[_e,ve]=(0,M.useState)([]),[ye,be]=(0,M.useState)(``),[xe,Se]=(0,M.useState)(!1),[Ce,we]=(0,M.useState)(0),[Te,Ee]=(0,M.useState)([]),[De,Oe]=(0,M.useState)(0),[ke,Ae]=(0,M.useState)(null),[je,Me]=(0,M.useState)(null),[Ne,Pe]=(0,M.useState)(!1),[Fe,Ie]=(0,M.useState)(!1),Le=(0,M.useRef)(!1),Re=(0,M.useRef)(null),ze=(0,M.useRef)(0),[Be,Ve]=(0,M.useState)(null),[He,Ue]=(0,M.useReducer)(wo,Co),[We,Ge]=(0,M.useState)(`all`),[Ke,qe]=(0,M.useState)(``),Je=(0,M.useCallback)(()=>Ve(null),[]),N=(0,M.useCallback)((e,t)=>{Ve({id:++Ko,tone:e,message:t})},[]),Ye=(0,M.useCallback)(()=>{let e=!!Re.current;return ze.current+=1,Re.current?.controller.abort(),Re.current=null,ge(!1),be(``),Se(!1),we(0),Ee([]),Oe(0),e},[]),Ze=(0,M.useCallback)(()=>{Ye()&&N(`info`,`Stopped waiting for this reply. Server-side work may still finish in the project timeline.`)},[Ye,N]),{activeSid:P,clearProjectSelection:Qe,prefetchProject:F,selectProject:$e,sidRef:et}=Ho({cancelActiveMessage:Ye,notify:N,projects:a,projectsError:r.isError,projectsReady:r.isSuccess,queryClient:n,setArtifactPath:Ae,setSidebarOpen:te,setTaskItemId:Me});(0,M.useEffect)(()=>()=>{ze.current+=1,Re.current?.controller.abort(),Re.current=null},[]);let tt=(0,M.useCallback)(e=>{let t=(e||``).trim(),n=et.current;!t||!n||fe||(j(!0),R.rewritePrompt(n,t).then(e=>{if(j(!1),e.error||!e.rewritten.trim()){N(`error`,`Rewrite failed: ${e.error||`empty rewrite`} — your prompt is unchanged`);return}de(e.rewritten),A(e=>e+1);let t=e.questions.length?` Manager asks: ${e.questions.join(` · `)}`:``;N(`success`,`Prompt rewritten — review it, then send.${t}`)},e=>{j(!1),N(`error`,`Rewrite failed: ${ai(e)} — your prompt is unchanged`)}))},[N,fe,et]),{createDaemon:nt,creatingDaemon:I}=Mo({localCwd:s,notify:N,onFocusComposer:()=>A(e=>e+1),queryClient:n,refetchProjects:r.refetch,selectProject:$e}),rt=hr(P),L=rt.data,it=L?.session.id===P?P:null,at=L?.continuous,ot=xr(it,!0),st=Cr(it,O===`mission`),{events:ct,connected:lt}=Mr(it,He.reconnectKey),ut=(0,M.useMemo)(()=>kr(ct),[ct]),z=(0,M.useMemo)(()=>jr(ct),[ct]);(0,M.useEffect)(()=>{!it||!ut||n.invalidateQueries({queryKey:[`artifacts`,it],exact:!0})},[ut,it,n]),(0,M.useEffect)(()=>{!it||!z||n.invalidateQueries({queryKey:[`snapshot`,it],exact:!0})},[it,n,z]);let dt=(0,M.useMemo)(()=>Fn(ct),[ct]),ft=br(it,O===`activity`,120),pt=gr(P,20,l===`inspector`),{answerPendingReply:mt,pendingReply:ht,pendingReplyBusy:B,pendingReplyOpen:V,setPendingReplyOpen:gt}=Lo({activeSid:P,backlog:L?.backlog,notify:N,pendingQuestions:L?.pending_questions,refetchSnapshot:rt.refetch}),_t=(0,M.useMemo)(()=>Oo(ct,ft.data??[],_e),[ct,_e,ft.data]),vt=(0,M.useMemo)(()=>L?Dn(L,_t,ot.data??[]):null,[_t,ot.data,L]),yt=(0,M.useRef)(_t);yt.current=_t,(0,M.useEffect)(()=>{Ge(`all`),qe(``),ve([]),Ue({kind:`reset`})},[it]);let bt=Tr(P,L?.daemon_commands?.revision),{daemonBusy:xt,manageDeleteProject:St,managePauseDaemon:Ct,manageRenameProject:wt,manageStartDaemon:Tt,requestDispose:Et,requestManageSession:Dt,requestStartDaemon:Ot,requestStopDaemon:kt,requestStopIteration:At,toggleContinuous:Mt}=Po({actions:bt,activeSid:P,clearProjectSelection:Qe,continuous:at,currentSnapshotSid:L?.session.id,notify:N,refetchProjects:r.refetch,selectProject:$e,setDaemonManageOpen:Ie}),Nt=(0,M.useCallback)(async e=>{if(!P)return;let t=await bt.updateProject.mutateAsync({sid:P,name:e});N(`success`,`Renamed to "${t.name}".`)},[bt.updateProject,P,N]),Pt=(0,M.useMemo)(()=>bo({activeSid:P,activityEventsRef:yt,notify:N,onClearEvents:e=>Ue({kind:`clear`,offset:e}),onDispose:Et,onOpenConfig:()=>u(`config`),onOpenDoctor:()=>u(`doctor`),onOpenHelp:()=>u(`help`),onOpenIdentity:()=>u(`identity`),onOpenInspector:()=>u(`inspector`),onOpenNewDaemon:()=>Pe(!0),onOpenOperations:()=>u(`operations`),onOpenSidebar:()=>te(!0),onReconnectEvents:()=>Ue({kind:`reconnect`}),onRenameProject:Nt,onRewriteDraft:tt,onSelectProject:$e,onSetArtifactPath:Ae,onSetEventFilter:Ge,onSetEventQuery:qe,onSetTaskItemId:Me,onSetWorkspaceView:E,onShowArtifacts:()=>w(!0),onStopIteration:At,onStopWaiting:Ze,refetchSnapshot:rt.refetch}),[P,N,Nt,Et,At,$e,rt.refetch,Ze,E]);Fo({focusComposer:()=>A(e=>e+1),openHelp:()=>u(`help`),toggleKiosk:()=>y(e=>!e),togglePalette:()=>u(e=>e===`palette`?`none`:`palette`),toggleReasoning:()=>ee(e=>!e),toggleSidebarCollapse:()=>b(e=>!e)});let Ft=async(e,n=[])=>{let r=P;if(!r||Le.current||Re.current)return!1;Le.current=!0;let i,a;try{if(!n.length){let t=await yo(e,Pt);if(t.kind===`handled`)return!0;if(t.kind===`error`)return N(`error`,t.message),!1}i=++ze.current,a=new AbortController,Re.current={id:i,sid:r,controller:a}}finally{Le.current=!1}let o=()=>{let e=Re.current;return!!(e&&e.id===i&&e.sid===r&&et.current===r&&!a.signal.aborted)},s=()=>{Re.current?.id===i&&(Re.current=null,ge(!1),be(``),Se(!1),we(0),Oe(0),Ee([]))};ge(!0),be(n.length?t(`chat.uploadingAttachments`):``),Se(!1),we(0),Ee([]),Oe(Date.now());let c=[];if(n.length)try{let e=await R.uploadAttachments(r,n,a.signal);if(!o())return!1;c=e.attachments.map(e=>({attachment_id:e.attachment_id}))}catch(e){return o()&&(N(`error`,t(`chat.attachmentUploadFailed`,{error:ai(e)})),s()),!1}ve(t=>[...t,Eo(r,i,e)]);let l=(e,t=``,n=`auto`)=>{!o()||typeof e!=`string`||!e.trim()||ve(a=>Do(a,r,i,e,t,Date.now(),n))},u=e=>{if(!o())return;let t=e.daemon&&typeof e.daemon==`object`?e.daemon:null,n=typeof e.reply==`string`?e.reply:null;t?.admission_required?N(`error`,n||`Task queued, but all daemon slots are busy: ${String(t.error||`operator action required`)}`):t&&Number(t.rc??0)!==0?N(`error`,n||`Task queued, but executor did not start: ${String(t.error||`unknown error`)}`):n&&N(`success`,n),rt.refetch?.()},d=e=>{o()&&So(e,{dispatchTask:u,notifyError:e=>N(`error`,e),refetchTranscript:()=>{ft.refetch()}})};return(async()=>{let t=!1,n=null,i=[];try{try{await R.messageStream(r,e,{onPhase:(e,t,n)=>{o()&&(be(e),Se(n.heartbeat),we(n.quietS),i=Kn(i,{label:e,role:t,kind:n.kind,detail:n.detail,heartbeat:n.heartbeat,quietS:n.quietS}),Ee(i))},onDelta:(e,n,r)=>{o()&&(t=!0,i=qn(i),Ee(i),be(``),Se(!1),we(0),l(e,n,r===`append`||r===`snapshot`?r:`auto`))},onDone:e=>{o()&&(l(e.reply,``,`snapshot`),d(e))},onError:e=>{o()&&(n=e)}},{signal:a.signal,attachments:c})}catch(e){o()&&(n=e)}if(!o())return;n&&N(`error`,oi(n,t))}finally{s()}})(),!0},It=(0,M.useRef)(Ft);It.current=Ft;let Lt=(0,M.useMemo)(()=>{let n=sa(jt,e=>{It.current(e)},e=>{de(e),A(e=>e+1)},e),r=[...f?[]:[{id:`new`,label:t(`palette.newDaemon`),hint:`+`,group:t(`palette.view`),run:()=>Pe(!0)}],{id:`transcript`,label:t(`palette.openTranscript`),hint:`/transcript`,group:t(`palette.view`),run:()=>u(`transcript`)},{id:`inspector`,label:t(`palette.openProject`),hint:t(`palette.projectHint`),group:t(`palette.view`),run:()=>u(`inspector`)},{id:`operations`,label:t(`palette.openOperations`),hint:t(`palette.operationsHint`),group:t(`palette.view`),run:()=>u(`operations`)},{id:`help`,label:t(`help.title`),hint:`?`,group:t(`palette.view`),run:()=>u(`help`)},{id:`reasoning`,label:t(re?`palette.hideReasoning`:`palette.showReasoning`),hint:`⌘T`,group:t(`palette.view`),run:()=>ee(e=>!e)},{id:`kiosk`,label:t(f?`palette.exitKiosk`:`palette.enterKiosk`),hint:`⌘.`,group:t(`palette.view`),run:()=>y(e=>!e)}],i=f?[]:[{id:`message`,label:t(`palette.messageArgus`),hint:`/`,group:t(`palette.action`),run:()=>A(e=>e+1)},...he?[{id:`cancel-message`,label:t(`palette.stopWaiting`),hint:`Esc`,group:t(`palette.action`),run:Ze}]:[],...at?[{id:`continuous`,label:at.enabled?t(`palette.stopContinuous`):t(`palette.startContinuous`),group:t(`palette.action`),run:Mt}]:[],...L?.daemon.control_available===!1?[]:[L?.daemon.alive?{id:`stop`,label:t(`palette.stopDaemon`),group:t(`palette.action`),run:kt}:{id:`start`,label:t(`palette.startDaemon`),group:t(`palette.action`),run:Ot}]],o=a.map(e=>({id:`p-${e.id}`,label:e.label||e.id,hint:e.daemon_alive?`● ${t(`common.live`)}`:`○`,keywords:`${e.id} ${e.display_name??``} ${e.objective} ${e.daemon_alive?`live running`:`stopped idle`}`,group:t(`palette.project`),run:()=>$e(e.id)}));return[...r,...i,...n,...o]},[a,L?.daemon.alive,f,re,at?.enabled,he,Ze,e,t]);return(0,K.jsxs)(`div`,{ref:ne,className:`workbench-shell ambient-canvas flex h-screen h-[100dvh] w-screen max-w-full overflow-hidden text-ink`,children:[(0,K.jsx)(Go,{error:c,onRetry:()=>{r.refetch(),i.refetch()}}),!f&&ie?(0,K.jsx)(`button`,{type:`button`,"aria-label":t(`common.closeSessions`),onClick:()=>te(!1),className:`fixed inset-0 z-30 bg-black/40 lg:hidden`}):null,f?null:(0,K.jsx)(Ka,{projects:a,activeId:P,localCwd:s,onSelect:e=>{$e(e),te(!1)},onPrefetch:F,onManage:Dt,onOpenPanel:e=>u(e),onNew:()=>Pe(!0),loading:r.isLoading,creating:I,error:r.isError?ai(r.error):void 0,onRetry:()=>void r.refetch(),mobileOpen:ie,collapsed:!p,onToggleCollapse:()=>b(e=>!e),themeMode:ae,onCycleTheme:d,expandedWidth:m}),!f&&p?(0,K.jsx)(io,{label:t(`common.resizeSessions`),value:m,min:220,max:400,onPointerDown:e=>g(`left`,e),onReset:()=>x(256),onNudge:e=>x(t=>Math.max(220,Math.min(400,t+e)))}):null,(0,K.jsx)(`main`,{className:`flex min-w-0 flex-1 overflow-x-hidden`,children:L?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{className:`${h===`activity`?`flex`:`hidden`} glass-panel glass-panel--main h-full min-w-0 flex-1 flex-col lg:flex`,children:[(0,K.jsx)(Gr,{snap:L,streamOk:lt,onStart:Ot,onStop:kt,onManage:()=>Ie(!0),busy:xt,snapshotStale:rt.isError,readOnly:f,missionView:vt}),(0,K.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-1 border-b border-line/60 px-3`,children:[(0,K.jsxs)(`div`,{className:`workspace-tabs`,"data-active":D,children:[(0,K.jsx)(`span`,{className:`workspace-tab-indicator`,"aria-hidden":`true`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`mission`),className:`workspace-tab`,"data-selected":D===`mission`,children:t(`mobile.mission`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`activity`),className:`workspace-tab`,"data-selected":D===`activity`,children:t(`mobile.activity`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`workbench`),className:`workspace-tab`,"data-selected":D===`workbench`,children:t(`mobile.workbench`)})]}),D===`mission`?(0,K.jsx)(`span`,{className:`ml-auto hidden max-w-72 truncate text-[10px] text-ink-faint sm:block`,children:vt?.active_role?t(`mission.roleActive`,{role:vt.active_role}):t(`mission.overview`)}):(0,K.jsx)(`span`,{className:`ml-auto`}),f?null:(0,K.jsx)(`button`,{type:`button`,onClick:()=>u(`operations`),className:`rounded border border-line/60 px-2 py-1 text-[10px] text-ink-faint hover:border-blue/50 hover:text-blue`,children:t(`mission.operations`)})]}),(0,K.jsxs)(`div`,{className:`${D===`workbench`?`hidden`:`flex`} min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(Sa,{alert:dt}),O===`mission`&&vt?(0,K.jsx)(lo,{view:vt,gitDiff:st.data,onOpenArtifact:Ae}):(0,K.jsx)(Pi,{events:_t,connected:lt,showReasoning:re,onToggleReasoning:()=>ee(e=>!e),embedded:!0,filter:We,query:Ke,skipFirst:He.skipFirst}),f?null:(0,K.jsx)(`div`,{className:`composer-dock shrink-0 px-4 pt-3`,children:(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-full lg:max-w-[61.8vw]`,children:[(0,K.jsx)(ba,{questions:L.pending_questions??[],backlog:L.backlog,onAnswer:()=>gt(!0)}),(0,K.jsx)(ia,{value:ue,onChange:de,onSend:Ft,onCancel:Ze,disabled:!P,pending:he,focusSignal:le,embedded:!0,phase:ye,heartbeat:xe,quietS:Ce,steps:Te,startedAt:De,onRewrite:tt,rewriting:fe,slashSelection:pe,onSlashSelectionChange:me},P||`no-session`)]})})]}),ce&&P?(0,K.jsx)(`div`,{className:`${D===`workbench`?`flex`:`hidden`} min-h-0 flex-1`,children:(0,K.jsx)(M.Suspense,{fallback:(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-xs text-ink-faint`,children:t(`common.loading`)}),children:(0,K.jsx)(qo,{sid:P,active:D===`workbench`})})}):null]}),_?(0,K.jsx)(io,{label:t(`common.resizePreview`),value:v,min:320,max:600,onPointerDown:e=>g(`right`,e),onReset:()=>T(440),onNudge:e=>T(t=>Math.max(320,Math.min(600,t-e)))}):null,(0,K.jsxs)(`aside`,{style:{"--preview-width":`${v}px`},className:`${h===`preview`?`flex`:`hidden`} relative min-w-0 flex-1 flex-col overflow-hidden border-l border-line/60 bg-panel transition-[width] duration-[250ms] ease-panel lg:flex lg:flex-none ${_?`lg:w-[var(--preview-width)]`:`lg:w-14`}`,children:[(0,K.jsx)(`div`,{className:`lg:hidden`,children:(0,K.jsx)(Gr,{snap:L,streamOk:lt,onStart:Ot,onStop:kt,onManage:()=>Ie(!0),busy:xt,snapshotStale:rt.isError,readOnly:f,missionView:vt})}),(0,K.jsx)(Va,{sid:it,artifacts:ot.data,error:ot.isError,onExpand:Ae,className:`min-h-0 flex-1 mobile-scroll-region ${_?`lg:flex`:`lg:hidden`}`,embedded:!0,onCollapse:()=>w(!1),missionView:vt,activityEvents:_t}),_?null:(0,K.jsx)(`div`,{className:`hidden h-12 items-center justify-center border-b border-line/50 text-ink-faint lg:flex`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>w(!0),"aria-label":t(`common.expandPreview`),title:t(`common.expandPreview`),className:`flex h-8 w-8 items-center justify-center rounded-md border border-line/50 bg-bg/40 hover:border-blue/50 hover:text-ink`,children:(0,K.jsx)(o,{icon:C,className:`h-3.5 w-3.5`})})})]})]}):(0,K.jsx)(go,{loading:r.isLoading||!!(P&&rt.isLoading),hasProjects:a.length>0,error:r.isError&&a.length===0?ai(r.error):rt.isError&&!L?ai(rt.error):void 0,onRetry:()=>{r.refetch(),P&&rt.refetch()},onNew:()=>Pe(!0),onChoose:()=>te(!0),canCreate:!f})}),(0,K.jsx)(la,{open:l===`palette`,onClose:()=>u(`none`),items:Lt}),(0,K.jsx)(da,{open:l===`help`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(_a,{sid:P,open:l===`doctor`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(Z,{sid:P,open:l===`config`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(va,{sid:P,open:l===`identity`,onClose:()=>u(`none`)}),P&&(0,K.jsx)(ya,{sid:P,open:l===`transcript`,onClose:()=>u(`none`)}),P&&L?(0,K.jsx)(eo,{open:l===`inspector`,snap:L,journal:pt.data??[],busy:bt.disposeBacklog.isPending||bt.stopBacklog.isPending,onClose:()=>u(`none`),onDispose:Et,onStop:At,onInspect:Me}):null,P&&L?(0,K.jsx)(po,{open:l===`operations`,sid:P,snap:L,onClose:()=>u(`none`),onChanged:()=>{rt.refetch(),r.refetch()},onRestored:async e=>{await r.refetch(),$e(e)}}):null,(0,K.jsx)(Oa,{sid:P,path:ke,onClose:()=>Ae(null)}),(0,K.jsx)(ro,{sid:P,itemId:je,onClose:()=>Me(null),onDone:e=>Et(e,`done`),onSkip:e=>Et(e,`rm`),onStop:At,busy:bt.disposeBacklog.isPending||bt.stopBacklog.isPending,readOnly:f}),(0,K.jsx)(Ua,{open:Ne,busy:I,onClose:()=>Pe(!1),onCreate:nt}),(0,K.jsx)(xa,{reply:ht,open:V,busy:B,onClose:()=>gt(!1),onSubmit:mt}),P&&L?(0,K.jsx)(Wa,{open:Fe,sid:P,name:L.session.display_name||``,alive:L.daemon.alive,controlAvailable:L.daemon.control_available!==!1,busy:xt,onClose:()=>Ie(!1),onRename:wt,onStart:Tt,onPause:Ct,onDelete:St}):null,(0,K.jsx)(Ha,{notice:Be,onClose:Je}),L&&!f?(0,K.jsx)(_o,{active:h===`preview`?`preview`:D,onSelect:e=>{if(e===`preview`){S(`preview`);return}S(`activity`),E(e)},onOpenSessions:()=>te(!0)}):null]})}function Yo({onDone:e}){let{t}=q(),n=(0,M.useRef)(!1),r=(0,M.useCallback)(()=>{n.current||(n.current=!0,e())},[e]);return(0,M.useEffect)(()=>{let e=window.setTimeout(r,330),t=()=>r();return window.addEventListener(`keydown`,t,{once:!0}),()=>{window.clearTimeout(e),window.removeEventListener(`keydown`,t)}},[r]),(0,K.jsxs)(`div`,{role:`status`,"aria-label":t(`splash.starting`),onClick:r,onAnimationEnd:e=>{e.currentTarget===e.target&&r()},className:`argus-web-splash`,children:[(0,K.jsx)(`div`,{className:`argus-web-splash-logo argus-web-splash-logo-full`,"aria-hidden":`true`,children:(0,K.jsx)(wi,{size:72})}),(0,K.jsx)(`div`,{className:`argus-web-splash-logo argus-web-splash-logo-compact`,"aria-hidden":`true`,children:(0,K.jsx)(Si,{size:112})})]})}He();var Xo=new Ee({defaultOptions:{queries:{staleTime:3e3,retry:dr,refetchOnWindowFocus:!1}}});function Zo(){let[e,t]=(0,M.useState)(!0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Jo,{}),e?(0,K.jsx)(Yo,{onDone:()=>t(!1)}):null]})}De.createRoot(document.getElementById(`root`)).render((0,K.jsx)(M.StrictMode,{children:(0,K.jsx)(de,{client:Xo,children:(0,K.jsx)(Hr,{children:(0,K.jsx)(Zo,{})})})}));export{ot as a,Ge as i,q as n,P as o,We as r,Yr as t}; \ No newline at end of file diff --git a/frontend/web/dist/assets/pdf-Dzq_asqX.js b/frontend/web/dist/assets/pdf-Dvbq7GvP.js similarity index 99% rename from frontend/web/dist/assets/pdf-Dzq_asqX.js rename to frontend/web/dist/assets/pdf-Dvbq7GvP.js index f11e36dd..fad9a08e 100644 --- a/frontend/web/dist/assets/pdf-Dzq_asqX.js +++ b/frontend/web/dist/assets/pdf-Dvbq7GvP.js @@ -1,4 +1,4 @@ -import{t as e}from"./index-DYvAJ_cb.js";var t=typeof process==`object`&&process+``==`[object process]`&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!==`browser`),n=[1/0,1/0,-1/0,-1/0],r=new Float32Array(n),i=[.001,0,0,.001,0,0],a=`http://www.w3.org/2000/svg`,o={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},s={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},c=`pdfjs_internal_id_`,l=`pdfjs_internal_editor_`,u={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},d={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},f={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},p={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},m={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},h={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26,RICHMEDIA:27},g={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},_={ERRORS:0,WARNINGS:1,INFOS:5},v={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},y={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},b={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},x=_.WARNINGS;function S(e){Number.isInteger(e)&&(x=e)}function C(){return x}function w(e){x>=_.INFOS&&console.info(`Info: ${e}`)}function T(e){x>=_.WARNINGS&&console.warn(`Warning: ${e}`)}function E(e){throw Error(e)}function D(e,t){e||E(t)}function O(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function k(e,t=null,n=null){if(!e)return null;if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=se(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return O(r)?r:null}function A(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&k(e,`http://example.com`)?e.split(`#`,1)[0]+`${t?`#${t}`:``}`:``}function j(e){return e.substring(e.lastIndexOf(`/`)+1)}function M(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var N=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),ee=class extends N{constructor(e,t){super(e,`PasswordException`),this.code=t}},te=class extends N{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},ne=class extends N{constructor(e){super(e,`InvalidPDFException`)}},re=class extends N{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},ie=class extends N{constructor(e){super(e,`FormatError`)}},P=class extends N{constructor(e){super(e,`AbortException`)}};function ae(e){(typeof e!=`object`||e?.length===void 0)&&E(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t`u`)return M(this,`isAlphaColorInputSupported`,!1);let e=document.createElement(`input`);return e.type=`color`,e.setAttribute(`alpha`,``),e.value=`#ff000080`,M(this,`isAlphaColorInputSupported`,e.value!==`#ff0000`)}static get isBackdropFilterSupported(){return M(this,`isBackdropFilterSupported`,typeof CSS<`u`&&CSS.supports(`backdrop-filter`,`blur(1px)`))}},I=class{static get hexNums(){return M(this,`hexNums`,Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let r=e[n],i=e[n+1];e[n]=r*t[0]+i*t[2]+t[4],e[n+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];for(let t=0;t<6;t+=2){let l=e[n+t],u=e[n+t+1];e[n+t]=l*r+u*a+s,e[n+t+1]=l*i+u*o+c}}static applyInverseTransform(e,t){let n=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=e[0],u=e[1],d=e[2],f=e[3],p=r*l+s,m=p,h=r*d+s,g=h,_=o*u+c,v=_,y=o*f+c,b=y;if(i!==0||a!==0){let e=i*l,t=i*d,n=a*u,r=a*f;p+=n,g+=n,h+=r,m+=r,_+=e,b+=e,y+=t,v+=t}n[0]=Math.min(n[0],p,h,m,g),n[1]=Math.min(n[1],_,y,v,b),n[2]=Math.max(n[2],p,h,m,g),n[3]=Math.max(n[3],_,y,v,b)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n**2+r**2,s=n*i+r*a,c=i**2+a**2,l=(o+c)/2,u=Math.sqrt(l**2-(o*c-s**2));t[0]=Math.sqrt(l+u||1),t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,r,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,r),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,r)}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s),this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c)}};function se(e){return decodeURIComponent(escape(e))}var ce=null,le=null;function ue(e){return ce||(ce=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,le=new Map([[`ſt`,`ſt`]])),e.replaceAll(ce,(e,t,n)=>t?t.normalize(`NFKC`):le.get(n))}function de(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),ae(e)}function fe(e,t,n){if(!Array.isArray(n)||n.length<2)return!1;let[r,i,...a]=n;if(!e(r)&&!Number.isInteger(r)||!t(i))return!1;let o=a.length,s=!0;switch(i.name){case`XYZ`:if(o<2||o>3)return!1;break;case`Fit`:case`FitB`:return o===0;case`FitH`:case`FitBH`:case`FitV`:case`FitBV`:if(o>1)return!1;break;case`FitR`:if(o!==4)return!1;s=!1;break;default:return!1}for(let e of a)if(!(typeof e==`number`||s&&e===null))return!1;return!0}var pe=()=>[],me=()=>new Map,he=()=>Object.create(null),ge=()=>new Set;typeof Iterator.prototype.join!=`function`&&(Iterator.prototype.join=function(e){return[...this].join(e)});function L(e,t,n){return Math.min(Math.max(e,t),n)}var _e=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let e=this.viewBox;return M(this,`rawDims`,{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){let n=[e,t];return I.applyTransform(n,this.transform),n}convertToPdfPoint(e,t){let n=[e,t];return I.applyInverseTransform(n,this.transform),n}},ve=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return e!==`textarea`&&e!==`input`&&e!==`option`&&e!==`select`}},ye=/url\(|image-set\(/i,be=/^on/i,xe=class{static get _allowedHtmlElements(){return M(this,`_allowedHtmlElements`,new Set([`a`,`b`,`br`,`button`,`div`,`i`,`img`,`input`,`label`,`li`,`ol`,`option`,`p`,`select`,`span`,`sub`,`sup`,`textarea`,`ul`]))}static get _allowedSvgElements(){return M(this,`_allowedSvgElements`,new Set([`ellipse`,`line`,`path`,`rect`,`svg`]))}static get _allowedRichTextElements(){return M(this,`_allowedRichTextElements`,new Set([`a`,`b`,`br`,`div`,`i`,`li`,`ol`,`p`,`span`,`sub`,`sup`,`ul`]))}static get _allowedRichTextAttributes(){return M(this,`_allowedRichTextAttributes`,new Set([`class`,`dir`,`style`]))}static get _allowedRichTextStyles(){return M(this,`_allowedRichTextStyles`,new Set(`color.font.fontFamily.fontSize.fontStretch.fontStyle.fontWeight.kerningMode.letterSpacing.lineHeight.margin.marginBottom.marginLeft.marginRight.marginTop.orphans.paddingLeft.paddingRight.breakAfter.breakBefore.breakInside.tabInterval.tabStop.textAlign.textDecoration.textIndent.transform.verticalAlign.widows`.split(`.`)))}static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:Object.hasOwn(e.attributes,`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(n!=null&&!be.test(t)&&!(r===`richText`&&!this._allowedRichTextAttributes.has(t)))switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:if(r===`richText`){let t=this._allowedRichTextStyles;for(let[r,i]of Object.entries(n))t.has(r)&&!ye.test(i)&&(e.style[r]=i)}else Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i?.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static#e(e,t,n){return n===`richText`?!t&&this._allowedRichTextElements.has(e)?document.createElement(e):null:t?t===a&&this._allowedSvgElements.has(e)?document.createElementNS(a,e):null:this._allowedHtmlElements.has(e)?document.createElement(e):null}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=this.#e(r.name,r.attributes?.xmlns,i)??document.createElement(`div`);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&ve.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=this.#e(u,s.attributes?.xmlns,i);if(d){if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&ve.shouldBuildText(u)&&c.push(e),d.append(e)}}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}static getPageViewport(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new _e({viewBox:[0,0,parseInt(r,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}},Se=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function Ce(e,t=`text`){if(Ae(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`blob`:return n.blob();case`bytes`:return n.bytes();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t===`bytes`?`arraybuffer`:t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`bytes`:n(new Uint8Array(i.response));return;case`blob`:case`json`:n(i.response);return}n(i.responseText);return}r(Error(i.statusText))}},i.send(null)})}var we=class extends N{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function Te(e){let t=e.length,n=0;for(;n{try{return new URL(e)}catch{}try{return new URL(decodeURIComponent(e))}catch{}try{return new URL(e,`https://foo.bar`)}catch{}try{return new URL(decodeURIComponent(e),`https://foo.bar`)}catch{}return null})(e);if(!n)return t;let r=e=>{try{let t=decodeURIComponent(e);return t.includes(`/`)&&(t=j(t),t.length===4&&i.test(t))?e:t}catch{return e}},i=/\.pdf$/i,a=j(n.pathname);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=e=>[...e].findLast(e=>i.test(e)),t=e(n.searchParams.values())??e(n.searchParams.keys());if(t)return r(t)}if(n.hash){let e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(e)return r(e[0])}return t}var ke=class{#e=new Map;times=[];time(e){this.#e.has(e)&&T(`Timer is already running for ${e}`),this.#e.set(e,Date.now())}timeEnd(e){this.#e.has(e)||T(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.#e.get(e),end:Date.now()}),this.#e.delete(e)}toString(){let e=Math.max(...this.times.map(e=>e.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms\n`).join(``)}};function Ae(e,t){let n=t?URL.parse(e,t):URL.parse(e);return/https?:/.test(n?.protocol??``)}function R(e){e.preventDefault()}function z(e){e.preventDefault(),e.stopPropagation()}var je=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}};function Me(e){if(e.startsWith(`#`)){let t=e.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(e.startsWith(`rgb(`)){let[t,n,r]=e.slice(4,-1).split(`,`).map(e=>parseInt(e,10));return[t,n,r,1]}if(e.startsWith(`rgba(`)){let t=e.slice(5,-1).split(`,`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}let t=e.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!==`none`?parseFloat(t[4]):1]:null}function Ne(e){let t=Me(e);return t?t.slice(0,3):(T(`Not a valid color format: "${e}"`),[0,0,0])}function Pe(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,t.style.colorScheme=`only light`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,Ne(r))}t.remove()}function B(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function V(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function Fe(e,t,n=!1,r=!0){if(t instanceof _e){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`,s=`round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;!n||t.rotation%180==0?(a.width=o,a.height=s):(a.width=s,a.height=o)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var Ie=class e{constructor(){let{pixelRatio:t}=e;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,n,r,i,a=-1){let o=1/0,s=1/0,c=1/0;r=e.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*n))),i!==-1&&(s=i/t,c=i/n);let l=Math.min(o,s,c);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},Le=[`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`],Re=class{static get isDarkMode(){return M(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},ze=class{static get commentForegroundColor(){let e=document.createElement(`span`);e.classList.add(`comment`,`sidebar`);let{style:t}=e;t.width=t.height=`0`,t.display=`none`,t.color=`var(--comment-fg-color)`,document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),M(this,`commentForegroundColor`,Ne(n))}};function Be(e,t){t=L(t??1,0,1);let n=255*(1-t);return e.map(e=>Math.round(e*t+n))}function Ve(e,t){let n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{let e=a-o;switch(t[1]=s<.5?e/(a+o):e/(2-a-o),a){case n:t[0]=((r-i)/e+(ri?(r+.05)/(i+.05):(i+.05)/(r+.05)}var Ge=new Map;function Ke(e,t){let n=e[0]+e[1]*256+e[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=Ge.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);Ve(e,o);let s=i.subarray(6,9);Ve(t,s);let c=s[2]<.5,l=c?12:4.5;if(o[2]=c?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),We(o,s,a).005;){let n=o[2]=(e+t)/2;c===We(o,s,a){n.delete()},{signal:n._signal}),this.#r.append(r)}get#p(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#f(t),this.#r.append(t,this.#p),this.#i=e}addComment(e,t=null){if(this.#a)return;let n=e.renderForToolbar();if(!n)return;this.#f(n);let r=this.#o=this.#p;t?(this.#r.insertBefore(n,t),this.#r.insertBefore(r,t)):this.#r.append(n,r),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#f(t),this.#r.append(t,this.#p)}async addEditSignatureButton(e){let t=this.#s=await e.renderEditButton(this.#n);this.#f(t),this.#r.append(t,this.#p)}removeButton(e){e===`comment`&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#o?.remove(),this.#o=null)}async addButton(e,t){switch(e){case`colorPicker`:t&&this.addColorPicker(t);break;case`altText`:t&&await this.addAltText(t);break;case`editSignature`:t&&await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:t&&this.addComment(t)}}async addButtonBefore(e,t,n){if(!t&&e===`comment`)return;let r=this.#r.querySelector(n);r&&e===`comment`&&this.addComment(t,r)}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},Xe=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`);let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,R,{signal:t});let n=this.#e=document.createElement(`div`);return n.className=`buttons`,e.append(n),this.#n.hasCommentManager()&&this.#a(`commentButton`,`pdfjs-comment-floating-button`,`pdfjs-comment-floating-button-label`,()=>{this.#n.commentSelection(`floating_button`)}),this.#a(`highlightButton`,`pdfjs-highlight-floating-button1`,`pdfjs-highlight-floating-button-label`,()=>{this.#n.highlightSelection(`floating_button`)}),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(en){r=a,n=e;continue}t?a>r&&(r=a):a=1}static clearPointerType(){e.#r=null}static clearPointerIds(){e.#e=NaN,e.#t=null}static clearTimeStamp(){e.#n=NaN}},$e=class{#e=0;get id(){return`${l}${this.#e++}`}},et=class e{#e=de();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=`data:image/svg+xml;charset=UTF-8,`,t=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),n=new Image;n.src=e;let r=n.decode().then(()=>(t.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0));return M(this,`_isSVGFittingCanvas`,r)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await Ce(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){T(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},tt=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},nt=class e{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;let{isMac:n}=F.platform;for(let[r,i,a={}]of t){let t=r.some(e=>e.startsWith(`mac+`));for(let o of r){let r=o;if(t){let e=o.startsWith(`mac+`);if(n!==e)continue;e&&(r=o.slice(4))}let[s,c]=e.#e(r);s!==null&&this.callbacks.getOrInsertComputed(s,pe).push({callback:i,options:a,modifiers:c})}}}static#e(t){let n=null,r=0;for(let i of t.split(`+`)){if(i=i.trim(),!i)continue;let a=i.toUpperCase(),o=e[a];if(o){r|=o;continue}if(n!==null){T(`KeyboardManager: multiple keys in shortcut "${t}"`);break}n=a===`SPACE`?` `:i}return n===null&&T(`KeyboardManager: no key found in shortcut "${t}"`),[n,r]}static#t(e){let t=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(e);return t?t[1]?.toLowerCase()??t[2]:null}exec(t,n){let r=this.callbacks.get(n.key);if(!r){if(/^[a-z]$/i.test(n.key))return;let t=e.#t(n.code);if(t===null||t===n.key||(r=this.callbacks.get(t),!r))return}let i=(n.altKey?e.ALT:0)|(n.ctrlKey?e.CTRL:0)|(n.metaKey?e.META:0)|(n.shiftKey?e.SHIFT:0),a=r.find(e=>e.modifiers===i);if(!a)return;let{callback:o,options:{bubbles:s=!1,args:c=[],checker:l=null}}=a;l&&!l(t,n)||(o.bind(t,...c,n)(),s||z(n))}},rt=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return Pe(e),M(this,`_colors`,e)}convert(t){let n=Ne(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?I.makeHexColor(...t):e}},it=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=null;#l=new tt;#u=null;#d=null;#f=null;#p=0;#m=new Set;#h=null;#g=null;#_=new Set;_editorUndoBar=null;#v=!1;#y=!1;#b=!1;#x=null;#S=null;#C=null;#w=null;#T=!1;#E=null;#D=new $e;#O=!1;#k=!1;#A=!1;#j=null;#M=null;#N=null;#P=null;#F=null;#I=u.NONE;#L=new Set;#R=null;#z=null;#B=null;#V=null;#H=null;#U={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#W=[0,0];#G=null;#K=null;#q=null;#J=null;#Y=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#K.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return M(this,`_keyboardManager`,new nt([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`Backspace`,`alt+Backspace`,`ctrl+Backspace`,`shift+Backspace`,`mac+Backspace`,`mac+alt+Backspace`,`mac+ctrl+Backspace`,`Delete`,`ctrl+Delete`,`shift+Delete`,`mac+Delete`],t.delete,{checker:r}],[[`Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#K.contains(t)&&!e.isEnterHandled}],[[`Space`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#K.contains(document.activeElement)}],[[`Escape`],t.unselectAll],[[`ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this._signal=this.#e.signal;this.#K=e,this.#q=t,this.#J=n,this.#o=r,this.#u=i,this.#z=a,this.#H=s,this._eventBus=o;let _={signal:g,...Ze};o.on(`editingaction`,this.onEditingAction.bind(this),_),o.on(`pagechanging`,this.onPageChanging.bind(this),_),o.on(`scalechanging`,this.onScaleChanging.bind(this),_),o.on(`rotationchanging`,this.onRotationChanging.bind(this),_),o.on(`setpreference`,this.onSetPreference.bind(this),_),o.on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),_),window.addEventListener(`pointerdown`,()=>{this.#k=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#k=!1},{capture:!0,signal:g}),window.addEventListener(`beforeunload`,this.endCurrentEditing.bind(this),{capture:!0,signal:g}),this.#te(),this.#ce(),this.#ie(),this.#s=s.annotationStorage,this.#x=s.filterFactory,this.#B=c,this.#w=l||null,this.#v=u,this.#y=d,this.#b=f,this.#F=p||null,this.viewParameters={realScale:Se.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=h!==!1,i?.setSidebarUiManager(this)}destroy(){this.#Y?.resolve(),this.#Y=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#_.clear(),this.#P?.clear(),this.#t=null,this.#L.clear(),this.#l.destroy(),this.#o?.destroy(),this.#u?.destroy(),this.#z?.destroy(),this.#E?.hide(),this.#E=null,this.#N?.destroy(),this.#N=null,this.#n=null,this.#S&&=(clearTimeout(this.#S),null),this.#G&&=(clearTimeout(this.#G),null),this._editorUndoBar?.destroy(),this.#H=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#F}get useNewAltTextFlow(){return this.#y}get useNewAltTextWhenAddingImage(){return this.#b}get hcmFilter(){return M(this,`hcmFilter`,this.#B?this.#x.addHCMFilter(this.#B.foreground,this.#B.background):`none`)}get direction(){return M(this,`direction`,getComputedStyle(this.#K).direction)}get _highlightColors(){return M(this,`_highlightColors`,this.#w?new Map(this.#w.split(`,`).map(e=>(e=e.split(`=`).map(e=>e.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return M(this,`highlightColors`,null);let t=new Map,n=!!this.#B;for(let[r,i]of e){let e=r.endsWith(`_HCM`);if(n&&e){t.set(r.replace(`_HCM`,``),i);continue}!n&&!e&&t.set(r,i)}return M(this,`highlightColors`,t)}get highlightColorNames(){return M(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#f=e}setMainHighlightColorPicker(e){this.#N=e}editAltText(e,t=!1){this.#o?.editAltText(this,e,t)}hasCommentManager(){return!!this.#u}editComment(e,t,n,r){this.#u?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#u?.updateComment(e.getData())}updatePopupColor(e){this.#u?.updatePopupColor(e)}removeComment(e){this.#u?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,`comment`),this.toggleComment(null),e.comment=null},undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){this.#u?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#u?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#u?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),r=n=>{n.pageNumber===e&&(this._eventBus.off(`editorsrendered`,r),t())};this._eventBus.on(`editorsrendered`,r,Ze),await n}getSignature(e){this.#z?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#z}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal,...Ze}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e===`enableNewAltTextWhenAddingImage`&&(this.#b=t)}onPageChanging({pageNumber:e}){this.#p=e-1}deletePage(e){for(let t of this.getEditors(e))t.remove();this.#i.delete(e),this.#p===e&&(this.#p=0)}focusMainContainer(){this.#K.focus()}findParent(e,t){for(let n of this.#i.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#q.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#_.add(e)}removeShouldRescale(e){this.#_.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Se.PDF_TO_CSS_UNITS;for(let e of this.#_)e.onScaleChanging();this.#f?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#X({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Z(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#i.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``,t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=n,s=n.toString(),c=this.#X(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let d=this.#Z(c),f=this.#I===u.NONE,p=()=>{let n=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o,text:s});f&&this.showAllEditors(`highlight`,!0,!0),t&&n?.editComment()};if(f){this.switchToMode(u.HIGHLIGHT,p);return}p()}commentSelection(e=``){this.highlightSelection(e,!0)}endCurrentEditing(){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#Q(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#X(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#E||=new Xe(this),this.#E.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#s)return null;let t=`${l}${e}`,n=this.#s.getRawValue(t);return n&&this.#s.remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#s&&!this.#s.has(e.id)&&this.#s.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#J;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#$(){let e=document.getSelection();if(!e||e.isCollapsed){this.#R&&(this.#E?.hide(),this.#R=null,this.#le({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#R)return;let n=this.#X(e).closest(`.textLayer`);if(!n){this.#R&&(this.#E?.hide(),this.#R=null,this.#le({hasSelectedText:!1}));return}if(this.#E?.hide(),this.#R=t,this.#le({hasSelectedText:!0}),(this.#I===u.HIGHLIGHT||this.#I===u.NONE)&&(this.#I===u.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#T=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#I===u.HIGHLIGHT?this.#Z(n):null;if(e?.toggleDrawing(),this.#k){let t=new AbortController,n=this.combinedSignal(t),r=n=>{(n.type!==`pointerup`||n.button===0)&&(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#ee(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#ee(`main_toolbar`)}}#ee(e=``){this.#I===u.HIGHLIGHT?this.highlightSelection(e):this.#v&&this.#Q()}#te(){document.addEventListener(`selectionchange`,this.#$.bind(this),{signal:this._signal})}#ne(){if(this.#C)return;this.#C=new AbortController;let e=this.combinedSignal(this.#C);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#re(){this.#C?.abort(),this.#C=null}blur(){if(this.isShiftKeyDown=!1,this.#T&&(this.#T=!1,this.#ee(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#L)if(t.div.contains(e)){this.#M=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#M)return;let[e,t]=this.#M;this.#M=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ie(){if(this.#j)return;this.#j=new AbortController;let e=this.combinedSignal(this.#j);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#ae(){this.#j?.abort(),this.#j=null}#oe(){if(this.#d)return;this.#d=new AbortController;let e=this.combinedSignal(this.#d);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#se(){this.#d?.abort(),this.#d=null}#ce(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#ie(),this.setEditingState(!0)}removeEditListeners(){this.#ae(),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#g)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#g)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#L){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#g)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){T(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#pe(t);this.#ge(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){T(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#I!==u.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#T&&(this.#T=!1,this.#ee(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`);break;case`commentSelection`:this.commentSelection(`context_menu`)}}updatePageIndex(e,t){for(let n of this.getEditors(e))n.pageIndex=t;let n=this.#a.get(e);n&&(n.pageIndex=t,this.#i.set(t,n),this.#O?n.enable():n.disable())}startUpdatePages(){this.#a=new Map(this.#i),this.#i.clear()}endUpdatePages(){this.#a=null}clonePage(e,t){for(let n of this.getEditors(e)){let e=n.serialize(n.mode!==u.HIGHLIGHT);e&&(e.pageIndex=t,e.id=this.getId(),e.isClone=!0,delete e.popupRef,this.#s.setValue(e.id,e))}}findClonesForPage(e){let t=[],{pageIndex:n}=e;for(let[r,i]of this.#s)i.pageIndex===n&&i.isClone&&(this.#s.remove(r),t.push(e.deserialize(i).then(t=>{t&&(t.isClone=!0,e.addOrRebuild(t))})));return Promise.all(t)}#le(e){Object.entries(e).some(([e,t])=>this.#U[e]!==t)&&(this._eventBus.dispatch(`editingstateschanged`,{source:this,details:Object.assign(this.#U,e)}),this.#I===u.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#ue([[d.HIGHLIGHT_FREE,!0]]))}#ue(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#ne(),this.#oe(),this.#le({isEditing:this.#I!==u.NONE,isEmpty:this.#he(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#re(),this.#se(),this.#le({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#g){this.#g=e;for(let e of this.#g)this.#ue(e.defaultPropertiesToUpdate)}}getId(){return this.#D.id}get currentLayer(){return this.#i.get(this.#p)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#p}addLayer(e){this.#i.set(e.pageIndex,e),this.#O?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1,a=!1){if(this.#I!==e&&!(this.#Y&&(await this.#Y.promise,!this.#Y))){if(this.#Y=Promise.withResolvers(),this.#f?.commitOrRemove(),this.#I===u.POPUP&&this.#u?.hideSidebar(),this.#u?.destroyPopup(),this.#I=e,e===u.NONE){this.setEditingState(!1),this.#fe();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#Y.resolve();return}for(let e of this.#r.values())e.addStandaloneCommentButton();e===u.SIGNATURE&&await this.#z?.loadSignatures(),n&&H.clearPointerType(),this.setEditingState(!0),await this.#de(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===u.POPUP){this.#n||=await this.#H.getAnnotationsByType(new Set(this.#g.map(e=>e._editorType)));let e=new Set,t=[];for(let n of this.#r.values()){let{annotationElementId:r,hasComment:i,deleted:a}=n;r&&e.add(r),i&&!a&&t.push(n.getData())}for(let n of this.#n){let{id:r,popupRef:i,contentsObj:a}=n;i&&a?.str&&!e.has(r)&&!this.#m.has(r)&&t.push(n)}this.#u?.showSidebar(t)}if(!t){r&&this.addNewEditorFromKeyboard(),this.#Y.resolve();return}for(let e of this.#r.values())e.uid===t?(this.setSelected(e),a?e.editComment():i?e.enterInEditMode():e.focus()):e.unselect();this.#Y.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#I&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#g){switch(e){case d.CREATE:this.currentLayer.addNewEditor(t);return;case d.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#V||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#L)n.updateParams(e,t);else for(let n of this.#g)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#V?.get(d.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#ue([[d.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#A!==e){this.#A=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#de(){if(!this.#O){this.#O=!0;let e=[];for(let t of this.#i.values())e.push(t.enable());await Promise.all(e);for(let e of this.#r.values())e.enable()}}#fe(){if(this.unselectAll(),this.#O){this.#O=!1;for(let e of this.#i.values())e.disable();for(let e of this.#r.values())e.disable()}}*getEditors(e){for(let t of this.#r.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#P?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#m.has(e.annotationElementId))&&this.#s?.remove(e.id)}addDeletedAnnotationElement(e){this.#m.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#m.has(e)}removeDeletedAnnotationElement(e){this.#m.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#pe(e){let t=this.#i.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#ue(e.propertiesToUpdate))}get#me(){let e=null;for(e of this.#L);return e}updateUI(e){this.#me===e&&this.#ue(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#ue(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#L.has(e)){this.#L.delete(e),e.unselect(),this.#le({hasSelectedEditor:this.hasSelection});return}this.#L.add(e),e.select(),this.#ue(e.propertiesToUpdate),this.#le({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#f?.commitOrRemove();for(let t of this.#L)t!==e&&t.unselect();this.#u?.destroyPopup(),this.#L.clear(),this.#L.add(e),e.select(),this.#ue(e.propertiesToUpdate),this.#le({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#L.values().next().value}unselect(e){e.unselect(),this.#L.delete(e),this.#le({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#L.size!==0}get isEnterHandled(){return this.#L.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#le({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#he()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#le({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#he()})}addCommands(e){this.#l.add(e),this.#le({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#he()})}cleanUndoStack(e){this.#l.cleanType(e)}#he(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#L],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#pe(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#ge(e){for(let e of this.#L)e.unselect();this.#L.clear();for(let t of e)t.isEmpty()||(this.#L.add(t),t.select());this.#le({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#L)e.commit();this.#ge(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#I!==u.NONE))&&!this.#f?.commitOrRemove()&&(this.#u?.destroyPopup(),this.hasSelection)){for(let e of this.#L)e.unselect();this.#L.clear(),this.#le({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#W[0]+=e,this.#W[1]+=t;let[r,i]=this.#W,a=[...this.#L];this.#G&&clearTimeout(this.#G),this.#G=setTimeout(()=>{this.#G=null,this.#W[0]=this.#W[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(r,i),e.translationDone())},undo:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(-r,-i),e.translationDone())},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t),n.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(let e of this.#L)this.#h.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);let e=this.#h;this.#h=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#r.has(e.id)){let i=this.#i.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#h)for(let n of this.#h.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#L.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#I}isEditingMode(){return this.#I!==u.NONE}get imageManager(){return M(this,`imageManager`,new et)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a})}let s=[];for(let e=0,n=t.rangeCount;ee.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e){this.#s?.remove(),this.#s=null;return}if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),(this.#e!==e||this.#t!==t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getElementForAltText()?.setAttribute(`aria-describedby`,n.id)}},ot=class{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=null;constructor(e){this.#r=e}renderForToolbar(){let e=this.#t=document.createElement(`button`);return e.className=`comment`,this.#u(e,!1)}renderForStandalone(){let e=this.#e=document.createElement(`button`);e.className=`annotationCommentButton`;let t=this.#r.commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction===`ltr`?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let r=this.#r.commentButtonColor;r&&(n.backgroundColor=r)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;let e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#e)return null;let{x:e,y:t,height:n}=this.#e.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#r.parent.boundingClientRect;return[(e-r)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#e&&(this.#e.classList.toggle(`selected`,e),this.#e.ariaExpanded=t)}#u(e,t){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex=`0`,e.ariaHasPopup=`dialog`,t?(e.ariaControls=`commentPopup`,e.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`)):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute(`data-l10n-id`,`pdfjs-editor-add-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,R,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,z(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,z(e)},{capture:!0,signal:n})),e.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:n});let r=t=>{t.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener(`click`,r,{capture:!0,signal:n}),e.addEventListener(`keydown`,t=>{t.target===e&&t.key===`Enter`&&(this.#n=!0,r(t))},{signal:n}),e.addEventListener(`pointerenter`,()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener(`pointerleave`,()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){let t=this.commentPopupPositionInLayer,n,r;if(t)[n,r]=t;else{[n,r]=this.#r.commentButtonPosition;let{width:e,height:t,x:i,y:a}=this.#r;n=i+n*e,r=a+r*t}let i=this.#r.parent.boundingClientRect,{x:a,y:o,width:s,height:c}=i;this.#r._uiManager.editComment(this.#r,a+n*s,o+r*c,{...e,parentDimensions:i})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#c||this.#o===``}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#i}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#a,date:this.#s,deleted:this.isDeleted()}}set data(e){if(e!==this.#o&&(this.#a=null),e===null){this.#o=``,this.#c=!0;return}this.#o=e,this.#s=new Date,this.#c=!1}restoreData({text:e,richText:t,date:n}){this.#o=e,this.#a=t,this.#s=n,this.#c=!1}setInitialText(e,t=null){this.#i=e,this.data=e,this.#s=null,this.#a=t}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#o=``,this.#a=null,this.#s=null,this.#r=null,this.#n=!1,this.#c=!1}},st=class e{#e;#t=!1;#n=null;#r;#i;#a;#o;#s=null;#c;#l=null;#u;#d=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#u=new AbortController,this.#c=AbortSignal.any([o,this.#u.signal]),e.addEventListener(`touchstart`,this.#f.bind(this),{passive:!1,signal:this.#c})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ie.pixelRatio}#f(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#s)return;let e=this.#s=new AbortController,t=AbortSignal.any([this.#c,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#s?.abort(),this.#s=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(z(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r);return}if(!this.#d){this.#d=new AbortController;let e=AbortSignal.any([this.#c,this.#d.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#p.bind(this),n);let r=this.#m.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,z,n),t.addEventListener(`pointermove`,z,n),t.addEventListener(`pointercancel`,z,n),t.addEventListener(`pointerup`,z,n),this.#i?.()}if(z(e),e.touches.length!==2||this.#n?.()){this.#l=null;return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#l={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#p(t){if(!this.#l||t.touches.length!==2)return;z(t);let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);let{screenX:i,screenY:a}=n,{screenX:o,screenY:s}=r,c=this.#l,{touch0X:l,touch0Y:u,touch1X:d,touch1Y:f}=c,p=d-l,m=f-u,h=o-i,g=s-a,_=Math.hypot(h,g)||1,v=Math.hypot(p,m)||1;if(!this.#t&&Math.abs(v-_)<=e.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=a,c.touch1X=o,c.touch1Y=s,!this.#t){this.#t=!0;return}let y=[(i+o)/2,(a+s)/2];this.#a?.(y,v,_)}#m(e){e.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#o?.()),this.#l&&(z(e),this.#l=null,this.#t=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#s?.abort(),this.#s=null}},U=class e{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;#s=``;#c=null;#l=null;#u=null;#d=null;#f=null;#p=``;#m=!1;#h=null;#g=!1;#_=!1;#v=!1;#y=null;#b=0;#x=0;#S=null;#C=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new rt;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=it.TRANSLATE_SMALL,r=it.TRANSLATE_BIG;return M(this,`_resizerKeyboardManager`,new nt([[[`ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return M(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new ct({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nAlert??=Object.freeze({highlight:`pdfjs-editor-highlight-added-alert`,freetext:`pdfjs-editor-freetext-added-alert`,ink:`pdfjs-editor-ink-added-alert`,stamp:`pdfjs-editor-stamp-added-alert`,signature:`pdfjs-editor-signature-added-alert`}),e._l10nResizer??=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){E(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle(`draggable`,e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#W(),this.#d?.remove(),this.#d=null):(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#m?this.#m=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this._onTranslated()}#E([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#E(this.parentDimensions,e,t)}translateInPage(e,t){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#h||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),n.scrollIntoView({block:`nearest`})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=L(i,0,n-o),a=L(a,0,r-s);break;case 90:i=L(i,0,n-s),a=L(a,o,r);break;case 180:i=L(i,o,n),a=L(a,s,r);break;case 270:i=L(i,s,n),a=L(a,0,r-o)}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#D(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#D(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#D(t,n,360-this.parentRotation)}#O(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#k(){if(this.#c)return;this.#c=document.createElement(`div`),this.#c.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#c.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#A.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,R,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=F.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#N.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,z,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,R,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#M()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#j(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#M(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#u;this.#u=null;let i=this.x,a=this.y,o=this.width,s=this.height;(i!==e||a!==t||o!==n||s!==r)&&this.addCommands({cmd:this.#j.bind(this,i,a,o,s),undo:this.#j.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#O(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#O(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),C=e._round(o+x[1]),w=1,T=1,E,D;if(n.fromKeyboard)({deltaX:E,deltaY:D}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[E,D]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}if([E,D]=m(E/r,D/i),_){let e=Math.hypot(s,c);w=T=Math.max(Math.min(Math.hypot(b[0]-y[0]-E,b[1]-y[1]-D)/e,1/s,1/c),l/s,u/c)}else v?w=L(Math.abs(b[0]-y[0]-E),l,1)/s:T=L(Math.abs(b[1]-y[1]-D),u,1)/c;let O=e._round(s*w),k=e._round(c*T);x=f(...g(O,k));let A=S-x[0],j=C-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=O,this.height=k,this.x=A,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_)return this._editToolbar;this._editToolbar=new Ye(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton(`comment`,this.addCommentButton()),this._editToolbar.addButton(`delete`),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore(`comment`,this.addCommentButton(),`.deleteButton`)}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton(`comment`)}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(at.initialize(e._l10n),this.#n=new at(this),this.#e&&=(this.#n.data=this.#e,null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new ot(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#i){this._uiManager.isEditingMode()&&this.#i.classList.remove(`hidden`);return}this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i))}}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add(`hidden`)}get comment(){if(!this.#r)return null;let{data:{richText:e,text:t,date:n,deleted:r}}=this.#r;return{text:t,richText:e,date:n,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new ot(this),typeof e==`object`&&e?this.#r.restoreData(e):this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(this.#r||=new ot(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new ot(this),this.#r.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,t]=e.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,i=r+n+1,a=t-100,o=i+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[i,a,o,t]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#r.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement(`div`);e.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),e.className=this.name,e.setAttribute(`id`,this.id),e.tabIndex=this.#a?-1:0,e.setAttribute(`role`,`application`),this.defaultL10nId&&e.setAttribute(`data-l10n-id`,this.defaultL10nId),this._isVisible||e.classList.add(`hidden`),this.setInForeground(),this.#z();let[t,n]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[r,i]=this.getInitialTranslation();return this.translate(r,i),Qe(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#C||=new st({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#F(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#O(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#h||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=F.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#m=!0,this._isDraggable){this.#R(e);return}this.#L(e)}#L(e){let{isMac:t}=F.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#o=null,this.#m=!1,this._uiManager.endDragSession()||this.#L(e),n&&this._onStopDragging()};t&&(this.#b=e.clientX,this.#x=e.clientY,this.#o=e.pointerId,this.#s=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#o){z(e);return}let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o)},a),window.addEventListener(`touchmove`,z,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),z(e)},a));let s=e=>{if(!this.#o||this.#o===e.pointerId){o(e);return}z(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&e._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:r,deleted:i,richText:a},uid:o,pageIndex:s,creationDate:c,modificationDate:l}=this;return{id:o,pageIndex:s,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||l,popupRef:!i,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#_=!1,!0):!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t0&&e0}#z(){if(this.#f||!this.div)return;this.#f=new AbortController;let e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}rebuild(){this.#z()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||``}}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#e=e.accessibilityData,r._isCopy=e.isCopy||!1;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&=(clearTimeout(this.#y),null),this.#W(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#C?.destroy(),this.#C=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#k(),this.#c.classList.remove(`hidden`))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction===`ltr`?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,n]}=this,[r,i,a,o]=this.getPDFRect();return[e._round(r+(a-r)*t),e._round(i+(o-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#c.children;if(!this.#t){this.#t=Array.from(n);let t=this.#B.bind(this),r=this.#V.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#H.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(ai)for(let e=0;e{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#c?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!==`BUTTON`&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#S||=new Map;let{action:n}=t,r=this.#S.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#S.delete(n),this.#S.size===0&&(this.#S=null)},e._telemetryTimeout),this.#S.set(n,r);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){if(!this.#d&&!this.deleted){this.#d=e.addFakeAnnotation(this);return}if(this.deleted){this.#d.remove(),this.#d=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},ct=class extends U{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},lt=3285377520,W=4294901760,ut=65535,dt=class{constructor(e){this.h1=e?e&4294967295:lt,this.h2=e?e&4294967295:lt}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e>>17,o=o*d&W|o*p&ut,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&W|s*f&ut,s=s<<15|s>>>17,s=s*d&W|s*p&ut,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&W|o*f&ut,o=o<<15|o>>>17,o=o*d&W|o*p&ut,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&W|e*36045&ut,t=t*4283543511&W|((t<<16|e>>>16)*2950163797&W)>>>16,e^=t>>>1,e=e*444984403&W|e*60499&ut,t=t*3301882366&W|((t<<16|e>>>16)*3120437893&W)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},ft=Object.freeze({map:null,hash:``,transfer:void 0}),pt=class{#e=!1;#t=null;#n=null;#r=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){let t=this.#r.get(e);t!==void 0&&(t instanceof U&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),!this.#r.values().some(e=>e instanceof U)&&this.onAnnotationEditor?.(null))}setValue(e,t){let n=this.#r.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#r.set(e,t);r&&this.#i(),t instanceof U&&((this.#n||=new Map).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,this.onSetModified?.())}resetModified(){this.#e&&(this.#e=!1,this.onResetModified?.())}get print(){return new mt(this)}get serializable(){if(this.#r.size===0)return ft;let e=new Map,t=new dt,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof U?a.serialize(!1,r):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:ft}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof U)){i.popup&&(i.popup.deleted?r+=1:n+=1);continue}i.isCommentDeleted?r+=1:i.hasEditedComment&&(n+=1);let a=i.telemetryFinalData;if(!a)continue;let{type:o}=a;t.getOrInsertComputed(o,()=>Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[o]||=new Map;for(let[e,t]of Object.entries(a)){if(e===`type`)continue;let n=s.getOrInsertComputed(e,me);n.set(t,(n.get(t)??0)+1)}}if((r>0||n>0)&&(e||=Object.create(null),e.comments={deleted:r,edited:n}),!e)return null;for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,t){let n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;let e=[];if(this.#n)for(let t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);let t=``;if(e.length){let n=new dt;n.update(e.join(`,`)),t=n.hexdigest()}return this.#t={ids:new Set(e),hash:t}}[Symbol.iterator](){return this.#r.entries()}},mt=class extends pt{#e=ft;constructor(e){super();let{serializable:t}=e;if(t===ft)return;let{map:n,hash:r,transfer:i}=t,a=structuredClone(n,i?{transfer:i}:null);this.#e={map:a,hash:r,transfer:[]}}get print(){E(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return M(this,`modifiedIds`,{ids:new Set,hash:``})}},ht=`__forcedDependency`,{floor:gt,ceil:_t}=Math;function vt(e,t,n,r,i,a){e[t*4+0]=Math.min(e[t*4+0],n),e[t*4+1]=Math.min(e[t*4+1],r),e[t*4+2]=Math.max(e[t*4+2],i),e[t*4+3]=Math.max(e[t*4+3],a)}function yt(e,t,n,r,i){let a;e?(e<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=e,i[2]*=e,t<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t,i[3]*=t):i.fill(0),i[0]+=n,i[1]+=r,i[2]+=n,i[3]+=r}var bt=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],xt=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===bt}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}},St=(e,t)=>e?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),Ct=class{#e=[[1,0,0,1,0,0]];#t=[-1/0,-1/0,1/0,1/0];#n=new Float64Array(n);_pendingBBoxIdx=-1;#r;#i;#a;#o;_savesStack=[];_markedContentStack=[];constructor(e,t){this.#r=e.width,this.#i=e.height,this.#s(t)}growOperationsCount(e){e>=this.#o.length&&this.#s(e,this.#o)}#s(e,t){let n=new ArrayBuffer(e*4);this.#a=new Uint8ClampedArray(n),this.#o=new Uint32Array(n),t&&t.length>0?(this.#o.set(t),this.#o.fill(bt,t.length)):this.#o.fill(bt)}get clipBox(){return this.#t}save(e){return this.#t={__proto__:this.#t},this._savesStack.push(e),this}restore(e,t){let n=Object.getPrototypeOf(this.#t);if(n===null)return this;this.#t=n;let r=this._savesStack.pop();return r!==void 0&&(t?.(r,e),this.#o[e]=this.#o[r]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){let n=this._savesStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){let n=this._markedContentStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}pushBaseTransform(e){return this.#e.push(I.multiplyByDOMMatrix(this.#e.at(-1),e.getTransform())),this}popBaseTransform(){return this.#e.length>1&&this.#e.pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,this.#n.set(n,0)),this}recordClipBox(e,t,r,i,a,o){let s=I.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform()),c=n.slice();I.axialAlignedBoundingBox([r,a,i,o],s,c);let l=I.intersect(this.#t,c);return l?(this.#t[0]=l[0],this.#t[1]=l[1],this.#t[2]=l[2],this.#t[3]=l[3]):(this.#t[0]=this.#t[1]=1/0,this.#t[2]=this.#t[3]=-1/0),this}recordBBox(e,t,r,i,a,o){let s=this.#t;if(s[0]===1/0)return this;let c=I.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform());if(s[0]===-1/0)return I.axialAlignedBoundingBox([r,a,i,o],c,this.#n),this;let l=n.slice();return I.axialAlignedBoundingBox([r,a,i,o],c,l),this.#n[0]=L(l[0],s[0],this.#n[0]),this.#n[1]=L(l[1],s[1],this.#n[1]),this.#n[2]=L(l[2],this.#n[2],s[2]),this.#n[3]=L(l[3],this.#n[3],s[3]),this}recordFullPageBBox(e){return this.#n[0]=Math.max(0,this.#t[0]),this.#n[1]=Math.max(0,this.#t[1]),this.#n[2]=Math.min(this.#r,this.#t[2]),this.#n[3]=Math.min(this.#i,this.#t[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;let r=gt(this.#n[0]*256/this.#r),i=gt(this.#n[1]*256/this.#i),a=_t(this.#n[2]*256/this.#r),o=_t(this.#n[3]*256/this.#i);if(vt(this.#a,e,r,i,a,o),n)for(let t of n)for(let n of t)n!==e&&vt(this.#a,n,r,i,a,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,this.#t[0]=Math.max(this.#t[0],this.#n[0]),this.#t[1]=Math.max(this.#t[1],this.#n[1]),this.#t[2]=Math.min(this.#t[2],this.#n[2]),this.#t[3]=Math.min(this.#t[3],this.#n[3])),this}take(){return new xt(this.#o,this.#a)}takeDebugMetadata(){throw Error(`Unreachable`)}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}},wt=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[ht]:[]};#n=new Map;#r=new Set;#i=new Map;#a;#o;#s;constructor(e,t=!1){this.#s=e,t&&(this.#a=new Map,this.#o=(e,t)=>{St(this.#a,t).dependencies.add(e)})}get clipBox(){return this.#s.clipBox}growOperationsCount(e){this.#s.growOperationsCount(e)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[ht]:{__proto__:this.#t[ht]}},this.#s.save(e),this}restore(e){this.#s.restore(e,this.#o);let t=Object.getPrototypeOf(this.#e);return t===null?this:(this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this)}recordOpenMarker(e){return this.#s.recordOpenMarker(e,this.#o),this}getOpenMarker(){return this.#s.getOpenMarker()}recordCloseMarker(e){return this.#s.recordCloseMarker(e,this.#o),this}beginMarkedContent(e){return this.#s.beginMarkedContent(e),this}endMarkedContent(e){return this.#s.endMarkedContent(e,this.#o),this}pushBaseTransform(e){return this.#s.pushBaseTransform(e),this}popBaseTransform(){return this.#s.popBaseTransform(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,n){this.#e[e]=this.#n.get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(ht,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#r)this.recordFutureForcedDependency(ht,e);return this}resetBBox(e){return this.#s.resetBBox(e),this}recordClipBox(e,t,n,r,i,a){return this.#s.recordClipBox(e,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#s.recordBBox(e,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){let s=n.bbox,c,l;if(s&&(c=s[2]!==s[0]&&s[3]!==s[1]&&this.#i.get(n),c!==!1&&(l=[0,0,0,0],I.axialAlignedBoundingBox(s,n.fontMatrix,l),(r!==1||i!==0||a!==0)&&yt(r,-r,i,a,l),c)))return this.recordBBox(e,t,l[0],l[2],l[1],l[3]);if(!o)return this.recordFullPageBBox(e);let u=o();return s&&l&&c===void 0&&(c=l[0]<=i-u.actualBoundingBoxLeft&&l[2]>=i+u.actualBoundingBoxRight&&l[1]<=a-u.actualBoundingBoxAscent&&l[3]>=a+u.actualBoundingBoxDescent,this.#i.set(n,c),c)?this.recordBBox(e,t,l[0],l[2],l[1],l[3]):this.recordBBox(e,t,i-u.actualBoundingBoxLeft,i+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#s.recordFullPageBBox(e),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#r,r=this.#e,i=this.#t;for(let e of t)e in this.#e?n.add(r[e]):e in i&&i[e].forEach(n.add,n);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#r.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[ht]),this.#a){let t=St(this.#a,e),{dependencies:n}=t;this.#r.forEach(n.add,n),this.#s._savesStack.forEach(n.add,n),this.#s._markedContentStack.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.recordOperation(e,t,[this.#r,this.#s._savesStack,this.#s._markedContentStack]),n&&this.#r.clear(),this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#r);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.bboxToClipBoxDropOperation(e),n&&this.#r.clear(),this}take(){return this.#i.clear(),this.#s.take()}takeDebugMetadata(){return this.#a}},Tt=class e{#e;#t;#n;#r=0;#i=0;constructor(t,n,r){if(t instanceof e&&t.#n===!!r)return t;this.#e=t,this.#t=n,this.#n=!!r}get clipBox(){return this.#e.clipBox}growOperationsCount(){throw Error(`Unreachable`)}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this.#e.recordSimpleDataFromNamed(e,t,this.#t),this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,t,n,r,i,a){return this.#n||this.#e.recordClipBox(this.#t,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#n||this.#e.recordBBox(this.#t,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r,i,a,o){return this.#n||this.#e.recordCharacterBBox(this.#t,t,n,r,i,a,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw Error(`Unreachable`)}takeDebugMetadata(){throw Error(`Unreachable`)}},G={stroke:[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],fill:[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],imageXObject:[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],rawFillPath:[`filter`,`fillColor`,`fillAlpha`],showText:[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],transform:[`transform`],transformAndFill:[`transform`,`fillColor`]},Et=class e{#e;#t;#n=4;#r=0;#i=new e.#a(this.#n*6);static#a=F.isFloat16ArraySupported?Float16Array:Float32Array;constructor(e){this.#e=e.width,this.#t=e.height}record(t,r,i,a){if(this.#r===this.#n){this.#n*=2;let t=new e.#a(this.#n*6);t.set(this.#i),this.#i=t}let o=B(t),s;if(a[0]!==1/0){let e=n.slice();I.axialAlignedBoundingBox([0,-i,r,0],o,e);let t=I.intersect(a,e);if(!t)return;let[c,l,u,d]=t;if(c!==e[0]||l!==e[1]||u!==e[2]||d!==e[3]){let e=Math.atan2(o[1],o[0]),t=Math.abs(Math.sin(e)),n=Math.abs(Math.cos(e));if(t<1e-6||n<1e-6||Math.abs(t-n)<1e-6)s=[c,l,c,d,u,l];else{let e=u-c,r=d-l,i=t*t,a=n*n,o=n*t,f=a-i,p=(r*a-e*o)/f;s=[c+(r*o-e*i)/f,l,c,l+p,u,d-p]}}}s||(s=[0,-i,0,0,r,-i],I.applyTransform(s,o,0),I.applyTransform(s,o,2),I.applyTransform(s,o,4)),s[0]/=this.#e,s[1]/=this.#t,s[2]/=this.#e,s[3]/=this.#t,s[4]/=this.#e,s[5]/=this.#t,this.#i.set(s,this.#r*6),this.#r++}take(){return this.#i.subarray(0,this.#r*6)}},Dt=class{#e=new Set;#t=null;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){let t=this.#n();t.insertRule(e,t.cssRules.length)}#n(){if(this.#t)return this.#t;let e=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&e){let{adoptedStyleSheets:t}=this._document;if(t){let n=new e;return t.push(n),this.#t=n}}return this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement)),this.#t=this.styleElement.sheet}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);if(this.nativeFontFaces.clear(),this.#e.clear(),this.#t){let{adoptedStyleSheets:e}=this._document;e?.includes(this.#t)&&(this._document.adoptedStyleSheets=e.filter(e=>e!==this.#t)),this.#t=null}this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(D(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:t,src:r,style:i}=e,a=new FontFace(t,r,i);this.addNativeFontFace(a);try{await a.load(),this.#e.add(t),n?.(e)}catch{T(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}E(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw T(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return M(this,`isFontLoadingAPISupported`,e)}get isSyncFontLoadingSupported(){return M(this,`isSyncFontLoadingSupported`,t||F.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(D(!r.done,`completeRequest() cannot be called twice.`),r.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.callback,0)}}let{loadingRequests:n}=this,r={done:!1,complete:t,callback:e};return n.push(r),r}get _loadTestFont(){let e=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`);return M(this,`_loadTestFont`,e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function r(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function i(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let a,o,s=this._document.createElement(`canvas`);s.width=1,s.height=1;let c=s.getContext(`2d`),l=0;function u(e,t){if(++l>30){T(`Load test font never loaded.`),t();return}if(c.font=`30px `+e,c.fillText(`.`,0,20),c.getImageData(0,0,1,1).data[3]>0){t();return}setTimeout(u.bind(null,e,t))}let d=`lt${Date.now()}${this.loadTestFontId++}`,f=this._loadTestFont;f=i(f,976,d.length,d);let p=1482184792,m=n(f,16);for(a=0,o=d.length-3;a{g.remove(),t.complete()})}},Ot=class{compiledGlyphs=Object.create(null);#e;constructor(e,t=null,n,r){this.#e=e,this._inspectFont=t,n&&(this.charProcOperatorList=n),r&&Object.assign(this,r)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){T(`getPathGenerator - ignoring character: "${e}".`)}let i=Je(r?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace}set disableFontFace(e){M(this,`disableFontFace`,!!e)}get fontExtraProperties(){return this.#e.fontExtraProperties}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}},kt=class{static strings=[`fontFamily`,`fontWeight`,`italicAngle`]},At=class{static strings=[`css`,`loadedName`,`baseFontName`,`src`]},K=class{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static OFFSET_NUMBERS=Math.ceil(this.bools.length*2/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+this.numbers.length*8;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6},jt=class{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16},Mt=class{#e;#t=new TextDecoder;#n;constructor(e){this.#e=e,this.#n=new DataView(e)}#r(e){D(e>n&3;return r===0?void 0:r===2}get black(){return this.#r(0)}get bold(){return this.#r(1)}get disableFontFace(){return this.#r(2)}get fontExtraProperties(){return this.#r(3)}get isInvalidPDFjsFont(){return this.#r(4)}get isType3Font(){return this.#r(5)}get italic(){return this.#r(6)}get missingFile(){return this.#r(7)}get remeasure(){return this.#r(8)}get vertical(){return this.#r(9)}#i(e){return D(e0){t=n.slice();for(let e=0,n=l.length;etypeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,Vt=fe.bind(null,Bt,e=>typeof e==`object`&&typeof e?.name==`string`),Ht=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){T("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},Ut={DATA:1,ERROR:2},q={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Wt(){}function J(e){if(e instanceof P||e instanceof ne||e instanceof ee||e instanceof re||e instanceof te)return e;switch(e instanceof Error||typeof e==`object`&&e||E(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new P(e.message);case`InvalidPDFException`:return new ne(e.message);case`PasswordException`:return new ee(e.message,e.code);case`ResponseException`:return new re(e.message,e.status,e.missing);case`UnknownErrorException`:return new te(e.message,e.details)}return new te(e.message,e.toString())}var Gt=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===Ut.DATA)n.resolve(e.data);else if(e.callback===Ut.ERROR)n.reject(J(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:Ut.DATA,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:Ut.ERROR,callbackId:e.callbackId,reason:J(t)})});return}if(e.streamId){this.#n(e);return}t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[i]={controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:q.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{D(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:q.CANCEL,streamId:i,reason:J(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:q.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:q.CLOSE,streamId:t}),delete a.streamSinks[t])},error(e){D(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:q.ERROR,streamId:t,reason:J(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:q.START_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:q.START_COMPLETE,streamId:t,reason:J(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case q.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(J(e.reason));break;case q.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(J(e.reason));break;case q.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:q.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||Wt).then(function(){i.postMessage({sourceName:n,targetName:r,stream:q.PULL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:q.PULL_COMPLETE,streamId:t,reason:J(e)})});break;case q.ENQUEUE:if(D(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case q.CLOSE:if(D(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case q.ERROR:D(a,`error should have stream controller`),a.controller.error(J(e.reason)),this.#i(a,t);break;case q.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(J(e.reason)),this.#i(a,t);break;case q.CANCEL:if(!o)break;let s=J(e.reason);Promise.try(o.onCancel||Wt,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:q.CANCEL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:q.CANCEL_COMPLETE,streamId:t,reason:J(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},Kt=class{#e=Object.freeze({cMapUrl:`CMap`,standardFontDataUrl:`font`,wasmUrl:`wasm`});constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case`cMapUrl`:case`standardFontDataUrl`:case`wasmUrl`:break;default:E(`Not implemented: ${e}`)}let n=this[e];if(!n)throw Error(`Ensure that the \`${e}\` API parameter is provided.`);let r=`${n}${t}`;return this._fetch(r,e).catch(t=>{throw Error(`Unable to load ${this.#e[e]} data at: ${r}`)})}async _fetch(e,t){E("Abstract method `_fetch` called.")}},qt=class extends Kt{async _fetch(e,t){let n=await Ce(e,t===`cMapUrl`&&!e.endsWith(`.bcmap`)?`text`:`bytes`);return n instanceof Uint8Array?n:oe(n)}},Jt=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset({canvas:e},t,n){if(!e)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.width=t,e.height=n}destroy(e){let{canvas:t}=e;if(!t)throw Error(`Canvas is not specified`);t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){E("Abstract method `_createCanvas` called.")}},Yt=class extends Jt{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},Xt=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addKnockoutFilter(e=0){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}addSelectionHCMFilter(e,t){return`none`}addSelectionFilter(){return`none`}createSelectionStyle(e=null){return null}destroy(e=!1){}},Zt=class extends Xt{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.colorScheme=`only light`,t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(a,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(a,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(Te(e)?T(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=A(e,``))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=I.makeHexColor(...a);let o=this.#v(t);if(t=I.makeHexColor(...o),this.#b(),e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array(256);for(let e=0;e<=255;e++){let t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let c=s.join(`,`),l=`g_${this.#r}_hcm_filter`,u=i.filter=this.#m(l);this.#g(c,c,c,u),this.#p(u);let d=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(d(0,5),d(1,5),d(2,5),u),i.url=this.#d(l),i.url}addSelectionHCMFilter(e,t){return this.addHighlightHCMFilter(`selection`,e,t,`HighlightText`,`Highlight`)}addSelectionFilter(){return this.addHighlightHCMFilter(`selection_default`,`black`,`white`,`HighlightText`,`Highlight`)}createSelectionStyle(e=null){let t=e?this.addSelectionHCMFilter(e.foreground,e.background):this.addSelectionFilter();return t===`none`||!F.platform.isFirefox?null:{"backdrop-filter":t,"background-color":`transparent`}}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addKnockoutFilter(e=0){let t=e>0?Math.min(1/e,1e6):1e6,n=`knockout_${t}`,r=this.#s.get(n);if(r)return r;let i=`g_${this.#r}_knockout_filter_${this.#o++}`,o=this.#d(i);this.#s.set(n,o);let s=this.#m(i),c=this.#i.createElementNS(a,`feComponentTransfer`);s.append(c);let l=this.#i.createElementNS(a,`feFuncA`);return l.setAttribute(`type`,`linear`),l.setAttribute(`slope`,`${t}`),l.setAttribute(`intercept`,`0`),c.append(l),o}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#x.bind(this));u{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(a,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0`),e.append(t)}#p(e){let t=this.#i.createElementNS(a,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0`),e.append(t)}#m(e){let t=this.#i.createElementNS(a,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(a,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(a,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(a,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,Ne(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#y(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,Me(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#b(){this.#l.style.color=``,this.#l.style.backgroundColor=``}#x(e){let[t,n,r,i]=this.#y(e);if(i===1)return[t,n,r];let[a,o,s]=this.#v(`Canvas`);return[Qt(t,a,i),Qt(n,o,i),Qt(r,s,i)]}};function Qt(e,t,n){return Math.round(n*e+(1-n)*t)}t&&T("Please use the `legacy` build in Node.js environments.");async function $t(e){let t=await process.getBuiltinModule(`fs/promises`).readFile(e);return new Uint8Array(t)}var en=class extends Xt{},tn=class extends Jt{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url)(`@napi-rs/canvas`).createCanvas(e,t)}},nn=class extends Kt{async _fetch(e,t){return $t(e)}};function rn({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=F.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=c^l,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let r=0;r>7&1)&f,n[m+1]=c^-(r>>6&1)&f,n[m+2]=c^-(r>>5&1)&f,n[m+3]=c^-(r>>4&1)&f,n[m+4]=c^-(r>>3&1)&f,n[m+5]=c^-(r>>2&1)&f,n[m+6]=c^-(r>>1&1)&f,n[m+7]=c^-(r&1)&f}if(d===0)continue;let r=t>7-e&1)&f}return{srcPos:t,destPos:m}}function an({src:e,srcPos:t=0,dest:n,destPos:r=0,width:i,height:a}){let o=0,s=i*a*3,c=s>>2,l=new Uint32Array(e.buffer,t,c),u=F.isLittleEndian?4278190080:255;if(F.isLittleEndian){for(;o>>24|t<<8|u,n[r+2]=t>>>16|i<<16|u,n[r+3]=i>>>8|u}for(let i=o*4,a=t+s;i>>8|u,n[r+2]=t<<16|i>>>16|u,n[r+3]=i<<8|u}for(let i=o*4,a=t+s;i=_.INFOS&&console.info(`Info: ${e}`)}function T(e){x>=_.WARNINGS&&console.warn(`Warning: ${e}`)}function E(e){throw Error(e)}function D(e,t){e||E(t)}function O(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function k(e,t=null,n=null){if(!e)return null;if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=se(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return O(r)?r:null}function A(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&k(e,`http://example.com`)?e.split(`#`,1)[0]+`${t?`#${t}`:``}`:``}function j(e){return e.substring(e.lastIndexOf(`/`)+1)}function M(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var N=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),ee=class extends N{constructor(e,t){super(e,`PasswordException`),this.code=t}},te=class extends N{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},ne=class extends N{constructor(e){super(e,`InvalidPDFException`)}},re=class extends N{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},ie=class extends N{constructor(e){super(e,`FormatError`)}},P=class extends N{constructor(e){super(e,`AbortException`)}};function ae(e){(typeof e!=`object`||e?.length===void 0)&&E(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t`u`)return M(this,`isAlphaColorInputSupported`,!1);let e=document.createElement(`input`);return e.type=`color`,e.setAttribute(`alpha`,``),e.value=`#ff000080`,M(this,`isAlphaColorInputSupported`,e.value!==`#ff0000`)}static get isBackdropFilterSupported(){return M(this,`isBackdropFilterSupported`,typeof CSS<`u`&&CSS.supports(`backdrop-filter`,`blur(1px)`))}},I=class{static get hexNums(){return M(this,`hexNums`,Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let r=e[n],i=e[n+1];e[n]=r*t[0]+i*t[2]+t[4],e[n+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];for(let t=0;t<6;t+=2){let l=e[n+t],u=e[n+t+1];e[n+t]=l*r+u*a+s,e[n+t+1]=l*i+u*o+c}}static applyInverseTransform(e,t){let n=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=e[0],u=e[1],d=e[2],f=e[3],p=r*l+s,m=p,h=r*d+s,g=h,_=o*u+c,v=_,y=o*f+c,b=y;if(i!==0||a!==0){let e=i*l,t=i*d,n=a*u,r=a*f;p+=n,g+=n,h+=r,m+=r,_+=e,b+=e,y+=t,v+=t}n[0]=Math.min(n[0],p,h,m,g),n[1]=Math.min(n[1],_,y,v,b),n[2]=Math.max(n[2],p,h,m,g),n[3]=Math.max(n[3],_,y,v,b)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n**2+r**2,s=n*i+r*a,c=i**2+a**2,l=(o+c)/2,u=Math.sqrt(l**2-(o*c-s**2));t[0]=Math.sqrt(l+u||1),t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,r,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,r),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,r)}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s),this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c)}};function se(e){return decodeURIComponent(escape(e))}var ce=null,le=null;function ue(e){return ce||(ce=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,le=new Map([[`ſt`,`ſt`]])),e.replaceAll(ce,(e,t,n)=>t?t.normalize(`NFKC`):le.get(n))}function de(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),ae(e)}function fe(e,t,n){if(!Array.isArray(n)||n.length<2)return!1;let[r,i,...a]=n;if(!e(r)&&!Number.isInteger(r)||!t(i))return!1;let o=a.length,s=!0;switch(i.name){case`XYZ`:if(o<2||o>3)return!1;break;case`Fit`:case`FitB`:return o===0;case`FitH`:case`FitBH`:case`FitV`:case`FitBV`:if(o>1)return!1;break;case`FitR`:if(o!==4)return!1;s=!1;break;default:return!1}for(let e of a)if(!(typeof e==`number`||s&&e===null))return!1;return!0}var pe=()=>[],me=()=>new Map,he=()=>Object.create(null),ge=()=>new Set;typeof Iterator.prototype.join!=`function`&&(Iterator.prototype.join=function(e){return[...this].join(e)});function L(e,t,n){return Math.min(Math.max(e,t),n)}var _e=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let e=this.viewBox;return M(this,`rawDims`,{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){let n=[e,t];return I.applyTransform(n,this.transform),n}convertToPdfPoint(e,t){let n=[e,t];return I.applyInverseTransform(n,this.transform),n}},ve=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return e!==`textarea`&&e!==`input`&&e!==`option`&&e!==`select`}},ye=/url\(|image-set\(/i,be=/^on/i,xe=class{static get _allowedHtmlElements(){return M(this,`_allowedHtmlElements`,new Set([`a`,`b`,`br`,`button`,`div`,`i`,`img`,`input`,`label`,`li`,`ol`,`option`,`p`,`select`,`span`,`sub`,`sup`,`textarea`,`ul`]))}static get _allowedSvgElements(){return M(this,`_allowedSvgElements`,new Set([`ellipse`,`line`,`path`,`rect`,`svg`]))}static get _allowedRichTextElements(){return M(this,`_allowedRichTextElements`,new Set([`a`,`b`,`br`,`div`,`i`,`li`,`ol`,`p`,`span`,`sub`,`sup`,`ul`]))}static get _allowedRichTextAttributes(){return M(this,`_allowedRichTextAttributes`,new Set([`class`,`dir`,`style`]))}static get _allowedRichTextStyles(){return M(this,`_allowedRichTextStyles`,new Set(`color.font.fontFamily.fontSize.fontStretch.fontStyle.fontWeight.kerningMode.letterSpacing.lineHeight.margin.marginBottom.marginLeft.marginRight.marginTop.orphans.paddingLeft.paddingRight.breakAfter.breakBefore.breakInside.tabInterval.tabStop.textAlign.textDecoration.textIndent.transform.verticalAlign.widows`.split(`.`)))}static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:Object.hasOwn(e.attributes,`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(n!=null&&!be.test(t)&&!(r===`richText`&&!this._allowedRichTextAttributes.has(t)))switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:if(r===`richText`){let t=this._allowedRichTextStyles;for(let[r,i]of Object.entries(n))t.has(r)&&!ye.test(i)&&(e.style[r]=i)}else Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i?.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static#e(e,t,n){return n===`richText`?!t&&this._allowedRichTextElements.has(e)?document.createElement(e):null:t?t===a&&this._allowedSvgElements.has(e)?document.createElementNS(a,e):null:this._allowedHtmlElements.has(e)?document.createElement(e):null}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=this.#e(r.name,r.attributes?.xmlns,i)??document.createElement(`div`);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&ve.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=this.#e(u,s.attributes?.xmlns,i);if(d){if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&ve.shouldBuildText(u)&&c.push(e),d.append(e)}}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}static getPageViewport(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new _e({viewBox:[0,0,parseInt(r,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}},Se=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function Ce(e,t=`text`){if(Ae(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`blob`:return n.blob();case`bytes`:return n.bytes();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t===`bytes`?`arraybuffer`:t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`bytes`:n(new Uint8Array(i.response));return;case`blob`:case`json`:n(i.response);return}n(i.responseText);return}r(Error(i.statusText))}},i.send(null)})}var we=class extends N{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function Te(e){let t=e.length,n=0;for(;n{try{return new URL(e)}catch{}try{return new URL(decodeURIComponent(e))}catch{}try{return new URL(e,`https://foo.bar`)}catch{}try{return new URL(decodeURIComponent(e),`https://foo.bar`)}catch{}return null})(e);if(!n)return t;let r=e=>{try{let t=decodeURIComponent(e);return t.includes(`/`)&&(t=j(t),t.length===4&&i.test(t))?e:t}catch{return e}},i=/\.pdf$/i,a=j(n.pathname);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=e=>[...e].findLast(e=>i.test(e)),t=e(n.searchParams.values())??e(n.searchParams.keys());if(t)return r(t)}if(n.hash){let e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(e)return r(e[0])}return t}var ke=class{#e=new Map;times=[];time(e){this.#e.has(e)&&T(`Timer is already running for ${e}`),this.#e.set(e,Date.now())}timeEnd(e){this.#e.has(e)||T(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.#e.get(e),end:Date.now()}),this.#e.delete(e)}toString(){let e=Math.max(...this.times.map(e=>e.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms\n`).join(``)}};function Ae(e,t){let n=t?URL.parse(e,t):URL.parse(e);return/https?:/.test(n?.protocol??``)}function R(e){e.preventDefault()}function z(e){e.preventDefault(),e.stopPropagation()}var je=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}};function Me(e){if(e.startsWith(`#`)){let t=e.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(e.startsWith(`rgb(`)){let[t,n,r]=e.slice(4,-1).split(`,`).map(e=>parseInt(e,10));return[t,n,r,1]}if(e.startsWith(`rgba(`)){let t=e.slice(5,-1).split(`,`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}let t=e.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!==`none`?parseFloat(t[4]):1]:null}function Ne(e){let t=Me(e);return t?t.slice(0,3):(T(`Not a valid color format: "${e}"`),[0,0,0])}function Pe(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,t.style.colorScheme=`only light`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,Ne(r))}t.remove()}function B(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function V(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function Fe(e,t,n=!1,r=!0){if(t instanceof _e){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`,s=`round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;!n||t.rotation%180==0?(a.width=o,a.height=s):(a.width=s,a.height=o)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var Ie=class e{constructor(){let{pixelRatio:t}=e;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,n,r,i,a=-1){let o=1/0,s=1/0,c=1/0;r=e.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*n))),i!==-1&&(s=i/t,c=i/n);let l=Math.min(o,s,c);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},Le=[`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`],Re=class{static get isDarkMode(){return M(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},ze=class{static get commentForegroundColor(){let e=document.createElement(`span`);e.classList.add(`comment`,`sidebar`);let{style:t}=e;t.width=t.height=`0`,t.display=`none`,t.color=`var(--comment-fg-color)`,document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),M(this,`commentForegroundColor`,Ne(n))}};function Be(e,t){t=L(t??1,0,1);let n=255*(1-t);return e.map(e=>Math.round(e*t+n))}function Ve(e,t){let n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{let e=a-o;switch(t[1]=s<.5?e/(a+o):e/(2-a-o),a){case n:t[0]=((r-i)/e+(ri?(r+.05)/(i+.05):(i+.05)/(r+.05)}var Ge=new Map;function Ke(e,t){let n=e[0]+e[1]*256+e[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=Ge.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);Ve(e,o);let s=i.subarray(6,9);Ve(t,s);let c=s[2]<.5,l=c?12:4.5;if(o[2]=c?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),We(o,s,a).005;){let n=o[2]=(e+t)/2;c===We(o,s,a){n.delete()},{signal:n._signal}),this.#r.append(r)}get#p(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#f(t),this.#r.append(t,this.#p),this.#i=e}addComment(e,t=null){if(this.#a)return;let n=e.renderForToolbar();if(!n)return;this.#f(n);let r=this.#o=this.#p;t?(this.#r.insertBefore(n,t),this.#r.insertBefore(r,t)):this.#r.append(n,r),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#f(t),this.#r.append(t,this.#p)}async addEditSignatureButton(e){let t=this.#s=await e.renderEditButton(this.#n);this.#f(t),this.#r.append(t,this.#p)}removeButton(e){e===`comment`&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#o?.remove(),this.#o=null)}async addButton(e,t){switch(e){case`colorPicker`:t&&this.addColorPicker(t);break;case`altText`:t&&await this.addAltText(t);break;case`editSignature`:t&&await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:t&&this.addComment(t)}}async addButtonBefore(e,t,n){if(!t&&e===`comment`)return;let r=this.#r.querySelector(n);r&&e===`comment`&&this.addComment(t,r)}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},Xe=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`);let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,R,{signal:t});let n=this.#e=document.createElement(`div`);return n.className=`buttons`,e.append(n),this.#n.hasCommentManager()&&this.#a(`commentButton`,`pdfjs-comment-floating-button`,`pdfjs-comment-floating-button-label`,()=>{this.#n.commentSelection(`floating_button`)}),this.#a(`highlightButton`,`pdfjs-highlight-floating-button1`,`pdfjs-highlight-floating-button-label`,()=>{this.#n.highlightSelection(`floating_button`)}),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(en){r=a,n=e;continue}t?a>r&&(r=a):a=1}static clearPointerType(){e.#r=null}static clearPointerIds(){e.#e=NaN,e.#t=null}static clearTimeStamp(){e.#n=NaN}},$e=class{#e=0;get id(){return`${l}${this.#e++}`}},et=class e{#e=de();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=`data:image/svg+xml;charset=UTF-8,`,t=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),n=new Image;n.src=e;let r=n.decode().then(()=>(t.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0));return M(this,`_isSVGFittingCanvas`,r)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await Ce(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){T(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},tt=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},nt=class e{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;let{isMac:n}=F.platform;for(let[r,i,a={}]of t){let t=r.some(e=>e.startsWith(`mac+`));for(let o of r){let r=o;if(t){let e=o.startsWith(`mac+`);if(n!==e)continue;e&&(r=o.slice(4))}let[s,c]=e.#e(r);s!==null&&this.callbacks.getOrInsertComputed(s,pe).push({callback:i,options:a,modifiers:c})}}}static#e(t){let n=null,r=0;for(let i of t.split(`+`)){if(i=i.trim(),!i)continue;let a=i.toUpperCase(),o=e[a];if(o){r|=o;continue}if(n!==null){T(`KeyboardManager: multiple keys in shortcut "${t}"`);break}n=a===`SPACE`?` `:i}return n===null&&T(`KeyboardManager: no key found in shortcut "${t}"`),[n,r]}static#t(e){let t=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(e);return t?t[1]?.toLowerCase()??t[2]:null}exec(t,n){let r=this.callbacks.get(n.key);if(!r){if(/^[a-z]$/i.test(n.key))return;let t=e.#t(n.code);if(t===null||t===n.key||(r=this.callbacks.get(t),!r))return}let i=(n.altKey?e.ALT:0)|(n.ctrlKey?e.CTRL:0)|(n.metaKey?e.META:0)|(n.shiftKey?e.SHIFT:0),a=r.find(e=>e.modifiers===i);if(!a)return;let{callback:o,options:{bubbles:s=!1,args:c=[],checker:l=null}}=a;l&&!l(t,n)||(o.bind(t,...c,n)(),s||z(n))}},rt=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return Pe(e),M(this,`_colors`,e)}convert(t){let n=Ne(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?I.makeHexColor(...t):e}},it=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=null;#l=new tt;#u=null;#d=null;#f=null;#p=0;#m=new Set;#h=null;#g=null;#_=new Set;_editorUndoBar=null;#v=!1;#y=!1;#b=!1;#x=null;#S=null;#C=null;#w=null;#T=!1;#E=null;#D=new $e;#O=!1;#k=!1;#A=!1;#j=null;#M=null;#N=null;#P=null;#F=null;#I=u.NONE;#L=new Set;#R=null;#z=null;#B=null;#V=null;#H=null;#U={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#W=[0,0];#G=null;#K=null;#q=null;#J=null;#Y=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#K.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return M(this,`_keyboardManager`,new nt([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`Backspace`,`alt+Backspace`,`ctrl+Backspace`,`shift+Backspace`,`mac+Backspace`,`mac+alt+Backspace`,`mac+ctrl+Backspace`,`Delete`,`ctrl+Delete`,`shift+Delete`,`mac+Delete`],t.delete,{checker:r}],[[`Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#K.contains(t)&&!e.isEnterHandled}],[[`Space`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#K.contains(document.activeElement)}],[[`Escape`],t.unselectAll],[[`ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this._signal=this.#e.signal;this.#K=e,this.#q=t,this.#J=n,this.#o=r,this.#u=i,this.#z=a,this.#H=s,this._eventBus=o;let _={signal:g,...Ze};o.on(`editingaction`,this.onEditingAction.bind(this),_),o.on(`pagechanging`,this.onPageChanging.bind(this),_),o.on(`scalechanging`,this.onScaleChanging.bind(this),_),o.on(`rotationchanging`,this.onRotationChanging.bind(this),_),o.on(`setpreference`,this.onSetPreference.bind(this),_),o.on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),_),window.addEventListener(`pointerdown`,()=>{this.#k=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#k=!1},{capture:!0,signal:g}),window.addEventListener(`beforeunload`,this.endCurrentEditing.bind(this),{capture:!0,signal:g}),this.#te(),this.#ce(),this.#ie(),this.#s=s.annotationStorage,this.#x=s.filterFactory,this.#B=c,this.#w=l||null,this.#v=u,this.#y=d,this.#b=f,this.#F=p||null,this.viewParameters={realScale:Se.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=h!==!1,i?.setSidebarUiManager(this)}destroy(){this.#Y?.resolve(),this.#Y=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#_.clear(),this.#P?.clear(),this.#t=null,this.#L.clear(),this.#l.destroy(),this.#o?.destroy(),this.#u?.destroy(),this.#z?.destroy(),this.#E?.hide(),this.#E=null,this.#N?.destroy(),this.#N=null,this.#n=null,this.#S&&=(clearTimeout(this.#S),null),this.#G&&=(clearTimeout(this.#G),null),this._editorUndoBar?.destroy(),this.#H=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#F}get useNewAltTextFlow(){return this.#y}get useNewAltTextWhenAddingImage(){return this.#b}get hcmFilter(){return M(this,`hcmFilter`,this.#B?this.#x.addHCMFilter(this.#B.foreground,this.#B.background):`none`)}get direction(){return M(this,`direction`,getComputedStyle(this.#K).direction)}get _highlightColors(){return M(this,`_highlightColors`,this.#w?new Map(this.#w.split(`,`).map(e=>(e=e.split(`=`).map(e=>e.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return M(this,`highlightColors`,null);let t=new Map,n=!!this.#B;for(let[r,i]of e){let e=r.endsWith(`_HCM`);if(n&&e){t.set(r.replace(`_HCM`,``),i);continue}!n&&!e&&t.set(r,i)}return M(this,`highlightColors`,t)}get highlightColorNames(){return M(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#f=e}setMainHighlightColorPicker(e){this.#N=e}editAltText(e,t=!1){this.#o?.editAltText(this,e,t)}hasCommentManager(){return!!this.#u}editComment(e,t,n,r){this.#u?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#u?.updateComment(e.getData())}updatePopupColor(e){this.#u?.updatePopupColor(e)}removeComment(e){this.#u?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,`comment`),this.toggleComment(null),e.comment=null},undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){this.#u?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#u?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#u?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),r=n=>{n.pageNumber===e&&(this._eventBus.off(`editorsrendered`,r),t())};this._eventBus.on(`editorsrendered`,r,Ze),await n}getSignature(e){this.#z?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#z}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal,...Ze}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e===`enableNewAltTextWhenAddingImage`&&(this.#b=t)}onPageChanging({pageNumber:e}){this.#p=e-1}deletePage(e){for(let t of this.getEditors(e))t.remove();this.#i.delete(e),this.#p===e&&(this.#p=0)}focusMainContainer(){this.#K.focus()}findParent(e,t){for(let n of this.#i.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#q.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#_.add(e)}removeShouldRescale(e){this.#_.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Se.PDF_TO_CSS_UNITS;for(let e of this.#_)e.onScaleChanging();this.#f?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#X({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Z(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#i.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``,t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=n,s=n.toString(),c=this.#X(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let d=this.#Z(c),f=this.#I===u.NONE,p=()=>{let n=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o,text:s});f&&this.showAllEditors(`highlight`,!0,!0),t&&n?.editComment()};if(f){this.switchToMode(u.HIGHLIGHT,p);return}p()}commentSelection(e=``){this.highlightSelection(e,!0)}endCurrentEditing(){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#Q(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#X(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#E||=new Xe(this),this.#E.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#s)return null;let t=`${l}${e}`,n=this.#s.getRawValue(t);return n&&this.#s.remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#s&&!this.#s.has(e.id)&&this.#s.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#J;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#$(){let e=document.getSelection();if(!e||e.isCollapsed){this.#R&&(this.#E?.hide(),this.#R=null,this.#le({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#R)return;let n=this.#X(e).closest(`.textLayer`);if(!n){this.#R&&(this.#E?.hide(),this.#R=null,this.#le({hasSelectedText:!1}));return}if(this.#E?.hide(),this.#R=t,this.#le({hasSelectedText:!0}),(this.#I===u.HIGHLIGHT||this.#I===u.NONE)&&(this.#I===u.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#T=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#I===u.HIGHLIGHT?this.#Z(n):null;if(e?.toggleDrawing(),this.#k){let t=new AbortController,n=this.combinedSignal(t),r=n=>{(n.type!==`pointerup`||n.button===0)&&(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#ee(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#ee(`main_toolbar`)}}#ee(e=``){this.#I===u.HIGHLIGHT?this.highlightSelection(e):this.#v&&this.#Q()}#te(){document.addEventListener(`selectionchange`,this.#$.bind(this),{signal:this._signal})}#ne(){if(this.#C)return;this.#C=new AbortController;let e=this.combinedSignal(this.#C);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#re(){this.#C?.abort(),this.#C=null}blur(){if(this.isShiftKeyDown=!1,this.#T&&(this.#T=!1,this.#ee(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#L)if(t.div.contains(e)){this.#M=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#M)return;let[e,t]=this.#M;this.#M=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ie(){if(this.#j)return;this.#j=new AbortController;let e=this.combinedSignal(this.#j);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#ae(){this.#j?.abort(),this.#j=null}#oe(){if(this.#d)return;this.#d=new AbortController;let e=this.combinedSignal(this.#d);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#se(){this.#d?.abort(),this.#d=null}#ce(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#ie(),this.setEditingState(!0)}removeEditListeners(){this.#ae(),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#g)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#g)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#L){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#g)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){T(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#pe(t);this.#ge(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){T(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#I!==u.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#T&&(this.#T=!1,this.#ee(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`);break;case`commentSelection`:this.commentSelection(`context_menu`)}}updatePageIndex(e,t){for(let n of this.getEditors(e))n.pageIndex=t;let n=this.#a.get(e);n&&(n.pageIndex=t,this.#i.set(t,n),this.#O?n.enable():n.disable())}startUpdatePages(){this.#a=new Map(this.#i),this.#i.clear()}endUpdatePages(){this.#a=null}clonePage(e,t){for(let n of this.getEditors(e)){let e=n.serialize(n.mode!==u.HIGHLIGHT);e&&(e.pageIndex=t,e.id=this.getId(),e.isClone=!0,delete e.popupRef,this.#s.setValue(e.id,e))}}findClonesForPage(e){let t=[],{pageIndex:n}=e;for(let[r,i]of this.#s)i.pageIndex===n&&i.isClone&&(this.#s.remove(r),t.push(e.deserialize(i).then(t=>{t&&(t.isClone=!0,e.addOrRebuild(t))})));return Promise.all(t)}#le(e){Object.entries(e).some(([e,t])=>this.#U[e]!==t)&&(this._eventBus.dispatch(`editingstateschanged`,{source:this,details:Object.assign(this.#U,e)}),this.#I===u.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#ue([[d.HIGHLIGHT_FREE,!0]]))}#ue(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#ne(),this.#oe(),this.#le({isEditing:this.#I!==u.NONE,isEmpty:this.#he(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#re(),this.#se(),this.#le({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#g){this.#g=e;for(let e of this.#g)this.#ue(e.defaultPropertiesToUpdate)}}getId(){return this.#D.id}get currentLayer(){return this.#i.get(this.#p)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#p}addLayer(e){this.#i.set(e.pageIndex,e),this.#O?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1,a=!1){if(this.#I!==e&&!(this.#Y&&(await this.#Y.promise,!this.#Y))){if(this.#Y=Promise.withResolvers(),this.#f?.commitOrRemove(),this.#I===u.POPUP&&this.#u?.hideSidebar(),this.#u?.destroyPopup(),this.#I=e,e===u.NONE){this.setEditingState(!1),this.#fe();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#Y.resolve();return}for(let e of this.#r.values())e.addStandaloneCommentButton();e===u.SIGNATURE&&await this.#z?.loadSignatures(),n&&H.clearPointerType(),this.setEditingState(!0),await this.#de(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===u.POPUP){this.#n||=await this.#H.getAnnotationsByType(new Set(this.#g.map(e=>e._editorType)));let e=new Set,t=[];for(let n of this.#r.values()){let{annotationElementId:r,hasComment:i,deleted:a}=n;r&&e.add(r),i&&!a&&t.push(n.getData())}for(let n of this.#n){let{id:r,popupRef:i,contentsObj:a}=n;i&&a?.str&&!e.has(r)&&!this.#m.has(r)&&t.push(n)}this.#u?.showSidebar(t)}if(!t){r&&this.addNewEditorFromKeyboard(),this.#Y.resolve();return}for(let e of this.#r.values())e.uid===t?(this.setSelected(e),a?e.editComment():i?e.enterInEditMode():e.focus()):e.unselect();this.#Y.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#I&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#g){switch(e){case d.CREATE:this.currentLayer.addNewEditor(t);return;case d.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#V||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#L)n.updateParams(e,t);else for(let n of this.#g)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#V?.get(d.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#ue([[d.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#A!==e){this.#A=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#de(){if(!this.#O){this.#O=!0;let e=[];for(let t of this.#i.values())e.push(t.enable());await Promise.all(e);for(let e of this.#r.values())e.enable()}}#fe(){if(this.unselectAll(),this.#O){this.#O=!1;for(let e of this.#i.values())e.disable();for(let e of this.#r.values())e.disable()}}*getEditors(e){for(let t of this.#r.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#P?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#m.has(e.annotationElementId))&&this.#s?.remove(e.id)}addDeletedAnnotationElement(e){this.#m.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#m.has(e)}removeDeletedAnnotationElement(e){this.#m.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#pe(e){let t=this.#i.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#ue(e.propertiesToUpdate))}get#me(){let e=null;for(e of this.#L);return e}updateUI(e){this.#me===e&&this.#ue(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#ue(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#L.has(e)){this.#L.delete(e),e.unselect(),this.#le({hasSelectedEditor:this.hasSelection});return}this.#L.add(e),e.select(),this.#ue(e.propertiesToUpdate),this.#le({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#f?.commitOrRemove();for(let t of this.#L)t!==e&&t.unselect();this.#u?.destroyPopup(),this.#L.clear(),this.#L.add(e),e.select(),this.#ue(e.propertiesToUpdate),this.#le({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#L.values().next().value}unselect(e){e.unselect(),this.#L.delete(e),this.#le({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#L.size!==0}get isEnterHandled(){return this.#L.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#le({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#he()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#le({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#he()})}addCommands(e){this.#l.add(e),this.#le({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#he()})}cleanUndoStack(e){this.#l.cleanType(e)}#he(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#L],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#pe(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#ge(e){for(let e of this.#L)e.unselect();this.#L.clear();for(let t of e)t.isEmpty()||(this.#L.add(t),t.select());this.#le({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#L)e.commit();this.#ge(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#I!==u.NONE))&&!this.#f?.commitOrRemove()&&(this.#u?.destroyPopup(),this.hasSelection)){for(let e of this.#L)e.unselect();this.#L.clear(),this.#le({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#W[0]+=e,this.#W[1]+=t;let[r,i]=this.#W,a=[...this.#L];this.#G&&clearTimeout(this.#G),this.#G=setTimeout(()=>{this.#G=null,this.#W[0]=this.#W[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(r,i),e.translationDone())},undo:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(-r,-i),e.translationDone())},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t),n.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#h=new Map;for(let e of this.#L)this.#h.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#h)return!1;this.disableUserSelect(!1);let e=this.#h;this.#h=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#r.has(e.id)){let i=this.#i.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#h)for(let n of this.#h.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#L.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#I}isEditingMode(){return this.#I!==u.NONE}get imageManager(){return M(this,`imageManager`,new et)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a})}let s=[];for(let e=0,n=t.rangeCount;ee.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e){this.#s?.remove(),this.#s=null;return}if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),(this.#e!==e||this.#t!==t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getElementForAltText()?.setAttribute(`aria-describedby`,n.id)}},ot=class{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=null;constructor(e){this.#r=e}renderForToolbar(){let e=this.#t=document.createElement(`button`);return e.className=`comment`,this.#u(e,!1)}renderForStandalone(){let e=this.#e=document.createElement(`button`);e.className=`annotationCommentButton`;let t=this.#r.commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction===`ltr`?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let r=this.#r.commentButtonColor;r&&(n.backgroundColor=r)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;let e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#e)return null;let{x:e,y:t,height:n}=this.#e.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#r.parent.boundingClientRect;return[(e-r)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#e&&(this.#e.classList.toggle(`selected`,e),this.#e.ariaExpanded=t)}#u(e,t){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex=`0`,e.ariaHasPopup=`dialog`,t?(e.ariaControls=`commentPopup`,e.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`)):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute(`data-l10n-id`,`pdfjs-editor-add-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,R,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,z(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,z(e)},{capture:!0,signal:n})),e.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:n});let r=t=>{t.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener(`click`,r,{capture:!0,signal:n}),e.addEventListener(`keydown`,t=>{t.target===e&&t.key===`Enter`&&(this.#n=!0,r(t))},{signal:n}),e.addEventListener(`pointerenter`,()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener(`pointerleave`,()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){let t=this.commentPopupPositionInLayer,n,r;if(t)[n,r]=t;else{[n,r]=this.#r.commentButtonPosition;let{width:e,height:t,x:i,y:a}=this.#r;n=i+n*e,r=a+r*t}let i=this.#r.parent.boundingClientRect,{x:a,y:o,width:s,height:c}=i;this.#r._uiManager.editComment(this.#r,a+n*s,o+r*c,{...e,parentDimensions:i})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#c||this.#o===``}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#i}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#a,date:this.#s,deleted:this.isDeleted()}}set data(e){if(e!==this.#o&&(this.#a=null),e===null){this.#o=``,this.#c=!0;return}this.#o=e,this.#s=new Date,this.#c=!1}restoreData({text:e,richText:t,date:n}){this.#o=e,this.#a=t,this.#s=n,this.#c=!1}setInitialText(e,t=null){this.#i=e,this.data=e,this.#s=null,this.#a=t}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#o=``,this.#a=null,this.#s=null,this.#r=null,this.#n=!1,this.#c=!1}},st=class e{#e;#t=!1;#n=null;#r;#i;#a;#o;#s=null;#c;#l=null;#u;#d=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#u=new AbortController,this.#c=AbortSignal.any([o,this.#u.signal]),e.addEventListener(`touchstart`,this.#f.bind(this),{passive:!1,signal:this.#c})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ie.pixelRatio}#f(e){if(this.#r?.())return;if(e.touches.length===1){if(this.#s)return;let e=this.#s=new AbortController,t=AbortSignal.any([this.#c,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#s?.abort(),this.#s=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(z(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r);return}if(!this.#d){this.#d=new AbortController;let e=AbortSignal.any([this.#c,this.#d.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#p.bind(this),n);let r=this.#m.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,z,n),t.addEventListener(`pointermove`,z,n),t.addEventListener(`pointercancel`,z,n),t.addEventListener(`pointerup`,z,n),this.#i?.()}if(z(e),e.touches.length!==2||this.#n?.()){this.#l=null;return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#l={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#p(t){if(!this.#l||t.touches.length!==2)return;z(t);let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);let{screenX:i,screenY:a}=n,{screenX:o,screenY:s}=r,c=this.#l,{touch0X:l,touch0Y:u,touch1X:d,touch1Y:f}=c,p=d-l,m=f-u,h=o-i,g=s-a,_=Math.hypot(h,g)||1,v=Math.hypot(p,m)||1;if(!this.#t&&Math.abs(v-_)<=e.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=a,c.touch1X=o,c.touch1Y=s,!this.#t){this.#t=!0;return}let y=[(i+o)/2,(a+s)/2];this.#a?.(y,v,_)}#m(e){e.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#o?.()),this.#l&&(z(e),this.#l=null,this.#t=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#s?.abort(),this.#s=null}},U=class e{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;#s=``;#c=null;#l=null;#u=null;#d=null;#f=null;#p=``;#m=!1;#h=null;#g=!1;#_=!1;#v=!1;#y=null;#b=0;#x=0;#S=null;#C=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new rt;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=it.TRANSLATE_SMALL,r=it.TRANSLATE_BIG;return M(this,`_resizerKeyboardManager`,new nt([[[`ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return M(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new ct({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nAlert??=Object.freeze({highlight:`pdfjs-editor-highlight-added-alert`,freetext:`pdfjs-editor-freetext-added-alert`,ink:`pdfjs-editor-ink-added-alert`,stamp:`pdfjs-editor-stamp-added-alert`,signature:`pdfjs-editor-signature-added-alert`}),e._l10nResizer??=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){E(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle(`draggable`,e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#W(),this.#d?.remove(),this.#d=null):(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#m?this.#m=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this._onTranslated()}#E([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#E(this.parentDimensions,e,t)}translateInPage(e,t){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#h||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),n.scrollIntoView({block:`nearest`})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=L(i,0,n-o),a=L(a,0,r-s);break;case 90:i=L(i,0,n-s),a=L(a,o,r);break;case 180:i=L(i,o,n),a=L(a,s,r);break;case 270:i=L(i,s,n),a=L(a,0,r-o)}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#D(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#D(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#D(t,n,360-this.parentRotation)}#O(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#k(){if(this.#c)return;this.#c=document.createElement(`div`),this.#c.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#c.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#A.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,R,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=F.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#N.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,z,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,R,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#M()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#j(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#M(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#u;this.#u=null;let i=this.x,a=this.y,o=this.width,s=this.height;(i!==e||a!==t||o!==n||s!==r)&&this.addCommands({cmd:this.#j.bind(this,i,a,o,s),undo:this.#j.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#O(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#O(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),C=e._round(o+x[1]),w=1,T=1,E,D;if(n.fromKeyboard)({deltaX:E,deltaY:D}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[E,D]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}if([E,D]=m(E/r,D/i),_){let e=Math.hypot(s,c);w=T=Math.max(Math.min(Math.hypot(b[0]-y[0]-E,b[1]-y[1]-D)/e,1/s,1/c),l/s,u/c)}else v?w=L(Math.abs(b[0]-y[0]-E),l,1)/s:T=L(Math.abs(b[1]-y[1]-D),u,1)/c;let O=e._round(s*w),k=e._round(c*T);x=f(...g(O,k));let A=S-x[0],j=C-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=O,this.height=k,this.x=A,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_)return this._editToolbar;this._editToolbar=new Ye(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton(`comment`,this.addCommentButton()),this._editToolbar.addButton(`delete`),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore(`comment`,this.addCommentButton(),`.deleteButton`)}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton(`comment`)}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(at.initialize(e._l10n),this.#n=new at(this),this.#e&&=(this.#n.data=this.#e,null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new ot(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#i){this._uiManager.isEditingMode()&&this.#i.classList.remove(`hidden`);return}this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i))}}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add(`hidden`)}get comment(){if(!this.#r)return null;let{data:{richText:e,text:t,date:n,deleted:r}}=this.#r;return{text:t,richText:e,date:n,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new ot(this),typeof e==`object`&&e?this.#r.restoreData(e):this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(this.#r||=new ot(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new ot(this),this.#r.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,t]=e.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,i=r+n+1,a=t-100,o=i+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[i,a,o,t]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#r.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement(`div`);e.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),e.className=this.name,e.setAttribute(`id`,this.id),e.tabIndex=this.#a?-1:0,e.setAttribute(`role`,`application`),this.defaultL10nId&&e.setAttribute(`data-l10n-id`,this.defaultL10nId),this._isVisible||e.classList.add(`hidden`),this.setInForeground(),this.#z();let[t,n]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[r,i]=this.getInitialTranslation();return this.translate(r,i),Qe(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#C||=new st({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#F(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#O(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#h||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=F.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#m=!0,this._isDraggable){this.#R(e);return}this.#L(e)}#L(e){let{isMac:t}=F.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#o=null,this.#m=!1,this._uiManager.endDragSession()||this.#L(e),n&&this._onStopDragging()};t&&(this.#b=e.clientX,this.#x=e.clientY,this.#o=e.pointerId,this.#s=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#o){z(e);return}let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o)},a),window.addEventListener(`touchmove`,z,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),z(e)},a));let s=e=>{if(!this.#o||this.#o===e.pointerId){o(e);return}z(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&e._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:r,deleted:i,richText:a},uid:o,pageIndex:s,creationDate:c,modificationDate:l}=this;return{id:o,pageIndex:s,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||l,popupRef:!i,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#_=!1,!0):!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t0&&e0}#z(){if(this.#f||!this.div)return;this.#f=new AbortController;let e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}rebuild(){this.#z()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||``}}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#e=e.accessibilityData,r._isCopy=e.isCopy||!1;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&=(clearTimeout(this.#y),null),this.#W(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#C?.destroy(),this.#C=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#k(),this.#c.classList.remove(`hidden`))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction===`ltr`?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,n]}=this,[r,i,a,o]=this.getPDFRect();return[e._round(r+(a-r)*t),e._round(i+(o-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#c.children;if(!this.#t){this.#t=Array.from(n);let t=this.#B.bind(this),r=this.#V.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#H.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(ai)for(let e=0;e{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#c?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!==`BUTTON`&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#S||=new Map;let{action:n}=t,r=this.#S.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#S.delete(n),this.#S.size===0&&(this.#S=null)},e._telemetryTimeout),this.#S.set(n,r);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){if(!this.#d&&!this.deleted){this.#d=e.addFakeAnnotation(this);return}if(this.deleted){this.#d.remove(),this.#d=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},ct=class extends U{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},lt=3285377520,W=4294901760,ut=65535,dt=class{constructor(e){this.h1=e?e&4294967295:lt,this.h2=e?e&4294967295:lt}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e>>17,o=o*d&W|o*p&ut,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&W|s*f&ut,s=s<<15|s>>>17,s=s*d&W|s*p&ut,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&W|o*f&ut,o=o<<15|o>>>17,o=o*d&W|o*p&ut,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&W|e*36045&ut,t=t*4283543511&W|((t<<16|e>>>16)*2950163797&W)>>>16,e^=t>>>1,e=e*444984403&W|e*60499&ut,t=t*3301882366&W|((t<<16|e>>>16)*3120437893&W)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},ft=Object.freeze({map:null,hash:``,transfer:void 0}),pt=class{#e=!1;#t=null;#n=null;#r=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){let t=this.#r.get(e);t!==void 0&&(t instanceof U&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),!this.#r.values().some(e=>e instanceof U)&&this.onAnnotationEditor?.(null))}setValue(e,t){let n=this.#r.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#r.set(e,t);r&&this.#i(),t instanceof U&&((this.#n||=new Map).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,this.onSetModified?.())}resetModified(){this.#e&&(this.#e=!1,this.onResetModified?.())}get print(){return new mt(this)}get serializable(){if(this.#r.size===0)return ft;let e=new Map,t=new dt,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof U?a.serialize(!1,r):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:ft}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof U)){i.popup&&(i.popup.deleted?r+=1:n+=1);continue}i.isCommentDeleted?r+=1:i.hasEditedComment&&(n+=1);let a=i.telemetryFinalData;if(!a)continue;let{type:o}=a;t.getOrInsertComputed(o,()=>Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[o]||=new Map;for(let[e,t]of Object.entries(a)){if(e===`type`)continue;let n=s.getOrInsertComputed(e,me);n.set(t,(n.get(t)??0)+1)}}if((r>0||n>0)&&(e||=Object.create(null),e.comments={deleted:r,edited:n}),!e)return null;for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,t){let n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;let e=[];if(this.#n)for(let t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);let t=``;if(e.length){let n=new dt;n.update(e.join(`,`)),t=n.hexdigest()}return this.#t={ids:new Set(e),hash:t}}[Symbol.iterator](){return this.#r.entries()}},mt=class extends pt{#e=ft;constructor(e){super();let{serializable:t}=e;if(t===ft)return;let{map:n,hash:r,transfer:i}=t,a=structuredClone(n,i?{transfer:i}:null);this.#e={map:a,hash:r,transfer:[]}}get print(){E(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return M(this,`modifiedIds`,{ids:new Set,hash:``})}},ht=`__forcedDependency`,{floor:gt,ceil:_t}=Math;function vt(e,t,n,r,i,a){e[t*4+0]=Math.min(e[t*4+0],n),e[t*4+1]=Math.min(e[t*4+1],r),e[t*4+2]=Math.max(e[t*4+2],i),e[t*4+3]=Math.max(e[t*4+3],a)}function yt(e,t,n,r,i){let a;e?(e<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=e,i[2]*=e,t<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t,i[3]*=t):i.fill(0),i[0]+=n,i[1]+=r,i[2]+=n,i[3]+=r}var bt=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],xt=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===bt}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}},St=(e,t)=>e?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),Ct=class{#e=[[1,0,0,1,0,0]];#t=[-1/0,-1/0,1/0,1/0];#n=new Float64Array(n);_pendingBBoxIdx=-1;#r;#i;#a;#o;_savesStack=[];_markedContentStack=[];constructor(e,t){this.#r=e.width,this.#i=e.height,this.#s(t)}growOperationsCount(e){e>=this.#o.length&&this.#s(e,this.#o)}#s(e,t){let n=new ArrayBuffer(e*4);this.#a=new Uint8ClampedArray(n),this.#o=new Uint32Array(n),t&&t.length>0?(this.#o.set(t),this.#o.fill(bt,t.length)):this.#o.fill(bt)}get clipBox(){return this.#t}save(e){return this.#t={__proto__:this.#t},this._savesStack.push(e),this}restore(e,t){let n=Object.getPrototypeOf(this.#t);if(n===null)return this;this.#t=n;let r=this._savesStack.pop();return r!==void 0&&(t?.(r,e),this.#o[e]=this.#o[r]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){let n=this._savesStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){let n=this._markedContentStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}pushBaseTransform(e){return this.#e.push(I.multiplyByDOMMatrix(this.#e.at(-1),e.getTransform())),this}popBaseTransform(){return this.#e.length>1&&this.#e.pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,this.#n.set(n,0)),this}recordClipBox(e,t,r,i,a,o){let s=I.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform()),c=n.slice();I.axialAlignedBoundingBox([r,a,i,o],s,c);let l=I.intersect(this.#t,c);return l?(this.#t[0]=l[0],this.#t[1]=l[1],this.#t[2]=l[2],this.#t[3]=l[3]):(this.#t[0]=this.#t[1]=1/0,this.#t[2]=this.#t[3]=-1/0),this}recordBBox(e,t,r,i,a,o){let s=this.#t;if(s[0]===1/0)return this;let c=I.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform());if(s[0]===-1/0)return I.axialAlignedBoundingBox([r,a,i,o],c,this.#n),this;let l=n.slice();return I.axialAlignedBoundingBox([r,a,i,o],c,l),this.#n[0]=L(l[0],s[0],this.#n[0]),this.#n[1]=L(l[1],s[1],this.#n[1]),this.#n[2]=L(l[2],this.#n[2],s[2]),this.#n[3]=L(l[3],this.#n[3],s[3]),this}recordFullPageBBox(e){return this.#n[0]=Math.max(0,this.#t[0]),this.#n[1]=Math.max(0,this.#t[1]),this.#n[2]=Math.min(this.#r,this.#t[2]),this.#n[3]=Math.min(this.#i,this.#t[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;let r=gt(this.#n[0]*256/this.#r),i=gt(this.#n[1]*256/this.#i),a=_t(this.#n[2]*256/this.#r),o=_t(this.#n[3]*256/this.#i);if(vt(this.#a,e,r,i,a,o),n)for(let t of n)for(let n of t)n!==e&&vt(this.#a,n,r,i,a,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,this.#t[0]=Math.max(this.#t[0],this.#n[0]),this.#t[1]=Math.max(this.#t[1],this.#n[1]),this.#t[2]=Math.min(this.#t[2],this.#n[2]),this.#t[3]=Math.min(this.#t[3],this.#n[3])),this}take(){return new xt(this.#o,this.#a)}takeDebugMetadata(){throw Error(`Unreachable`)}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}},wt=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[ht]:[]};#n=new Map;#r=new Set;#i=new Map;#a;#o;#s;constructor(e,t=!1){this.#s=e,t&&(this.#a=new Map,this.#o=(e,t)=>{St(this.#a,t).dependencies.add(e)})}get clipBox(){return this.#s.clipBox}growOperationsCount(e){this.#s.growOperationsCount(e)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[ht]:{__proto__:this.#t[ht]}},this.#s.save(e),this}restore(e){this.#s.restore(e,this.#o);let t=Object.getPrototypeOf(this.#e);return t===null?this:(this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this)}recordOpenMarker(e){return this.#s.recordOpenMarker(e,this.#o),this}getOpenMarker(){return this.#s.getOpenMarker()}recordCloseMarker(e){return this.#s.recordCloseMarker(e,this.#o),this}beginMarkedContent(e){return this.#s.beginMarkedContent(e),this}endMarkedContent(e){return this.#s.endMarkedContent(e,this.#o),this}pushBaseTransform(e){return this.#s.pushBaseTransform(e),this}popBaseTransform(){return this.#s.popBaseTransform(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,n){this.#e[e]=this.#n.get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(ht,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#r)this.recordFutureForcedDependency(ht,e);return this}resetBBox(e){return this.#s.resetBBox(e),this}recordClipBox(e,t,n,r,i,a){return this.#s.recordClipBox(e,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#s.recordBBox(e,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){let s=n.bbox,c,l;if(s&&(c=s[2]!==s[0]&&s[3]!==s[1]&&this.#i.get(n),c!==!1&&(l=[0,0,0,0],I.axialAlignedBoundingBox(s,n.fontMatrix,l),(r!==1||i!==0||a!==0)&&yt(r,-r,i,a,l),c)))return this.recordBBox(e,t,l[0],l[2],l[1],l[3]);if(!o)return this.recordFullPageBBox(e);let u=o();return s&&l&&c===void 0&&(c=l[0]<=i-u.actualBoundingBoxLeft&&l[2]>=i+u.actualBoundingBoxRight&&l[1]<=a-u.actualBoundingBoxAscent&&l[3]>=a+u.actualBoundingBoxDescent,this.#i.set(n,c),c)?this.recordBBox(e,t,l[0],l[2],l[1],l[3]):this.recordBBox(e,t,i-u.actualBoundingBoxLeft,i+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#s.recordFullPageBBox(e),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#r,r=this.#e,i=this.#t;for(let e of t)e in this.#e?n.add(r[e]):e in i&&i[e].forEach(n.add,n);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#r.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[ht]),this.#a){let t=St(this.#a,e),{dependencies:n}=t;this.#r.forEach(n.add,n),this.#s._savesStack.forEach(n.add,n),this.#s._markedContentStack.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.recordOperation(e,t,[this.#r,this.#s._savesStack,this.#s._markedContentStack]),n&&this.#r.clear(),this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#r);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.bboxToClipBoxDropOperation(e),n&&this.#r.clear(),this}take(){return this.#i.clear(),this.#s.take()}takeDebugMetadata(){return this.#a}},Tt=class e{#e;#t;#n;#r=0;#i=0;constructor(t,n,r){if(t instanceof e&&t.#n===!!r)return t;this.#e=t,this.#t=n,this.#n=!!r}get clipBox(){return this.#e.clipBox}growOperationsCount(){throw Error(`Unreachable`)}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this.#e.recordSimpleDataFromNamed(e,t,this.#t),this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,t,n,r,i,a){return this.#n||this.#e.recordClipBox(this.#t,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#n||this.#e.recordBBox(this.#t,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r,i,a,o){return this.#n||this.#e.recordCharacterBBox(this.#t,t,n,r,i,a,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw Error(`Unreachable`)}takeDebugMetadata(){throw Error(`Unreachable`)}},G={stroke:[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],fill:[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],imageXObject:[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],rawFillPath:[`filter`,`fillColor`,`fillAlpha`],showText:[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],transform:[`transform`],transformAndFill:[`transform`,`fillColor`]},Et=class e{#e;#t;#n=4;#r=0;#i=new e.#a(this.#n*6);static#a=F.isFloat16ArraySupported?Float16Array:Float32Array;constructor(e){this.#e=e.width,this.#t=e.height}record(t,r,i,a){if(this.#r===this.#n){this.#n*=2;let t=new e.#a(this.#n*6);t.set(this.#i),this.#i=t}let o=B(t),s;if(a[0]!==1/0){let e=n.slice();I.axialAlignedBoundingBox([0,-i,r,0],o,e);let t=I.intersect(a,e);if(!t)return;let[c,l,u,d]=t;if(c!==e[0]||l!==e[1]||u!==e[2]||d!==e[3]){let e=Math.atan2(o[1],o[0]),t=Math.abs(Math.sin(e)),n=Math.abs(Math.cos(e));if(t<1e-6||n<1e-6||Math.abs(t-n)<1e-6)s=[c,l,c,d,u,l];else{let e=u-c,r=d-l,i=t*t,a=n*n,o=n*t,f=a-i,p=(r*a-e*o)/f;s=[c+(r*o-e*i)/f,l,c,l+p,u,d-p]}}}s||(s=[0,-i,0,0,r,-i],I.applyTransform(s,o,0),I.applyTransform(s,o,2),I.applyTransform(s,o,4)),s[0]/=this.#e,s[1]/=this.#t,s[2]/=this.#e,s[3]/=this.#t,s[4]/=this.#e,s[5]/=this.#t,this.#i.set(s,this.#r*6),this.#r++}take(){return this.#i.subarray(0,this.#r*6)}},Dt=class{#e=new Set;#t=null;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){let t=this.#n();t.insertRule(e,t.cssRules.length)}#n(){if(this.#t)return this.#t;let e=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&e){let{adoptedStyleSheets:t}=this._document;if(t){let n=new e;return t.push(n),this.#t=n}}return this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement)),this.#t=this.styleElement.sheet}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);if(this.nativeFontFaces.clear(),this.#e.clear(),this.#t){let{adoptedStyleSheets:e}=this._document;e?.includes(this.#t)&&(this._document.adoptedStyleSheets=e.filter(e=>e!==this.#t)),this.#t=null}this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(D(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:t,src:r,style:i}=e,a=new FontFace(t,r,i);this.addNativeFontFace(a);try{await a.load(),this.#e.add(t),n?.(e)}catch{T(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}E(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw T(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return M(this,`isFontLoadingAPISupported`,e)}get isSyncFontLoadingSupported(){return M(this,`isSyncFontLoadingSupported`,t||F.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(D(!r.done,`completeRequest() cannot be called twice.`),r.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.callback,0)}}let{loadingRequests:n}=this,r={done:!1,complete:t,callback:e};return n.push(r),r}get _loadTestFont(){let e=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIA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(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function r(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function i(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let a,o,s=this._document.createElement(`canvas`);s.width=1,s.height=1;let c=s.getContext(`2d`),l=0;function u(e,t){if(++l>30){T(`Load test font never loaded.`),t();return}if(c.font=`30px `+e,c.fillText(`.`,0,20),c.getImageData(0,0,1,1).data[3]>0){t();return}setTimeout(u.bind(null,e,t))}let d=`lt${Date.now()}${this.loadTestFontId++}`,f=this._loadTestFont;f=i(f,976,d.length,d);let p=1482184792,m=n(f,16);for(a=0,o=d.length-3;a{g.remove(),t.complete()})}},Ot=class{compiledGlyphs=Object.create(null);#e;constructor(e,t=null,n,r){this.#e=e,this._inspectFont=t,n&&(this.charProcOperatorList=n),r&&Object.assign(this,r)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){T(`getPathGenerator - ignoring character: "${e}".`)}let i=Je(r?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace}set disableFontFace(e){M(this,`disableFontFace`,!!e)}get fontExtraProperties(){return this.#e.fontExtraProperties}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}},kt=class{static strings=[`fontFamily`,`fontWeight`,`italicAngle`]},At=class{static strings=[`css`,`loadedName`,`baseFontName`,`src`]},K=class{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static OFFSET_NUMBERS=Math.ceil(this.bools.length*2/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+this.numbers.length*8;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6},jt=class{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16},Mt=class{#e;#t=new TextDecoder;#n;constructor(e){this.#e=e,this.#n=new DataView(e)}#r(e){D(e>n&3;return r===0?void 0:r===2}get black(){return this.#r(0)}get bold(){return this.#r(1)}get disableFontFace(){return this.#r(2)}get fontExtraProperties(){return this.#r(3)}get isInvalidPDFjsFont(){return this.#r(4)}get isType3Font(){return this.#r(5)}get italic(){return this.#r(6)}get missingFile(){return this.#r(7)}get remeasure(){return this.#r(8)}get vertical(){return this.#r(9)}#i(e){return D(e0){t=n.slice();for(let e=0,n=l.length;etypeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,Vt=fe.bind(null,Bt,e=>typeof e==`object`&&typeof e?.name==`string`),Ht=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){T("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},Ut={DATA:1,ERROR:2},q={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Wt(){}function J(e){if(e instanceof P||e instanceof ne||e instanceof ee||e instanceof re||e instanceof te)return e;switch(e instanceof Error||typeof e==`object`&&e||E(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new P(e.message);case`InvalidPDFException`:return new ne(e.message);case`PasswordException`:return new ee(e.message,e.code);case`ResponseException`:return new re(e.message,e.status,e.missing);case`UnknownErrorException`:return new te(e.message,e.details)}return new te(e.message,e.toString())}var Gt=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===Ut.DATA)n.resolve(e.data);else if(e.callback===Ut.ERROR)n.reject(J(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:Ut.DATA,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:Ut.ERROR,callbackId:e.callbackId,reason:J(t)})});return}if(e.streamId){this.#n(e);return}t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[i]={controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:q.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{D(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:q.CANCEL,streamId:i,reason:J(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:q.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:q.CLOSE,streamId:t}),delete a.streamSinks[t])},error(e){D(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:q.ERROR,streamId:t,reason:J(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:q.START_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:q.START_COMPLETE,streamId:t,reason:J(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case q.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(J(e.reason));break;case q.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(J(e.reason));break;case q.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:q.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||Wt).then(function(){i.postMessage({sourceName:n,targetName:r,stream:q.PULL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:q.PULL_COMPLETE,streamId:t,reason:J(e)})});break;case q.ENQUEUE:if(D(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case q.CLOSE:if(D(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case q.ERROR:D(a,`error should have stream controller`),a.controller.error(J(e.reason)),this.#i(a,t);break;case q.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(J(e.reason)),this.#i(a,t);break;case q.CANCEL:if(!o)break;let s=J(e.reason);Promise.try(o.onCancel||Wt,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:q.CANCEL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:q.CANCEL_COMPLETE,streamId:t,reason:J(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},Kt=class{#e=Object.freeze({cMapUrl:`CMap`,standardFontDataUrl:`font`,wasmUrl:`wasm`});constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case`cMapUrl`:case`standardFontDataUrl`:case`wasmUrl`:break;default:E(`Not implemented: ${e}`)}let n=this[e];if(!n)throw Error(`Ensure that the \`${e}\` API parameter is provided.`);let r=`${n}${t}`;return this._fetch(r,e).catch(t=>{throw Error(`Unable to load ${this.#e[e]} data at: ${r}`)})}async _fetch(e,t){E("Abstract method `_fetch` called.")}},qt=class extends Kt{async _fetch(e,t){let n=await Ce(e,t===`cMapUrl`&&!e.endsWith(`.bcmap`)?`text`:`bytes`);return n instanceof Uint8Array?n:oe(n)}},Jt=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset({canvas:e},t,n){if(!e)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.width=t,e.height=n}destroy(e){let{canvas:t}=e;if(!t)throw Error(`Canvas is not specified`);t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){E("Abstract method `_createCanvas` called.")}},Yt=class extends Jt{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},Xt=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addKnockoutFilter(e=0){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}addSelectionHCMFilter(e,t){return`none`}addSelectionFilter(){return`none`}createSelectionStyle(e=null){return null}destroy(e=!1){}},Zt=class extends Xt{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.colorScheme=`only light`,t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(a,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(a,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(Te(e)?T(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=A(e,``))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=I.makeHexColor(...a);let o=this.#v(t);if(t=I.makeHexColor(...o),this.#b(),e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array(256);for(let e=0;e<=255;e++){let t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let c=s.join(`,`),l=`g_${this.#r}_hcm_filter`,u=i.filter=this.#m(l);this.#g(c,c,c,u),this.#p(u);let d=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(d(0,5),d(1,5),d(2,5),u),i.url=this.#d(l),i.url}addSelectionHCMFilter(e,t){return this.addHighlightHCMFilter(`selection`,e,t,`HighlightText`,`Highlight`)}addSelectionFilter(){return this.addHighlightHCMFilter(`selection_default`,`black`,`white`,`HighlightText`,`Highlight`)}createSelectionStyle(e=null){let t=e?this.addSelectionHCMFilter(e.foreground,e.background):this.addSelectionFilter();return t===`none`||!F.platform.isFirefox?null:{"backdrop-filter":t,"background-color":`transparent`}}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addKnockoutFilter(e=0){let t=e>0?Math.min(1/e,1e6):1e6,n=`knockout_${t}`,r=this.#s.get(n);if(r)return r;let i=`g_${this.#r}_knockout_filter_${this.#o++}`,o=this.#d(i);this.#s.set(n,o);let s=this.#m(i),c=this.#i.createElementNS(a,`feComponentTransfer`);s.append(c);let l=this.#i.createElementNS(a,`feFuncA`);return l.setAttribute(`type`,`linear`),l.setAttribute(`slope`,`${t}`),l.setAttribute(`intercept`,`0`),c.append(l),o}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#x.bind(this));u{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(a,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0`),e.append(t)}#p(e){let t=this.#i.createElementNS(a,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0`),e.append(t)}#m(e){let t=this.#i.createElementNS(a,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(a,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(a,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(a,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,Ne(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#y(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,Me(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#b(){this.#l.style.color=``,this.#l.style.backgroundColor=``}#x(e){let[t,n,r,i]=this.#y(e);if(i===1)return[t,n,r];let[a,o,s]=this.#v(`Canvas`);return[Qt(t,a,i),Qt(n,o,i),Qt(r,s,i)]}};function Qt(e,t,n){return Math.round(n*e+(1-n)*t)}t&&T("Please use the `legacy` build in Node.js environments.");async function $t(e){let t=await process.getBuiltinModule(`fs/promises`).readFile(e);return new Uint8Array(t)}var en=class extends Xt{},tn=class extends Jt{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url)(`@napi-rs/canvas`).createCanvas(e,t)}},nn=class extends Kt{async _fetch(e,t){return $t(e)}};function rn({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=F.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=c^l,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let r=0;r>7&1)&f,n[m+1]=c^-(r>>6&1)&f,n[m+2]=c^-(r>>5&1)&f,n[m+3]=c^-(r>>4&1)&f,n[m+4]=c^-(r>>3&1)&f,n[m+5]=c^-(r>>2&1)&f,n[m+6]=c^-(r>>1&1)&f,n[m+7]=c^-(r&1)&f}if(d===0)continue;let r=t>7-e&1)&f}return{srcPos:t,destPos:m}}function an({src:e,srcPos:t=0,dest:n,destPos:r=0,width:i,height:a}){let o=0,s=i*a*3,c=s>>2,l=new Uint32Array(e.buffer,t,c),u=F.isLittleEndian?4278190080:255;if(F.isLittleEndian){for(;o>>24|t<<8|u,n[r+2]=t>>>16|i<<16|u,n[r+3]=i>>>8|u}for(let i=o*4,a=t+s;i>>8|u,n[r+2]=t<<16|i>>>16|u,n[r+3]=i<<8|u}for(let i=o*4,a=t+s;i - + diff --git a/frontend/web/src/App.tsx b/frontend/web/src/App.tsx index d0b3bd47..72bdfff9 100644 --- a/frontend/web/src/App.tsx +++ b/frontend/web/src/App.tsx @@ -138,6 +138,7 @@ export default function App() { const [taskItemId, setTaskItemId] = useState(null); const [newDaemonOpen, setNewDaemonOpen] = useState(false); const [daemonManageOpen, setDaemonManageOpen] = useState(false); + const messageSubmitLockRef = useRef(false); const messageRequestRef = useRef(null); const messageEpochRef = useRef(0); const [notice, setNotice] = useState(null); @@ -376,20 +377,28 @@ export default function App() { const sendMessage = async (text: string, attachments: File[] = []): Promise => { const requestSid = activeSid; - if (!requestSid || messageRequestRef.current) return false; + if (!requestSid || messageSubmitLockRef.current || messageRequestRef.current) return false; - if (!attachments.length) { - const command = await dispatchWebCommand(text, commandHandlers); - if (command.kind === 'handled') return true; - if (command.kind === 'error') { - notify('error', command.message); - return false; + messageSubmitLockRef.current = true; + let requestId: number; + let controller: AbortController; + try { + if (!attachments.length) { + const command = await dispatchWebCommand(text, commandHandlers); + if (command.kind === 'handled') return true; + if (command.kind === 'error') { + notify('error', command.message); + return false; + } } + + requestId = ++messageEpochRef.current; + controller = new AbortController(); + messageRequestRef.current = { id: requestId, sid: requestSid, controller }; + } finally { + messageSubmitLockRef.current = false; } - const requestId = ++messageEpochRef.current; - const controller = new AbortController(); - messageRequestRef.current = { id: requestId, sid: requestSid, controller }; const isCurrent = () => { const request = messageRequestRef.current; return Boolean( diff --git a/frontend/web/src/api.ts b/frontend/web/src/api.ts index 6f14a8dd..73dcdf51 100644 --- a/frontend/web/src/api.ts +++ b/frontend/web/src/api.ts @@ -14,6 +14,7 @@ import type { ProjectCostRow, RequestUsage, Role, + Snapshot, } from '../../core/src/types'; import { ensureResponseOk } from '../../core/src/http'; import { @@ -495,6 +496,8 @@ export function parseSSEFrames(buf: string): { frames: SSEFrame[]; rest: string return { frames, rest: buf }; } +let activeSnapshotPrewarmSid: string | null = null; + export const api = { meta: compatibleApiMeta, projectIndex: async () => { @@ -558,15 +561,29 @@ export const api = { workdir: string; workdir_preserved: boolean; }>('DELETE', P(sid)), - snapshot: async (sid: string, signal?: AbortSignal) => { + snapshot: async (sid: string, signal?: AbortSignal, prewarm = false) => { await compatibleApiMeta(); const value = await getJson( - P(sid, '/snapshot?compact=true&events_limit=1'), + P(sid, `/snapshot?compact=true&events_limit=1${prewarm ? '&prewarm=true' : ''}`), signal, API_LOCAL_READ_TIMEOUT_MS, ); return requireSnapshotContract(value); }, + activeSnapshot: async (sid: string, signal?: AbortSignal): Promise => { + const prewarm = activeSnapshotPrewarmSid !== sid; + if (prewarm) activeSnapshotPrewarmSid = sid; + try { + return await api.snapshot(sid, signal, prewarm); + } catch (error) { + if (prewarm && activeSnapshotPrewarmSid === sid) { + activeSnapshotPrewarmSid = null; + } + throw error; + } + }, + prefetchSnapshot: (sid: string, signal?: AbortSignal) => + api.snapshot(sid, signal, false), status: (sid: string, signal?: AbortSignal) => getJson(P(sid, '/status'), signal), journal: (sid: string, n = 20, signal?: AbortSignal) => diff --git a/frontend/web/src/hooks.ts b/frontend/web/src/hooks.ts index feea2a42..94ff6876 100644 --- a/frontend/web/src/hooks.ts +++ b/frontend/web/src/hooks.ts @@ -35,7 +35,7 @@ export const useProjectCosts = () => export const useSnapshot = (sid: string | null) => useQuery({ queryKey: ['snapshot', sid], - queryFn: ({ signal }) => api.snapshot(sid!, signal), + queryFn: ({ signal }) => api.activeSnapshot(sid!, signal), enabled: !!sid, refetchInterval: SNAPSHOT_POLL_MS, }); diff --git a/frontend/web/src/test/apiProtocol.test.ts b/frontend/web/src/test/apiProtocol.test.ts index 3c97e6e9..0a63e117 100644 --- a/frontend/web/src/test/apiProtocol.test.ts +++ b/frontend/web/src/test/apiProtocol.test.ts @@ -252,7 +252,8 @@ describe('web API protocol handshake', () => { it('times out a stalled compact snapshot and succeeds on retry', async () => { vi.useFakeTimers(); let snapshotAttempts = 0; - const snapshotPath = '/api/projects/s-stalled/snapshot?compact=true&events_limit=1'; + const snapshotPath = + '/api/projects/s-stalled/snapshot?compact=true&events_limit=1'; const fetchMock = vi.fn((path: string, init?: RequestInit): Promise => { if (path === '/api/meta') return Promise.resolve(Response.json(currentMeta)); if (path === snapshotPath) { @@ -286,6 +287,25 @@ describe('web API protocol handshake', () => { expect(snapshotAttempts).toBe(2); }); + it('prewarms an active project once instead of on every snapshot poll', async () => { + const paths: string[] = []; + vi.stubGlobal('fetch', vi.fn((path: string): Promise => { + paths.push(path); + if (path === '/api/meta') return Promise.resolve(Response.json(currentMeta)); + return Promise.resolve(Response.json(currentSnapshot)); + })); + const { api } = await import('../api'); + + await api.activeSnapshot('s-active'); + await api.activeSnapshot('s-active'); + + expect(paths).toEqual([ + '/api/meta', + '/api/projects/s-active/snapshot?compact=true&events_limit=1&prewarm=true', + '/api/projects/s-active/snapshot?compact=true&events_limit=1', + ]); + }); + it('times out when response headers arrive but the JSON body stalls', async () => { vi.useFakeTimers(); let projectAttempts = 0; diff --git a/frontend/web/src/useProjectSelection.ts b/frontend/web/src/useProjectSelection.ts index 4938bbfd..f28cda76 100644 --- a/frontend/web/src/useProjectSelection.ts +++ b/frontend/web/src/useProjectSelection.ts @@ -90,7 +90,7 @@ export function useProjectSelection({ const prefetchProject = useCallback((id: string) => { void queryClient.prefetchQuery({ queryKey: ['snapshot', id], - queryFn: ({ signal }) => api.snapshot(id, signal), + queryFn: ({ signal }) => api.prefetchSnapshot(id, signal), staleTime: 3_000, }); }, [queryClient]); diff --git a/pyproject.toml b/pyproject.toml index a444c951..3788ae4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,6 +137,7 @@ artifacts = [ "frontend/web/dist/**", ] include = [ + "argus_doctor.py", "argus_skill/**", "tests/**", "frontend/tui/bundle/**", diff --git a/tests/apps/test_tui_launcher.py b/tests/apps/test_tui_launcher.py index 301a6c2a..de1da1ee 100644 --- a/tests/apps/test_tui_launcher.py +++ b/tests/apps/test_tui_launcher.py @@ -170,24 +170,32 @@ def test_public_admin_flags_stay_on_python_admin_path(monkeypatch) -> None: ] -def test_documented_web_aliases_before_action_stay_on_python_admin_path( - monkeypatch, +def test_web_launch_uses_tui_unless_raw_backend_options_are_requested( + monkeypatch, tmp_path: Path, ) -> None: - seen = [] + bundle = tmp_path / "argus.mjs" + bundle.write_text("// bundle", encoding="utf-8") + seen = {} + admin = [] + monkeypatch.setattr(tui_launcher, "_bundle_path", lambda: bundle) + monkeypatch.setattr(tui_launcher.shutil, "which", lambda name: "/usr/bin/node") + monkeypatch.setattr(tui_launcher, "_node_major", lambda node: 20) + monkeypatch.setattr(tui_launcher, "_needs_foreground_spawn", lambda: False) monkeypatch.setattr( - tui_launcher, - "_run_python_admin", - lambda argv: seen.append(argv) or 7, + tui_launcher.os, + "execv", + lambda executable, argv: seen.update(executable=executable, argv=argv), ) monkeypatch.setattr( tui_launcher, - "_bundle_path", - lambda: (_ for _ in ()).throw(AssertionError("TUI must not launch")), + "_run_python_admin", + lambda argv: admin.append(argv) or 7, ) - argv = ["--host", "127.0.0.1", "--port", "8801", "--web"] - assert tui_launcher.main(argv) == 7 - assert seen == [argv] + assert tui_launcher.main(["--web", "--no-open"]) == 0 + assert seen["argv"] == ["/usr/bin/node", str(bundle), "--web", "--no-open"] + assert tui_launcher.main(["--web", "--web-port", "8800"]) == 7 + assert admin == [["--web", "--web-port", "8800"]] def test_admin_subcommands_stay_on_python_admin_path(monkeypatch) -> None: diff --git a/tests/core/test_portable_filename.py b/tests/core/test_portable_filename.py new file mode 100644 index 00000000..71fd7ef5 --- /dev/null +++ b/tests/core/test_portable_filename.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from argus_skill.core.portable_filename import portable_filename_component + + +def test_windows_reserved_and_unsafe_names_are_encoded() -> None: + assert portable_filename_component("CON", windows=True).startswith("~") + assert portable_filename_component("team::task", windows=True).startswith("~") + + +def test_encoded_looking_logical_id_cannot_alias_an_unsafe_id() -> None: + unsafe = portable_filename_component("team::task", windows=True) + + assert portable_filename_component(unsafe, windows=True) != unsafe + + +def test_oversized_identifier_is_rejected() -> None: + try: + portable_filename_component("x" * 121, windows=True) + except ValueError as exc: + assert "120" in str(exc) + else: + raise AssertionError("oversized identifier must not reach the filesystem") diff --git a/tests/core/test_release.py b/tests/core/test_release.py index ecfcc849..3894f750 100644 --- a/tests/core/test_release.py +++ b/tests/core/test_release.py @@ -29,6 +29,7 @@ def test_release_digest_covers_runtime_and_frontend_build_inputs() -> None: "frontend/web/package-lock.json", "frontend/web/vite.config.ts", "frontend/web/index.html", + "argus_doctor.py", ".agents/plugins/marketplace.json", ".claude-plugin/marketplace.json", "plugins/argus/.codex-plugin/plugin.json", diff --git a/tests/manager/test_front_door_classify_fresh.py b/tests/manager/test_front_door_classify_fresh.py index b65e3124..717bf3ad 100644 --- a/tests/manager/test_front_door_classify_fresh.py +++ b/tests/manager/test_front_door_classify_fresh.py @@ -40,7 +40,7 @@ def _manager(answer: str, tmp_path) -> tuple[Manager, _RecordingBackend]: return mgr, backend -def test_front_door_runs_fresh_medium_effort(tmp_path, monkeypatch) -> None: +def test_front_door_runs_fresh_low_effort(tmp_path, monkeypatch) -> None: monkeypatch.delenv("ARGUS_SKILL_FRONTDOOR_CLASSIFY_EFFORT", raising=False) monkeypatch.setattr( "argus_skill.core.knobs.resolve_manager_classify_model", @@ -60,7 +60,7 @@ def test_front_door_runs_fresh_medium_effort(tmp_path, monkeypatch) -> None: call = backend.calls[0] assert call["resume_thread_id"] is None # fresh, no session assert call["run_label"] == "manager-frontdoor-classify" - assert call["options"].reasoning_effort == "medium" + assert call["options"].reasoning_effort == "low" assert call["options"].model == "fast-manager" diff --git a/tests/team/test_curator.py b/tests/team/test_curator.py index 46d6ec12..f5ac5517 100644 --- a/tests/team/test_curator.py +++ b/tests/team/test_curator.py @@ -4,6 +4,7 @@ import os import time from pathlib import Path +from types import SimpleNamespace from argus_skill.team import curator as cur from argus_skill.team import leaderboard, pool, registry, roster, task_board @@ -70,6 +71,64 @@ def test_adopt_reclaims_running_roster_orphan_once(tmp_path: Path, monkeypatch) assert c._adopt_orphans(root, now=200.0) == [] +def test_windows_adopted_process_uses_retained_handle_for_polling( + tmp_path: Path, + monkeypatch, +) -> None: + alive = iter((True, False)) + closed: list[int] = [] + monkeypatch.setattr(cur, "os", SimpleNamespace(name="nt")) + monkeypatch.setattr(cur, "_open_windows_process_handle", lambda _pid: 77) + monkeypatch.setattr(cur, "_windows_process_handle_alive", lambda _handle: next(alive)) + monkeypatch.setattr(cur, "_close_windows_process_handle", closed.append) + monkeypatch.setattr( + cur, + "_pid_is_teammate", + lambda *_args, **_kwargs: (_ for _ in ()).throw( + AssertionError("poll must not launch another identity query") + ), + ) + + proc = cur._AdoptedProc(4242, "w1", tmp_path) + + assert proc.poll() is None + assert proc.poll() == 0 + assert closed == [77] + + +def test_windows_adoption_opens_handle_before_identity_check( + tmp_path: Path, + monkeypatch, +) -> None: + root = tmp_path / "team" + roster.add_member(root, { + "id": "w1", + "pid": 4242, + "cwd": str(tmp_path), + "task_id": "t::a", + "status": "running", + }) + order: list[str] = [] + monkeypatch.setattr(cur, "os", SimpleNamespace(name="nt")) + monkeypatch.setattr( + cur, + "_open_windows_process_handle", + lambda _pid: order.append("open") or 77, + ) + monkeypatch.setattr( + cur, + "_pid_is_teammate", + lambda *_args, **_kwargs: order.append("verify") or True, + ) + monkeypatch.setattr(cur, "_windows_process_handle_alive", lambda _handle: True) + monkeypatch.setattr(cur, "_close_windows_process_handle", lambda _handle: None) + + c = _fake_curator(tmp_path) + + assert c._adopt_orphans(root, now=100.0) == ["w1"] + assert order == ["open", "verify"] + + def test_adopt_then_stop_kills_real_orphan(tmp_path: Path) -> None: import subprocess import sys @@ -365,7 +424,24 @@ def test_reap_hard_timeout_killpg_and_fails_task(tmp_path: Path, monkeypatch) -> assert task["state"] == "failed" member = next(m for m in roster.members(root) if m["id"] == tt.member_id) assert member["status"] == "failed" - assert c._children == {} + + +def test_reap_keeps_tracking_when_termination_does_not_finish( + tmp_path: Path, + monkeypatch, +) -> None: + root = tmp_path / "team" + task_board.form(root, [{"task_id": "t::a", "objective": "x"}]) + c = _fake_curator(tmp_path, teammate_timeout_s=10.0, hard_grace_s=5.0) + c._refill(root, width=1, cwd=tmp_path, now=100.0) + monkeypatch.setattr(c, "_terminate", lambda _tt: False) + + result = c._reap(now=200.0) + + assert result["hard_killed"] == [] + assert len(c._children) == 1 + task = next(task for task in task_board.snapshot(root) if task["task_id"] == "t::a") + assert task["state"] == "claimed" def test_reap_keeps_alive_child_within_deadline(tmp_path: Path) -> None: diff --git a/tests/test_bootstrap_doctor.py b/tests/test_bootstrap_doctor.py index 5e2ec7b3..04da1a48 100644 --- a/tests/test_bootstrap_doctor.py +++ b/tests/test_bootstrap_doctor.py @@ -52,6 +52,25 @@ def test_bootstrap_accepts_current_editable_python_without_checkout_venv( assert core["ok"] is True +def test_bootstrap_desktop_runtime_is_advisory_for_cli_web( + tmp_path: Path, +) -> None: + root = tmp_path / "Argus" + (root / "argus_skill").mkdir(parents=True) + (root / "pyproject.toml").write_text("[project]\nname='argus-skill'\n", encoding="utf-8") + electron = root / "desktop" / "node_modules" / "electron" + electron.mkdir(parents=True) + (root / "desktop" / "package.json").write_text("{}\n", encoding="utf-8") + + report = argus_doctor.run_bootstrap_doctor(root) + + desktop = next( + item for item in report["findings"] if item["code"] == "ARGUS-DESKTOP-001" + ) + assert desktop["ok"] is True + assert "optional for CLI/Web" in desktop["detail"] + + def test_bootstrap_repair_requires_explicit_yes(capsys) -> None: rc = argus_doctor.main(["--repair-install"]) diff --git a/tests/webapi/test_manager_rotation.py b/tests/webapi/test_manager_rotation.py index 9bcc0b91..b1191e85 100644 --- a/tests/webapi/test_manager_rotation.py +++ b/tests/webapi/test_manager_rotation.py @@ -36,6 +36,7 @@ def test_manager_prewarm_schedule_is_one_shot_after_success( ) -> None: manager_state._STATES.clear() manager_state._MANAGER_PREWARMING.clear() + monkeypatch.setattr(manager_state, "_MANAGER_PREWARM_OWNER", None) calls: list[tuple[str, Path | None]] = [] def fake_prewarm(sid: str, *, global_root=None) -> None: @@ -69,6 +70,7 @@ def test_manager_prewarm_schedule_does_not_wait_for_busy_manager_turn( sid = "s-prewarm-busy" manager_state._STATES.clear() manager_state._MANAGER_PREWARMING.clear() + monkeypatch.setattr(manager_state, "_MANAGER_PREWARM_OWNER", None) lock_held = threading.Event() release_lock = threading.Event() schedule_returned = threading.Event() @@ -143,6 +145,25 @@ def reset_chat_session(self) -> None: assert closed == ["s-old"] +def test_manager_shutdown_clears_control_generations() -> None: + manager_state._STATES.clear() + manager_state._CONTROL_GENERATIONS.clear() + manager_state.interrupt_manager_turns("s-old") + + manager_state.shutdown_manager_bridge() + + assert manager_state._CONTROL_GENERATIONS == {} + + +def test_latest_explicit_project_becomes_prewarm_owner(monkeypatch) -> None: + monkeypatch.setattr(manager_state, "_MANAGER_PREWARM_OWNER", None) + + manager_state._claim_manager_prewarm_owner("s-first") + assert manager_state._MANAGER_PREWARM_OWNER == "s-first" + manager_state._claim_manager_prewarm_owner("s-second") + assert manager_state._MANAGER_PREWARM_OWNER == "s-second" + + def test_manager_session_rotates_with_structured_handoff(tmp_path: Path, monkeypatch) -> None: _make_project(tmp_path) monkeypatch.setenv("ARGUS_SKILL_MANAGER_ROTATE_TURNS", "4") diff --git a/tests/webapi/test_project_index_cache_freshness.py b/tests/webapi/test_project_index_cache_freshness.py index a972c75b..d09a223c 100644 --- a/tests/webapi/test_project_index_cache_freshness.py +++ b/tests/webapi/test_project_index_cache_freshness.py @@ -126,24 +126,37 @@ def counting(*args, **kwargs): # noqa: ANN002, ANN003 assert builds == [1] -def test_repeated_compact_snapshot_polls_reuse_one_manager_prewarm( - home: Path, monkeypatch: pytest.MonkeyPatch +def test_repeated_compact_snapshot_polls_do_not_start_manager_contexts( + home: Path, ) -> None: - prewarms: list[tuple[str, Path | None]] = [] + from argus_skill.webapi import manager_state + + manager_state._STATES.clear() + client = TestClient(server.create_app(global_root=home)) + + for _ in range(10): + response = client.get("/api/projects/s-cachetest/snapshot?compact=true&events_limit=30") + assert response.status_code == 200 - def counting_prewarm(sid: str, *, global_root=None) -> None: # noqa: ANN001 - prewarms.append((sid, Path(global_root) if global_root is not None else None)) + assert manager_state._STATES == {} + +def test_active_snapshot_polls_schedule_one_manager_prewarm( + home: Path, monkeypatch: pytest.MonkeyPatch, +) -> None: + prewarms: list[tuple[str, Path]] = [] monkeypatch.setattr( "argus_skill.webapi.manager_state.schedule_manager_prewarm", - counting_prewarm, + lambda sid, *, global_root=None: prewarms.append((sid, Path(global_root))), ) client = TestClient(server.create_app(global_root=home)) - for _ in range(10): - response = client.get("/api/projects/s-cachetest/snapshot?compact=true&events_limit=30") - assert response.status_code == 200 + response = client.get( + "/api/projects/s-cachetest/snapshot" + "?compact=true&events_limit=30&prewarm=true" + ) + assert response.status_code == 200 assert prewarms == [("s-cachetest", home)]